开发者

Changing style of latex description lists

This should be an easy question for someone out there. I have a description list

\begin{description}
\item[Name:]  Halpo
\item[Email Address:] halpo@users.mysite.com
\item[Address:]  1234 Ivy Ln \\ Springfield, USA
\end{description}

It comes back as

Name: Halpo

Email Address: halpoe@users.mysite.com

Address: 1234 Ivy Ln

 Springfield开发者_如何学C, USA

This is for an official document that has style requirements. The First thing is how do I turn off the bold? second how do I have all the text line up with the item labels and still be left justified?


If you \usepackage{enumitem} you may get what you like:

\begin{description}[style=multiline,leftmargin=3cm,font=\normalfont]
\item[Name:]  Halpo
\item[Email Address:] halpo@users.mysite.com
\item[Address:]  1234 Ivy Ln \\ Springfield, USA
\end{description}

Results in:

Changing style of latex description lists

Check here for full package documentation.


The formatting of description labels is controlled by the command \descriptionlabel. Here's an example of changing to italics, no bold:

\renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textit{#1}}

To change the formatting of the label to something else, change the \textit{#1} part above.

EDIT 2017-01-24: My original example used \emph, but as @ebo pointed out, it is better to use \textit for this situation because this is a case of changing the text style, not emphasizing text.


Geoff - you can set these parameters for all lists (so that it's automatic) using this code:

\setlist[description]{style=multiline,leftmargin=3cm}

Apologies, I don't have enough rep to reply to your comment, hence the separate answer.


For a hack, do \item[\rm Name:].

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜