Skip to content

Commit a2f0903

Browse files
committed
template overhaul, added a fukton of commands. Yes i do need to fix the code block macro
Signed-off-by: Ash Entwisle <[email protected]>
1 parent 5cf4e95 commit a2f0903

File tree

6 files changed

+62
-47
lines changed

6 files changed

+62
-47
lines changed

build.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
xelatex --shell-escape report.tex
2-
bibtex report.aux
32
xelatex --shell-escape report.tex
3+
bibtex report.aux
44
xelatex --shell-escape report.tex
55
xelatex --shell-escape report.tex

chapters/1-example-chapter.tex

+9-43
Original file line numberDiff line numberDiff line change
@@ -16,57 +16,24 @@ \subsection{C-Sharp Code Block}
1616
}
1717
}
1818
\end{minted}
19-
\caption{C-Sharp Code Block}
20-
\label{fig:CSharpCodeBlock}
19+
\macFC{CSharp Code Block}{cscb}
2120
\end{figure}
2221

22+
2323
\subsection{Python Code Block}
2424

2525
You can print to the python standard output using the \mintinline{python}|print| keyword.
2626

27-
\begin{figure}[ht]
28-
\centering
29-
\begin{lstlisting}[language=python]
30-
: print("Hello World!, this is listings instead of minted")
31-
\end{lstlisting}
32-
\caption{Python Code Block}
33-
\label{fig:PythonCodeBlock}
34-
\end{figure}
35-
36-
37-
\begin{figure}[ht]
38-
\centering
39-
\begin{Verbatim}
40-
print("this is as-is")
41-
\end{Verbatim}
42-
\caption{Mother Mother}
43-
\label{fig:berbatim}
44-
\end{figure}
45-
4627
\newpage
4728

4829

4930
\section{Maths}
5031

51-
\begin{figure}[ht]
52-
\centering
53-
\begin{math}
54-
E=mc^2
55-
\end{math}
56-
\caption{Einstein Formula}
57-
\label{fig:Emc2}
58-
59-
\end{figure}
60-
61-
\begin{figure}[ht]
62-
\centering
63-
\begin{math}
64-
\frac{1}{2}
65-
\end{math}
66-
\caption{Fraction}
67-
\label{fig:Fraction-1}
68-
69-
\end{figure}
32+
\macMath{
33+
E = mc^2
34+
}
35+
{Einstein Formula}
36+
{emc2}
7037

7138
\subsection{this is a subsection}
7239

@@ -77,7 +44,7 @@ \subsection{another subection with a table in it}
7744

7845
\begin{table}[h!]
7946
\centering
80-
\begin{tabular}{||c c c c||}
47+
\begin{tabular}{||c|c|c|c||}
8148
\hline
8249
Col1 & Col2 & Col2 & Col3 \\ [0.5ex]
8350
\hline\hline
@@ -88,8 +55,7 @@ \subsection{another subection with a table in it}
8855
5 & 88 & 788 & 6344 \\ [1ex]
8956
\hline
9057
\end{tabular}
91-
\caption{Table to test captions and labels.}
92-
\label{table:1}
58+
\macFC{Table to test captions and labels.}{table:example}
9359
\end{table}
9460

9561
\newpage

config/commands.tex

+46-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,46 @@
1-
\newcommand{\bib}{\bibliographystyle{config/hull}\bibliography{ref.bib}}
1+
\newcommand{\bib}{
2+
\bibliographystyle{config/hull}
3+
\bibliography{ref.bib}
4+
}
5+
6+
\newcommand{\macFC}[2]{
7+
\caption{#1}
8+
\label{#2}
9+
}
10+
11+
\newcommand{\macMath}[3]{
12+
\begin{figure}[ht]
13+
\centering
14+
\begin{math}
15+
#1
16+
\end{math}
17+
\caption{#2}
18+
\label{fig:#3}
19+
\end{figure}
20+
}
21+
22+
% may be borked
23+
\newcommand{\macCode}[4]{
24+
\begin{figure}[ht]
25+
#2
26+
\macFC{#3}{#4}
27+
\end{figure}
28+
}
29+
30+
\newcommand{\macImg}[3]{
31+
\begin{figure}[ht]
32+
\centering
33+
\includegraphics[width=\textwidth]{#1}
34+
\macFC{#2}{#3}
35+
\end{figure}
36+
}
37+
38+
\newcommand{\macVerb}[3]{
39+
\begin{figure}[ht]
40+
\centering
41+
\begin{Verbatim}
42+
#1
43+
\end{Verbatim}
44+
\macfc{#2}{#3}
45+
\end{figure}
46+
}

config/titlepage.tex

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
\Large\bfseries{\reportModNumber : \reportModName}
44
}
55
\author{
6-
\reportAuthors
6+
\reportAuthors \\
7+
}
8+
\date{
9+
Word Count: \reportWordCount \\
10+
\reportDate
711
}
8-
\date{\reportDate}
912

1013
\newcommand{\buildtitle}{\maketitle\normalsize}
1114
\newcommand{\authorNameNo}[2]{#1 \textit{(#2)} \\}

report.pdf

-716 Bytes
Binary file not shown.

report.tex

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
\newcommand{\reportModNumber}{Module\_Number}
66
\newcommand{\reportModName}{Module Name}
77
\newcommand{\reportDate}{Date/Due/In}
8+
\newcommand{\reportWordCount}{XXXX}
89
\newcommand{\reportAuthors} {
910
\authorNameNo{1st Author}{author no.}
1011
\authorName{2nd Author}

0 commit comments

Comments
 (0)