Professional Documents
Culture Documents
https://github.com/SFr682k/mensa-tex
Sebastian Friedl
sfr682k@t-online.de
2017/12/03
Abstract
A LATEX class for typesetting school cafeteria menus consisting of two lunches (with
dessert) and dinner
Contents
Dependencies and other requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Call for cooperation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Creating a menu 3
2.1 Setting up the basic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Adding food . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Adding additional information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.1 Remarks at the bottom of the page . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.2 Remarks for additive ingredients . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.3 Symbols for vegetarian and vegan food . . . . . . . . . . . . . . . . . . . . 5
2.4 Using fancy colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4.1 Changing colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4.2 A short note about color selection . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4.3 Using class–defined colors in normal text . . . . . . . . . . . . . . . . . . . 5
4 A working example 9
Dependencies and other requirements
The mensa-tex class requires LATEX 2" and the following packages:
License
© 2017 Sebastian Friedl
This work may be distributed and/or modified under the conditions of the LATEX Project Public
License, either version 1.3c of this license or (at your option) any later version.
The latest version of this license is available at http://www.latex-project.org/lppl.txt
and version 1.3c or later is part of all distributions of LATEX version 2008-05-04 or later.
This work has the LPPL maintenance status ‘maintained’. The current maintainer of this work is
Sebastian Friedl.
This work consists of the following files:
• mensa-tex.cls,
• mensa-tex-doc.tex and
• mensa-tex-example.tex
2
1 Using the \documentclass command
Using this class is as easy as using the \documentclass{mensa-tex} command.
app Use a layout optimized for small screens using DIN/ISO A6 paper
2 Creating a menu
This section deals with creating a menu using mensa-tex.
All the commands described in this section are to be used inside the preamble since the
menu gets created instantly when using \begin{document}.
3
2.2 Adding food
For adding information about the food, the commands described in this subsection are
provided.
\startdate This commands defines the “start date”, the date of the first entry (the start date’s weekday
mostly happens to be a Monday). The start date has to be present in YYYY-MM-DD format,
e. g. \startdate{2007-01-01} (Default is 2001-01-01).
\monday Use these five commands to insert food into the empty diet.
\tuesday Every single command requires the same four arguments:
\wednesday
\thursday 1. Menu I 2. Menu II 3. Dessert 4. Dinner
\friday
For example, to obtain Monday’s menu consisting of
4
\sup This command is a shortcut providing access to the \textsuperscript command.
It can be used to produce a superscript 4 with \sup{4}.
5
en-GB en-US german
\menuname Menu Menü
\dessertname Dessert Dessert
\dinnername Dinner Abendessen
\dietname Weekly menu Speiseplan vom
\shortdate 18/09/17 09/18/17 18.09.
\dowshortdate Monday, 18/09/17 Monday, 09/18/17 Montag, 18.09.17
\longdate 18/09/2017 09/18/2017 18.09.2017
\daterange 18/09/17 – 22/09/17 09/18/17 – 09/22/17 18.09. – 22.09.2017
6
Sunday%
\fi
}
3.2 Keywords
There are four keywords stored in separate commands.
To modify them, copy the code printed below into your preamble and replace the English
words by vocabulary appropriate for your localization.
\def\menuname{Menu}
\def\dessertname{Dessert}
\def\dinnername{Dinner}
\def\dietname{Weekly menu}
• \shortdate
The short form of the date (e. g. 10/11)
• \dowshortdate
The short form of the date, including the weekday (e. g. Sat., 10/11)
• \longdate
The long form of the date (e. g. 10/11/2012)
7
• \daterange
A range between two dates (e. g. 10/11–14/11/2012)
When redefining these commands, you have to assemble the templates available for day,
month and year in an order matching the localization.
Date templates
DD \DTMtwodigits{\DTMfetchday{#1}}
Prints the day using two digits
If the day consists of only one digit, a zero is inserted (e. g. 01 instead of 1)
D \DTMfetchday{#1}
Prints the day using one or two digits
Month templates
MM \DTMtwodigits{\DTMfetchmonth{#1}}
Prints the month using two digits
M \DTMfetchmonth{#1}
Prints the month using one or two digits
Year templates
YYYY \DTMfetchyear{#1}
Prints the year using as many digits as required
YY \DTMtwodigits{\DTMfetchyear{#1}}
Prints the year using two digits
8
\DTMfetchyear{#1}% The YYYY template
-% Year/month separator
\DTMtwodigits{\DTMfetchmonth{#1}}% The MM template
-% Month/day separator
\DTMtwodigits{\DTMfetchday{#1}}% The DD template
}
The same principle applies to redefinitions of \shortdate and \dowshortdate.
The %s avoid spaces after templates and separators when inserting line breaks.
If you have already redefined \shortdate and \longdate, you may reuse these defini-
tions when redefining \dowshortdate, for example:
\renewcommand{\dowshortdate}[1]{%
\wdayname{#1}% Insert the weekday
,~% Weekday/day seperator (~ = space)
\shortdate{#1}% Use the short date template
}
For example, a working redefinition of \daterange can be achieved with this code:
\renewcommand{\daterange}[2]{% <-- »[2]« instead of »[1]«!!
\shortdate{#1}% Start date
\,--\,% Seperator: -- with spaces
\shortdate{#2}% End date: #2 inst. of #1
}
4 A working example
\documentclass[en-US]{mensa-tex}
\usepackage[american]{babel}
\usepackage[utf8]{inputenc}
\setbgcolor{blue}
\setcolorfg{white}
\setctextcolor{red}
\setimage{\includegraphics[height=.125\textheight]{cafe-logo}}
9
\startdate{2017-09-18}
\wednesday{-/-}{-/-}{-/-}{-/-}
\thursday{Buffalo Wings}%
{Vegetarian Eggrolls \linebreak\vgt}%
{Sacher Cake}%
{Chicken Tortilla}
\friday{Pastrami Melt}%
{Grilled Cheese \linebreak\vgt}%
{Tiramisu}%
{Salmon Burger}
\longremarks{%
{\color{\ctextcolor}
Due to a training course of our staff, the café is closed
on Wednesday, 09/20/17.}
\medskip
In our efforts to sustain a seasonal menu, sometimes
substitutions may be required, and menu items may change
without notice.
\bigskip
\textbf{Key:} \quad
\vgt: vegetarian \quad
\vgn: vegan \quad
\sup{1)}: spicy
}
\begin{document}
\end{document}
10
Output:
Café
Weekly menu
09/18/17 – 09/22/17
Sesame Noodles
Tue Philly Cheese Steak1) Donuts Orzo Pasta
ll
Due to a training course of our staff, the café is closed on Wednesday, 09/20/17.
In our efforts to sustain a seasonal menu, sometimes substitutions may be required, and menu items may
change without notice.
11