Fix maths fonts with newtx when using XeLaTeX, thanks to @LeoLiu.

This commit is contained in:
Casper Ti. Vector 2015-12-15 20:35:15 +08:00
parent 5778e6f60a
commit 8f1476dd7a
5 changed files with 42 additions and 9 deletions

View File

@ -25,11 +25,6 @@
% 若需按照中文文献在前英文文献在后排序请设置“sorting = centy”
% 若需按照引用顺序排序请设置“sorting = none”。
\usepackage[backend = biber, style = caspervector, utf8, sorting = none]{biblatex}
% 提供近似于学校所要求的 Times New Roman / Arial 的字体。
\usepackage[defaultsups]{newtxtext}
\usepackage{newtxmath}
% 产生 originauth.tex 里的 \square
\usepackage{latexsym}
% 按学校要求设定参考文献列表中的条目之内及之间的距离。
\setlength{\bibitemsep}{3bp}

View File

@ -39,6 +39,10 @@
用户如果不需要自动载入 pkuthss-extra 宏包,
则需要在载入 pkuthss 时加上 \verb|noextra| 选项。
\item \textbf{\texttt{[no]pkufont}}
是否根据学校对论文格式的要求\mbox{\supercite{pku-thesisstyle}}%
将英文字体改为类似于 Times New Roman / Arial 的字体。
\item \textbf{\texttt{[no]uppermark}}
是否在页眉中将章节名中的小写字母转换为大写字母。
就目前而言,
@ -312,7 +316,10 @@
不用在 pkuthss 文档类中重复调用;
这里调用 xCJK2un 是为了兼容 ctex 1.x 而进行的设定,
该设定将在 2017 年被去除。%
}
}
启用 \verb|pkufont| 选项时会调用 %
newtxtext 和 newtxmath\supercite{newtx} 宏包,
否则会调用 latexsym\supercite{latexsym} 宏包。
因此ctexbook 文档类和这些宏包所提供的功能均可以使用。
例如,用户如果想将目录的标题改为“目{\quad\quad}录”,

View File

@ -110,6 +110,26 @@
language = {english},
}
@online{latexsym,
author = {Mittelbach, Frank},
title = {The \LaTeX{} symbol fonts for use with \LaTeX2e{} (v2.2e)},
type = {M/OL},
date = {1998/08/17},
url = {http://mirrors.rit.edu/CTAN/macros/latex/base/},
urldate = {2015-12-15},
language = {english},
}
@online{newtx,
author = {Sharpe, Michael},
title = {New TX font package},
type = {M/OL},
date = {2015-09-14},
url = {http://mirror.ctan.org/fonts/newtx/},
urldate = {2015-12-15},
language = {english},
}
@online{scrextend,
author = {Kohm, Markus and Morawski, Jens-Uwe},
title = {KOMA-Script: a versatile \hologo{LaTeX2e} bundle},

View File

@ -31,9 +31,6 @@
\documentclass[UTF8, colorlinks]{pkuthss}
\usepackage[backend = biber, style = caspervector, utf8, sorting = ecnty]{biblatex}
\usepackage[defaultsups]{newtxtext}
\usepackage{newtxmath}
\usepackage{latexsym}
\usepackage{fancyvrb}
\usepackage{hologo}

View File

@ -51,6 +51,8 @@
\DeclareOption{UTF8}{\pkuthss@opt@gbkfalse\PassOptionsToClass{UTF8}{ctexbook}}
% Whether to enable `\Uppercase' (works problematically) in heading marks.
\pkuthss@int@boolopt{uppermark}{false}
% Whether to modify fonts according to school regulation.
\pkuthss@int@boolopt{pkufont}{true}
% Whether to enable the default extra settings.
\pkuthss@int@boolopt{extra}{true}
% Pass options to `pkuthss-extra'.
@ -67,6 +69,8 @@
% Process all class options now.
\ProcessOptions\relax
% Prevent fontspec (loaded by xeCJK) from interfering with newtxmath.
\ifpkuthss@opt@pkufont\PassOptionsToPackage{no-math}{fontspec}\fi
% pkuthss is based on ctexbook; we use `xiao 4' as default font size.
% CJKfntef provides `\CJKunderline' used in `\maketitle'.
% fancyhdr provides utilities for setting up headers and footers.
@ -104,6 +108,16 @@
\fi
}
\ifpkuthss@opt@pkufont
% Use Times New Roman / Arial according to school regulation.
% Option used to prevent newtxtext from manipulating footnote marks.
\RequirePackage[defaultsups]{newtxtext}
\RequirePackage{newtxmath}
\else
% Provides `\Box' for originauth.tex if newtx is absent.
\RequirePackage{latexsym}
\fi
% eg. `\pkuthss@int@infoitema{ctitle}' will expand to:
% \def\ctitle#1{\def\@ctitle{#1}}
% \define@key{pkuthss@info}{ctitle}{\ctitle{#1}}