hust-latex / hustthesis

:notebook_with_decorative_cover: An Unofficial Thesis Template in LaTeX for Huazhong University of Science and Technology
http://hust-latex.github.io/download#hustthesis
LaTeX Project Public License v1.3c
151 stars 30 forks source link

Errors in Tex Live 2015 #12

Closed fomy closed 8 years ago

fomy commented 8 years ago

你好,谢谢分享,

我在编译 hustthesis-zh-example.tex 时,遇到下面错误,不知道是什么原因。

Package geometry Warning: `a4paper': not available in `\newgeometry'; skipped.

! You can't use `\dimexpr' in horizontal mode.
\pgfkeys@code ...ntpath }{\noexpand \the \dimexpr 
                                                  \itf@sk }\pgfkeysgetvalue ...
l.82 \maketitle

在 MacOS 和 Linux 下都遇到这个问题。

此前还遇到几个问题,做了如下修改:

  1. 几个英文字体(CMU Typewriter Text)缺失,被我注释了;
  2. hustthesis.cls : 180, \changefont{} 需要 \begin{document},也被注释了;
  3. hustthesis-zh-example.tex, \begin{document} 被前移避免错误
xiaojun-hei commented 8 years ago

建议尝试在Windows下尝试Texlive。我目前使用的是Texlive2013,曾经有同学反馈说,Texlive2014遇到编译问题。

xu-cheng commented 8 years ago

这应该是pgf的bug,请按照http://hust-latex.github.io/faqs/#compile-troubleshooting 中的步骤将pgf降级到2.10 。

几个英文字体(CMU Typewriter Text)缺失,被我注释了;

TeXLive 和MacTeX 都自带这个字体。如果缺少,请确定TeX安装环境安装正确。

hustthesis.cls : 180, \changefont{} 需要 \begin{document},也被注释了; hustthesis-zh-example.tex, \begin{document} 被前移避免错误

这个应该是pgf的bug,降级就应该可以解决问题了。

P.S. 如果将模板里\changefont{}全部替换为\fontsize{}{}\selectfont并保证字体大小和行距不变,我们就可以绕过pgf的bug。如果你愿意解决这个问题,可以发PR

fomy commented 8 years ago

非常感谢回复,

按照你的建议修改为 \fontsize{10pt}{1.3}\selectfont 可以绕过changefont的错误(我不确定 10pt 和1.3 是否准确)

hustthesis-zh-example.tex 中 \begin{document} 的错误是否有办法绕过?

xu-cheng commented 8 years ago

这些都是pgf的bug,你需要将pgf降级。

fomy commented 8 years ago

pgf 降级可以解决 \changefont 和 \dimexpr 的问题,但不能解决 hustthesis-zh-example.tex 中需要移动 \begin{document} 的问题。

将 \begin{document} 移到 \stuno{} 之前可以编译通过,但是第二页英文封面的名字等都变成中文显示了。

“第二页英文封面的名字等都变成中文显示了。” 这个问题可以这么解决:

\author {许铖} {Xu Cheng}

修改为

\author{许铖}{Xu Cheng}

xu-cheng commented 8 years ago

但不能解决 hustthesis-zh-example.tex 中需要移动 \begin{document} 的问题。

我不能复现这个问题。

这个问题可以这么解决:

如果还有其他问题,欢迎重开这个issue。

QYQSDTC commented 7 years ago

我也遇到了同样的问题,一模一样。。。