/
macros.tex
executable file
·96 lines (66 loc) · 2.47 KB
/
macros.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
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
%% To do: trim these definitions
\newcommand\nc\newcommand
\nc\rnc\renewcommand
\usepackage{epsfig}
\usepackage{latexsym}
%% Look for the \smalltriangleup definition. I expected it in amssymb
\nc\smalltriangleup{\scriptscriptstyle \triangle}
\nc\smalltriangledown{\scriptscriptstyle \triangledown}
\nc\out[1]{}
\nc\mynoteOut[2]{\mynote{#1}\out{#2}}
% While working, use these defs
%% \nc\mynote[1]{{\em [#1]}}
%% \nc\mynotefoot[1]{\footnote{\mynote{#1}}}
% But for the submission, use these
\nc\mynote\out
\nc\mynotefoot\out
\nc\todo{\mynote{To do.}}
\nc\figlabel[1]{\label{fig:#1}}
\nc\figref[1]{Figure~\ref{fig:#1}}
\nc\seclabel[1]{\label{sec:#1}}
\nc\secref[1]{Section~\ref{sec:#1}}
\nc\secreftwo[2]{Sections~\ref{sec:#1} and~\ref{sec:#2}}
\nc\appref[1]{Appendix~\ref{sec:#1}}
%% The name \secdef is already taken
\nc\sectiondef[1]{\section{#1}\seclabel{#1}}
\nc\subsectiondef[1]{\subsection{#1}\seclabel{#1}}
\nc\subsubsectiondef[1]{\subsubsection{#1}\seclabel{#1}}
\nc\needcite{\mynote{ref}}
% \nc\myurl\texttt
% http://cs.wlu.edu/~necaise/refs/latex2e/env-floats.3.html#lnfigure
% Arguments: env, label, caption, body
\nc\figdefG[4]{\begin{#1}[tbp]
#4
\caption{#3}
\figlabel{#2}
\end{#1}}
% Arguments: label, caption, body
\nc\figdef{\figdefG{figure}}
\nc\figdefwide{\figdefG{figure*}}
% Arguments: label, caption, body
\nc\figrefdef[3]{\figref{#1}\figdef{#1}{#2}{#3}}
\nc\figrefdefwide[3]{\figref{#1}\figdefwide{#1}{#2}{#3}}
% Image format: PNG or JPEG? JPEG lets us shrink the files, at some cost
% in fidelity. Png is much slower to process even when the files are
% smaller. I guess there's some conversion process going on.
% JPEG compressed at 35x, the figures are smaller and faster to
% process than png. The eps files are huge (about 80x).
% Since PNG is lossless, keep the master figures in that format and convert.
\nc\picext{png}
%\nc\picext{jpg}
%\nc\picext{eps}
%\nc\picext{tif}
\nc\picfile[1]{pictures/\picext/#1.\picext}
\nc\pict[1]{\includegraphics[width=3.2in]{\picfile{#1}}}
\nc\picframe[1]{\frame{\pict{#1}}}
\nc\picframewide[1]{\frame{\includegraphics[width=6in]{\picfile{#1}}}}
\nc\picdef[2]{\figdef{#1}{#2}{\centering \picframe{#1}}}
\nc\picdefwide[2]{\figdefwide{#1}{#2}{\picframewide{#1}}}
\nc\picrefdef[2]{\picdef{#1}{#2}\figref{#1}}
\nc\picrefdefwide[2]{\figref{#1}\picdefwide{#1}{#2}}
\nc\figneeded[1]{\figdef{needed}{#1}}
\nc\symTwo[1]{\mathbin{#1\!\!\!#1}}
\nc\symThree[1]{\mathbin{#1\!\!\!#1\!\!\!#1}}
\nc{\lb}{[\![}
\nc{\rb}{]\!]}
\nc{\db}[1]{\lb#1\rb}