Created
October 8, 2016 07:02
-
-
Save erjiaqing/33101e5a9210116b89891b92e131b22a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Original zhfontcfg.sty | |
% https://gist.github.com/blindFS/318c4d5e00b2eb06247c | |
% xetex/xelatex 字体设定宏包 | |
\ProvidesPackage{zhfontcfg_mac} | |
\usepackage[cm-default]{fontspec} %[cm-default]选项主要用来解决使用数学环境时数学符号不能正常显示的问题 | |
\usepackage{xunicode,xltxtra} | |
\defaultfontfeatures{Mapping=tex-text} %如果没有它,会有一些 tex 特殊字符无法正常使用,比如连字符。 | |
% 中文断行 | |
\XeTeXlinebreaklocale "zh" | |
%\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt | |
%将系统字体名映射为逻辑字体名称,主要是为了维护的方便 | |
\newcommand\fontnamewenquanyi{PingFang SC} | |
\newcommand\fontnamefangsong{STFangsong} | |
\newcommand\fontnameyahei{STXihei} | |
\newcommand\fontnamehei{STHeiti} | |
\newcommand\fontnamesong{Songti SC} | |
\newcommand\fontnamekai{Kaiti SC} | |
%English Fonts | |
\newcommand\fontnamemono{Monaco} | |
\newcommand\fontnameroman{Times New Roman} | |
\newcommand\fontnamelucida{Lucida Grande} | |
\newcommand\fontnamecourier{Monaco} | |
%%设置常用中文字号,方便调用 | |
\newcommand{\erhao}{\fontsize{22pt}{\baselineskip}\selectfont} | |
\newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont} | |
\newcommand{\sanhao}{\fontsize{16pt}{\baselineskip}\selectfont} | |
\newcommand{\xiaosanhao}{\fontsize{15pt}{\baselineskip}\selectfont} | |
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont} | |
\newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}\selectfont} | |
\newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}\selectfont} | |
\newcommand{\xiaowuhao}{\fontsize{9pt}{\baselineskip}\selectfont} | |
\newcommand{\liuhao}{\fontsize{7.5pt}{\baselineskip}\selectfont} | |
%设置文档正文字体为宋体 | |
\setmainfont[BoldFont={Songti SC:style=粗体}]{\fontnamesong} | |
\setsansfont[BoldFont={Kaiti SC:style=粗体}]{\fontnamekai} | |
\setmonofont{\fontnamemono} | |
\newfontfamily\Monofont{Monaco} | |
%文泉驿 | |
\newfontinstance\WENQUANYI{\fontnamewenquanyi} | |
\newcommand{\wenquanyi}[1]{{\WENQUANYI#1}} | |
%楷体 | |
\newfontinstance\KAI {\fontnamekai} | |
\newcommand{\kai}[1]{{\KAI#1}} | |
%黑体 | |
\newfontinstance\HEI{\fontnamehei} | |
\newcommand{\hei}[1]{{\HEI#1}} | |
%雅黑 | |
\newfontinstance\YAHEI{\fontnameyahei} | |
\newcommand{\yahei}[1]{{\YAHEI#1}} | |
% | |
%宋体 | |
\newfontinstance\SONG{\fontnamesong} | |
\newcommand{\song}[1]{{\SONG#1}} | |
%仿宋 | |
\newfontinstance\FANGSONG {\fontnamefangsong} | |
\newcommand{\fangsong}[1]{{\FANGSONG#1}} | |
%英文 | |
\newfontinstance\ROMAN{\fontnameroman} | |
\newcommand{\newroman}[1]{\,{\ROMAN#1}\,} | |
%Lucida Console | |
\newfontinstance\LUCIDA{\fontnamelucida} | |
\newcommand{\lucida}[1]{\,{\LUCIDA#1}\,} | |
%Courier New | |
\newfontinstance\COURIER{\fontnamecourier} | |
\newcommand{\courier}[1]{\,{\COURIER#1}\,} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment