Macro to capture until end-of-line as argument












13















Is it possible to capture the contents to the end-of-line as a macro argument?



For example, consider the following naive visualization:



enter image description here



documentclass{article}
newenvironment{myitemize}
{defitem{textbullet }}
{}
begin{document}
begin{myitemize}
item First
item Second
item Third
item Last
end{myitemize}
end{document}


I'd like to define item using something like



defitem#1par{<do stuff with #1>}


but this requires an empty line between items to pick up par:



enter image description here



documentclass{article}
newenvironment{myitemize}
{defitem##1par{textbullet ##1par}}
{}
begin{document}
begin{myitemize}
item First

item Second

item Third

item Last

end{myitemize}
end{document}


Looking at obeylines in latex.ltx I thought this may have something to do with ^^M, but I'm not sure how I can incorporate that into the definition of item.










share|improve this question























  • Related, but not answered explicitly: Is it possible to scan until the end of the current item

    – Werner
    Aug 6 '13 at 18:12











  • You have this in enumitem package, with itemize*.

    – Manuel
    Jan 21 '16 at 19:05











  • @Manuel: I'm referring to the general use-case of capturing items to do something with them.

    – Werner
    Jan 21 '16 at 19:07











  • Well, itemize* can be configured, it's enumitem's power. But of course, if you grab them with a macro not bounded to a list you can do much more things.

    – Manuel
    Jan 21 '16 at 19:27
















13















Is it possible to capture the contents to the end-of-line as a macro argument?



For example, consider the following naive visualization:



enter image description here



documentclass{article}
newenvironment{myitemize}
{defitem{textbullet }}
{}
begin{document}
begin{myitemize}
item First
item Second
item Third
item Last
end{myitemize}
end{document}


I'd like to define item using something like



defitem#1par{<do stuff with #1>}


but this requires an empty line between items to pick up par:



enter image description here



documentclass{article}
newenvironment{myitemize}
{defitem##1par{textbullet ##1par}}
{}
begin{document}
begin{myitemize}
item First

item Second

item Third

item Last

end{myitemize}
end{document}


Looking at obeylines in latex.ltx I thought this may have something to do with ^^M, but I'm not sure how I can incorporate that into the definition of item.










share|improve this question























  • Related, but not answered explicitly: Is it possible to scan until the end of the current item

    – Werner
    Aug 6 '13 at 18:12











  • You have this in enumitem package, with itemize*.

    – Manuel
    Jan 21 '16 at 19:05











  • @Manuel: I'm referring to the general use-case of capturing items to do something with them.

    – Werner
    Jan 21 '16 at 19:07











  • Well, itemize* can be configured, it's enumitem's power. But of course, if you grab them with a macro not bounded to a list you can do much more things.

    – Manuel
    Jan 21 '16 at 19:27














13












13








13


1






Is it possible to capture the contents to the end-of-line as a macro argument?



For example, consider the following naive visualization:



enter image description here



documentclass{article}
newenvironment{myitemize}
{defitem{textbullet }}
{}
begin{document}
begin{myitemize}
item First
item Second
item Third
item Last
end{myitemize}
end{document}


I'd like to define item using something like



defitem#1par{<do stuff with #1>}


but this requires an empty line between items to pick up par:



enter image description here



documentclass{article}
newenvironment{myitemize}
{defitem##1par{textbullet ##1par}}
{}
begin{document}
begin{myitemize}
item First

item Second

item Third

item Last

end{myitemize}
end{document}


Looking at obeylines in latex.ltx I thought this may have something to do with ^^M, but I'm not sure how I can incorporate that into the definition of item.










share|improve this question














Is it possible to capture the contents to the end-of-line as a macro argument?



For example, consider the following naive visualization:



enter image description here



documentclass{article}
newenvironment{myitemize}
{defitem{textbullet }}
{}
begin{document}
begin{myitemize}
item First
item Second
item Third
item Last
end{myitemize}
end{document}


I'd like to define item using something like



defitem#1par{<do stuff with #1>}


but this requires an empty line between items to pick up par:



enter image description here



documentclass{article}
newenvironment{myitemize}
{defitem##1par{textbullet ##1par}}
{}
begin{document}
begin{myitemize}
item First

item Second

item Third

item Last

end{myitemize}
end{document}


Looking at obeylines in latex.ltx I thought this may have something to do with ^^M, but I'm not sure how I can incorporate that into the definition of item.







macros line-breaking






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 6 '13 at 18:12









WernerWerner

448k709911697




448k709911697













  • Related, but not answered explicitly: Is it possible to scan until the end of the current item

    – Werner
    Aug 6 '13 at 18:12











  • You have this in enumitem package, with itemize*.

    – Manuel
    Jan 21 '16 at 19:05











  • @Manuel: I'm referring to the general use-case of capturing items to do something with them.

    – Werner
    Jan 21 '16 at 19:07











  • Well, itemize* can be configured, it's enumitem's power. But of course, if you grab them with a macro not bounded to a list you can do much more things.

    – Manuel
    Jan 21 '16 at 19:27



















  • Related, but not answered explicitly: Is it possible to scan until the end of the current item

    – Werner
    Aug 6 '13 at 18:12











  • You have this in enumitem package, with itemize*.

    – Manuel
    Jan 21 '16 at 19:05











  • @Manuel: I'm referring to the general use-case of capturing items to do something with them.

    – Werner
    Jan 21 '16 at 19:07











  • Well, itemize* can be configured, it's enumitem's power. But of course, if you grab them with a macro not bounded to a list you can do much more things.

    – Manuel
    Jan 21 '16 at 19:27

















Related, but not answered explicitly: Is it possible to scan until the end of the current item

– Werner
Aug 6 '13 at 18:12





Related, but not answered explicitly: Is it possible to scan until the end of the current item

– Werner
Aug 6 '13 at 18:12













You have this in enumitem package, with itemize*.

– Manuel
Jan 21 '16 at 19:05





You have this in enumitem package, with itemize*.

– Manuel
Jan 21 '16 at 19:05













@Manuel: I'm referring to the general use-case of capturing items to do something with them.

– Werner
Jan 21 '16 at 19:07





@Manuel: I'm referring to the general use-case of capturing items to do something with them.

– Werner
Jan 21 '16 at 19:07













Well, itemize* can be configured, it's enumitem's power. But of course, if you grab them with a macro not bounded to a list you can do much more things.

– Manuel
Jan 21 '16 at 19:27





Well, itemize* can be configured, it's enumitem's power. But of course, if you grab them with a macro not bounded to a list you can do much more things.

– Manuel
Jan 21 '16 at 19:27










1 Answer
1






active

oldest

votes


















12














You can use environ:



documentclass{article}
usepackage{environ}

makeatletter
NewEnviron{myitemize}{%
defitem##1item{dosomething{##1}}%
expandafter@emptyBODYitem}

newcommand{dosomething}[1]{%
defwerner@arg{#1}%
ifxwerner@argwerner@stop
expandafterenv@ignore % to end the recursion
else
``Here is #1unskip''par % what to do with #1
expandafteritem % to continue the recursion
fi}

edefwerner@stop{noexpandenv@ignorespace}
makeatother
begin{document}

begin{myitemize}
item First
item Second
item Last
end{myitemize}

end{document}


Note that end{myitemize} should go on a line of its own (one could also take care of it appearing on the same line as the last item). The unskip is necessary if par is not next to #1 or isn't used at all, because of the end of line at the end of the item text.



enter image description here



A much more powerful implementation with expl3:



documentclass{article}
usepackage{xparse}

ExplSyntaxOn
NewDocumentEnvironment{myitemize}{ O{} +b }
{
% do the setup
keys_set:nn { werner/itemize } { #1 }
% split the contents at item
seq_set_split:Nnn l_werner_itemize_input_seq { item } { #2 }
% remove the first (empty) item
seq_pop_left:NN l_werner_itemize_input_seq l_tmpa_tl
% issue the preamble
tl_use:N l_werner_itemize_pre_tl
% adorn the items
seq_set_map:NNn
l_werner_itemize_output_seq
l_werner_itemize_input_seq
{ exp_not:n { __werner_itemize_do:n { ##1 } } }
% output the items, separated by the chosen separator
seq_use:NV l_werner_itemize_output_seq l_werner_itemize_sep_tl
% issue the postamble
tl_use:N l_werner_itemize_post_tl
}
{}

seq_new:N l_werner_itemize_input_seq
seq_new:N l_werner_itemize_output_seq
cs_generate_variant:Nn seq_use:Nn { NV }

keys_define:nn { werner/itemize }
{
pre .tl_set:N = l_werner_itemize_pre_tl,
post .tl_set:N = l_werner_itemize_post_tl,
sep .tl_set:N = l_werner_itemize_sep_tl,
action .code:n = cs_set_eq:NN __werner_itemize_do:n #1,
action .initial:n = use:n,
}
ExplSyntaxOff

NewDocumentCommand{quotepar}{m}{%
``#1''par
}
NewDocumentCommand{normalitem}{m}{%
item #1
}
NewDocumentCommand{bulletitem}{m}{%
textbullet #1%
}

begin{document}

begin{myitemize}[action=bulletitem,sep={, }]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[action=quotepar]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[
action=normalitem,
pre=begin{itemize},
post=end{itemize},
]
item First
item Second
item Last
end{myitemize}

end{document}


enter image description here






share|improve this answer


























  • How can this answer be updated to set myitemize just like an original itemize? If I just wrap the environment definition inside an itemize and immediately save letolditemitem before it's redefined, then olditem ``...'' produces an extra item at the bottom of the list.

    – Werner
    Jan 21 '16 at 17:02













  • @Werner newenvironment{myitemize}{itemize}{enditemize}

    – egreg
    Jan 21 '16 at 17:11













  • @Werner I added a new implementation

    – egreg
    Jan 21 '16 at 18:51











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f127005%2fmacro-to-capture-until-end-of-line-as-argument%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









12














You can use environ:



documentclass{article}
usepackage{environ}

makeatletter
NewEnviron{myitemize}{%
defitem##1item{dosomething{##1}}%
expandafter@emptyBODYitem}

newcommand{dosomething}[1]{%
defwerner@arg{#1}%
ifxwerner@argwerner@stop
expandafterenv@ignore % to end the recursion
else
``Here is #1unskip''par % what to do with #1
expandafteritem % to continue the recursion
fi}

edefwerner@stop{noexpandenv@ignorespace}
makeatother
begin{document}

begin{myitemize}
item First
item Second
item Last
end{myitemize}

end{document}


Note that end{myitemize} should go on a line of its own (one could also take care of it appearing on the same line as the last item). The unskip is necessary if par is not next to #1 or isn't used at all, because of the end of line at the end of the item text.



enter image description here



A much more powerful implementation with expl3:



documentclass{article}
usepackage{xparse}

ExplSyntaxOn
NewDocumentEnvironment{myitemize}{ O{} +b }
{
% do the setup
keys_set:nn { werner/itemize } { #1 }
% split the contents at item
seq_set_split:Nnn l_werner_itemize_input_seq { item } { #2 }
% remove the first (empty) item
seq_pop_left:NN l_werner_itemize_input_seq l_tmpa_tl
% issue the preamble
tl_use:N l_werner_itemize_pre_tl
% adorn the items
seq_set_map:NNn
l_werner_itemize_output_seq
l_werner_itemize_input_seq
{ exp_not:n { __werner_itemize_do:n { ##1 } } }
% output the items, separated by the chosen separator
seq_use:NV l_werner_itemize_output_seq l_werner_itemize_sep_tl
% issue the postamble
tl_use:N l_werner_itemize_post_tl
}
{}

seq_new:N l_werner_itemize_input_seq
seq_new:N l_werner_itemize_output_seq
cs_generate_variant:Nn seq_use:Nn { NV }

keys_define:nn { werner/itemize }
{
pre .tl_set:N = l_werner_itemize_pre_tl,
post .tl_set:N = l_werner_itemize_post_tl,
sep .tl_set:N = l_werner_itemize_sep_tl,
action .code:n = cs_set_eq:NN __werner_itemize_do:n #1,
action .initial:n = use:n,
}
ExplSyntaxOff

NewDocumentCommand{quotepar}{m}{%
``#1''par
}
NewDocumentCommand{normalitem}{m}{%
item #1
}
NewDocumentCommand{bulletitem}{m}{%
textbullet #1%
}

begin{document}

begin{myitemize}[action=bulletitem,sep={, }]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[action=quotepar]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[
action=normalitem,
pre=begin{itemize},
post=end{itemize},
]
item First
item Second
item Last
end{myitemize}

end{document}


enter image description here






share|improve this answer


























  • How can this answer be updated to set myitemize just like an original itemize? If I just wrap the environment definition inside an itemize and immediately save letolditemitem before it's redefined, then olditem ``...'' produces an extra item at the bottom of the list.

    – Werner
    Jan 21 '16 at 17:02













  • @Werner newenvironment{myitemize}{itemize}{enditemize}

    – egreg
    Jan 21 '16 at 17:11













  • @Werner I added a new implementation

    – egreg
    Jan 21 '16 at 18:51
















12














You can use environ:



documentclass{article}
usepackage{environ}

makeatletter
NewEnviron{myitemize}{%
defitem##1item{dosomething{##1}}%
expandafter@emptyBODYitem}

newcommand{dosomething}[1]{%
defwerner@arg{#1}%
ifxwerner@argwerner@stop
expandafterenv@ignore % to end the recursion
else
``Here is #1unskip''par % what to do with #1
expandafteritem % to continue the recursion
fi}

edefwerner@stop{noexpandenv@ignorespace}
makeatother
begin{document}

begin{myitemize}
item First
item Second
item Last
end{myitemize}

end{document}


Note that end{myitemize} should go on a line of its own (one could also take care of it appearing on the same line as the last item). The unskip is necessary if par is not next to #1 or isn't used at all, because of the end of line at the end of the item text.



enter image description here



A much more powerful implementation with expl3:



documentclass{article}
usepackage{xparse}

ExplSyntaxOn
NewDocumentEnvironment{myitemize}{ O{} +b }
{
% do the setup
keys_set:nn { werner/itemize } { #1 }
% split the contents at item
seq_set_split:Nnn l_werner_itemize_input_seq { item } { #2 }
% remove the first (empty) item
seq_pop_left:NN l_werner_itemize_input_seq l_tmpa_tl
% issue the preamble
tl_use:N l_werner_itemize_pre_tl
% adorn the items
seq_set_map:NNn
l_werner_itemize_output_seq
l_werner_itemize_input_seq
{ exp_not:n { __werner_itemize_do:n { ##1 } } }
% output the items, separated by the chosen separator
seq_use:NV l_werner_itemize_output_seq l_werner_itemize_sep_tl
% issue the postamble
tl_use:N l_werner_itemize_post_tl
}
{}

seq_new:N l_werner_itemize_input_seq
seq_new:N l_werner_itemize_output_seq
cs_generate_variant:Nn seq_use:Nn { NV }

keys_define:nn { werner/itemize }
{
pre .tl_set:N = l_werner_itemize_pre_tl,
post .tl_set:N = l_werner_itemize_post_tl,
sep .tl_set:N = l_werner_itemize_sep_tl,
action .code:n = cs_set_eq:NN __werner_itemize_do:n #1,
action .initial:n = use:n,
}
ExplSyntaxOff

NewDocumentCommand{quotepar}{m}{%
``#1''par
}
NewDocumentCommand{normalitem}{m}{%
item #1
}
NewDocumentCommand{bulletitem}{m}{%
textbullet #1%
}

begin{document}

begin{myitemize}[action=bulletitem,sep={, }]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[action=quotepar]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[
action=normalitem,
pre=begin{itemize},
post=end{itemize},
]
item First
item Second
item Last
end{myitemize}

end{document}


enter image description here






share|improve this answer


























  • How can this answer be updated to set myitemize just like an original itemize? If I just wrap the environment definition inside an itemize and immediately save letolditemitem before it's redefined, then olditem ``...'' produces an extra item at the bottom of the list.

    – Werner
    Jan 21 '16 at 17:02













  • @Werner newenvironment{myitemize}{itemize}{enditemize}

    – egreg
    Jan 21 '16 at 17:11













  • @Werner I added a new implementation

    – egreg
    Jan 21 '16 at 18:51














12












12








12







You can use environ:



documentclass{article}
usepackage{environ}

makeatletter
NewEnviron{myitemize}{%
defitem##1item{dosomething{##1}}%
expandafter@emptyBODYitem}

newcommand{dosomething}[1]{%
defwerner@arg{#1}%
ifxwerner@argwerner@stop
expandafterenv@ignore % to end the recursion
else
``Here is #1unskip''par % what to do with #1
expandafteritem % to continue the recursion
fi}

edefwerner@stop{noexpandenv@ignorespace}
makeatother
begin{document}

begin{myitemize}
item First
item Second
item Last
end{myitemize}

end{document}


Note that end{myitemize} should go on a line of its own (one could also take care of it appearing on the same line as the last item). The unskip is necessary if par is not next to #1 or isn't used at all, because of the end of line at the end of the item text.



enter image description here



A much more powerful implementation with expl3:



documentclass{article}
usepackage{xparse}

ExplSyntaxOn
NewDocumentEnvironment{myitemize}{ O{} +b }
{
% do the setup
keys_set:nn { werner/itemize } { #1 }
% split the contents at item
seq_set_split:Nnn l_werner_itemize_input_seq { item } { #2 }
% remove the first (empty) item
seq_pop_left:NN l_werner_itemize_input_seq l_tmpa_tl
% issue the preamble
tl_use:N l_werner_itemize_pre_tl
% adorn the items
seq_set_map:NNn
l_werner_itemize_output_seq
l_werner_itemize_input_seq
{ exp_not:n { __werner_itemize_do:n { ##1 } } }
% output the items, separated by the chosen separator
seq_use:NV l_werner_itemize_output_seq l_werner_itemize_sep_tl
% issue the postamble
tl_use:N l_werner_itemize_post_tl
}
{}

seq_new:N l_werner_itemize_input_seq
seq_new:N l_werner_itemize_output_seq
cs_generate_variant:Nn seq_use:Nn { NV }

keys_define:nn { werner/itemize }
{
pre .tl_set:N = l_werner_itemize_pre_tl,
post .tl_set:N = l_werner_itemize_post_tl,
sep .tl_set:N = l_werner_itemize_sep_tl,
action .code:n = cs_set_eq:NN __werner_itemize_do:n #1,
action .initial:n = use:n,
}
ExplSyntaxOff

NewDocumentCommand{quotepar}{m}{%
``#1''par
}
NewDocumentCommand{normalitem}{m}{%
item #1
}
NewDocumentCommand{bulletitem}{m}{%
textbullet #1%
}

begin{document}

begin{myitemize}[action=bulletitem,sep={, }]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[action=quotepar]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[
action=normalitem,
pre=begin{itemize},
post=end{itemize},
]
item First
item Second
item Last
end{myitemize}

end{document}


enter image description here






share|improve this answer















You can use environ:



documentclass{article}
usepackage{environ}

makeatletter
NewEnviron{myitemize}{%
defitem##1item{dosomething{##1}}%
expandafter@emptyBODYitem}

newcommand{dosomething}[1]{%
defwerner@arg{#1}%
ifxwerner@argwerner@stop
expandafterenv@ignore % to end the recursion
else
``Here is #1unskip''par % what to do with #1
expandafteritem % to continue the recursion
fi}

edefwerner@stop{noexpandenv@ignorespace}
makeatother
begin{document}

begin{myitemize}
item First
item Second
item Last
end{myitemize}

end{document}


Note that end{myitemize} should go on a line of its own (one could also take care of it appearing on the same line as the last item). The unskip is necessary if par is not next to #1 or isn't used at all, because of the end of line at the end of the item text.



enter image description here



A much more powerful implementation with expl3:



documentclass{article}
usepackage{xparse}

ExplSyntaxOn
NewDocumentEnvironment{myitemize}{ O{} +b }
{
% do the setup
keys_set:nn { werner/itemize } { #1 }
% split the contents at item
seq_set_split:Nnn l_werner_itemize_input_seq { item } { #2 }
% remove the first (empty) item
seq_pop_left:NN l_werner_itemize_input_seq l_tmpa_tl
% issue the preamble
tl_use:N l_werner_itemize_pre_tl
% adorn the items
seq_set_map:NNn
l_werner_itemize_output_seq
l_werner_itemize_input_seq
{ exp_not:n { __werner_itemize_do:n { ##1 } } }
% output the items, separated by the chosen separator
seq_use:NV l_werner_itemize_output_seq l_werner_itemize_sep_tl
% issue the postamble
tl_use:N l_werner_itemize_post_tl
}
{}

seq_new:N l_werner_itemize_input_seq
seq_new:N l_werner_itemize_output_seq
cs_generate_variant:Nn seq_use:Nn { NV }

keys_define:nn { werner/itemize }
{
pre .tl_set:N = l_werner_itemize_pre_tl,
post .tl_set:N = l_werner_itemize_post_tl,
sep .tl_set:N = l_werner_itemize_sep_tl,
action .code:n = cs_set_eq:NN __werner_itemize_do:n #1,
action .initial:n = use:n,
}
ExplSyntaxOff

NewDocumentCommand{quotepar}{m}{%
``#1''par
}
NewDocumentCommand{normalitem}{m}{%
item #1
}
NewDocumentCommand{bulletitem}{m}{%
textbullet #1%
}

begin{document}

begin{myitemize}[action=bulletitem,sep={, }]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[action=quotepar]
item First
item Second
item Last
end{myitemize}

begin{myitemize}[
action=normalitem,
pre=begin{itemize},
post=end{itemize},
]
item First
item Second
item Last
end{myitemize}

end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 9 at 15:17

























answered Aug 6 '13 at 19:28









egregegreg

727k8819223231




727k8819223231













  • How can this answer be updated to set myitemize just like an original itemize? If I just wrap the environment definition inside an itemize and immediately save letolditemitem before it's redefined, then olditem ``...'' produces an extra item at the bottom of the list.

    – Werner
    Jan 21 '16 at 17:02













  • @Werner newenvironment{myitemize}{itemize}{enditemize}

    – egreg
    Jan 21 '16 at 17:11













  • @Werner I added a new implementation

    – egreg
    Jan 21 '16 at 18:51



















  • How can this answer be updated to set myitemize just like an original itemize? If I just wrap the environment definition inside an itemize and immediately save letolditemitem before it's redefined, then olditem ``...'' produces an extra item at the bottom of the list.

    – Werner
    Jan 21 '16 at 17:02













  • @Werner newenvironment{myitemize}{itemize}{enditemize}

    – egreg
    Jan 21 '16 at 17:11













  • @Werner I added a new implementation

    – egreg
    Jan 21 '16 at 18:51

















How can this answer be updated to set myitemize just like an original itemize? If I just wrap the environment definition inside an itemize and immediately save letolditemitem before it's redefined, then olditem ``...'' produces an extra item at the bottom of the list.

– Werner
Jan 21 '16 at 17:02







How can this answer be updated to set myitemize just like an original itemize? If I just wrap the environment definition inside an itemize and immediately save letolditemitem before it's redefined, then olditem ``...'' produces an extra item at the bottom of the list.

– Werner
Jan 21 '16 at 17:02















@Werner newenvironment{myitemize}{itemize}{enditemize}

– egreg
Jan 21 '16 at 17:11







@Werner newenvironment{myitemize}{itemize}{enditemize}

– egreg
Jan 21 '16 at 17:11















@Werner I added a new implementation

– egreg
Jan 21 '16 at 18:51





@Werner I added a new implementation

– egreg
Jan 21 '16 at 18:51


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f127005%2fmacro-to-capture-until-end-of-line-as-argument%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?