%%Author: Justin Cawood %%License: LPPL 1.3c \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{practicalreports}[25/09/2019 v2.0.0 Practical Report Package] \RequirePackage{mathtools, array, longtable, scrextend, float, fancyhdr, lastpage} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\shift}[2]{ \begin{addmargin}[#1cm]{0cm} \begin{minipage}{\textwidth} #2 \end{minipage} \end{addmargin} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Create a new title page %\newtitlepage{Title}{Author}{Date} \newcommand*{\newtitlepage}[3]{ \begin{titlepage} \vspace*{\fill} \begin{center} {\Huge #1}\\[0.5cm] {\Large #2}\\[0.4cm] {\small #3} \end{center} \vspace*{\fill} \end{titlepage} } %Add a new figure \newcommand*{\newfigure}[4]{ \begin{figure}[H] \centering \textbf{#1} \par\medskip \center{\includegraphics[width=\textwidth] {#3}} \caption{#2} \label{fig:#4} \end{figure} } %Add a new scalable figure \newcommand*{\newsfigure}[5]{ \begin{figure}[H] \centering \textbf{#1} \par\medskip \center{\includegraphics[scale=#5] {#3}} \caption{#2} \label{fig:#4} \end{figure} } %Reference a labeled figure \newcommand*{\reffigure}[1]{Figure~\ref{fig:#1}} %Create a table %\newtable{Caption} %{Columns and Alignment} %{Column Headings} %{Table Data} \newcommand*{\newtable}[5]{ \begin{table}[H] \begin{center} \caption{#1} \vspace*{5mm} \begin{tabular}{#2} \hline #3\\ \hline #4\\ \hline \end{tabular} \label{table:#5} \end{center} \end{table} } %Create a long table %\newlongtable{Caption} %{Columns and Alignment} %{Column Headings} %{Table Data} \newcommand{\newlongtable}[5]{ \begin{center} \begin{longtable}{#2} \label{table:#5} \\ \caption{#1} \\ \hline #3 \\ \hline \endfirsthead \caption{\textit{Continued}} \\ \hline #3 \\ \hline \endhead \hline\\ \endfoot \hline \endlastfoot #4 \end{longtable} \end{center} } %Reference a labeled table \newcommand*{\reftable}[1]{Table~\ref{table:#1}} %Box and solotion or multiple lines of solutions \newcommand*{\boxanswer}[1]{ \begin{equation*} \addtolength{\fboxsep}{5pt} \boxed{ \begin{gathered} #1 \end{gathered} } \end{equation*}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Multipleys a number by 10^{user input} \newcommand*{\E}[1]{$\times10^{#1}$} %Multipleys a number by 10^{user input} \newcommand*{\e}[1]{\times10^{#1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\setpagefancy}{ \pagestyle{fancy} \fancyhf{} } %Add a header to all pages \newcommand*{\header}[3]{ \lhead{#1} \chead{#2} \rhead{#3} } %Add a footer to all pages \newcommand*{\footer}[3]{ \lfoot{#1} \cfoot{#2} \rfoot{#3} } %Add a footer to all pages \newcommand*{\goodfoot}{ \cfoot{Page \thepage \ of \pageref{LastPage}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% }