-
Notifications
You must be signed in to change notification settings - Fork 5
/
x3-util.tex
63 lines (54 loc) · 1.5 KB
/
x3-util.tex
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
%
% These are utility commands I often use in my documents.
% They're not loaded automatically by any of the templates, so you'll have to do that
% manually if you'd like to use them :)
%
% Needed for landscape figures
\usepackage{pdflscape}
\newcommand{\leadingzero}[1]{\ifnum #1<10 0\the#1\else\the#1\fi}
\newcommand{\todayInNumbers}{\leadingzero{\day}.\leadingzero{\month}.\the\year}
\newcommand{\mcal}[1]{\mathcal{#1}}
\newcommand{\op}[1]{\operatorname{#1}}
\ifDisableTodos
\renewcommand{\todo}[1]{}
\newcommand{\todoin}[1]{}
\else
\newcommand{\todoin}[1]{\todo[inline]{#1}}
\fi
% Normal figure
\newcommand{\fig}[2]{
\begin{figure}[h]
\centering\footnotesize
\includegraphics[width=\columnwidth]{figures/#1}
\caption{#2}
\label{fig:#1}
\end{figure}
}
% Wide figure (for two-column mode)
\newcommand{\figw}[2]{
\begin{figure*}[htbp]
\centering\footnotesize
\includegraphics[width=\textwidth]{figures/#1}
\caption{#2}
\label{fig:#1}
\end{figure*}
}
\newcommand{\figwb}[2]{
\begin{figure*}[hbp]
\centering\footnotesize
\includegraphics[width=\textwidth]{figures/#1}
\caption{#2}
\label{fig:#1}
\end{figure*}
}
% Landscape figure
\newcommand{\figl}[2]{
\begin{landscape}
\begin{figure}
\centering\footnotesize
\includegraphics[width=\linewidth]{figures/#1}
\caption{#2}
\label{fig:#1}
\end{figure}
\end{landscape}
}