-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecipe.sty
105 lines (88 loc) · 2.72 KB
/
recipe.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
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{recipe}
[Recipe Styling 2020]
\documentclass{article}
\RequirePackage{fancyhdr}
\RequirePackage{multicol}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[bottom]{footmisc}
\RequirePackage{lastpage}
\RequirePackage[left=1in, right=1in, top=1in, bottom=1in]{geometry}
\RequirePackage{vwcol} % for variable width columns
\RequirePackage{lipsum}
% some default formatting
\pagestyle{fancy}
\cfoot{Page\\\thepage\ of \pageref{LastPage}}
\setlength\parindent{0pt}
% some custom commands for hyperlinks
\RequirePackage{tablefootnote}
\hypersetup{%
colorlinks=true,
urlcolor=black,
linkcolor=black,
runcolor=black,
allcolors=black}
\newcommand{\foothref}[2]{\href{#1}{#2}\tablefootnote{\mbox{\url{#1}}}}
\makeatletter
\newcommand{\spewfootnotes}{%
\tfn@tablefootnoteprintout%
\global\let\tfn@tablefootnoteprintout\relax%
\gdef\tfn@fnt{0}%
}
\makeatother
\makeatletter
\renewcommand\footnoterule{%
\kern-3\p@
\hrule\@width \textwidth
\kern2.6\p@}
\makeatother
%%%%%%% Commands for recipes %%%%%%%
% preceed recipe with \recipe{NAME} command
\newcommand{\recipe}[1]{%
\newpage\lhead{}\chead{#1}\rhead{}\lfoot{}\rfoot{}\section*{#1}}
% display how many servings it makes with \serves{NUMBER}
\newcommand{\serves}[1]{%
\chead{Serves #1}}
% options for different diets: \vegetarian, \vegan, \pescetarian, \noredmeat
\newcommand{\vegetarian}{%
\rhead{Vegetarian}}
\newcommand{\vegan}{%
\rhead{Vegan}}
\newcommand{\pescetarian}{%
\rhead{Pescetarian}}
\newcommand{\noredmeat}{%
\rhead{No Red Meat}}
% options for recipe type: \breakfast, \lunch, \dinner, \snack, \dessert, \side
\newcommand{\breakfast}{%
\lhead{Breakfast}}
\newcommand{\lunch}{%
\lhead{Lunch}}
\newcommand{\dinner}{%
\lhead{Dinner}}
\newcommand{\snack}{%
\lhead{Snack}}
\newcommand{\dessert}{%
\lhead{Dessert}}
\newcommand{\side}{%
\lhead{Side}}
% display only one of preptime or cooktime with \preptime{PREPTIME} or \cooktime{COOKTIME}
% display both preptime and cooktime with \prepcooktime{PREPTIME}{COOKTIME}
\newcommand{\preptime}[1]{%
\lfoot{Prep time: #1}}
\newcommand{\cooktime}[1]{%
\lfoot{Cook time: #1}}
\newcommand{\prepcooktime}[2]{%
\lfoot{Prep time: #1\\Cook time: #2}}
% start ingredients list with \ingredients or \ingredients[HEADER]
\newcommand{\ingredients}[1][\Large\emph{Ingredients}]{%
\emph{#1}\\}
% start instructions list with \instructions or \instructions[HEADER]
\newcommand{\instructions}[1][\Large\emph{Instructions}]{%
\emph{#1}\\}
% temperature in farenheit with \temp{TEMPERATURE}
\newcommand{\temp}[1]{%
$#1^\circ$F}
% sign recipe with \sign{NAME}{URL}
\newcommand{\sign}[2]{%
\rfoot{#1\\\emph{\href{#2}{#2}}\\}}
\endinput