Skip to content
New issue

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

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

Already on GitHub? # to your account

“算法”以及目录的“算法索引”没有在每章进行重新编号,是bug还是feature(附重编号方法) #186

Closed
goodbest opened this issue Mar 28, 2017 · 8 comments

Comments

@goodbest
Copy link
Collaborator

goodbest commented Mar 28, 2017

看到figure和table都是在每章重新编号的,如1-1,1-2,3-1,4-1等
而目前algorithm则是全文统一编号,如1-1,1-2,2-3,3-4等

是故意这么做的么?不符合前后一致性啊。

解决方法:
来源于此处
在目前的sjtuthesis.clu文件的第197行(或其他合适的位置)处增加如下一行

@addtoreset{algorithm}{chapter}% algorithm counter resets every chapter

效果测试:
改之前
改之前

改之后
改之后

目录、正文的引用编号、书签超链接也均没有问题。当然要提前注意各算法label的名称不能冲突。

@goodbest goodbest changed the title “算法索引”没有在每章进行重新编号,是bug还是feature(附重编号方法) “算法”以及目录的“算法索引”没有在每章进行重新编号,是bug还是feature(附重编号方法) Mar 28, 2017
@weijianwen
Copy link
Collaborator

欢迎提交 PR 到dev分支。

@gaocegege
Copy link
Member

Hi, @goodbest

有空提交 PR 么?要不我来帮你修改

@goodbest
Copy link
Collaborator Author

goodbest commented Mar 29, 2017

@gaocegege
其实还遇到一个问题,就是目录的“算法索引”每章之间没有空行,而figure和table都有。

搜了一下,发现了这里给出的解决方案。

\usepackage{etoolbox}
\patchcmd{\@chapter} % <cmd>
  {\chaptermark{#1}} % <search>
  {\chaptermark{#1} 
   \addtocontents{loa}{\protect\addvspace{10\p@}}} % replace
  {}{} % <success><failure>

该方法在我本地texlive 2016环境下有效解决,但是sharelatex的texlive2015环境下却无效。

你有空的话可以看看。

@gaocegege
Copy link
Member

re @goodbest

好的

@weijianwen
Copy link
Collaborator

ping. 抱歉好久没有关注了,这个PR进度如何了?

@gaocegege
Copy link
Member

呃,原本想留给一个有心贡献的小朋友的,他跑了,我来做掉吧

gaocegege added a commit to gaocegege/SJTUThesis that referenced this issue May 18, 2017
Closes sjtug#186
Thanks https://github.com/goodbest

Signed-off-by: Ce Gao <ce.gao@outlook.com>
@gaocegege
Copy link
Member

#186 (comment)

这个问题我会新提一个 issue,看看怎么解决

weijianwen pushed a commit that referenced this issue May 28, 2017
Closes #186
Thanks https://github.com/goodbest

Signed-off-by: Ce Gao <ce.gao@outlook.com>
@weijianwen
Copy link
Collaborator

PR已经合并。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants