stone-zeng / fduthesis

LaTeX thesis template for Fudan University
LaTeX Project Public License v1.3c
811 stars 205 forks source link

使用 v0.9a 版本模板,编译中遇到如下问题 #305

Closed XiaosuWang closed 1 year ago

XiaosuWang commented 1 year ago

Discussed in https://github.com/stone-zeng/fduthesis/discussions/304

Originally posted by **XiaosuWang** May 31, 2023 使用 v0.9a 版本模板,编译中遇到如下问题: ```tex Package fontspec Warning: Font "STSongti-SC-Light" does not contain requested (fontspec) Script "CJK". (./main.aux) *geometry* driver: auto-detecting *geometry* detected driver: xetex (./main.out) (./main.out) Package hyperref Warning: Rerun to get /PageLabels entry. ! Undefined control sequence. \c__fdu_thesis_type_prop l.257 \begin{document} ? ``` 操作系统:macOS 12.6.6 编译命令:xelatex 入口文件.tex 直接回车无法解决,把版本换成 0.8或者0.9 的模板编译都没有问题,请问该怎么解决?
stone-zeng commented 1 year ago

检查一下 fduthesis.def 文件是不是也更新到了 v0.9a?

XiaosuWang commented 1 year ago

检查一下 fduthesis.def 文件是不是也更新到了 v0.9a?

这个文件和 fduthesis.cls 一样,是通过运行命令 bash install-unix.sh 后 自动生成的,所以我想应该是最新的吧 因为我是直接从github上下载对应版本的源文件压缩包,然后运行上述命令生成的 thesis/ 目录

stone-zeng commented 1 year ago

在 log 文件里看一下是不是有

File: fduthesis.def 2023/05/27 v0.9a Definition file for fduthesis

这样的内容?

XiaosuWang commented 1 year ago

在 log 文件里看一下是不是有

File: fduthesis.def 2023/05/27 v0.9a Definition file for fduthesis

这样的内容?

谢谢哈,问题解决了,应该就是您说的和 fduthesis.def 版本不匹配的问题。 出现上面问题的原因是,我在main.tex文件中如下使用自己生成的 fduthesis.cls: \documentclass[twoside, type=doctor]{./template/fduthesis-0.9/thesis/fduthesis} 这样使用的虽然是自己生成的最新版本的 fduthesis.cls,但是使用的却是系统中,如下目录中的 fduthesis.def 版本: /usr/local/texlive/2022/texmf-dist/tex/latex/fduthesis/fduthesis.def 这样就造成两个文件版本不匹配,出现了如上问题。 ------------------ 解决办法也比较简单,直接将自己本地生成的最新版本的 thesis/ 目录中的文件,拷贝覆盖掉系统如下目录中的文件: /usr/local/texlive/2022/texmf-dist/tex/latex/fduthesis/ 然后在main.tex文件中如下使用fduthesis.cls: \documentclass[twoside, type=doctor]{fduthesis} 问题就解决了。