summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/practicalreports/practicalreports.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-25 03:00:48 +0000
committerNorbert Preining <norbert@preining.info>2019-09-25 03:00:48 +0000
commitd232e1107d60e7689e706bee9705f26745ae8b9e (patch)
treef9ac3303fdb36c2eca1872286615c0931d952476 /macros/latex/contrib/practicalreports/practicalreports.sty
parent94c2e367c3690be2a3c715b4577c81200652ad81 (diff)
CTAN sync 201909250300
Diffstat (limited to 'macros/latex/contrib/practicalreports/practicalreports.sty')
-rw-r--r--macros/latex/contrib/practicalreports/practicalreports.sty161
1 files changed, 161 insertions, 0 deletions
diff --git a/macros/latex/contrib/practicalreports/practicalreports.sty b/macros/latex/contrib/practicalreports/practicalreports.sty
new file mode 100644
index 0000000000..3f81259621
--- /dev/null
+++ b/macros/latex/contrib/practicalreports/practicalreports.sty
@@ -0,0 +1,161 @@
+%%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}}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+} \ No newline at end of file