Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]图目录,表目录超链接无效 #54

Closed
qiaott opened this issue Apr 6, 2020 · 8 comments
Closed

[BUG]图目录,表目录超链接无效 #54

qiaott opened this issue Apr 6, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@qiaott
Copy link

qiaott commented Apr 6, 2020

遇到的问题
图目录和表目录超链接无效,点击导航栏“图目录”和“表目录”,页面停留在abstract那一页,不会跳转。

image

重现步骤
下载Github原模版,zjuthesis.tex中是如下配置:
'''
\documentclass[
StudentName = 姓名,
StudentID = 学号,
AdvisorName = 指导教师,
Grade = 2014, % only the year, no '级'
Major = 专业,
Department = 学院,
Title = 毕业论文/设计题目,
SubmitDate = 递交日期,
MajorFormat = general,
Degree = graduate, % 'undergraduate' or 'graduate'
Type = thesis, % 'thesis' or 'design'
Period = final, % 'proposal' or 'final'
BlindReview = false, % 'false' or 'true'
Language = chinese, % 'chinese' or 'english'
% Below only for 'graduate'
GradLevel = master, % 'master' or 'doctor'
Topic = 研究方向,
ColaboratorName = 合作导师,
TitleEng = {{Graduation Thesis Title}}
]{./config/zjuthesis}
'''

同样,刚才试了一下,在GitHub上提供的zjuthesis-graduate-general-doctor-thesis-final-english.pdf文档,也有类似的问题,点那个表目录的时候,跳转到了Custom Page页面,而不是List of Tables页面:
image

不知道是什么原因,求更新和解答。 @TheNetAdmin

@qiaott qiaott added the bug Something isn't working label Apr 6, 2020
@muzimuzhi
Copy link

muzimuzhi commented Apr 6, 2020

如果只使用 hyperref 宏包,可以这么修改

diff --git a/page/graduate/toc.tex b/page/graduate/toc.tex
index 4657881..2ffcf16 100644
--- a/page/graduate/toc.tex
+++ b/page/graduate/toc.tex
@@ -2,9 +2,11 @@
 \tableofcontents

 \cleardoublepage
+\phantomsection
 \marklof
 \listoffigures

 \cleardoublepage
+\phantomsection
 \marklot
 \listoftables

参考 texdoc hyperref, sec. 5.27。

或者,使用 bookmark 宏包,用法参考我的知乎文章《[LaTeX] 把不编号章节加进目录和 PDF 书签》。

@muzimuzhi
Copy link

另外,发现一处和 \listoffigures 有关的 typo

diff --git a/config/format/general/reference.tex b/config/format/general/reference.tex
index 2403083..f0576be 100644
--- a/config/format/general/reference.tex
+++ b/config/format/general/reference.tex
@@ -14,5 +14,5 @@
 \def\appendixautorefname        {附录}
 \def\FancyVerbLineautorefname   {行}
 \def\theoremautorefname         {定理}
-\def\listoffigures              {代码}
+\def\listoffiguresname          {代码}
 \def\lstlistingname             {代码}

@qiaott
Copy link
Author

qiaott commented Apr 6, 2020

问题已解决,感谢!
学习了!

@TheNetAdmin
Copy link
Owner

感谢 @qiaott 指出问题以及 @muzimuzhi 提供的代码,我已经将修复代码push到master。

目前的模板中似乎还没用到 listoffiguresname,所以我直接将原本写错的 \def\listoffigures 删掉了,感谢指出。

@muzimuzhi
Copy link

目前的模板中似乎还没用到 listoffiguresname,所以我直接将原本写错的 \def\listoffigures 删掉了,感谢指出。

会不会想修改的是 \listfigurename?类比 \contentsname\tableofcontents 的关系。

@TheNetAdmin
Copy link
Owner

@muzimuzhi 我记得当初写初版模板时, listoffigures 是为了设置代码块名称的,可能后续更新了正确的设定之后忘记删掉这行了。

@qiaott
Copy link
Author

qiaott commented Apr 9, 2020

@muzimuzhi @TheNetAdmin 两位大神,麻烦再请教一个问题:
image
在图、表目录中,不同章节之间的突然增大的间距在哪里可以取消掉?
看了半天layout.text没看懂。。

@TheNetAdmin
Copy link
Owner

新开一个issue并给一份可重现问题的代码吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants