Skip to content
Snippets Groups Projects
Unverified Commit 879fadc2 authored by atxy-blip's avatar atxy-blip Committed by GitHub
Browse files

Merge pull request #29 from glatavento/master

docs: 完善“指定字体”一节
parents 93adf9d9 94018f73
No related branches found
No related tags found
No related merge requests found
......@@ -217,7 +217,11 @@ through XeTeX.
%<*driver>
\ProvidesFile{njuthesis.dtx}
\documentclass{ctxdoc}
\usepackage{listings,xcolor}
\usepackage{listings,xcolor,tabularray}
\UseTblrLibrary{booktabs,siunitx,diagbox}
\DefTblrTemplate{caption-tag}{default}{表\hspace{0.25em}\thetable}
\SetTblrStyle{caption-tag}{font=\bfseries}
\DefTblrTemplate{caption-sep}{default}{\quad}
\definecolor{njuviolet}{cmyk}{0.5,1,0,0.4}
\definecolor{njumagenta}{cmyk}{0.05,1,0.55,0}
\definecolor{njublue}{cmyk}{0.8,0.5,0,0}
......@@ -461,105 +465,90 @@ through XeTeX.
%
%
%
% \subsubsection{指定字体}
%
% \subsubsection{指定字体\protect\footnote{
% 本节提及的字库中,中文字库只有方正书宋、方正黑体、方正楷体、方正仿宋、两种思源字体和四种Fandol字体能够免费商用;
% 英文字库中只有 Times New Roman、STIX 和三种\Hologo{TeX} Gyre字体能够免费商用。
% 因此,若需要将本模板用于商业相关的活动,请咨询专业人士。}}
%
% 学校论文格式要求使用的字体一般已经预装在各个操作系统,本模板针对不同平台进行了自动检测适配,可以开箱即用。
%
% 如果希望更改本模板使用的字体,请填写以下两个选项覆盖检测操作系统得到的设置。
% 如果希望更改本模板使用的字体,请填写以下两个选项覆盖操作系统检测得到的设置。
%
% \begin{function}[added=2021-09-07]{customchinesefont}
% \begin{syntax}
% customchinesefont = <(windows)|macos|fandol|founder|noto|none>
% \end{syntax}
%
% 手动指定中文字体,可选:
% \opt{windows}(默认), \opt{macos}, \opt{fandol}, \opt{founder},\opt{noto},\opt{none}。
% \end{function}
%
% \begin{function}[added=2021-09-07]{customlatinfont}
% \begin{syntax}
% customlatinfont = <(windows)|macos|gyre|none>
% \end{syntax}
%
% 手动指定文字体,可选:
% 手动指定西文字体,可选:
% \opt{windows}(默认), \opt{macos}, \opt{gyre}, \opt{none}。
% \end{function}
%
% 西文包括衬线(serif)、无衬线(sans)、等宽(mono)三种字形
% \begin{table}[htbp]
% \centering
% \caption{西文字体清单}
% \label{tab:latinfontset}
% \begin{tabular}{cccc}
% \toprule
% 操作系统 & 衬线 & 无衬线 & 等宽 \\
% \midrule
% Windows & Times~New~Roman & Arial & Courier~New \\
% macOS & Times~New~Roman & Arial & Menlo \\
% Linux & TeX~Gyre~Termes & TeX~Gyre~Heros & TeX~Gyre~Cursor \\
% \bottomrule
% \end{tabular}
% \end{table}
% 根据学校论文格式的要求,本模板使用的中文字体主要有{\songti 宋体}、{\heiti 黑体}、{\kaishu 楷体}、{\fangsong 仿宋}四种;
% 西文字体主要有衬线体(\textup{serif})、无衬线体(\textsf{sans-serif})和等宽字体(\texttt{monospace})三种。
% 在生成论文时,需要将每一种字体(宋体、楷体)与一种字库(操作系统中的 ttf 文件)相对应。
% 由于不同操作系统自带的字库不同,在不同的操作系统上使用同一套配置会导致缺字、编译出错等后果。
% 因此,本模板对于中文字体和西文字体都提供了多种字体配置。
%
%
% \begin{function}[added=2021-09-07]{customchinesefont}
% \begin{syntax}
% customchinesefont = <(windows)|macos|fandol|founder|noto|none>
% \end{syntax}
% 本模板提供的中文字体配置如表 \ref{tab:chinesefontset} 所示。
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置(见表中前三行,Windows 和 macOS 以外的系统采用 Fandol 配置)。
% 此外,我们也单独提供了方正和思源两套中文字体配置。
%
% 手动指定中文字体,可选:
% \opt{windows}(默认), \opt{macos}, \opt{fandol}, \opt{founder},\opt{noto},\opt{none}。
% \end{function}
%
% 中文字体分为宋体(serif)、黑体(sans)、楷体、仿宋四种字形
%
% \begin{table}[htbp]
% \centering
% \caption{中文字体清单}
% \label{tab:cjkfontset}
% \begin{tabular}{ccccc}
% \toprule
% 操作系统 & 宋体 & 黑体 & 楷书 & 仿宋 \\
% \midrule
% Windows & SimSun & SimHei & KaiTi & FangSong \\
% macOS & Songti~SC~Light & Heiti~SC~Light & Kaiti~SC & STFangsong \\
% Linux & FandolSong & FandolHei & FandolKai & FandolFang \\
% 方正 & FZSSK/FZXBSK & FZHTK/FZXH1K & FZKTK & FZFSK \\
% 思源 & Noto~Serif~CJK~SC & Noto~Sans~CJK~SC & FZKTK & FZFSK \\
% \bottomrule
% \end{tabular}
% \begin{talltblr}[
% caption = {中文字体配置列表},
% label = {tab:chinesefontset},
% note{a} = {此字体只有常规自重,因此本模板中使用伪粗体代替粗体},
% note{b} = {使用方正小标宋作为粗体},
% note{c} = {使用方正黑体作为粗体},
% note{d} = {考虑到获取字体的难易程度,采用 noto 字体表示思源字体},
% note{e} = {思源字体并不包含楷书和仿宋,而Adobe楷体和仿宋难以直接下载,因此使用方正字体代替},
% ]{colspec = {ccccc}}
% \toprule
% 配置名称 & 宋体 & 黑体 & 楷书 & 仿宋 \\
% \midrule
% Windows & 中易宋体\TblrNote{a} & 中易黑体 & 中易楷体\TblrNote{a} & 中易仿宋 \\
% macOS & 华文宋体 & 华文黑体 & 华文楷体 & 华文仿宋 \\
% Fandol & Fandol宋体 & Fandol黑体 & Fandol楷体\TblrNote{a} & Fandol仿宋 \\
% 方正 & 方正书宋\TblrNote{b} & 方正细黑一\TblrNote{c} & 方正楷体 & 方正仿宋 \\
% 思源 & 思源宋体\TblrNote{d} & 思源黑体\TblrNote{d} & 方正楷体\TblrNote{e} & 方正仿宋\TblrNote{e} \\
% \bottomrule
% \end{talltblr}
% \end{table}
%
% 可以看出,不同系统上使用的字体以及加粗的方式有所差别,实际输出结果可能存在细微不同,使用时请注意。
% 若想要获得与 Word 版本模板最为贴近的体验,可以通过手动安装 Windows 自带的中易宋体、中易黑体、中易楷体和中易仿宋,并设置使用 Windows 字体来实现。
%
% 各个系统的默认字体请参考上述表格。可以看到,在模板自动检测时不同系统上使用的字体有所差别,实际输出结果可能存在细微不同, 使用时请注意。例如,在Linux平台或者使用了Ubuntu后端的南大\hologo{TeX}上,宋体加粗效果更明显;另一方面,在Windows平台进行编译的效果更接近Word加粗\footnote{因为SimSun没有原生粗体,通过AutoFakeBold=2.17进行模仿},建议最后交稿时设置使用Windows字体以适应评委视觉习惯。
%
% 出于美观考虑,我们也单独提供了方正和思源两套中文字体预设。表中方正字体采用了文件名以缩短长度,其全称如下所示:
% 本模板提供的西文字体配置如表 \ref{tab:latinfontset} 所示。
% 在不指定字体配置的情况下,本模板默认使用与操作系统相对应的字体配置(见表中前三行,Windows 和 macOS 以外的系统采用 gyre 配置)。
%
% \begin{table}[htbp]
% \centering
% \caption{方正字体清单}
% \label{tab:founder}
% \begin{tabular}{ccc}
% \caption{西文字体清单}
% \label{tab:latinfontset}
% \begin{tabular}{cccc}
% \toprule
% 文件名 & 全称 & 许可 \\
% 配置名称 & 衬线体 & 无衬线体 & 等宽字体 \\
% \midrule
% FZSSK & \href{http://www.foundertype.com/index.php/FontInfo/index/id/151}{方正书宋(简繁扩展)} & 免费商用 \\
% FZXBSK & \href{http://www.foundertype.com/index.php/FontInfo/index/id/164}{方正小标宋(简繁扩展)} & 设计师非商免费 \\
% FZHTK & \href{http://www.foundertype.com/index.php/FontInfo/index/id/131}{方正黑体(简繁扩展)} & 免费商用 \\
% FZXH1K & \href{http://www.foundertype.com/index.php/FontInfo/index/id/161}{方正细黑一(简繁扩展)} & 设计师非商免费 \\
% FZKTK & \href{http://www.foundertype.com/index.php/FontInfo/index/id/137}{方正楷体(简繁扩展)} & 免费商用 \\
% FZFSK & \href{http://www.foundertype.com/index.php/FontInfo/index/id/128}{方正仿宋(简繁扩展)} & \\
% Windows & Times~New~Roman & Arial & Courier~New \\
% macOS & Times~New~Roman & Arial & Menlo \\
% gyre & \Hologo{TeX}~Gyre~Termes & \Hologo{TeX}~Gyre~Heros & \Hologo{TeX}~Gyre~Cursor \\
% \bottomrule
% \end{tabular}
% \end{table}
%
%
% 若要手动选择字体,则需将字体设置为 \texttt{none},再通过 \texttt{fontspec} 宏包或 \texttt{ctex} 宏包中给出的命令来实现。
%
% 关于思源字体的一些解释:
% \begin{itemize}
% \item 思源宋体和思源黑体有两种英文命名,本模板采用Google的noto系列:\href{https://www.google.com/get/noto/#serif-hans}{思源宋体}、\href{https://www.google.com/get/noto/#sans-hans}{思源黑体}
% \item 思源字体并不包含楷书和仿宋,所以使用方正字体代替
% \end{itemize}
%
%
%
%
%
%
%
% 最后,出于统一格式的需要,本模板还选取了与正文字体相似度最高的数学字体(STIX 字体)用于公式排版。
%
% \subsection{个人信息}
%
......@@ -1236,7 +1225,7 @@ through XeTeX.
}
% \end{macrocode}
%
% 接下来逐个定义所需要使用的字符集
% 接下来逐个定义所需要使用的字
%
% \begin{macro}{\@@_load_latin_font_windows:}
% Windows 西文字体
......@@ -1331,16 +1320,7 @@ through XeTeX.
\setCJKfamilyfont{zhsong}{Songti~SC~Light}[BoldFont=Songti~SC~Bold]
\setCJKfamilyfont{zhhei}{Heiti~SC~Light}[BoldFont=Heiti~SC~Medium]
\setCJKfamilyfont{zhfs}{STFangsong}
\setCJKfamilyfont{zhkai}{Kaiti~SC}
[
BoldFont=Kaiti~SC~Bold,
% AlternateFont =
% {
% {character range1} {alternate font name1}
% {alternate font features2} ,
% ......
% }
]
\setCJKfamilyfont{zhkai}{Kaiti~SC}[BoldFont=Kaiti~SC~Bold]
\setCJKfamilyfont{zhnewhei}{PingFang~SC}
}
% \end{macrocode}
......@@ -1378,8 +1358,8 @@ through XeTeX.
%
%
% \begin{macro}{\@@_load_cjk_font_founder:}
% 方正字符集(简繁扩展)
% FZYouHK_508R \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{方正悠黑508R} 设计师非商免费,
% 方正字(简繁扩展)
% FZYouHK_508R \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{方正悠黑508R} 设计师非商免费,
% FZYouHK_511M \href{http://www.foundertype.com/index.php/FontInfo/index/id/244}{方正悠黑511M} 设计师非商免费
% \begin{macrocode}
\cs_new_protected:Npn \@@_load_cjk_font_founder:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment