TongjiThesis icon indicating copy to clipboard operation
TongjiThesis copied to clipboard

字体安装

Open marquistj13 opened this issue 5 years ago • 41 comments

前言

鉴于大多数情况下需要安装字体,我决定把字体文件传到这里:字体文件.zip

安装方法

字体文件.zip中的字体适用于windows 系统:,并包含:

  1. KaiTi_GB2312.ttf
  2. LiShu.ttf
  3. FangSong_GB2312.ttf

安装方法:下载、解压后,右键选择字体文件,然后选择 为所有用户安装

注意事项

如何查看系统中安装的字体? 答:打开终端(cmd),运行 fc-list :lang=zh-cn > font.txt 即可将字体列表输出到 font.txt 文件,查看该文件即可。

marquistj13 avatar May 07 '19 11:05 marquistj13

不建议还用GB2312字符集的字体,缺字严重。

chennanzhang avatar May 24 '19 08:05 chennanzhang

@chennanzhang 同意你的看法。 不过,如果不用GB2312字符集的话,字体会和word版的有细微差别,当然,不仔细看是看不出来的。

如果不想安装GB2312字体的话,可参考 自动进行字体配置+pifont的修改,将tongjithesis.cls中的这一行:\IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} 删掉。

marquistj13 avatar May 25 '19 01:05 marquistj13

我用了你的模板,和学校给的word模板比较,感觉标题(包括章节标题,一二级标题)的黑体好像都不够黑?有点细感觉?难道是系统字体原因,我用的是win10。

wyznio avatar May 25 '19 09:05 wyznio

@wyznio ,你好 据我所知,目前只能使用伪黑体(还请指正)。

如果你嫌不够粗的话,可以更改cls文件的这一行的数值:

%将伪粗体与伪斜体的选项传递给xeCJK package
\PassOptionsToPackage{AutoFakeBold=1.2,AutoFakeSlant}{xeCJK}

marquistj13 avatar May 26 '19 05:05 marquistj13

前辈你好,为什么将tongjithesis.cls中的这一行:\IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} 删掉后,参考文献列表依旧没有打印出来。我用的是2019TeXLive,编译也是按照XeLatex-biber-XeLatex-XeLatex。搞了一个晚上,简直要炸毛了。还请前辈指点。

bianlaing avatar Oct 30 '19 14:10 bianlaing

@bianlaing 我才毕业一年多,算不算前辈啦:grin: 参考文献列表和这一行 \IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} 没啥关系吧,这一行的意思是,在windows系统中使用windowsold的字符集配置。

你好好看一下biber的输出?贴出来看看吧。 我还在嘉定校区旁边住着,实在不行就现场去解决了。

marquistj13 avatar Oct 31 '19 02:10 marquistj13

师兄,这个biber的输出在哪儿看,是运行完biber后看message吗? 我上午又尝试了一下,发现还是不行哎。 师兄一般什么时间有空啊

------------------ 原始邮件 ------------------ 发件人: "Marquis"<[email protected]>; 发送时间: 2019年10月31日(星期四) 上午10:26 收件人: "marquistj13/TongjiThesis"<[email protected]>; 抄送: "海鸟和鱼相遇"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18)

@bianlaing 我才毕业一年多,算不算前辈啦😁 参考文献列表和这一行 \IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} 没啥关系吧,这一行的意思是,在windows系统中使用windowsold的字符集配置。

你好好看一下biber的输出?贴出来看看吧。 我还在嘉定校区旁边住着,实在不行就现场去解决了。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bianlaing avatar Oct 31 '19 04:10 bianlaing

@bianlaing 你用的什么编辑器?编译命令是命令行运行的还是用编辑器调用?你可以把每个步骤的输出贴出来看看的。

hushidong avatar Oct 31 '19 04:10 hushidong

用texlive+texstudio,采用编辑器调用,PDFLaTeX-biber-PDFLaTeX-PDFLaTeX。

---原始邮件--- 发件人: "[email protected]"<[email protected]> 发送时间: 2019年10月31日(星期四) 中午12:22 收件人: "marquistj13/TongjiThesis"<[email protected]>; 抄送: "bianlaing"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18)

@bianlaing 你用的什么编辑器?编译命令是命令行运行的还是用编辑器调用?你可以把每个步骤的输出贴出来看看的。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bianlaing avatar Oct 31 '19 04:10 bianlaing

师兄,为了方便交流,能否加个微信。我的微信号是 bianlian95。

---原始邮件--- 发件人: "[email protected]"<[email protected]> 发送时间: 2019年10月31日(星期四) 中午12:22 收件人: "marquistj13/TongjiThesis"<[email protected]>; 抄送: "bianlaing"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18)

@bianlaing 你用的什么编辑器?编译命令是命令行运行的还是用编辑器调用?你可以把每个步骤的输出贴出来看看的。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bianlaing avatar Oct 31 '19 04:10 bianlaing

那你就在命令行运行一遍看看输出是啥样的?

hushidong avatar Oct 31 '19 05:10 hushidong

看每个命令是否都正确输出了。

hushidong avatar Oct 31 '19 05:10 hushidong

@bianlaing 最好在issue里解决吧,这样别人看见了也能借鉴一下。 最好用xelatex。 你再根据 @hushidong 大神的指示看一下输出。

marquistj13 avatar Oct 31 '19 05:10 marquistj13

好滴,感谢师兄

---原始邮件--- 发件人: "Marquis"<[email protected]> 发送时间: 2019年10月31日(星期四) 中午1:22 收件人: "marquistj13/TongjiThesis"<[email protected]>; 抄送: "bianlaing"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18)

@bianlaing 最好在issue里解决吧,这样别人看见了也能借鉴一下。 最好用xelatex。 你再根据 @hushidong 大神的指示看一下输出。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bianlaing avatar Oct 31 '19 05:10 bianlaing

@bianlaing 解决了没? 没解决的话就把 xelatex a.tex biber a xelatex a.tex 这三步编译结果贴上来,这里a指代你的文档名。

hushidong avatar Oct 31 '19 09:10 hushidong

多谢师兄关心,我刚刚从本部回来,晚上搞一搞看。

---原始邮件--- 发件人: "[email protected]"<[email protected]> 发送时间: 2019年10月31日(星期四) 下午5:53 收件人: "marquistj13/TongjiThesis"<[email protected]>; 抄送: "bianlaing"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18)

@bianlaing 解决了没? 没解决的话就把 xelatex a.tex biber a xelatex a.tex 这三步编译结果贴上来,这里a指代你的文档名。

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bianlaing avatar Oct 31 '19 09:10 bianlaing

其实没有mwe 是非常难判断的,最好给个简短的mwe,看看就知道了。

发送自 Windows 10 版邮件应用

发件人: bianlaing 发送时间: 2019年10月30日 22:44 收件人: marquistj13/TongjiThesis 抄送: chennanzhang; Mention 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18)

前辈你好,为什么将tongjithesis.cls中的这一行:\IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} 删掉后,参考文献列表依旧没有打印出来。我用的是2019TeXLive,编译也是按照XeLatex-biber-XeLatex-XeLatex。搞了一个晚上,简直要炸毛了。还请前辈指点。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

chennanzhang avatar Oct 31 '19 16:10 chennanzhang

最后选择用了老版格式,能够运行的出来。我还是选用老版。感谢前辈的耐心帮助,thank you!

------------------ 原始邮件 ------------------ 发件人: "chennanzhang"<[email protected]>; 发送时间: 2019年11月1日(星期五) 凌晨0:14 收件人: "marquistj13/TongjiThesis"<[email protected]>; 抄送: "海鸟和鱼相遇"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18)

其实没有mwe 是非常难判断的,最好给个简短的mwe,看看就知道了。

发送自 Windows 10 版邮件应用

发件人: bianlaing 发送时间: 2019年10月30日 22:44 收件人: marquistj13/TongjiThesis 抄送: chennanzhang; Mention 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18)

前辈你好,为什么将tongjithesis.cls中的这一行:\IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} 删掉后,参考文献列表依旧没有打印出来。我用的是2019TeXLive,编译也是按照XeLatex-biber-XeLatex-XeLatex。搞了一个晚上,简直要炸毛了。还请前辈指点。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bianlaing avatar Oct 31 '19 16:10 bianlaing

Window环境下,已经将biblatex-gb7714-2015四个文件放在了编译的主目录下,然后也将tongjithesis.cls中的这一行:\IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} 删掉后,参考文献列表依旧没有打印出来。我用的是2019TeXLive,编译也是按照XeLatex 运行 xelatex thesis.tex提示的错误信息是: ! Undefined control sequence. \xeCJK/family/rm ...e:n \fontspec_gset_family:Nnn \g__xeCJK_fontspec_family_... l.110 }

guangxush avatar Dec 11 '19 14:12 guangxush

还是缺字体,改成fontset=windowsnew

hushidong avatar Dec 11 '19 15:12 hushidong

还是缺字体,改成fontset=windowsnew

修改了之后还是不行

guangxush avatar Dec 12 '19 03:12 guangxush

两个方法 1.从其他电脑把缺的字体拷过来。 2.自己设置用你现有的字体。

hushidong avatar Dec 12 '19 05:12 hushidong

字体按照你说的修改好了,但是参考文献还是有问题: 首先将https://github.com/hushidong/biblatex-gb7714-2015 master分支上的四个gb7714-2015文件放在了本项目的主目录下,thesis.tex中选择了bibtype=numeric,然后采用xelatex进行编译,但是正文中cite{}引用的参考文献不能显示上标数字,只显示bib文件里面的英文名称,最后参考文献也没打印出来,这是怎么回事呢?

guangxush avatar Dec 12 '19 13:12 guangxush

使用(一定要仔细看啊)

主文件为 thesis.tex,该文档头部说明了本模板的所有选项(包含 数字式引用及作者年份引用的切换选项,默认使用数字上标的引用格式)。

基本的编译步骤是:tex,biber,tex,tex(这里的tex替换成你常用的tex,如xelatex)。一般的前端都可以定制成一键运行这些步骤,如emacs的C-c C-a,vscode的 LaTeX Workshop 插件,WinEdt自带的编译按键等。
首选xelatex编译,次选pdflatex,lualatex貌似也能用。
使用xelatex时,如果提示缺少某字体,不要慌,请参考下面的字体安装说明。

hushidong avatar Dec 12 '19 23:12 hushidong

看一下项目说明。

hushidong avatar Dec 12 '19 23:12 hushidong

最后终于弄好了,按照这个方式 用命令提示符打开当前路径 然后依次执行:1.xelatex thesis.tex 2.biber thesis(这里千万别写成biber thesis.tex我困扰了好久)3.再次运行xelatex thesis.tex,即可生成带参考文献的PDF

guangxush avatar Dec 14 '19 15:12 guangxush

您好,我windows下载安装的的texlive2019-20190410.iso,Xelatex运行thesis.tex时,出现如下错误,请问知道怎么解决吗?

! LaTeX Error: Unknown option AutoFakeBold=1.2' for package fontspec'.

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

l.257 \ProcessOptions*

?

StevenYuCao avatar Jan 20 '20 14:01 StevenYuCao

师兄,这个biber的输出在哪儿看,是运行完biber后看message吗? 我上午又尝试了一下,发现还是不行哎。 师兄一般什么时间有空啊 ------------------ 原始邮件 ------------------ 发件人: "Marquis"<[email protected]>; 发送时间: 2019年10月31日(星期四) 上午10:26 收件人: "marquistj13/TongjiThesis"<[email protected]>; 抄送: "海鸟和鱼相遇"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [marquistj13/TongjiThesis] 字体安装 (#18) @bianlaing 我才毕业一年多,算不算前辈啦😁 参考文献列表和这一行 \IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} 没啥关系吧,这一行的意思是,在windows系统中使用windowsold的字符集配置。 你好好看一下biber的输出?贴出来看看吧。 我还在嘉定校区旁边住着,实在不行就现场去解决了。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

您好 问题解决了吗?能发一份模板到我的邮箱吗 谢谢 [email protected]

StevenYuCao avatar Jan 20 '20 14:01 StevenYuCao

师兄您好,为何我编译出来只有一级标题显示为了黑体,二级、三级标题都是宋体呢

Gloria123summer avatar Jan 31 '20 05:01 Gloria123summer

我试了一下用老模板编译出来字体是对的,用最新master的模板编译出来好像字体都不太对,比如很多地方没有加粗,英文的显示也和老板出来的不太一样

Gloria123summer avatar Jan 31 '20 07:01 Gloria123summer