Inline list: How to insert a non-stretching but line-breaking thin space?
up vote
1
down vote
favorite
This is a follow-up to How to insert a non-stretching but line-breaking thin space?, but in reference to an inline list. The MWE below attempts to use each of the solutions mentioned there, but the best I can using:
sloppyRaggedRight
%ttfamily
is shown in the image below. Ultimately, I want to use ttfamily in this list (but that is another problem entirely and should probably be a separate question), thus the use of normalfont in:
setlist[MyList*]{..., itemjoin={normalfont,BreakableSpace{,}}, ...}

Notes:
- I attempted to use the solutions in What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?, but was not able to get them to work either.
- It seems that I have asked a similar question a long time ago Why is text being placed beyond the specified line width?, but here I am using
sloppyandRaggedRightbut that still is not sufficient.
Question:
What options do I have to force the text to stay within the specified area?
Slightly Better Results:
It seems that if I move the sloppyRaggedRight to be before I call TypesetMyList as in:
{sloppyRaggedRightTypesetMyList{Title}{MyList*}}
the results are better but still has some additional leading space at the beginning of lines:

References
How to insert a non-stretching but line-breaking thin space?.- What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?
Code:
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
sloppyRaggedRight
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
endgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}
spacing line-breaking microtype
add a comment |
up vote
1
down vote
favorite
This is a follow-up to How to insert a non-stretching but line-breaking thin space?, but in reference to an inline list. The MWE below attempts to use each of the solutions mentioned there, but the best I can using:
sloppyRaggedRight
%ttfamily
is shown in the image below. Ultimately, I want to use ttfamily in this list (but that is another problem entirely and should probably be a separate question), thus the use of normalfont in:
setlist[MyList*]{..., itemjoin={normalfont,BreakableSpace{,}}, ...}

Notes:
- I attempted to use the solutions in What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?, but was not able to get them to work either.
- It seems that I have asked a similar question a long time ago Why is text being placed beyond the specified line width?, but here I am using
sloppyandRaggedRightbut that still is not sufficient.
Question:
What options do I have to force the text to stay within the specified area?
Slightly Better Results:
It seems that if I move the sloppyRaggedRight to be before I call TypesetMyList as in:
{sloppyRaggedRightTypesetMyList{Title}{MyList*}}
the results are better but still has some additional leading space at the beginning of lines:

References
How to insert a non-stretching but line-breaking thin space?.- What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?
Code:
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
sloppyRaggedRight
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
endgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}
spacing line-breaking microtype
ttfamily would change things quite a bit as the inter-word space is then not stretchy by default, so if that's what you want, possibly the initial exampe should use that.
– David Carlisle
3 hours ago
@DavidCarlisle: Yeah I normally would have includedttfamily, but as it seemed to be another can of worms as per How to automatically hyphenate within texttt?, I decided not too. As egreg's solution already seems to work for that case I won't post a new question (unless some other issue comes up).
– Peter Grill
2 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
This is a follow-up to How to insert a non-stretching but line-breaking thin space?, but in reference to an inline list. The MWE below attempts to use each of the solutions mentioned there, but the best I can using:
sloppyRaggedRight
%ttfamily
is shown in the image below. Ultimately, I want to use ttfamily in this list (but that is another problem entirely and should probably be a separate question), thus the use of normalfont in:
setlist[MyList*]{..., itemjoin={normalfont,BreakableSpace{,}}, ...}

Notes:
- I attempted to use the solutions in What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?, but was not able to get them to work either.
- It seems that I have asked a similar question a long time ago Why is text being placed beyond the specified line width?, but here I am using
sloppyandRaggedRightbut that still is not sufficient.
Question:
What options do I have to force the text to stay within the specified area?
Slightly Better Results:
It seems that if I move the sloppyRaggedRight to be before I call TypesetMyList as in:
{sloppyRaggedRightTypesetMyList{Title}{MyList*}}
the results are better but still has some additional leading space at the beginning of lines:

References
How to insert a non-stretching but line-breaking thin space?.- What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?
Code:
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
sloppyRaggedRight
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
endgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}
spacing line-breaking microtype
This is a follow-up to How to insert a non-stretching but line-breaking thin space?, but in reference to an inline list. The MWE below attempts to use each of the solutions mentioned there, but the best I can using:
sloppyRaggedRight
%ttfamily
is shown in the image below. Ultimately, I want to use ttfamily in this list (but that is another problem entirely and should probably be a separate question), thus the use of normalfont in:
setlist[MyList*]{..., itemjoin={normalfont,BreakableSpace{,}}, ...}

Notes:
- I attempted to use the solutions in What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?, but was not able to get them to work either.
- It seems that I have asked a similar question a long time ago Why is text being placed beyond the specified line width?, but here I am using
sloppyandRaggedRightbut that still is not sufficient.
Question:
What options do I have to force the text to stay within the specified area?
Slightly Better Results:
It seems that if I move the sloppyRaggedRight to be before I call TypesetMyList as in:
{sloppyRaggedRightTypesetMyList{Title}{MyList*}}
the results are better but still has some additional leading space at the beginning of lines:

References
How to insert a non-stretching but line-breaking thin space?.- What is the meaning of fussy, sloppy, emergencystretch, tolerance, hbadness?
Code:
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
sloppyRaggedRight
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
endgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}
spacing line-breaking microtype
spacing line-breaking microtype
edited 4 hours ago
asked 4 hours ago
Peter Grill
163k24432743
163k24432743
ttfamily would change things quite a bit as the inter-word space is then not stretchy by default, so if that's what you want, possibly the initial exampe should use that.
– David Carlisle
3 hours ago
@DavidCarlisle: Yeah I normally would have includedttfamily, but as it seemed to be another can of worms as per How to automatically hyphenate within texttt?, I decided not too. As egreg's solution already seems to work for that case I won't post a new question (unless some other issue comes up).
– Peter Grill
2 hours ago
add a comment |
ttfamily would change things quite a bit as the inter-word space is then not stretchy by default, so if that's what you want, possibly the initial exampe should use that.
– David Carlisle
3 hours ago
@DavidCarlisle: Yeah I normally would have includedttfamily, but as it seemed to be another can of worms as per How to automatically hyphenate within texttt?, I decided not too. As egreg's solution already seems to work for that case I won't post a new question (unless some other issue comes up).
– Peter Grill
2 hours ago
ttfamily would change things quite a bit as the inter-word space is then not stretchy by default, so if that's what you want, possibly the initial exampe should use that.
– David Carlisle
3 hours ago
ttfamily would change things quite a bit as the inter-word space is then not stretchy by default, so if that's what you want, possibly the initial exampe should use that.
– David Carlisle
3 hours ago
@DavidCarlisle: Yeah I normally would have included
ttfamily, but as it seemed to be another can of worms as per How to automatically hyphenate within texttt?, I decided not too. As egreg's solution already seems to work for that case I won't post a new question (unless some other issue comes up).– Peter Grill
2 hours ago
@DavidCarlisle: Yeah I normally would have included
ttfamily, but as it seemed to be another can of worms as per How to automatically hyphenate within texttt?, I decided not too. As egreg's solution already seems to work for that case I won't post a new question (unless some other issue comes up).– Peter Grill
2 hours ago
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
You're forgetting to set afterlabel that, by default, is ~ (non breaking space).
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={normalfont,},
afterlabel={hspace{0.16667em}},
after={.}
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begingroupsloppyRaggedRight
begin{MyList*}
ttfamily
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
parendgroup
end{document}

You can also use before to set up other features. If you add csname @@parendcsname to after, RaggedRight and sloppy will be honored. If you want to change the font for the items, but preserve normal font commas, use textnormal{,}.
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={textnormal{,}},
afterlabel={hspace{0.16667em}},
after={.csname @@parendcsname},
before={sloppyRaggedRightttfamily},
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begin{MyList*}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
end{document}

add a comment |
up vote
1
down vote
raggedright handles the list, although the text before is ~2pt over
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
raggedright
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
parendgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}

although you want to change,to an hskip (eg theaddthinspaceso it is discarded at start of line.
– David Carlisle
3 hours ago
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You're forgetting to set afterlabel that, by default, is ~ (non breaking space).
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={normalfont,},
afterlabel={hspace{0.16667em}},
after={.}
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begingroupsloppyRaggedRight
begin{MyList*}
ttfamily
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
parendgroup
end{document}

You can also use before to set up other features. If you add csname @@parendcsname to after, RaggedRight and sloppy will be honored. If you want to change the font for the items, but preserve normal font commas, use textnormal{,}.
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={textnormal{,}},
afterlabel={hspace{0.16667em}},
after={.csname @@parendcsname},
before={sloppyRaggedRightttfamily},
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begin{MyList*}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
end{document}

add a comment |
up vote
1
down vote
accepted
You're forgetting to set afterlabel that, by default, is ~ (non breaking space).
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={normalfont,},
afterlabel={hspace{0.16667em}},
after={.}
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begingroupsloppyRaggedRight
begin{MyList*}
ttfamily
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
parendgroup
end{document}

You can also use before to set up other features. If you add csname @@parendcsname to after, RaggedRight and sloppy will be honored. If you want to change the font for the items, but preserve normal font commas, use textnormal{,}.
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={textnormal{,}},
afterlabel={hspace{0.16667em}},
after={.csname @@parendcsname},
before={sloppyRaggedRightttfamily},
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begin{MyList*}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
end{document}

add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You're forgetting to set afterlabel that, by default, is ~ (non breaking space).
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={normalfont,},
afterlabel={hspace{0.16667em}},
after={.}
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begingroupsloppyRaggedRight
begin{MyList*}
ttfamily
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
parendgroup
end{document}

You can also use before to set up other features. If you add csname @@parendcsname to after, RaggedRight and sloppy will be honored. If you want to change the font for the items, but preserve normal font commas, use textnormal{,}.
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={textnormal{,}},
afterlabel={hspace{0.16667em}},
after={.csname @@parendcsname},
before={sloppyRaggedRightttfamily},
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begin{MyList*}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
end{document}

You're forgetting to set afterlabel that, by default, is ~ (non breaking space).
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={normalfont,},
afterlabel={hspace{0.16667em}},
after={.}
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begingroupsloppyRaggedRight
begin{MyList*}
ttfamily
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
parendgroup
end{document}

You can also use before to set up other features. If you add csname @@parendcsname to after, RaggedRight and sloppy will be honored. If you want to change the font for the items, but preserve normal font commas, use textnormal{,}.
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{
label={},
itemsep=0pt,
itemjoin={textnormal{,}},
afterlabel={hspace{0.16667em}},
after={.csname @@parendcsname},
before={sloppyRaggedRightttfamily},
}
begin{document}
Some text before the start of the list.
noindenttextbf{Title:}~%
begin{MyList*}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{MyList*}
end{document}

edited 3 hours ago
answered 3 hours ago
egreg
702k8618723146
702k8618723146
add a comment |
add a comment |
up vote
1
down vote
raggedright handles the list, although the text before is ~2pt over
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
raggedright
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
parendgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}

although you want to change,to an hskip (eg theaddthinspaceso it is discarded at start of line.
– David Carlisle
3 hours ago
add a comment |
up vote
1
down vote
raggedright handles the list, although the text before is ~2pt over
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
raggedright
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
parendgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}

although you want to change,to an hskip (eg theaddthinspaceso it is discarded at start of line.
– David Carlisle
3 hours ago
add a comment |
up vote
1
down vote
up vote
1
down vote
raggedright handles the list, although the text before is ~2pt over
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
raggedright
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
parendgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}

raggedright handles the list, although the text before is ~2pt over
documentclass{article}
usepackage[inline]{enumitem}
usepackage{ragged2e}
usepackage{xcolor}
usepackage{microtype}
usepackage[showframe, paperwidth=5cm]{geometry}
newlist{MyList*}{enumerate*}{1}
setlist[MyList*]{label={}, itemsep=0pt, itemjoin={normalfont,BreakableSpace{,}}, after={.}}
%% https://tex.stackexchange.com/questions/78914/
%% how-to-insert-a-non-stretching-but-line-breaking-thin-space
newcommand*{addthinspace}{hskip0.16667emrelax}% lockstep
newcommandbigspace{kern 0.1em}% <-- Changed amount here as I don't want large space
newcommandbreakingspaceJfbuA{allowbreakbigspaceallowbreak}% jfbu's 1st solution
newcommandbreakingspaceJfbuB{allowbreakbigspace}% jfbu's 2nd solution
newcommand{breakingspaceEgregA}[1]{#1hspace{0pt}}% egreg's 1st solution
newcommand{breakingspaceEgregB}[1]{{letkernhskip#1}}% egreg's 2nd solution
newcommand{badbreakingspace}[1]{penalty 0 #1}% egreg's 3rd solution
%% Select which breakable space we want to try. First uncommented one here gets used:
providecommand*{BreakableSpace}[1]{addthinspace}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuA}
providecommand*{BreakableSpace}[1]{breakingspaceJfbuB}
providecommand*{BreakableSpace}[1]{breakingspaceEgregA{#1}}
providecommand*{BreakableSpace}[1]{breakingspaceEgregB{#1}}
providecommand*{BreakableSpace}[1]{badbreakingspace{#1}}
newcommand*{TypesetMyList}[2]{%
smallskip%
parnoindent{bfseries#1:}~%
begingroup
raggedright
%ttfamily
begin{#2}
item First Item
item Second item in list
item Third item
item Fourth item in list
item Fifth item
item Sixth item in list
item Seventh item
item Eighth item in list
end{#2}%
parendgroupsmallskippar%
}%
begin{document}
Some text before the start of the list.
TypesetMyList{Title}{MyList*}
Some text after the end of the list.
end{document}

answered 3 hours ago
David Carlisle
479k3811101844
479k3811101844
although you want to change,to an hskip (eg theaddthinspaceso it is discarded at start of line.
– David Carlisle
3 hours ago
add a comment |
although you want to change,to an hskip (eg theaddthinspaceso it is discarded at start of line.
– David Carlisle
3 hours ago
although you want to change
, to an hskip (eg the addthinspace so it is discarded at start of line.– David Carlisle
3 hours ago
although you want to change
, to an hskip (eg the addthinspace so it is discarded at start of line.– David Carlisle
3 hours ago
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f463223%2finline-list-how-to-insert-a-non-stretching-but-line-breaking-thin-space%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
ttfamily would change things quite a bit as the inter-word space is then not stretchy by default, so if that's what you want, possibly the initial exampe should use that.
– David Carlisle
3 hours ago
@DavidCarlisle: Yeah I normally would have included
ttfamily, but as it seemed to be another can of worms as per How to automatically hyphenate within texttt?, I decided not too. As egreg's solution already seems to work for that case I won't post a new question (unless some other issue comes up).– Peter Grill
2 hours ago