开发者

LaTeX - Description list - Split the item across multiple lines

开发者 https://www.devze.com 2023-01-09 00:36 出处:网络
I have the following LaTeX file. Notice how the item on the description is very long ...foo.... \\documentclass{article}

I have the following LaTeX file. Notice how the item on the description is very long ...foo....

\documentclass{article}
\begin{document}
\begin{de开发者_StackOverflow中文版scription}

\item[foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo]
bar

\item[baz]
bang

\end{description}
\end{document}

It produces a file like this:

LaTeX - Description list - Split the item across multiple lines

The foo is all on one line and will run off the edge. Is there anyway to split the description part across multiple lines so it doesn't run off the edge of the page? I want to be able to do this only in the preamble, since I can't edit the actual body of the document.


Changing the description environment in the preamble, using mdwlist: \usepackage{mdwlist}

\renewenvironment{description}%
{
\begin{basedescript}{
\desclabelstyle{\nextlinelabel}
\renewcommand{\makelabel}[1]{%
\parbox[b]{\textwidth}{\bfseries##1}%
}%
\desclabelwidth{2em}}}
{
\end{basedescript}
}


Don't use the brackets:

\item foo foo foo foo foo 
0

精彩评论

暂无评论...
验证码 换一张
取 消