-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCommands.tex
78 lines (72 loc) · 2.6 KB
/
Commands.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
\newcommand{\importrcp}[2]{\def\ThisFile{#1}\input{#2}}
\newcommand{\half}{\sfrac{1}{2}}
\newcommand{\quarter}{\sfrac{1}{4}}
\newcommand{\threequarter}{\sfrac{3}{4}}
\newcommand{\eighth}{\sfrac{1}{8}}
\newcommand{\third}{\sfrac{1}{3}}
\newcommand{\twothird}{\sfrac{2}{3}}
\newcommand{\Tp}[1]{#1\,tbsp}
\newcommand{\tp}[1]{#1\,tsp}
\newcommand{\C}[1]{#1\,cup}
\newcommand{\oz}[1]{#1\,oz}
\newcommand{\cm}[1]{#1\,cm}
\newcommand{\inch}[1]{#1$^{\prime\prime}$}
\newcommand{\lbs}[1]{#1\,lbs}
\newcommand{\qt}[1]{#1\,qt}
\newcommand{\gr}[1]{#1\,g}
\newcommand{\kgr}[1]{#1\,kg}
\newcommand{\gal}[1]{#1\,gallon}
\newcommand{\ltr}[1]{#1\,L}
\newcommand{\mL}[1]{#1\,mL}
\newcommand{\tF}[1]{#1\,\textdegree{}F}
\newcommand{\tC}[1]{#1\,\textcelsius}
\newcommand{\ang}[1]{#1\,\textdegree}
\newcommand{\UNTESTED}{\textbullet{}}
\newcommand{\FIXME}{\textdaggerdbl{}}
\newcommand{\seerecipe}[1]{\nameref{rcp:#1}~(See page~\pageref{rcp:#1})\ }
\newcommand{\up}[1]{{\thinspace$^{\hbox{\scriptsize#1\fam=-1}}$}}
\newcommand{\pronounce}[1]{(\textsl{#1})}
\newcommand{\method}[1]{This recipe is made using \nameref{method:#1}.\par}
\newenvironment{ingredients}
{\noindent Ingredients:\begin{itemize*}\setlength{\itemindent}{-1.2pc}\renewcommand{\labelitemi}{$\cdot$}}{\end{itemize*}}
\newenvironment{directions}
{\smallskip\begin{enumerate*}}{\end{enumerate*}}
\catcode`\@=11
% \@car is actually already defined in latex.tex, but for
% maximum robustness it needs to have the \long prefix:
\long\def\@car#1#2\@nil{#1}
\long\def\@first#1#2{#1}
\long\def\@second#1#2{#2}
\long\def\ifempty#1{\expandafter\ifx\@car#1@\@nil @\@empty
\expandafter\@first\else\expandafter\@second\fi}
\catcode`\@=12
\long\def\test#1{\begingroup \toks0{[#1]}%
\newlinechar`\/\message{/\the\toks0:
\ifempty{#1}{EMPTY}{NOT empty}%
}\endgroup}
\newcommand{\nonempty}[2]{\ifempty{#1}{}{#2}}
\newenvironment{recipe}[3]{
\newcommand{\theme}[1]{\index{##1!#1}##1}
\newcommand{\stheme}[1]{\index{##1!#1}}
\newcommand{\htheme}[2]{\index{##2!##1!#1}##1 ##2}
\newcommand{\shtheme}[2]{\index{##2!##1!#1}##1}
\newcommand{\hint}[1]{\smallskip \noindent \textsl{##1} \par}
\newcommand{\subrecipe}[1]{\subsection*{##1}}
\newcommand{\slashitem}[1]{\item Slash the top of the loaf. \par\hfil\includegraphics{##1}\hfil\par}
\section{#1}\label{\ThisFile}
\nonempty{#2#3}{
\noindent
\nonempty{#2}{From #2.}
\hfil
\nonempty{#3}{Makes #3.}
\par}
}{\vspace*\fill\pagebreak[2]}
\titlelabel{}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{\textit{\nouppercase{\leftmark}}}
\fancyhead[LO]{}
\widowpenalty=0
\clubpenalty=0