众所周知,您可以使用 \textit{} 或 \textbf{} 将字体设为斜体或粗体。但是,如果我有斜体或粗体字体,我可以使用什么命令将其设为非斜体或非粗体?
答案1
您可以使用\normalfont
\documentclass{book}
\begin{document}
\textit{Some italic and {\normalfont non italic} text}
\textbf{Some bold and {\normalfont non bold} text}
\emph{Some italic and {\normalfont non italic} text}
\end{document}
答案2
为了便于讨论,我假设您使用或\textbf{...}
来{\bfseries ...}
生成加粗字体,以及\textit{...}
,\emph{...}
或{\itshape ...}
来生成斜体文字. 这些方法可以结合起来得到粗斜体文字,即\textbf{\textit{...}}
或{\bfseries\itshape ...}
。
要取消/覆盖斜体字体形状,同时保留(大胆的或非粗体)字体粗细不变,使用
\textup{...}
或{\upshape ...}
:\textit{Some italic and some \textup{non italic} text} {\itshape Some italic and some {\upshape non italic} text}
该
\emph{...}
方法可以嵌套:\emph{Some italic and some \emph{non italic} text}
请注意,和
\textit{...}
方法\emph{...}
会小心地插入所谓的斜体修正在从斜体文本到非斜体文本的转换中,该{\upshape ...}
方法不起作用。要仅覆盖粗体字体粗细,同时保留(斜体或直立)字体形状不变,使用
\textmd{...}
或{\mdseries ...}
:\textbf{Some bold and some \textmd{non bold} text} {\bfseries Some bold and some {\mdseries non bold} text}
强制使用普通字体重量和正常字体形状同时,也可以将以上几种方法结合起来。除非字体默认设置已提前重置(例如,
\ttfamily
或\sffamily
;参见下面@JonathanLandrum的评论),也可以使用或\textnormal{...}
来{\normalfont ...}
强制正常字体粗细和形状:\textbf{\textit{Some bold-italic, \textmd{non-bold italic}, \textup{non-italic bold}, and \textmd{\textup{{upright\slash non-bold} text}}.} {\itshape\bfseries Some bold-italic, {\mdseries non-bold italic}, {\upshape non-italic bold}, and {\mdseries\upshape upright\slash non-bold} text.}
这些方法生成的结果在以下 MWE 中进行了说明:
\documentclass{article}
\usepackage{geometry}
\begin{document}
Some normal, i.e., upright and non-bold, text.
\medskip
\textit{Some italic and some \textup{upright} text.}
\emph{Some italic and some \emph{upright} text.}
{\itshape Some italic and some {\upshape upright} text.}
\medskip
\textbf{Some bold and some \textmd{non-bold} text.}
{\bfseries Some bold and some {\mdseries non-bold} text.}
\medskip
\textbf{\textit{Some bold-italic, \textmd{non-bold italic}, \textup{non-italic bold}, and \textmd{\textup{upright\slash non-bold}} text}.}
{\itshape\bfseries Some bold-italic, {\mdseries non-bold italic}, {\upshape non-italic bold}, and {\mdseries\upshape upright\slash non-bold} text.}
\end{document}