Skip to content

Commit

Permalink
reset footnote counter per page
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Mar 30, 2018
1 parent c81a14f commit 735ced5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Travis build](https://travis-ci.org/ustctug/ustcthesis.svg?branch=master)](https://travis-ci.org/ustctug/ustcthesis)
[![GitHub release](https://img.shields.io/github/release/ustctug/ustcthesis/all.svg)](https://github.com/ustctug/ustcthesis/releases/latest)
[![Github downloads](https://img.shields.io/github/downloads/ustctug/ustcthesis/total.svg)](https://github.com/ustctug/ustcthesis/releases)
[![GitHub commits](https://img.shields.io/github/commits-since/ustctug/ustcthesis/v3.0.3.svg)](https://github.com/ustctug/ustcthesis/commits/master)
[![GitHub commits](https://img.shields.io/github/commits-since/ustctug/ustcthesis/v3.0.4.svg)](https://github.com/ustctug/ustcthesis/commits/master)

本项目是中国科学技术大学的学位论文 LaTeX 模板 ustcthesis,按照最新版的
[研究生学位论文撰写手册](http://gradschool.ustc.edu.cn/ylb/material/xw/wdxz/32.pdf)
Expand Down
5 changes: 3 additions & 2 deletions ustcthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{ustcthesis}
[2018/03/16 v3.0.3 USTC thesis template]
[2018/03/16 v3.0.4 USTC thesis template]
\newif\if@ustc@doctor
\newif\if@ustc@master
\newif\if@ustc@bachelor
Expand Down Expand Up @@ -209,7 +209,7 @@
\def\ustc@textcircled#1{%
\ifnum\value{#1} >9
\ClassError{ustcthesis}%
{Too many footnotes in this page.}{Keep footnote less than 10.}
{Too many circled numbers. Make number of footnotes less than 10.}{}
\fi
\ding{\the\numexpr\value{#1}+191\relax}}
\RequirePackage{xstring}
Expand Down Expand Up @@ -693,6 +693,7 @@
\captionsetup{position = bottom, font = small}
\caption*{\hangindent=2\ccwd\relax\ustc@notesname\rmfamily#1}}
\renewcommand{\thefootnote}{\ustc@textcircled{footnote}}
\RequirePackage[perpage]{footmisc}
\renewcommand\footnoterule{%
\kern-3\p@
\hrule\@width.25\textwidth
Expand Down
15 changes: 13 additions & 2 deletions ustcthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ LaTeX version 1999/12/01 or later.
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{ustcthesis}
%<*class>
[2018/03/16 v3.0.3 USTC thesis template]
[2018/03/16 v3.0.4 USTC thesis template]
%</class>
%
%<*driver>
Expand Down Expand Up @@ -919,7 +919,7 @@ LaTeX version 1999/12/01 or later.
\def\ustc@textcircled#1{%
\ifnum\value{#1} >9
\ClassError{ustcthesis}%
{Too many footnotes in this page.}{Keep footnote less than 10.}
{Too many circled numbers. Make number of footnotes less than 10.}{}
\fi
\ding{\the\numexpr\value{#1}+191\relax}}
% \end{macrocode}
Expand Down Expand Up @@ -1617,6 +1617,17 @@ LaTeX version 1999/12/01 or later.
\renewcommand{\thefootnote}{\ustc@textcircled{footnote}}
% \end{macrocode}
%
% \changes{v3.0.4}{2013/03/30}{脚注按页计数}
% LaTeX 默认脚注按章计数,即每章的开始才重置脚注计数器;我们修改为按页计数。
% 简单的|\@addtoreset{footnote}{page}|并不可靠,
% \footnote{\url{http://www.tex.ac.uk/FAQ-footnpp.html}}
% 所以必须使用额外的宏包。
% 其中 zref-perpage 包含在 collection-latex 中,最为推荐,
% 然而在此处直接似乎不能生效。
% \begin{macrocode}
\RequirePackage[perpage]{footmisc}
% \end{macrocode}
%
% 脚注线长为版心宽度的四分之一:
% \changes{v3.0}{2017/07/01}{脚注线长度为版心宽度四分之一}
% \begin{macrocode}
Expand Down

0 comments on commit 735ced5

Please sign in to comment.