3

How to change the font of some words of an item of a description?
I want it to appear like this:

Abc Def
Description...
Ghi Jkl
Description

So that the words Def and Jkl are italique.

The following code doesn't work as intended, as all words are regular:

\begin{description}
  \item[Abd \textit{Def}] \hfill \\ 
Description...
  \item[Ghi \textit{Jkl}] \hfill \\ 
Description...
\end{description}
  • Your example works for me. Can you explain why this output isn't what you want? – wchargin Mar 2 '15 at 5:57
3

You can use the \normalfont switch before \textit, or the \textnormal command, to "kill" the boldface font attribute; of course, you can define a dedicated command for this:

\documentclass{article}
\usepackage{enumitem}

\setlist[description]{style=nextline}

\newcommand\MyIt[1]{{\normalfont\textit{#1}}}

\begin{document}

\begin{description}
  \item[Abd \MyIt{Def}]
Description...
  \item[Ghi \MyIt{Jkl}]
Description...
\end{description}

\end{document}

I used the nextline style from the enumitem package to give the descriptions on a new line. enter image description here

|improve this answer|||||
  • I'm very tempted to edit your answer in order to remove the last remark. By the way, you're forgetting about \textnormal – egreg Mar 2 '15 at 8:56
  • @egreg Don't worry, I've removed it myself. – Gonzalo Medina Mar 2 '15 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.