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:
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
精彩评论