I have one text that need to be italicized.
\textit{some text2 ~\\ some text2}
But i found ~\\
converted to \newline\
. Is there any alternative to \textit
? Is there any alternative to \it
?
italic
I have one text that need to be italicized.
\textit{some text2 ~\\ some text2}
But i found ~\\
converted to \newline\
. Is there any alternative to \textit
? Is there any alternative to \it
?
Best Answer
I assume your intent was to get a backslash, instead of a
\newline
which is what\\
is. In that case you can use\textbackslash
with either the macro\textit{...}
, or the font switch{\itshape ...}
as in the first two lines below:The third line above was produced with
\emph{...}
and yields identical results (in this case).However, you should carefully consider why you are doing this. Do you want an italic font, or are you trying to emphasize some words? In most cases one is trying to emphasize some words in which case
\emph{...}
should be used. Note the differences in the following where we have nested uses of\textit{...}
,{\itshape ...}
, and\emph{...}
:Notes:
{
and}
when using the switch\itshape
is so that the italics font switch is only on during within a scope.Code: