I would like to set a part of the LaTeX document in italics but with using \emph{...}
for emphasizing inside. This is easy to do within single paragraph where \emph
can be easily nested. But since \text@command
is not \long
, it does not extend to multiple paragraphs.
If there is no standard way of doing that, I can always use \bgroup\itshape ... \egroup
but I need to trick \emph
into knowing it already is in italicized text so that it will change back to upright.
I don't find my current solution \bgroup\itshape\def\emph#1{{\rm #1}} ... \egroup
is particularly elegant. Something better would be appreciated.
EDIT: While \emph
does switch correctly inside \itshape
, the problem was found to be caused by \usepackage{fontspec}
:
\documentclass{minimal}
\usepackage{fontspec}
% \usepackage{libertine}
\begin{document}
\itshape This is an \emph{emphasized} word.
\end{document}
\def\emph
inside\bgroup\itshape ... \egroup
.\emph
de-italicizes the emphasis and is nestable.\emph
is not used in emphasis context & does not know the text is already italicized by\itshape
. So it only switches to italics, producing no visible effect at all.\emph
works on my machine inside a\itshape
group.fontspec
do you have? There was a similar issue before.