How can I make it so that when a line gets too long it goes to the next line?
2 Answers
In order to ensure that a description label can span multiple lines, you can make use of the unboxed
style offered by the enumitem
package:
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{description}[style=unboxed]
\item[description] here is the description of the label
\item[this is a very long description label this is a very long description label ] here is the description of the label here is the description of the label here is the description of the label
\end{description}
\end{document}
-
Would it be possible to tweak this so that it doesn't indent? To be clear, it gives me right now imgur.com/a/aoxqRuP but I'd like to not have an indent.– medihdeFeb 20, 2020 at 18:38
-
In your question you asked about a
description
, while the screenshot you show in your comment lookas like you actually useditemize
. If this is the case, please post your question as a follow up question to this one and please also include a minimal example showing how you achieved this output. Feb 20, 2020 at 18:49 -
I'm using description, see code below
\begin{description} [align=left,leftmargin=*,labelsep=\parindent,font=\normalfont, style = unboxed] \item[• Magret de canard (150-200g par personne)] \item[• Riz] \item[• Brocolis] \item[• Ketchup, ail, gingembre, huile d'olive, sauce soja salée, vinaigre de balsamique, orange, miel de cuisine, poivre, piment espelette, thym, laurier] \end{description}
– medihdeFeb 20, 2020 at 22:56
Two solutions that might be better suited to what you actually want to achieve. Just use itemize or use paragraphs instead:
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{itemize}[label={}]
\bfseries
\item An extremely long description that is written in bold and so on which is long enough to wrap properly
\item Another item
\end{itemize}
Or you could just use paragraphs:
\paragraph{A very long item with lots of words in it and so on and then some normal text}
This text is normal
\end{document}
-
1
\paragraph
is a 4th level heading, like\section
it is just intended to be used after\subsubsection
Feb 9, 2020 at 23:44