-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjournal.tex
50 lines (39 loc) · 1.25 KB
/
journal.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
\documentclass{tufte-book}
%\documentclass{article}
%\usepackage{lipsum}
\usepackage{tikz}
\usepackage{xifthen}
\usepackage{xeCJK}
\setCJKmainfont{Microsoft JhengHei}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\newenvironment{loggentry}[2]% date, heading
{\noindent\textbf{#2}\marginnote{#1}\par}{\vspace{0.5cm}}
\def\?#1{}
\pgfmathtruncatemacro{\StartYear}{2014}
\pgfmathtruncatemacro{\EndYear}{2024}
\newcommand{\writetitle}{0}
\newcommand{\mytitle}[1]
{ \ifthenelse{\writetitle=1}{#1}{}
}
\newread\mysource
\begin{document}
\foreach \Year in {\StartYear,...,\EndYear}
{ \foreach \Month in {Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}
{ \foreach \Day in {1,...,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}
}
{ % files does not exist, so nothing to do
}
}
}
}
\end{document}