-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
94 lines (78 loc) · 1.98 KB
/
main.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
\documentclass[twoside,symmetric,a4paper]{tufte-book}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{xifthen}
\usepackage{xcolor}
\usepackage{fontawesome}
\usepackage{microtype}
\usepackage{hyperref}
\newenvironment{loggentry}[2]% date, heading
{\noindent\textbf{#2}\marginnote{#1}\par}{\vspace{0.5cm}}
\newcommand{\book}[1]
{
\footnote{\faBook\enspace {#1}}
}
\newcommand{\music}[1]
{
\footnote{\faMusic\enspace {#1}}
}
\newcommand{\yt}[1]
{
\footnote{\faYoutube\enspace \href{https://www.youtube.com/watch?v=#1}{{#1}}}
}
\newcommand{\travel}[1]
{
\footnote{\faPlane\enspace {#1}}
}
\newcommand{\movie}[1]
{
\footnote{\faPlayCircle\enspace {#1}}
}
\def\?#1{}
\pgfmathtruncatemacro{\StartYear}{2020}
\pgfmathtruncatemacro{\EndYear}{2020}
\newcommand{\writetitle}{0}
\newcommand{\mytitle}[1]
{ \ifthenelse{\writetitle=1}{#1}{}
}
\newread\mysource
\begin{document}
\begingroup% T&H Typography
\raggedleft\vspace*{\baselineskip}
{\Large Author}\\[0.167\textheight]
{\bfseries Journaling}\\[\baselineskip]
{\textcolor{Red}{\Huge DEAR DIARY}}\\[\baselineskip]
\vfill
{\Large Do not read.}\par
\vspace*{3\baselineskip}
\endgroup
\foreach \Year in {\StartYear,...,\EndYear}
{
\chapter{\Year}
\foreach \Month in {Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}
{
\IfFileExists{\Year/\Month/entries}
{
\section{\Month}
\foreach \Day in {01,...,31}
{
\IfFileExists{\Year/\Month/\Day}
{
\openin\mysource=\Year/\Month/\Day.tex
\read\mysource to \firstline
\closein\mysource
\xdef\writetitle{1}
\begin{loggentry}{\Year\ - \Month\ - \Day}{\firstline}
\xdef\writetitle{0}
\input{\Year/\Month/\Day}
\end{loggentry}
}
{
}
}
}
{
}
}
}
\end{document}