Vertical list customization like enumitem's itemjoin?
I like the flexibility in editing afforded by custom inline enumitem lists; for example:
documentclass{article}
usepackage{enumitem}
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before=unskip{:}, % Colon before list
itemjoin={{;}}, % Join with semicolons
itemjoin*={{; and}}, % Last join has "; and "
label={}, % No label
after=.} % Period at end of last item
begin{document}
Here is some text that will have a list of
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

I'd like to do the same thing with a non-inline list; however, enumitem's docs state that "itemjoin is ignored in vertical mode", and so it is.
lists enumitem
add a comment |
I like the flexibility in editing afforded by custom inline enumitem lists; for example:
documentclass{article}
usepackage{enumitem}
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before=unskip{:}, % Colon before list
itemjoin={{;}}, % Join with semicolons
itemjoin*={{; and}}, % Last join has "; and "
label={}, % No label
after=.} % Period at end of last item
begin{document}
Here is some text that will have a list of
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

I'd like to do the same thing with a non-inline list; however, enumitem's docs state that "itemjoin is ignored in vertical mode", and so it is.
lists enumitem
What does "the same thing" mean? Have you triedlabel={; and}?
– Andrew
Sep 13 '18 at 14:39
1
@Andrew "the same thing" means automatically addingbeforebefore the list,itemjointo the end of every item in the list except the penultimate and last ones,itemjoin*to the penultimate item, andafterto the last item. Usinglabel={; and}changes the label of every item to be; and, which is definitely not the effect I'm going for.
– Dan
Sep 14 '18 at 7:39
I'm reminded this bounty needs to be allocated soon, so just a reminder to raise any concerns with either answer before I have to make a decision.
– KJO
Feb 3 at 17:44
add a comment |
I like the flexibility in editing afforded by custom inline enumitem lists; for example:
documentclass{article}
usepackage{enumitem}
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before=unskip{:}, % Colon before list
itemjoin={{;}}, % Join with semicolons
itemjoin*={{; and}}, % Last join has "; and "
label={}, % No label
after=.} % Period at end of last item
begin{document}
Here is some text that will have a list of
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

I'd like to do the same thing with a non-inline list; however, enumitem's docs state that "itemjoin is ignored in vertical mode", and so it is.
lists enumitem
I like the flexibility in editing afforded by custom inline enumitem lists; for example:
documentclass{article}
usepackage{enumitem}
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before=unskip{:}, % Colon before list
itemjoin={{;}}, % Join with semicolons
itemjoin*={{; and}}, % Last join has "; and "
label={}, % No label
after=.} % Period at end of last item
begin{document}
Here is some text that will have a list of
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

I'd like to do the same thing with a non-inline list; however, enumitem's docs state that "itemjoin is ignored in vertical mode", and so it is.
lists enumitem
lists enumitem
asked Sep 13 '18 at 12:38
DanDan
1625
1625
What does "the same thing" mean? Have you triedlabel={; and}?
– Andrew
Sep 13 '18 at 14:39
1
@Andrew "the same thing" means automatically addingbeforebefore the list,itemjointo the end of every item in the list except the penultimate and last ones,itemjoin*to the penultimate item, andafterto the last item. Usinglabel={; and}changes the label of every item to be; and, which is definitely not the effect I'm going for.
– Dan
Sep 14 '18 at 7:39
I'm reminded this bounty needs to be allocated soon, so just a reminder to raise any concerns with either answer before I have to make a decision.
– KJO
Feb 3 at 17:44
add a comment |
What does "the same thing" mean? Have you triedlabel={; and}?
– Andrew
Sep 13 '18 at 14:39
1
@Andrew "the same thing" means automatically addingbeforebefore the list,itemjointo the end of every item in the list except the penultimate and last ones,itemjoin*to the penultimate item, andafterto the last item. Usinglabel={; and}changes the label of every item to be; and, which is definitely not the effect I'm going for.
– Dan
Sep 14 '18 at 7:39
I'm reminded this bounty needs to be allocated soon, so just a reminder to raise any concerns with either answer before I have to make a decision.
– KJO
Feb 3 at 17:44
What does "the same thing" mean? Have you tried
label={; and}?– Andrew
Sep 13 '18 at 14:39
What does "the same thing" mean? Have you tried
label={; and}?– Andrew
Sep 13 '18 at 14:39
1
1
@Andrew "the same thing" means automatically adding
before before the list, itemjoin to the end of every item in the list except the penultimate and last ones, itemjoin* to the penultimate item, and after to the last item. Using label={; and} changes the label of every item to be ; and, which is definitely not the effect I'm going for.– Dan
Sep 14 '18 at 7:39
@Andrew "the same thing" means automatically adding
before before the list, itemjoin to the end of every item in the list except the penultimate and last ones, itemjoin* to the penultimate item, and after to the last item. Using label={; and} changes the label of every item to be ; and, which is definitely not the effect I'm going for.– Dan
Sep 14 '18 at 7:39
I'm reminded this bounty needs to be allocated soon, so just a reminder to raise any concerns with either answer before I have to make a decision.
– KJO
Feb 3 at 17:44
I'm reminded this bounty needs to be allocated soon, so just a reminder to raise any concerns with either answer before I have to make a decision.
– KJO
Feb 3 at 17:44
add a comment |
2 Answers
2
active
oldest
votes
Here's a possible solution that works by redefining item.
This may seem a little heavy-handed, but it is also how the itemjoin key for inline lists works.
I'm using SetEnumitemKey to define a new key, sentence, that can be supplied to any list environment that enumitem knows about.
It will append a period (.) to the last item and a semicolon (;) to every other item.
documentclass{article}
usepackage{enumitem}
SetEnumitemKey{sentence}{%
before*={sentencelistprep{;}},
after*={unskip.},
}
letsentenceitemjoinempty
edefsentenceitem{noexpandsentenceitemjoinunexpandedexpandafter{item}}%
newcommand*sentencelistprep[1]{%
defsentenceitemjoin{defsentenceitemjoin{unskip#1}}%
letitemsentenceitem
}
begin{document}
Here is an texttt{itemize} environment whose items are part of this sentence and therefore come with appropriate punctuation:
begin{itemize}[sentence]
item a list item that could go first but also last
item another list item that I'm not sure about that is long enough to span two lines
item this one should go last unless I think of another one
end{itemize}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

Warning: you can't use any other list environments inside one with the
sentencekey because the redefinition ofitemwill also apply to those and will insert additional semicolons there as well.
(You probably wouldn't want to nest lists inside a running sentence, but if you have to you can addletsentenceitemjoinemptyinside the inner list.)
Remarks
- I didn't include the colon (:) because does not feel like it is a part of the list (and not affected if items are reordered).
If you do want the colon to automatically be inserted you can replace the value ofbefore*above by{unskip:sentencelistprep{;}}.
If you don't want to have to supply the
sentencekey every time, you can create a custom list environment that includes it with e.g.
newlist{myitemize}{itemize}{1}
setlist[myitemize]{label=textbullet,sentence}
The
beforeandafterkeys overwritesentenceif supplied later, but the converse is not true becausesentenceuses the starred versionsbefore*andafter*.sentencelistprep{;}, which is called at the start of a list withsentence, does the following: it definessentenceitemjoinasdefsentenceitemjoin{unskip;}and replacesitemby a version that includessentenceitemjoin.
The firstitemtherefore redefinessentenceitemjointounskip;, and everyitemafter that consequently inserts a;before it.
add a comment |
Here is a version that sort of reproduces a display itemize allowing for the features of an itemize*. Below is the same content using inlineitem (provided in question), displayitem and a regular itemize for comparison purposes:

Notes:
The color red has been added to make it easier to compare the three versions. You can replace the definition of
Showwith
newcommand*{Show}[1]{#1}
to eliminate the highlighting or simply remove all references to the
Showmacro.
The "sort of" is because I wasn't able to get the vertical spacing of the very first item to match what
itemizeyields.
Code:
documentclass{article}
usepackage{enumitem}
usepackage{xcolor}
newcommand*{NextLine}{%
newline
vspace*{0.5baselineskip}%
hspace*{dimexprlabelindent+labelwidth-labelseprelax}%
}%
newcommand*{Show}[1]{textcolor{red}{bfseries#1}}% Make it easier to see difference
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before={unskipShow:}, % Colon before list
itemjoin={{Show;}}, % Join with semicolons
itemjoin*={{Show{; and}}}, % Last join has "; and "
label={}, % No label
after=., % Period at end of last item
}
newlist{displayitem}{itemize*}{1}
setlist[displayitem]{ % Customize itemize* environ
before={unskipShow:NextLine}, % Colon before list
itemjoin={Show;NextLine}, % Join with semicolons
itemjoin*={Show{; and}NextLine}, % Last join has "; and "
label={$bullet$}, % Label
after={unskipShow.endgrafnoindent}, % Period at end of last item
}
pagecolor{white}
begin{document}
noindent
Here is some text in a verb|inlineitem|
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
Some text after verb|inlineitem|.
bigskip
noindent
Here is the same text in a verb|displayitem|
begin{displayitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{displayitem}
Some text after verb|displayitem|.
bigskip
noindent
Here is the same text in an verb|itemize|
begin{itemize}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{itemize}
Some text after regular verb|itemize|.
end{document}
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f450715%2fvertical-list-customization-like-enumitems-itemjoin%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here's a possible solution that works by redefining item.
This may seem a little heavy-handed, but it is also how the itemjoin key for inline lists works.
I'm using SetEnumitemKey to define a new key, sentence, that can be supplied to any list environment that enumitem knows about.
It will append a period (.) to the last item and a semicolon (;) to every other item.
documentclass{article}
usepackage{enumitem}
SetEnumitemKey{sentence}{%
before*={sentencelistprep{;}},
after*={unskip.},
}
letsentenceitemjoinempty
edefsentenceitem{noexpandsentenceitemjoinunexpandedexpandafter{item}}%
newcommand*sentencelistprep[1]{%
defsentenceitemjoin{defsentenceitemjoin{unskip#1}}%
letitemsentenceitem
}
begin{document}
Here is an texttt{itemize} environment whose items are part of this sentence and therefore come with appropriate punctuation:
begin{itemize}[sentence]
item a list item that could go first but also last
item another list item that I'm not sure about that is long enough to span two lines
item this one should go last unless I think of another one
end{itemize}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

Warning: you can't use any other list environments inside one with the
sentencekey because the redefinition ofitemwill also apply to those and will insert additional semicolons there as well.
(You probably wouldn't want to nest lists inside a running sentence, but if you have to you can addletsentenceitemjoinemptyinside the inner list.)
Remarks
- I didn't include the colon (:) because does not feel like it is a part of the list (and not affected if items are reordered).
If you do want the colon to automatically be inserted you can replace the value ofbefore*above by{unskip:sentencelistprep{;}}.
If you don't want to have to supply the
sentencekey every time, you can create a custom list environment that includes it with e.g.
newlist{myitemize}{itemize}{1}
setlist[myitemize]{label=textbullet,sentence}
The
beforeandafterkeys overwritesentenceif supplied later, but the converse is not true becausesentenceuses the starred versionsbefore*andafter*.sentencelistprep{;}, which is called at the start of a list withsentence, does the following: it definessentenceitemjoinasdefsentenceitemjoin{unskip;}and replacesitemby a version that includessentenceitemjoin.
The firstitemtherefore redefinessentenceitemjointounskip;, and everyitemafter that consequently inserts a;before it.
add a comment |
Here's a possible solution that works by redefining item.
This may seem a little heavy-handed, but it is also how the itemjoin key for inline lists works.
I'm using SetEnumitemKey to define a new key, sentence, that can be supplied to any list environment that enumitem knows about.
It will append a period (.) to the last item and a semicolon (;) to every other item.
documentclass{article}
usepackage{enumitem}
SetEnumitemKey{sentence}{%
before*={sentencelistprep{;}},
after*={unskip.},
}
letsentenceitemjoinempty
edefsentenceitem{noexpandsentenceitemjoinunexpandedexpandafter{item}}%
newcommand*sentencelistprep[1]{%
defsentenceitemjoin{defsentenceitemjoin{unskip#1}}%
letitemsentenceitem
}
begin{document}
Here is an texttt{itemize} environment whose items are part of this sentence and therefore come with appropriate punctuation:
begin{itemize}[sentence]
item a list item that could go first but also last
item another list item that I'm not sure about that is long enough to span two lines
item this one should go last unless I think of another one
end{itemize}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

Warning: you can't use any other list environments inside one with the
sentencekey because the redefinition ofitemwill also apply to those and will insert additional semicolons there as well.
(You probably wouldn't want to nest lists inside a running sentence, but if you have to you can addletsentenceitemjoinemptyinside the inner list.)
Remarks
- I didn't include the colon (:) because does not feel like it is a part of the list (and not affected if items are reordered).
If you do want the colon to automatically be inserted you can replace the value ofbefore*above by{unskip:sentencelistprep{;}}.
If you don't want to have to supply the
sentencekey every time, you can create a custom list environment that includes it with e.g.
newlist{myitemize}{itemize}{1}
setlist[myitemize]{label=textbullet,sentence}
The
beforeandafterkeys overwritesentenceif supplied later, but the converse is not true becausesentenceuses the starred versionsbefore*andafter*.sentencelistprep{;}, which is called at the start of a list withsentence, does the following: it definessentenceitemjoinasdefsentenceitemjoin{unskip;}and replacesitemby a version that includessentenceitemjoin.
The firstitemtherefore redefinessentenceitemjointounskip;, and everyitemafter that consequently inserts a;before it.
add a comment |
Here's a possible solution that works by redefining item.
This may seem a little heavy-handed, but it is also how the itemjoin key for inline lists works.
I'm using SetEnumitemKey to define a new key, sentence, that can be supplied to any list environment that enumitem knows about.
It will append a period (.) to the last item and a semicolon (;) to every other item.
documentclass{article}
usepackage{enumitem}
SetEnumitemKey{sentence}{%
before*={sentencelistprep{;}},
after*={unskip.},
}
letsentenceitemjoinempty
edefsentenceitem{noexpandsentenceitemjoinunexpandedexpandafter{item}}%
newcommand*sentencelistprep[1]{%
defsentenceitemjoin{defsentenceitemjoin{unskip#1}}%
letitemsentenceitem
}
begin{document}
Here is an texttt{itemize} environment whose items are part of this sentence and therefore come with appropriate punctuation:
begin{itemize}[sentence]
item a list item that could go first but also last
item another list item that I'm not sure about that is long enough to span two lines
item this one should go last unless I think of another one
end{itemize}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

Warning: you can't use any other list environments inside one with the
sentencekey because the redefinition ofitemwill also apply to those and will insert additional semicolons there as well.
(You probably wouldn't want to nest lists inside a running sentence, but if you have to you can addletsentenceitemjoinemptyinside the inner list.)
Remarks
- I didn't include the colon (:) because does not feel like it is a part of the list (and not affected if items are reordered).
If you do want the colon to automatically be inserted you can replace the value ofbefore*above by{unskip:sentencelistprep{;}}.
If you don't want to have to supply the
sentencekey every time, you can create a custom list environment that includes it with e.g.
newlist{myitemize}{itemize}{1}
setlist[myitemize]{label=textbullet,sentence}
The
beforeandafterkeys overwritesentenceif supplied later, but the converse is not true becausesentenceuses the starred versionsbefore*andafter*.sentencelistprep{;}, which is called at the start of a list withsentence, does the following: it definessentenceitemjoinasdefsentenceitemjoin{unskip;}and replacesitemby a version that includessentenceitemjoin.
The firstitemtherefore redefinessentenceitemjointounskip;, and everyitemafter that consequently inserts a;before it.
Here's a possible solution that works by redefining item.
This may seem a little heavy-handed, but it is also how the itemjoin key for inline lists works.
I'm using SetEnumitemKey to define a new key, sentence, that can be supplied to any list environment that enumitem knows about.
It will append a period (.) to the last item and a semicolon (;) to every other item.
documentclass{article}
usepackage{enumitem}
SetEnumitemKey{sentence}{%
before*={sentencelistprep{;}},
after*={unskip.},
}
letsentenceitemjoinempty
edefsentenceitem{noexpandsentenceitemjoinunexpandedexpandafter{item}}%
newcommand*sentencelistprep[1]{%
defsentenceitemjoin{defsentenceitemjoin{unskip#1}}%
letitemsentenceitem
}
begin{document}
Here is an texttt{itemize} environment whose items are part of this sentence and therefore come with appropriate punctuation:
begin{itemize}[sentence]
item a list item that could go first but also last
item another list item that I'm not sure about that is long enough to span two lines
item this one should go last unless I think of another one
end{itemize}
It's convenient because I can add, remove, and rearrange items without worrying about punctuation.
end{document}

Warning: you can't use any other list environments inside one with the
sentencekey because the redefinition ofitemwill also apply to those and will insert additional semicolons there as well.
(You probably wouldn't want to nest lists inside a running sentence, but if you have to you can addletsentenceitemjoinemptyinside the inner list.)
Remarks
- I didn't include the colon (:) because does not feel like it is a part of the list (and not affected if items are reordered).
If you do want the colon to automatically be inserted you can replace the value ofbefore*above by{unskip:sentencelistprep{;}}.
If you don't want to have to supply the
sentencekey every time, you can create a custom list environment that includes it with e.g.
newlist{myitemize}{itemize}{1}
setlist[myitemize]{label=textbullet,sentence}
The
beforeandafterkeys overwritesentenceif supplied later, but the converse is not true becausesentenceuses the starred versionsbefore*andafter*.sentencelistprep{;}, which is called at the start of a list withsentence, does the following: it definessentenceitemjoinasdefsentenceitemjoin{unskip;}and replacesitemby a version that includessentenceitemjoin.
The firstitemtherefore redefinessentenceitemjointounskip;, and everyitemafter that consequently inserts a;before it.
edited Jan 31 at 13:50
answered Jan 30 at 23:44
CircumscribeCircumscribe
6,4312836
6,4312836
add a comment |
add a comment |
Here is a version that sort of reproduces a display itemize allowing for the features of an itemize*. Below is the same content using inlineitem (provided in question), displayitem and a regular itemize for comparison purposes:

Notes:
The color red has been added to make it easier to compare the three versions. You can replace the definition of
Showwith
newcommand*{Show}[1]{#1}
to eliminate the highlighting or simply remove all references to the
Showmacro.
The "sort of" is because I wasn't able to get the vertical spacing of the very first item to match what
itemizeyields.
Code:
documentclass{article}
usepackage{enumitem}
usepackage{xcolor}
newcommand*{NextLine}{%
newline
vspace*{0.5baselineskip}%
hspace*{dimexprlabelindent+labelwidth-labelseprelax}%
}%
newcommand*{Show}[1]{textcolor{red}{bfseries#1}}% Make it easier to see difference
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before={unskipShow:}, % Colon before list
itemjoin={{Show;}}, % Join with semicolons
itemjoin*={{Show{; and}}}, % Last join has "; and "
label={}, % No label
after=., % Period at end of last item
}
newlist{displayitem}{itemize*}{1}
setlist[displayitem]{ % Customize itemize* environ
before={unskipShow:NextLine}, % Colon before list
itemjoin={Show;NextLine}, % Join with semicolons
itemjoin*={Show{; and}NextLine}, % Last join has "; and "
label={$bullet$}, % Label
after={unskipShow.endgrafnoindent}, % Period at end of last item
}
pagecolor{white}
begin{document}
noindent
Here is some text in a verb|inlineitem|
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
Some text after verb|inlineitem|.
bigskip
noindent
Here is the same text in a verb|displayitem|
begin{displayitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{displayitem}
Some text after verb|displayitem|.
bigskip
noindent
Here is the same text in an verb|itemize|
begin{itemize}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{itemize}
Some text after regular verb|itemize|.
end{document}
add a comment |
Here is a version that sort of reproduces a display itemize allowing for the features of an itemize*. Below is the same content using inlineitem (provided in question), displayitem and a regular itemize for comparison purposes:

Notes:
The color red has been added to make it easier to compare the three versions. You can replace the definition of
Showwith
newcommand*{Show}[1]{#1}
to eliminate the highlighting or simply remove all references to the
Showmacro.
The "sort of" is because I wasn't able to get the vertical spacing of the very first item to match what
itemizeyields.
Code:
documentclass{article}
usepackage{enumitem}
usepackage{xcolor}
newcommand*{NextLine}{%
newline
vspace*{0.5baselineskip}%
hspace*{dimexprlabelindent+labelwidth-labelseprelax}%
}%
newcommand*{Show}[1]{textcolor{red}{bfseries#1}}% Make it easier to see difference
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before={unskipShow:}, % Colon before list
itemjoin={{Show;}}, % Join with semicolons
itemjoin*={{Show{; and}}}, % Last join has "; and "
label={}, % No label
after=., % Period at end of last item
}
newlist{displayitem}{itemize*}{1}
setlist[displayitem]{ % Customize itemize* environ
before={unskipShow:NextLine}, % Colon before list
itemjoin={Show;NextLine}, % Join with semicolons
itemjoin*={Show{; and}NextLine}, % Last join has "; and "
label={$bullet$}, % Label
after={unskipShow.endgrafnoindent}, % Period at end of last item
}
pagecolor{white}
begin{document}
noindent
Here is some text in a verb|inlineitem|
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
Some text after verb|inlineitem|.
bigskip
noindent
Here is the same text in a verb|displayitem|
begin{displayitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{displayitem}
Some text after verb|displayitem|.
bigskip
noindent
Here is the same text in an verb|itemize|
begin{itemize}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{itemize}
Some text after regular verb|itemize|.
end{document}
add a comment |
Here is a version that sort of reproduces a display itemize allowing for the features of an itemize*. Below is the same content using inlineitem (provided in question), displayitem and a regular itemize for comparison purposes:

Notes:
The color red has been added to make it easier to compare the three versions. You can replace the definition of
Showwith
newcommand*{Show}[1]{#1}
to eliminate the highlighting or simply remove all references to the
Showmacro.
The "sort of" is because I wasn't able to get the vertical spacing of the very first item to match what
itemizeyields.
Code:
documentclass{article}
usepackage{enumitem}
usepackage{xcolor}
newcommand*{NextLine}{%
newline
vspace*{0.5baselineskip}%
hspace*{dimexprlabelindent+labelwidth-labelseprelax}%
}%
newcommand*{Show}[1]{textcolor{red}{bfseries#1}}% Make it easier to see difference
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before={unskipShow:}, % Colon before list
itemjoin={{Show;}}, % Join with semicolons
itemjoin*={{Show{; and}}}, % Last join has "; and "
label={}, % No label
after=., % Period at end of last item
}
newlist{displayitem}{itemize*}{1}
setlist[displayitem]{ % Customize itemize* environ
before={unskipShow:NextLine}, % Colon before list
itemjoin={Show;NextLine}, % Join with semicolons
itemjoin*={Show{; and}NextLine}, % Last join has "; and "
label={$bullet$}, % Label
after={unskipShow.endgrafnoindent}, % Period at end of last item
}
pagecolor{white}
begin{document}
noindent
Here is some text in a verb|inlineitem|
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
Some text after verb|inlineitem|.
bigskip
noindent
Here is the same text in a verb|displayitem|
begin{displayitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{displayitem}
Some text after verb|displayitem|.
bigskip
noindent
Here is the same text in an verb|itemize|
begin{itemize}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{itemize}
Some text after regular verb|itemize|.
end{document}
Here is a version that sort of reproduces a display itemize allowing for the features of an itemize*. Below is the same content using inlineitem (provided in question), displayitem and a regular itemize for comparison purposes:

Notes:
The color red has been added to make it easier to compare the three versions. You can replace the definition of
Showwith
newcommand*{Show}[1]{#1}
to eliminate the highlighting or simply remove all references to the
Showmacro.
The "sort of" is because I wasn't able to get the vertical spacing of the very first item to match what
itemizeyields.
Code:
documentclass{article}
usepackage{enumitem}
usepackage{xcolor}
newcommand*{NextLine}{%
newline
vspace*{0.5baselineskip}%
hspace*{dimexprlabelindent+labelwidth-labelseprelax}%
}%
newcommand*{Show}[1]{textcolor{red}{bfseries#1}}% Make it easier to see difference
newlist{inlineitem}{itemize*}{1}
setlist[inlineitem]{ % Customize itemize* environ
before={unskipShow:}, % Colon before list
itemjoin={{Show;}}, % Join with semicolons
itemjoin*={{Show{; and}}}, % Last join has "; and "
label={}, % No label
after=., % Period at end of last item
}
newlist{displayitem}{itemize*}{1}
setlist[displayitem]{ % Customize itemize* environ
before={unskipShow:NextLine}, % Colon before list
itemjoin={Show;NextLine}, % Join with semicolons
itemjoin*={Show{; and}NextLine}, % Last join has "; and "
label={$bullet$}, % Label
after={unskipShow.endgrafnoindent}, % Period at end of last item
}
pagecolor{white}
begin{document}
noindent
Here is some text in a verb|inlineitem|
begin{inlineitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{inlineitem}
Some text after verb|inlineitem|.
bigskip
noindent
Here is the same text in a verb|displayitem|
begin{displayitem}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{displayitem}
Some text after verb|displayitem|.
bigskip
noindent
Here is the same text in an verb|itemize|
begin{itemize}
item a list item that could go first but also last
item another list item that I'm not sure about
item this one should go last unless I think of another one
end{itemize}
Some text after regular verb|itemize|.
end{document}
answered Jan 30 at 21:47
Peter GrillPeter Grill
165k25438752
165k25438752
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f450715%2fvertical-list-customization-like-enumitems-itemjoin%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
What does "the same thing" mean? Have you tried
label={; and}?– Andrew
Sep 13 '18 at 14:39
1
@Andrew "the same thing" means automatically adding
beforebefore the list,itemjointo the end of every item in the list except the penultimate and last ones,itemjoin*to the penultimate item, andafterto the last item. Usinglabel={; and}changes the label of every item to be; and, which is definitely not the effect I'm going for.– Dan
Sep 14 '18 at 7:39
I'm reminded this bounty needs to be allocated soon, so just a reminder to raise any concerns with either answer before I have to make a decision.
– KJO
Feb 3 at 17:44