diff --git a/Assignment-Template/AssignmentTemplate2.tex b/Assignment-Template/AssignmentTemplate2.tex index e38e43c..99d8d6b 100644 --- a/Assignment-Template/AssignmentTemplate2.tex +++ b/Assignment-Template/AssignmentTemplate2.tex @@ -43,94 +43,4 @@ Answer \end{enumerate} -\end{document} - - - - - -%%--------------------- COMMAND USAGE ---------------------%% -%% FIGURES -% Normal figure: -% \fig{scale 1=100%}{filename}{caption \label{labelname}} (label optional) - -% Figure with frame: -% \framefig{scale}{file}{caption \label{labelname}} - -% Insert sub-figures (within a \begin{figure}[H] \end{figure} pair) -%\subfig{alignment}{fig-width}{img-scale/height/width}{filename}{caption} -% alignment = t(top) / b(bottom) -% width e.g. = 0.5\textwidth -% scale e.g. = scale=0.5 / height=5cm / width=3in -% filename e.g. = image / image.jpg / etc -% caption e.g. = Descriptive subfigure caption - -%% COMMENTS -% Insert multi-line comments with \comment{} -% Insert displayed multi-line comments using \dcom{} - -%% QUESTIONS -% Question syntax: -% % QN -% \que {Question summary/details} -% Question response. - -%% CODE -% Insert formatted Matlab file (\matlab{filename}{label}) -% Insert formatted Python file (\python{filename}{label}) - -%% REFERENCING -% Reference figures (\figref{label}) -% Reference subfigures (\sfigref{label}) -% Reference tables (\tabref{label}) -% Reference code (\coderef{label}) -% Reference sections (\secref{label}) -% Reference appendices (\appref{label}) - -%% MATHS NOTATIONS -% Align (multiline) maths environment: -% \begin{align} --> \end{align} -% use \\ for newline, & for alignment character - -% Inline maths environment: -% $ --> $ - -% Insert units with \unit{} (e.g. \unit{m}^3) -% Units without a space before are \nsunit{} - -% Insert *10^n with \E{n} (e.g. \E{-5}) -% To use inline in normal text mode, use \tE{n} - -% Command for math formatted differentials (\D x) - -% Command for short bolded vector notation (\ve{x}) - -% Commands for left/right surrounding braces -% \lr{thing} % -> \left( thing \right), -% \lrs{thing} %-> \left[ thing \right], -% \lra{thing} %-> \left | thing \right | - -% Commands for integrals -% \eint{integrand}{wrt var} -% \eiint{integrand}{wrt var inner}{wrt var outer} -% \dint{lower limit}{upper limit}{integrand}{wrt var} -% \diint{outer_low}{out_high}{inner_low}{in_high}{integrand}{in_var}{out_var} - -% Command for partial derivatives (\del{y}{t}) - -% Command for full derivatives, nth order (\der[2]{y}{t} or \der{y}{x}) -% 'order' is optional, hence square brackets - -% Command for trigonometric functions, nth power -% (e.g. \cos[2]{x} or \sin{4} or \tan[-1]{y}) -% 'power' is optional - -% Command for logarithms, base n (e.g. \log[2]{x} or \log{y}) -% 'base' is optional - -% Command for quadratic formula (\qf{a}{b}{c}) - -% Command for 2x2 eigenvalues working (\evals{X}{x11}{x21}{x12}{x22}) - -% Command for 2x2 eigenvectors working -% (\evecs{X}{\ve{v}}{v1}{v2}{x11}{x21}{x12}{x22}) \ No newline at end of file +\end{document} \ No newline at end of file diff --git a/CommonSetup2.tex b/CommonSetup2.tex index 6e86388..e989889 100644 --- a/CommonSetup2.tex +++ b/CommonSetup2.tex @@ -122,7 +122,7 @@ } % Insert sub-figures (within a multifig) -% \subfig[img-scale/height/width][alignment]{fig-width}{filename}{caption} +% \subfig[img-scale/height/width]{alignment}{fig-width}{filename}{caption} % alignment: applies to within the figure (normally want t (top)) % % auto-labelling labels by the filename, reference with \sfigref{filename} or @@ -244,33 +244,48 @@ \end{center} } -% use as \python{filename}{caption} -\newcommand{\python}[2]{ - \codeCaption[#1]{#2} - \lstinputlisting[ - language=Python, - numbers=left, - numberstyle=\color{lightgrey}\small, - numbersep=8pt, - basicstyle=\ttm, - basewidth={.48em}, % Inter-letter spacing - otherkeywords={self,cls}, % Custom keywords - keywordstyle=\ttb\color{deepblue}, % Keywords style - emph={__init__,__call__,__eq__,__str__,__repr__}, % Custom highlighting - emphstyle=\ttb\color{deepred}, % Highlighting style - stringstyle=\color{deepgreen}, - commentstyle=\color{deepred}, - frame=single, - showstringspaces=false, - breaklines=true - ]{#1} +\lstdefinestyle{python-IDLE}{ + language=Python, + numbers=left, + numberstyle=\color{lightgrey}\small, + numbersep=8pt, + basicstyle=\ttm, + basewidth={.48em}, % Inter-letter spacing + otherkeywords={self,cls}, % Custom keywords + keywordstyle=\ttb\color{deepblue}, % Keywords style + emph={__init__,__call__,__eq__,__str__,__repr__}, % Custom highlighting + emphstyle=\ttb\color{deepred}, % Highlighting style + stringstyle=\color{deepgreen}, + commentstyle=\color{deepred}, + frame=single, + showstringspaces=false, + breaklines=true } -% use as \matlab{filename}{caption} -\newcommand{\matlab}[2]{ - \codeCaption[#1]{#2} - \lstset{style=Matlab-editor} - \lstinputlisting{#1} +\lstset{basicstyle=\ttfamily, basewidth={0.48em}} + +% \intextCode[options]{caption}{code} +\newcommand{\intextCode}[3][]{ + \codeCaption{#2} + \begin{lstlisting}[#1] +#3 + \end{lstlisting} +} + +% \inputCode[options]{filename}{caption} +\newcommand{\inputCode}[3][]{ + \codeCaption[#2]{#3} + \lstinputlisting[#1]{#2} +} + +% use as \python[options]{filename}{caption} +\newcommand{\python}[3][]{ + \inputCode[style=python-IDLE, #1]{#2}{#3} +} + +% use as \matlab[options]{filename}{caption} +\newcommand{\matlab}[3][]{ + \inputCode[style=Matlab-editor, #1]{#2}{#3} } %-----------------REFERENCING------------------% @@ -299,7 +314,7 @@ \newcommand{\D}{\,\mathrm{d}} % Command for degrees symbol -\renewcommand{\deg}[1]{{#1}^\circ} +\renewcommand{\deg}[1][]{{}^\circ\nsunit{#1}} % Command for short bolded vector notation \newcommand{\ve}[1]{\mathbf{#1}} diff --git a/Minutes-Template/MinutesTemplate2.tex b/Minutes-Template/MinutesTemplate2.tex index 4c87e71..7311b5f 100644 --- a/Minutes-Template/MinutesTemplate2.tex +++ b/Minutes-Template/MinutesTemplate2.tex @@ -77,181 +77,4 @@ \end{itemize} -\end{document} - - - - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -------------------- COMMAND USAGE ---------------------- % - -\comment{%% - %% MINIPAGES - \begin{minipage}{0.4\linewidth} - % minipages have their own size within the main page, as well as their - % own footnotes and other specified geometry/text features. - \end{minipage} - - %% LISTS - % removes space before list - \vspace{-0.7\topsep} - \begin{itemize} - \item Main - \begin{itemize} - \item[o] Sub - \end{itemize} - \end{itemize} - - %% FOOTNOTES - % Sets the footnotetext with the key of the contents of the square - % brackets (used when creating footnotes in minipages) - \footnotetext[1]{Text in footnote} - % in the main page standard footnotes can be created using - % \footnote{•} - \footnote{Text in footnote} - - %% PAGENUMBERING - \pagenumbering{roman} % Roman numerals (contents, cover page) - \pagenumbering{arabic} % Arabic numerals (body, appendices) - - %% COLUMNS - % Sets two columns for this section of the document - \begin{multicols}{2} - - \columnbreak % this breaks to the next column - - \end{multicols} - - %% TABLES - \begin{table}[H] - \footnotesize % sets text size to that of footnotes, within table - \centering % centers table on screen - \caption{Table Caption} - \label{tab: Table Caption} - % Using p{n\linewidth} sets that column to justified, with width n times - % text-width of the line. - % Using c sets that column to be centered, with width auto-scaled. - % Vertical line sets that column to have a vertical border there - % Space separates columns without a border. - \begin{tabular}{|c|c|p{0.5\linewidth}|} - \hline % adds a horizontal line - \rowcolor{tableHeadColour} - \textbf{Heading1} & \textbf{Heading2} & - \textbf{Heading3} \\ %\\ changes to next row of table - \hline - \textbf{Side Heading} & Text & Text\\ - \hline - \end{tabular} - \end{table} - - %% CODE - % the following code allows for displaying programming code, telling - % LaTeX to just print the contents rather than try to read it as LaTeX - % text. - \begin{lstlisting} - /** Code goes in here */ - \end{lstlisting} - - %% PAGE RESIZING/ROTATING - \setafport % Make the following pages A4 portrait - \setafland % Make the following pages A4 landscape - \setatport % Make the following pages A3 landscape - \setatland % Make the following pages A3 landscape - - %% FIGURES - % Insert figures with - \fig{scale}{filename}{caption \label{fig: