-
Notifications
You must be signed in to change notification settings - Fork 3
/
importsreferences-en.sty
executable file
·123 lines (110 loc) · 4.15 KB
/
importsreferences-en.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
\ProvidesPackage{importsreferences-en}
\RequirePackage{tikz,subfigure,float,listings,animate,float,etoolbox,algorithmicx,algpseudocode,algorithm}
\newfloat{gramf}{hbt}{grm}
\floatname{gramf}{Grammar}
\newcommand{\genlab}[2]{\label{#1:#2}}
\newcommand{\genref}[3]{#2~\ref{#1:#3}}
\newcommand{\genrefpag}[3]{\genref{#1}{#2}{#3} op pagina~\pageref{#1:#3}}
\newcommand{\figlab}[1]{\genlab{fig}{#1}}
\newcommand{\figref}[1]{\genref{fig}{Figure}{#1}}
\newcommand{\figrefpag}[1]{\genrefpag{fig}{Figure}{#1}}
\newcommand{\tbllab}[1]{\genlab{tbl}{#1}}
\newcommand{\tblref}[1]{\genref{tbl}{Table}{#1}}
\newcommand{\tblrefpag}[1]{\genrefpag{tbl}{Table}{#1}}
\newcommand{\seclab}[1]{\genlab{sec}{#1}}
\newcommand{\secref}[1]{\genref{sec}{Section}{#1}}
\newcommand{\secrefpag}[1]{\genrefpag{sec}{Section}{#1}}
\newcommand{\ssclab}[1]{\genlab{ssc}{#1}}
\newcommand{\sscref}[1]{\genref{ssc}{Subsection}{#1}}
\newcommand{\sscrefpag}[1]{\genrefpag{ssc}{Subsection}{#1}}
\newcommand{\ssslab}[1]{\genlab{sss}{#1}}
\newcommand{\sssref}[1]{\genref{sss}{Subsubsection}{#1}}
\newcommand{\sssrefpag}[1]{\genrefpag{sss}{Subsubsection}{#1}}
\newcommand{\chplab}[1]{\genlab{chp}{#1}}
\newcommand{\chpref}[1]{\genref{chp}{Chapter}{#1}}
\newcommand{\chprefpag}[1]{\genrefpag{chp}{Chapter}{#1}}
\newcommand{\applab}[1]{\genlab{app}{#1}}
\newcommand{\appref}[1]{\genref{app}{Appendix}{#1}}
\newcommand{\apprefpag}[1]{\genrefpag{app}{Appendix}{#1}}
\newcommand{\collab}[1]{\genlab{col}{#1}}
\newcommand{\colref}[1]{\genref{col}{Corollary}{#1}}
\newcommand{\colrefpag}[1]{\genrefpag{col}{Corollary}{#1}}
\newcommand{\thmlab}[1]{\genlab{col}{#1}}
\newcommand{\thmref}[1]{\genref{col}{Theorem}{#1}}
\newcommand{\thmrefpag}[1]{\genrefpag{col}{Theorem}{#1}}
\newcommand{\exclab}[1]{\genlab{exc}{#1}}
\newcommand{\excref}[1]{\genref{exc}{Exercise}{#1}}
\newcommand{\excrefpag}[1]{\genrefpag{exc}{Exercise}{#1}}
\newcommand{\grmlab}[1]{\genlab{grm}{#1}}
\newcommand{\grmref}[1]{\genref{grm}{Grammar}{#1}}
\newcommand{\grmrefpag}[1]{\genrefpag{grm}{Grammar}{#1}}
\newcommand{\eqnlab}[1]{\genlab{eqn}{#1}}
\newcommand{\eqnref}[1]{Equation~(\ref{eqn:#1})}
\newcommand{\eqncref}[1]{Constraint~(\ref{eqn:#1})}
\newcommand{\eqncsref}[1]{Constraints~(\ref{eqn:#1})}
\newcommand{\eqncsrefr}[2]{Constraints~(\ref{eqn:#1})-(\ref{eqn:#2})}
\newcommand{\eqnnref}[1]{(\ref{eqn:#1})}
\newcommand{\eqnnrefr}[2]{(\ref{eqn:#1})-(\ref{eqn:#2})}
\newcommand{\alglab}[1]{\genlab{alg}{#1}}
\newcommand{\algoref}[1]{\genref{alg}{Algorithm}{#1}}
\newcommand{\lstlab}[1]{\genlab{lst}{#1}}
\newcommand{\lstref}[2][Listing]{\genref{lst}{#1}{#2}}
\newcommand{\importtikz}[1]{
\input{tikzpictures/tikz-#1.tex}
\figlab{#1}
}
\newcommand{\importabular}[1]{
\input{tables/tbl-#1.tex}
\tbllab{#1}
}
\newcommand{\importtikzfigure}[2]{
\begin{figure}[htb]
\centering
\input{tikzpictures/tikz-#1.tex}
\caption{#2}
\figlab{#1}
\end{figure}
}
\newcommand{\importgram}[1]{
\begin{grammar}[(colon){$\rightarrow$}][(semicolon)$|$][(comma){}][(period){\\}][(quote){\begin{bf}}{\end{bf}}][(nonterminal){$\langle$}{$\rangle$}]\input{grammars/#1.tex}\end{grammar}
}
\newcommand{\importgramenv}[2]{
\begin{gramf}
\begin{grammar}[(colon){$\rightarrow$}][(semicolon)$|$][(comma){}][(period){\\}][(quote){\begin{bf}}{\end{bf}}][(nonterminal){$\langle$}{$\rangle$}]\input{grammars/#1.tex}\end{grammar}
\caption{#2}
\grmlab{#1}
\end{gramf}
}
\newcommand{\importtikzsubfigure}[2]{
\subfigure[#2]{\importtikz{#1}}
}
\newcommand{\importtabulartable}[2]{
\begin{table}[htb]
\centering
\input{tables/tbl-#1.tex}
\caption{#2}
\tbllab{#1}
\end{table}
}
\newcommand{\importtabularsubtable}[2]{
\subtable[#2]{\importabular{#1}}
}
\newcommand{\importalgorithmicalgorithm}[2]{
\begin{algorithm}[hbt]
\caption{#2}\alglab{#1}
\input{algorithms/alg-#1.tex}
\end{algorithm}}
\algnewcommand\algorithmicto{\textbf{to}}
\algnewcommand\algorithmicwith{\textbf{with}}
\newcommand{\Forrange}[4][1]{
\ifthenelse{#1=1}
{\For{\ensuremath{#2\gets#3\ \algorithmicto\ #4}}}
{\For{\ensuremath{#2\gets#3\ \algorithmicto\ #4\ \algorithmicwith\ #1}}}}
\newcommand{\importlisting}[3][Java]{
\begin{listing}[hbt]
\centering
\lstinputlisting[caption=\relax,title=\relax,frame=none,language=#1]{listings/lst-#2.tex}
\caption{#3}
\lstlab{#2}
\end{listing}
}