LaTeX技巧006:使用不同的英文字體

效果展示



  可以看到文章的主體部分使用的Times New Roman字體,局部可以使用其他的字體。要使用不同的英文字體,首先需要知道有哪些可以使用的英文字體,得到它們的名稱,然後使用fontspec設置即可。對於我來說,偷懶的方法就是在Word中去找那些字體,然後得到字體的名稱。當然也可以使用命令

fc-list >>c:\fonts.txt

來獲取,我更喜歡前者(看個人)。得到字體的名稱之後,然後使用fontspec來設置新的命令在正文使用即可。

代碼

\documentclass[UTF8]{article}
\usepackage{fontspec}
\newcommand{\tnewroman}{\fontspec{Times New Roman}}
\newcommand{\adobegothicstdb}{\fontspec{Adobe Gothic Std B}}
\newcommand{\Centaur}{\fontspec{Centaur}}
\setmainfont{Times New Roman}%fontspec下這個命令設置全局默認字體
\begin{document}

Anne Boleyn was the second wife of King Henry VIII, with their marriage changing the course of english history. King Henry was already married to Catherine of aragon and could not obtain a divorce from the roman catholic church. In order to obtain his divorce he therefore created a reformed version of the church, putting himself at the head - a direct challenge of authority to the pope.

\vspace{1cm}

%這也是一種調用方式,無須fontspec宏包
\font\rm="Stencil Std" at 14pt \rm This is Stencil Std

{\tnewroman This is <Times New Roman>}

{\adobegothicstdb This is <Adobe Gothic Std B>}

{\Centaur This is <Centaur>}

\end{document}

參考

XeTex字體設置指南

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章