How can I make the following daily schedule in LaTeX?
1 Answer
One way to do this is to:
- use a
tablular
to create the vertical numerical data, - use
collcell
to apply a\tikzmark
to each row of the table, - use
tikz
to insert the brace and text based on row numbers.
Notes:
- The data can be be allowed to auto wrap, or manually wrapped as in the brown text.
- You can change the alignment of the text via the
align=
options as shown in the blue, orange, and violet text.
Code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.pathreplacing}
\usepackage{collcell}
\newcolumntype{R}{>{\collectcell\NewRowData}{r}<{\endcollectcell}}
\newcounter{RowCount}
\newcommand*{\NewRowData}[1]{%
\stepcounter{RowCount}%
\tikzmark{Left Mark of Row \arabic{RowCount}}%
\makebox[1.0em]{#1}%
\tikzmark{Right Mark of Row \arabic{RowCount}}%
}%
\newcommand{\tikzmark}[1]{%
\tikz[overlay,remember picture,baseline] \node [anchor=base] (#1) {};}
\newcommand*{\LeftTextWidth}{6.0cm}
\newcommand*{\RightTextWidth}{6.0cm}
\newcommand\LeftBrace[4][]{%
\begin{tikzpicture}[overlay,remember picture,baseline]
\draw[decorate,decoration={brace,raise=6pt, amplitude=1.0ex, mirror}, ultra thick, #1]
([yshift=3pt]Left Mark of #2.north east)
-- node[xshift=-10pt, align=left, text width=\LeftTextWidth, anchor=east, #1]
{#4}
([yshift=3pt]Left Mark of #3.south east);
\end{tikzpicture}
}
\newcommand\RightBrace[4][]{%
\begin{tikzpicture}[overlay,remember picture,baseline]
\draw[decorate,decoration={brace,raise=6pt, amplitude=1.0ex}, ultra thick, #1]
([xshift=2pt, yshift=3pt]Left Mark of #2.north east)
-- node[xshift=10pt, align=left, text width=\LeftTextWidth, anchor=west, #1]
{#4}
([xshift=2pt, yshift=3pt]Left Mark of #3.south east);
\end{tikzpicture}
}
\begin{document}
{\centering%
\begin{tabular}{R}
5 \\
6 \\
\\
7 \\
\\
8 \\
9 \\
10 \\
11 \\
12 \\
1 \\
2 \\
3 \\
4 \\
5 \\
6 \\
7 \\
8 \\
9 \\
10 \\
11 \\
12 \\
1 \\
2 \\
3 \\
4 \\
\end{tabular}
\par}
\LeftBrace[red]{Row 1}{Row 5}{%
Rise, wash, and address \emph{Powerful Goodness! Contrive day's business},
and take the resolution of the day;%
}
\RightBrace[brown]{Row 1}{Row 5}{%
The Morning. \\
Question: What good shall I do \\
this day?%
}
\RightBrace[magenta]{Row 6}{Row 9}{Work.}
\RightBrace[violet]{Row 10}{Row 11}{Read, or overlook my accounts, and dine.}
\LeftBrace[blue, align=center]{Row 10}{Row 11}{NOON.}
\RightBrace[olive]{Row 12}{Row 15}{Work.}
\LeftBrace[orange, align=center]{Row 16}{Row 19}{%
Evening \\
\emph{Question}: What good have I done \\
today?%
}
\RightBrace[purple]{Row 16}{Row 19}{%
Put things in their places. Supper.
Music or diversion, or conversation/
Examination of the day.
}
\LeftBrace[violet, align=center]{Row 20}{Row 26}{NIGHT.}
\RightBrace[red]{Row 20}{Row 26}{Sleep.}
\end{document}