-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.py
110 lines (90 loc) · 2.16 KB
/
template.py
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
106
107
108
109
110
preamble = r'''
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{ragged2e}
\usepackage{longtable}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{rotating}
\usepackage{listings}
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{frame=tb,
language=Java,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\small\ttfamily},
numbers=none,
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=4
}
\setcounter{secnumdepth}{1}
%\newgeometry{vmargin={20mm}, hmargin={12mm,17mm}}
%\makeatletter
%\renewcommand{\thefigure}{\thesection .\@arabic\c@figure}
%\makeatother
\usepackage{chngcntr}
\counterwithin{figure}{section}
\renewcommand*{\thepage}{C\arabic{page}}
%header
\pagestyle{fancy}
\lhead{ACME Robotics}
\chead{\#8367}
\rhead{\ifcontents Contents \else Week \thesection \fi}
%get rid of section numbering
\makeatletter
% \@seccntformat is the command that adds the number to section titles
% we make it a no-op
\renewcommand{\@seccntformat}[1]{}
\makeatother
%fix table padding
\renewcommand{\arraystretch}{1.5}
\newif\ifcontents
\contentstrue
'''
weekBegin = r'''
\newpage
\section{Week \thesection\ note}
'''
tableBeginTemplate = r'''
\subsection{title}
\begin{center}
\begin{flushleft}
\begin{longtable}{ | p{.2\textwidth} | p{.3\textwidth} | p{.4\textwidth} |}
\hline
Goal & Description & Outcome \\ \hline
'''
tableRowTemplate = r'''
goal & description & outcome \\ \hline
'''
tableEnd = r'''
\end{longtable}
\end{flushleft}
\end{center}
'''
goalBeginTemplate = r'''
\subsection{goal}
'''
figureTemplate = r'''\begin{figure} \centering
\includegraphics[width=10cm,height=10cm,keepaspectratio]{path}
\caption{captionr}
\label{fig:name}
\end{figure}'''
eqTemplate = r'\begin{equation} value \label{eq:name} \end{equation}'
scheduleTemplate = r'''
\begin{sidewaysfigure}
\includegraphics[width=\textheight]{file}
\end{sidewaysfigure}
'''