Skip to content

Commit

Permalink
Update numbering rules
Browse files Browse the repository at this point in the history
- remove `thechapter` prefix of `thesection`
- use `section.subsection.equation` style for `math` major `equation` style
- update to v1.2.0
  • Loading branch information
TheNetAdmin committed May 10, 2018
1 parent 1aba6c6 commit 2504d17
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/format/general/numbering.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
\renewcommand{\thefigure}{\arabic{figure}}
\renewcommand{\thetable}{\arabic{table}}
\AtBeginDocument{\renewcommand{\thelstlisting}{\arabic{lstlisting}}}
\renewcommand*{\thesection}{\arabic{section}}
2 changes: 2 additions & 0 deletions config/format/major/math/format.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
\input{config/format/major/math/packages}
\input{config/format/major/math/numbering}
12 changes: 12 additions & 0 deletions config/format/major/math/numbering.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
\numberwithin{equation}{section}% reset equation counter for sections
\numberwithin{equation}{subsection}

% Omit `.0` in equation numbers for non-existent subsections.
\renewcommand*{\theequation}{%
\ifnum\value{subsection}=0 %
\thesection
\else
\thesubsection
\fi
.\arabic{equation}%
}
1 change: 1 addition & 0 deletions config/format/major/math/packages.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\usepackage{amsmath}
2 changes: 1 addition & 1 deletion config/version.tex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
\newcommand{\zjuthesisversion}{1.1.0}
\newcommand{\zjuthesisversion}{1.2.0}
7 changes: 7 additions & 0 deletions content/final/body/body.tex
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@ \subsubsection{小节标题}
xxx & xxx \\ \hline
\end{tabularx}
\end{table}

\par\autoref{equ:sample},这是一个公式

\begin{equation}
\label{equ:sample}
A=\overbrace{(a+b+c)+\underbrace{i(d+e+f)}_{\text{虚数}}}^{\text{复数}}
\end{equation}

0 comments on commit 2504d17

Please sign in to comment.