-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.tex
executable file
·129 lines (89 loc) · 3.15 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
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
124
125
126
127
128
129
%% To do: trim these definitions
\newcommand\nc\newcommand
\nc\rnc\renewcommand
\usepackage{epsfig}
\usepackage{latexsym}
%% \usepackage{bbold} %% for $\mathbbm{1}$
%% %% 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}
\usepackage{tikz}
%%%<
%% \usepackage[active,tightpage]{preview}
%% \PreviewEnvironment{tikzpicture}
%%%>
\usepackage{amsmath}
%% \usepackage{tikz-cd}
%% % I used tikz-cd version 0.3c, of December 30, 2012.
%% % July 2012 version lacks a feature I use (shift left).
%% \usetikzlibrary{matrix, calc, arrows}
%% \tikzset{ ampersand replacement=\& }
\nc\wpicture[2]{\includegraphics[width=#1]{#2}}
\nc\wfig[2]{
\begin{center}
\wpicture{#1}{#2}
\end{center}
}
\nc\fig[1]{\wfig{4in}{#1}}
\nc\usebg[1]{\usebackgroundtemplate{\wpicture{1.2\textwidth}{#1}}}
\nc\framet[2]{\frame{\frametitle{#1}#2}}
\nc\hidden[1]{}
\nc\Back{\!\!\!\!\!\!\!}