From 30e223be30ac74b2dd030ec888f906263a3f99c1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 24 Sep 2019 20:07:21 +0000 Subject: practicalreports (24sep19) git-svn-id: svn://tug.org/texlive/trunk@52173 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/practicalreports/practicalreports.sty | 161 +++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/practicalreports/practicalreports.sty (limited to 'Master/texmf-dist/tex/latex/practicalreports') diff --git a/Master/texmf-dist/tex/latex/practicalreports/practicalreports.sty b/Master/texmf-dist/tex/latex/practicalreports/practicalreports.sty new file mode 100644 index 00000000000..3f812596219 --- /dev/null +++ b/Master/texmf-dist/tex/latex/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 -- cgit v1.2.3