Skip to content

Commit

Permalink
support nomencl
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Oct 22, 2018
1 parent d269c0f commit 2351f99
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 9 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ build
*.synctex.gz(busy)
*.pdfsync

## Build tool directories for auxiliary files
# latexrun
latex.out/

## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
Expand All @@ -65,6 +69,9 @@ acs-*.bib
# changes
*.soc

# comment
*.cut

# cprotect
*.cpt

Expand Down Expand Up @@ -158,7 +165,9 @@ _minted*
*.mw

# nomencl
*.nlg
*.nlo
*.nls

# pax
*.pax
Expand Down Expand Up @@ -187,6 +196,9 @@ sympy-plots-for-*.tex/
*.pytxcode
pythontex-files-*/

# tcolorbox
*.listing

# thmtools
*.loe

Expand All @@ -201,6 +213,12 @@ pythontex-files-*/
# easy-todo
*.lod

# xcolor
*.xcp

# xmpincl
*.xmpi

# xindy
*.xdy

Expand All @@ -222,6 +240,9 @@ TSWLatexianTemp*
# Texpad
.texpadtmp

# LyX
*.lyx~

# Kile
*.backup

Expand Down
27 changes: 21 additions & 6 deletions chapters/notation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,26 @@

\begin{notation}

\centering
\begin{tabular}{rl}
$\ln x$ & natural logarithm $\log_ex$ \\
$\log x$ & common logarithm $\log_{10}x$ \\
$x\ \mathrm{mod}\ y$ & remainder \\
\end{tabular}
\begin{center}
\begin{tabular}{rl}
$a$ & The number of angels per unit area \\
$N$ & The number of angels per needle point \\
$A$ & The area of the needle point \\
$\sigma$ & The total mass of angels per unit area \\
$m$ & The mass of one angel \\
\end{tabular}
\end{center}

\end{notation}



% 也可以使用 nomencl 宏包

% \printnomenclature

% \nomenclature{$a$}{The number of angels per unit area}
% \nomenclature{$N$}{The number of angels per needle point}
% \nomenclature{$A$}{The area of the needle point}
% \nomenclature{$\sigma$}{The total mass of angels per unit area}
% \nomenclature{$m$}{The mass of one angel}
6 changes: 6 additions & 0 deletions latexmkrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ sub glo2gls {
system("makeindex -s gglo.ist -o \"$_[0].gls\" \"$_[0].glo\"");
}
push @generated_exts, "glo", "gls";

add_cus_dep('nlo', 'nls', 0, 'nlo2nls');
sub nlo2nls {
system("makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\"");
}
push @generated_exts, "nlo", "nls";
2 changes: 1 addition & 1 deletion main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
\tableofcontents
% \listoffigures
% \listoftables
% \input{chapters/notation}
\input{chapters/notation}

\mainmatter
\input{chapters/intro}
Expand Down
20 changes: 19 additions & 1 deletion ustcthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,6 @@
\ifustc@graduate\cleardoublepage\else\clearpage\fi
\pagestyle{headings}%
\ustc@chapter{\ustc@notationname}%
\setlength{\itemsep}{\z@}%
}{%
\clearpage\pagestyle{plain}%
}%
Expand Down Expand Up @@ -1292,3 +1291,22 @@
\cleardoublepage
\ustc@save@listofalgorithms}
}
\ustc@atendpackage{nomencl}{
\let\nomname\ustc@notationname
\def\thenomenclature{%
\ifustc@graduate\cleardoublepage\else\clearpage\fi
\pagestyle{headings}%
\ustc@chapter{\ustc@notationname}%
\nompreamble
\list{}{%
\labelwidth\nom@tempdim
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\itemsep\nomitemsep
\let\makelabel\nomlabel}}
\def\endthenomenclature{%
\endlist
\nompostamble
\clearpage\pagestyle{plain}%
}
}
26 changes: 25 additions & 1 deletion ustcthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,6 @@ version 2005/12/01 or later.
\ifustc@graduate\cleardoublepage\else\clearpage\fi
\pagestyle{headings}%
\ustc@chapter{\ustc@notationname}%
\setlength{\itemsep}{\z@}%
}{%
\clearpage\pagestyle{plain}%
}%
Expand Down Expand Up @@ -2744,6 +2743,31 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
%
% \subsubsection{nomencl 宏包}
%
% \begin{macrocode}
\ustc@atendpackage{nomencl}{
\let\nomname\ustc@notationname
\def\thenomenclature{%
\ifustc@graduate\cleardoublepage\else\clearpage\fi
\pagestyle{headings}%
\ustc@chapter{\ustc@notationname}%
\nompreamble
\list{}{%
\labelwidth\nom@tempdim
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\itemsep\nomitemsep
\let\makelabel\nomlabel}}
\def\endthenomenclature{%
\endlist
\nompostamble
\clearpage\pagestyle{plain}%
}
}
% \end{macrocode}
%
% \begin{macrocode}
%</class>
% \end{macrocode}
Expand Down

0 comments on commit 2351f99

Please sign in to comment.