Two line labels in the description items











up vote
2
down vote

favorite












I would like to have two lines for long description names in the description environment. The only help I could find is here. Where they have the following code.



begin{description}
% won't work
item[first line\second line]
% won't work
item[first linenewline second line]
% will work
item[{parbox[t]{3cm}{first line\second line}}]
end{description}


But this doesn't look nice, I have a long paragraph on the item and the second line of the paragraph starts below the second line of the item label.










share|improve this question


















  • 2




    Please show your preamble part, i.e., documentclass{...}...begin{document}...
    – MadyYuvi
    Nov 30 at 11:40















up vote
2
down vote

favorite












I would like to have two lines for long description names in the description environment. The only help I could find is here. Where they have the following code.



begin{description}
% won't work
item[first line\second line]
% won't work
item[first linenewline second line]
% will work
item[{parbox[t]{3cm}{first line\second line}}]
end{description}


But this doesn't look nice, I have a long paragraph on the item and the second line of the paragraph starts below the second line of the item label.










share|improve this question


















  • 2




    Please show your preamble part, i.e., documentclass{...}...begin{document}...
    – MadyYuvi
    Nov 30 at 11:40













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I would like to have two lines for long description names in the description environment. The only help I could find is here. Where they have the following code.



begin{description}
% won't work
item[first line\second line]
% won't work
item[first linenewline second line]
% will work
item[{parbox[t]{3cm}{first line\second line}}]
end{description}


But this doesn't look nice, I have a long paragraph on the item and the second line of the paragraph starts below the second line of the item label.










share|improve this question













I would like to have two lines for long description names in the description environment. The only help I could find is here. Where they have the following code.



begin{description}
% won't work
item[first line\second line]
% won't work
item[first linenewline second line]
% will work
item[{parbox[t]{3cm}{first line\second line}}]
end{description}


But this doesn't look nice, I have a long paragraph on the item and the second line of the paragraph starts below the second line of the item label.







description






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 30 at 11:23









MetalMathician

956




956








  • 2




    Please show your preamble part, i.e., documentclass{...}...begin{document}...
    – MadyYuvi
    Nov 30 at 11:40














  • 2




    Please show your preamble part, i.e., documentclass{...}...begin{document}...
    – MadyYuvi
    Nov 30 at 11:40








2




2




Please show your preamble part, i.e., documentclass{...}...begin{document}...
– MadyYuvi
Nov 30 at 11:40




Please show your preamble part, i.e., documentclass{...}...begin{document}...
– MadyYuvi
Nov 30 at 11:40










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










For single-line item data, use stackunder{}{}. For multi-line item data, use smash{stackunder{}{}}.



Also shown is the use of smash{Longunderstack{...\...\...}} in the event the label gets to be longer than 2 lines.



documentclass{article}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here



You could add bfseries before the stack, if you wanted it in boldface.



As Bernard notes, the title bleeds into the left margin, which is a standard behavior for itemize. The way to alleviate that is to select leftmargin that allows for the widest label:



documentclass{article}
usepackage[pass,showframe]{geometry}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum,enumitem}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}[leftmargin=53pt]
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here






share|improve this answer























  • The labels flow into the left margin.
    – Bernard
    Nov 30 at 13:11










  • @Bernard Addressed.
    – Steven B. Segletes
    Nov 30 at 13:29










  • Really beautiful!
    – Bernard
    Nov 30 at 13:33











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',
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%2f462549%2ftwo-line-labels-in-the-description-items%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








up vote
2
down vote



accepted










For single-line item data, use stackunder{}{}. For multi-line item data, use smash{stackunder{}{}}.



Also shown is the use of smash{Longunderstack{...\...\...}} in the event the label gets to be longer than 2 lines.



documentclass{article}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here



You could add bfseries before the stack, if you wanted it in boldface.



As Bernard notes, the title bleeds into the left margin, which is a standard behavior for itemize. The way to alleviate that is to select leftmargin that allows for the widest label:



documentclass{article}
usepackage[pass,showframe]{geometry}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum,enumitem}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}[leftmargin=53pt]
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here






share|improve this answer























  • The labels flow into the left margin.
    – Bernard
    Nov 30 at 13:11










  • @Bernard Addressed.
    – Steven B. Segletes
    Nov 30 at 13:29










  • Really beautiful!
    – Bernard
    Nov 30 at 13:33















up vote
2
down vote



accepted










For single-line item data, use stackunder{}{}. For multi-line item data, use smash{stackunder{}{}}.



Also shown is the use of smash{Longunderstack{...\...\...}} in the event the label gets to be longer than 2 lines.



documentclass{article}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here



You could add bfseries before the stack, if you wanted it in boldface.



As Bernard notes, the title bleeds into the left margin, which is a standard behavior for itemize. The way to alleviate that is to select leftmargin that allows for the widest label:



documentclass{article}
usepackage[pass,showframe]{geometry}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum,enumitem}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}[leftmargin=53pt]
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here






share|improve this answer























  • The labels flow into the left margin.
    – Bernard
    Nov 30 at 13:11










  • @Bernard Addressed.
    – Steven B. Segletes
    Nov 30 at 13:29










  • Really beautiful!
    – Bernard
    Nov 30 at 13:33













up vote
2
down vote



accepted







up vote
2
down vote



accepted






For single-line item data, use stackunder{}{}. For multi-line item data, use smash{stackunder{}{}}.



Also shown is the use of smash{Longunderstack{...\...\...}} in the event the label gets to be longer than 2 lines.



documentclass{article}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here



You could add bfseries before the stack, if you wanted it in boldface.



As Bernard notes, the title bleeds into the left margin, which is a standard behavior for itemize. The way to alleviate that is to select leftmargin that allows for the widest label:



documentclass{article}
usepackage[pass,showframe]{geometry}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum,enumitem}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}[leftmargin=53pt]
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here






share|improve this answer














For single-line item data, use stackunder{}{}. For multi-line item data, use smash{stackunder{}{}}.



Also shown is the use of smash{Longunderstack{...\...\...}} in the event the label gets to be longer than 2 lines.



documentclass{article}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here



You could add bfseries before the stack, if you wanted it in boldface.



As Bernard notes, the title bleeds into the left margin, which is a standard behavior for itemize. The way to alleviate that is to select leftmargin that allows for the widest label:



documentclass{article}
usepackage[pass,showframe]{geometry}
usepackage[usestackEOL]{stackengine}
usepackage{lipsum,enumitem}
begin{document}
renewcommandstackalignment{r}% RIGHT ALIGNED STACKS
renewcommandstacktype{L}% MAKE STACKS OBEY FIXED BASELINESKIP
strutlongstacks{T}% TO GET PROPER SPACING FOR SINGLE-LINE ITEMS
begin{itemize}[leftmargin=53pt]
item[stackunder{first line}{second line}] blah blah
item[smash{stackunder{first line}{second line}}] lipsum[4]
item[smash{Longunderstack{first\second\third}}] lipsum[3]
end{itemize}
end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 30 at 14:59

























answered Nov 30 at 12:27









Steven B. Segletes

152k9192399




152k9192399












  • The labels flow into the left margin.
    – Bernard
    Nov 30 at 13:11










  • @Bernard Addressed.
    – Steven B. Segletes
    Nov 30 at 13:29










  • Really beautiful!
    – Bernard
    Nov 30 at 13:33


















  • The labels flow into the left margin.
    – Bernard
    Nov 30 at 13:11










  • @Bernard Addressed.
    – Steven B. Segletes
    Nov 30 at 13:29










  • Really beautiful!
    – Bernard
    Nov 30 at 13:33
















The labels flow into the left margin.
– Bernard
Nov 30 at 13:11




The labels flow into the left margin.
– Bernard
Nov 30 at 13:11












@Bernard Addressed.
– Steven B. Segletes
Nov 30 at 13:29




@Bernard Addressed.
– Steven B. Segletes
Nov 30 at 13:29












Really beautiful!
– Bernard
Nov 30 at 13:33




Really beautiful!
– Bernard
Nov 30 at 13:33


















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.





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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462549%2ftwo-line-labels-in-the-description-items%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

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?