LaTeX局部改变字体类型

从StackExchange获取的资料
LaTeX局部改变字体类型_第1张图片
翻译如下

可以使用fontspec这个宏包
可以定义一个新的形式如:\newfamily\cmd[font features]{font name这里是postscript 名称},等到调用的时候使用\cmd{text}即可,也可以形如{\cmd text}
一个例子
\documentclass{article}
\usepackage{fontspec}
\newfontfamily\unicodefont{Lucida Grande}
%重新定义Lucida Grande字体的名字为unicodefont
%\newCJKfontfamily\unicodefont{中文字体对应的postscript名字即可}
\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\begin{document}
A legacy \TeX\ font. {\unicodefont A unicode font.}
%在这里调用unicodefont来实现
\end{document}


以上全是对英文实现的,要是想在中文中实现
只需要改为\newCJKfontfamily\unicodefont{中文字体对应的postscript名字即可}

如果想要实现上述所说的环境方法,如下

\newenvironment{cmd}{\fontfamily{Lucida Grande}\selectfont}
\begin{cmd}
hello world!!!
\end{cmd}

你可能感兴趣的:(LaTeX)