最近开始写论文,笔者是在mac下使用浙江大学论文模板,中间遇到一些问题,现将配置的过程总结如下:
步骤一:安装LaTeX,配置sublime txt环境
具体的步骤网上有朋友给出了详细步骤,按照操作执行。
步骤二:克隆zju论文模板
步骤三:修改字体配置文件
步骤二的模板里面详细描述了windows系统下需要的操作,在mac系统下也需要修改字体配置文件。默认在/usr/local/texlive/2018/texmf-dist/tex/latex/ctex/fontset文件夹下找到ctex-fontset-mac.def文件,替换成下图所示:
%%
%% This is file `ctex-fontset-mac.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ctex.dtx (with options: `fontset,mac')
%%
%% Copyright (C) 2003--2018
%% CTEX.ORG and any individual authors listed in the documentation.
%% ------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%% http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainers of this work are Leo Liu, Qing Lee and Liam Huang.
%%
%% ------------------------------------------------------------------------------
%%
\GetIdInfo$Id: ctex.dtx dd8349e 2018-01-28 19:10:52 +0800 Qing Lee <sobenlee@gmail.com> $
{Mac OS X fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-mac.def}
{\ExplFileDate}{2.4.12}{\ExplFileDescription}
\sys_if_engine_pdftex:TF
{ \ctex_fontset_error:n { mac } }
{
\sys_if_engine_uptex:TF
{ \ctex_fontset_error:n { mac } }
{
\setCJKmainfont [ BoldFont = STHeiti , ItalicFont = STKaiti ] { STSong }
\setCJKsansfont [ BoldFont = STHeiti ] { STXihei }
\setCJKmonofont { STFangsong }
\setCJKfamilyfont { zhsong } { STSong }
\setCJKfamilyfont { zhhei } { STHeiti }
\setCJKfamilyfont { zhfs } { STFangsong }
\setCJKfamilyfont { zhkai } { STKaiti }
\setCJKfamilyfont { zhli } { LiSu }
\setCJKfamilyfont { zhyou } { YouYuan }
}
}
\NewDocumentCommand \songti { } { \CJKfamily { zhsong } }
\NewDocumentCommand \heiti { } { \CJKfamily { zhhei } }
\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs } }
\NewDocumentCommand \kaishu { } { \CJKfamily { zhkai } }
\NewDocumentCommand \lishu { } { \CJKfamily { zhli } }
\NewDocumentCommand \youyuan { } { \CJKfamily { zhou } }
%%
%%
%% End of file `ctex-fontset-mac.def'.
至此,在sublime中打开.tex文件,cmd b 就可以正常编译成功显示出pdf了。