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}
1
  • Your example works for me. Can you explain why this output isn't what you want?
    – wchargin
    Mar 2, 2015 at 5:57

1 Answer 1

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

2
  • 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, 2015 at 8:56
  • @egreg Don't worry, I've removed it myself. Mar 2, 2015 at 11:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .