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\emphinside\bgroup\itshape ... \egroup.\emphde-italicizes the emphasis and is nestable. – Skillmon Apr 24 '17 at 08:12\emphis 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. – eudoxos Apr 24 '17 at 08:17\emphworks on my machine inside a\itshapegroup. – Skillmon Apr 24 '17 at 08:24fontspecdo you have? There was a similar issue before. – campa Apr 24 '17 at 08:53