I'm wondering if there is any difference between \textsc{ciao}
and \text{\scshape ciao}
. I wrote them in Texmaker and it seems that the effect is the same.
1 Answer
Two differences:
- the
\text
construction in text mode is the same as\mbox
, so its argument cannot be split across lines or hyphenated; - no italic correction is added at the end.
Of course, there's no difference in math mode. Indeed, a command such as \textsc{...}
in math mode becomes \text{\scshape ...}
.
Speaking of text mode, the first outlined difference might be what you're actually looking for, but in that case why not using \mbox
directly?
About the latter outlined difference, it doesn't really show with small caps, but the similar situation with italics should be considered
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\text{\itshape if} test
\textit{if} test
\end{document}
Perhaps less impressive, but important, with \bfseries
and \textbf
you get
-
Hello @egreg thank you very much for your detailed answer Commented Apr 5, 2021 at 9:26