以下 MWE 适用于 pdfLaTeX 引擎,但不适用于 XeLaXeX 引擎。\fontfamily{...}\selectfont
使用 XeLaTeX 引擎时是否仅适用于某些字体系列?是否有合适的方法在一个文档中使用所有这些字体系列?
\documentclass{article}
\begin{document}
\begin{enumerate}
\fontfamily{pag}\selectfont \item Avant Garde
\fontfamily{fvs}\selectfont \item Bitstream Vera Sans
\fontfamily{pbk}\selectfont \item Bookman
\fontfamily{bch}\selectfont \item Charter
\fontfamily{ccr}\selectfont \item Computer Concrete
\fontfamily{cmr}\selectfont \item Computer Modern
\fontfamily{pcr}\selectfont \item Courier
\fontfamily{phv}\selectfont \item Helvetica
\fontfamily{fi4}\selectfont \item Inconsolata
\fontfamily{lmr}\selectfont \item Latin Modern
\fontfamily{lmss}\selectfont\item Latin Modern Sans
\fontfamily{lmtt}\selectfont\item Latin Modern Typewriter
\fontfamily{pnc}\selectfont \item New Century Schoolbook
\fontfamily{ppl}\selectfont \item Palatino
\fontfamily{ptm}\selectfont \item Times
\fontfamily{uncl}\selectfont\item Uncial
\fontfamily{put}\selectfont \item Utopia
\fontfamily{pzc}\selectfont \item Zapf Chancery
\end{enumerate}
\end{document}
答案1
您需要明确指定字体编码,因为默认情况下TU
使用强制 LaTeX 经典字体选择系统使用 OpenType 字体的方法。
\documentclass{article}
\begin{document}
\begin{enumerate}\fontencoding{T1}
\fontfamily{pag}\selectfont \item Avant Garde
\fontfamily{fvs}\selectfont \item Bitstream Vera Sans
\fontfamily{pbk}\selectfont \item Bookman
\fontfamily{bch}\selectfont \item Charter
\fontfamily{ccr}\selectfont \item Computer Concrete
\fontfamily{cmr}\selectfont \item Computer Modern
\fontfamily{pcr}\selectfont \item Courier
\fontfamily{phv}\selectfont \item Helvetica
\fontfamily{fi4}\selectfont \item Inconsolata
\fontfamily{lmr}\selectfont \item Latin Modern
\fontfamily{lmss}\selectfont\item Latin Modern Sans
\fontfamily{lmtt}\selectfont\item Latin Modern Typewriter
\fontfamily{pnc}\selectfont \item New Century Schoolbook
\fontfamily{ppl}\selectfont \item Palatino
\fontfamily{ptm}\selectfont \item Times
\fontfamily{uncl}\selectfont\item Uncial
\fontfamily{put}\selectfont \item Utopia
\fontfamily{pzc}\selectfont \item Zapf Chancery
\end{enumerate}
\end{document}
您可以来回切换,但建议仅在 XeTeX/LuaTeX 中使用 OpenType 字体。
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\begin{document}
Now using Times New Roman.
\fontencoding{T1}\fontfamily{cmr}\selectfont
Now using Computer Modern classic 8bit font files.
\normalfont
Now using again Times New Roman.
\fontencoding{T1}\fontfamily{pzc}\selectfont
Now using Zapf Chancery classic 8bit font files.
\normalfont
Now using again Times New Roman.
\fontencoding{T1}\fontfamily{pnc}\selectfont
Now using New Century Schoolbook classic 8bit font files.
\normalfont
Now using again Times New Roman.
\end{document}