summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/practicalreports
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
parent94c2e367c3690be2a3c715b4577c81200652ad81 (diff)
CTAN sync 201909250300
Diffstat (limited to 'macros/latex/contrib/practicalreports')
-rw-r--r--macros/latex/contrib/practicalreports/README18
-rw-r--r--macros/latex/contrib/practicalreports/practicalreports.pdfbin0 -> 179978 bytes
-rw-r--r--macros/latex/contrib/practicalreports/practicalreports.sty161
-rw-r--r--macros/latex/contrib/practicalreports/practicalreports.tex325
4 files changed, 504 insertions, 0 deletions
diff --git a/macros/latex/contrib/practicalreports/README b/macros/latex/contrib/practicalreports/README
new file mode 100644
index 0000000000..24a20b25aa
--- /dev/null
+++ b/macros/latex/contrib/practicalreports/README
@@ -0,0 +1,18 @@
+%% practicalreports.zip
+%% Copyright 2019 J. Cawood
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is J. Cawood.
+%
+
+
+This package provides a handful of macros for writing up science practical reports. \ No newline at end of file
diff --git a/macros/latex/contrib/practicalreports/practicalreports.pdf b/macros/latex/contrib/practicalreports/practicalreports.pdf
new file mode 100644
index 0000000000..3846092595
--- /dev/null
+++ b/macros/latex/contrib/practicalreports/practicalreports.pdf
Binary files differ
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
diff --git a/macros/latex/contrib/practicalreports/practicalreports.tex b/macros/latex/contrib/practicalreports/practicalreports.tex
new file mode 100644
index 0000000000..7b6e2e811e
--- /dev/null
+++ b/macros/latex/contrib/practicalreports/practicalreports.tex
@@ -0,0 +1,325 @@
+\documentclass[12pt]{article}
+
+\usepackage[right=1in, top=1in, left=1in, bottom=1in]{geometry}
+\usepackage{amssymb,amsmath, mathtools}
+
+\usepackage[parfill]{parskip}
+
+\usepackage{practicalreports}
+
+
+\begin{document}
+
+\begin{titlepage}
+\vspace*{\fill}
+\begin{center}
+{\Huge Practical Reports Documentation}\\[0.5cm]
+{\Large Version: 2.0.0}\\[0.4cm]
+{\Large Date: $25^{th}$ of September 2019}\\[0.2cm]
+{\small Author: Justin Cawood}
+\end{center}
+\vspace*{\fill}
+\end{titlepage}
+
+\tableofcontents
+\newpage
+
+\section{Practical Reports Package}
+This package provides macros for displaying scientific notation, simple title pages, tables, figures, headers footers.
+
+\section{Importing the Package}
+Import the package by typing $\backslash$usepackage\{practicalreports\} at the top of the tex file.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Exponent Macro}
+This macro is much quicker and easier than the rest of the scientific notation macros in this package.
+
+\subsection{How to use it}
+To use this macro simply type "\textbf{value} $\backslash$E\{Power\} \textbf{units}". eg. 2.997 $\backslash$E\{8\} m\$s\^\ \{-1\}\$ This will output 2.997\E{8} m$s^{-1}$. The \textbf{value} and \textbf{units} are not required, so the macro can be also used like this, $\backslash$E\{8\}, this will output \E{8}.
+
+\subsection{Useful tricks}
+\textbf{\!\!\! If you are already in math mode use $\backslash$e instead\!\!\! }
+
+If the power/exponent being use in the scientific notation is only 1 number or character, there is no need for the curly brackets \{\}. It is much quicker to simply type $\backslash$E8 than to type $\backslash$E\{8\}. They both output the same result \E8. However this wont work for powers with more than one number or character eq. $\backslash$E88 will output \E88. Instead this will have to be written as $\backslash$E\{88\}, this will output \E{88}.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Setting the page to fancy}
+Before any headers or footers can be used the pages need to be set to fancy. This can be done by typing $\backslash$setpagefancy just below the import statements but not inside the $\backslash$begin\{document\} $\backslash$end\{document\}. Once the page is set to fancy the page numbering will go away, this can be added back in with the macros from this package. Before the page is set to fancy is shown in \reffigure{normal_page} and after the page is set to fancy is shown in \reffigure{fancy_page}
+
+\newfigure{Normal Page}{Normal page}{normal_page.png}{normal_page}
+
+\newfigure{Setting the page to fancy}{Output of the macro $\backslash$setpagefancy}{fancy_page.png}{fancy_page}
+
+\subsection{Headers}
+To add a header use the macro $\backslash$header\{left header\}\{center header\}\{right header\}. An example is shown in below and in \reffigure{fancy_header}.
+
+$\backslash$header\{left header\}\{center header\}\{right header\} this will display
+
+\newfigure{Adding a fancy header}{Output of the macro $\backslash$header\{left header\}\{center header\}\{right header\}}{fancy_header.png}{fancy_header}
+
+\subsection{Footers}
+To add a footer use the macro $\backslash$footer\{left footer\}\{center footer\}\{right footer\}. An example is shown below and in \reffigure{fancy_footer}.
+
+$\backslash$footer\{left footer\}\{center footer\}\{right footer\} this will display
+
+\newfigure{Adding a fancy footer}{Output of the macro $\backslash$footer\{left footer\}\{center footer\}\{right footer\}}{fancy_footer.png}{fancy_footer}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Title Page}
+To create a title page, at the beginning of the document after the $\backslash$begin\{document\} type $\backslash$newtitlepage\{Title\}\{Author\}\{Date\}
+An example is shown below and the result is shown in \reffigure{new-title-page}
+
+
+\newfigure{New title page}{Result of $\backslash$newtitlepage\{Title\}\{Author\}\{Date\}}{new_title_page.png}{new-title-page}
+
+\section{Figures}
+These macros can include figures and reference them in a tex file.
+
+\subsection{Including a Figure}
+To include a figure type $\backslash$newfigure\{Caption\}\{Description\}\{file\_ name.jpg\}\{reference\}.\\ \LaTeX \ accepts the file types pdf, jpg and png for figures. \reffigure{example-figure} is an example of using this macro.
+
+\newfigure{Example Figure}{Result of using $\backslash$newfigure\{Caption\}\{Description\}\{file name\}\{reference\}}{example_figure.jpeg}{example-figure}
+
+\subsection*{Scaling Figures}
+This macro allows you to shrink figures that are two large or expand figures that are too small.
+The macro is in the form
+
+$\backslash$newsfigure\{Caption\}\{Description\}\{file\_ name.jpg\}\{reference\}\{scale factor\}
+
+\subsubsection{Shrink Example}
+\reffigure{example-shrink-figure}, shows an example of decreasing the size of a figure.
+
+\newsfigure{Example Figure}{Result of using $\backslash$newfigure\{Caption\}\{Description\}\{file name\}\{reference\}\{0.4\}}{example_figure.jpeg}{example-shrink-figure}{0.4}
+
+\subsubsection{Expand Example}
+\reffigure{example-expand-figure}, shows an example of increasing the size of a figure.
+
+\newsfigure{Example Figure}{Result of using $\backslash$newfigure\{Caption\}\{Description\}\{file name\}\{reference\}\{1.6\}}{example_figure.jpeg}{example-expand-figure}{1.6}
+
+\subsection{Referencing a Figure}
+This macro allows figures to be referenced by simply typing $\backslash$reffigure\{reference\}. If a figure is ever added or removed, this macro will take care of the numbering so the figures are always referenced correctly. An example is shown below.
+
+$\backslash$reffigure\{example-figure\} this will output "\reffigure{example-figure}". This is the from the section of how to include a figure. Sometimes instead of displaying "\reffigure{example-figure}", instead it might display Figure ??. This can be fixed by building the tex file a second time. If this does not work then the reference inside the \{\} is wrong.
+
+
+\section{Tables}
+These macros can create normal tables, long tables and reference tables.
+The difference be normal tables and long tables is, once a normal table becomes large than the size of an entire page the extra content will be cut off so the table fits the page. However a long table when is becomes larger than an entire page the extra content will be pushed to the next page.
+
+\subsection{Creating a Table}
+To create a normal table use the macro
+
+$\backslash$newtable\{Caption\}
+\{Column Data Positioning\}
+\{Column Headings\}
+\{Table Data\}\\
+\{Reference\}
+
+It is often more readable to type the macro in the form below.
+
+$\backslash$newtable\{Caption\} \\
+\{Column Data Positioning\} \\
+\{Column Headings\} \\
+\{Table Data\} \\
+\{Reference\}
+
+An example of a normal table is show below and the output is \reftable{Normal-Table}
+
+$\backslash$newtable\{Normal Table Example\} \\
+\{lcr\} \\
+\{Left Positioned Column \& Center Positioned Column \& Right Positioned Column\} \\
+\{1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3\} \\
+\{Normal-Table\}
+
+\newtable{Normal Table Example}
+{lcr}
+{Left Positioned Column & Center Positioned Column & Right Positioned Column} {1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3}
+{Normal-Table}
+
+The "Column Data Positioning" field is required. It accepts any of the three positioning values "l = left c = center r = right", each column need to have a positioning value eg. if there are two columns the possible positions are " ll, lc, lr, cl, cc, cr, rl, rc, or rr". The positioning field is required however the other fields aren't. But to display something in the table the each field will need something.
+
+\subsection{Creating a Long Table}
+The long table macro is very similar to the normal table macro
+To create a long table use the macro
+
+$\backslash$newlongtable\{Caption\}
+\{Column Data Positioning\}
+\{Column Headings\}
+\{Table Data\}
+\{Reference\}
+
+It is often more readable to type the macro in the form below.
+
+$\backslash$newlongtable\{Caption\} \\
+\{Column Data Positioning\} \\
+\{Column Headings\} \\
+\{Table Data\} \\
+\{Reference\}
+
+An example of a long table is show below and the output is \reftable{Long-Table}
+
+$\backslash$newlongtable\{Long Table Example\} \\
+\{lcr\} \\
+\{Left Positioned Column \& Center Positioned Column \& Right Positioned Column\} \\
+\{1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3 $\backslash$ $\backslash$ \\
+1 \& 2 \& 3\} \\
+\{Long-Table\}
+
+\newlongtable{Long Table Example}
+{lcr}
+{Left Positioned Column & Center Positioned Column & Right Positioned Column}
+{1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3 \\
+1 & 2 & 3}
+{Long-Table}
+
+Clearly this table was too long to fit on the previous page so the long table macro pushes the excess to the next page. A normal table would have cut off the excess and wouldn't have displayed it.
+
+The column positioning for a long table is the same as for a normal table.
+
+\subsection{Referencing a Table}
+To reference a table the macro $\backslash$reftable\{reference\} can be used. If a table is ever added or removed, this macro will take care of the numbering so the tables are always referenced correctly.
+Below is an example of referencing tables.
+
+$\backslash$reftable\{Normal-Table\} is the example normal table used in this manual.
+This will output "\reftable{Normal-Table} is the example normal table used in this manual."
+
+Another example is shown below
+
+$\backslash$reftable\{Long-Table\} is the example long table used in this manual.
+This will output "\reftable{Long-Table} is the example normal table used in this manual."
+
+\section{Boxing Content}
+To place a box around content simply use the macro $\backslash$boxanswer\{Content To be boxed\} this will output
+
+\boxanswer{Content To be boxed}
+
+The words are joined together and displayed differently because this macro is already in math mode. So to display normal text use the $\backslash$text\{\} macro. So the previous example an be written as
+
+$\backslash$boxanswer\{$\backslash$text\{Content To be boxed\}\}
+This will display
+
+\boxanswer{\text{Content To be boxed}}
+
+Most of the time this will be used to box an answer to a maths question. An example of this is shown below.
+
+$\backslash$boxanswer\{$y = mx + c \\
+E = mc^2\\
+E = hf$\}
+
+This will out put
+
+\boxanswer{y = mx + c \\
+E = mc^2\\
+E = hf}
+
+\section{Other Macros}
+
+\subsection{Shift}
+The shift macro allows you to shift content left or right. $\backslash$shift\{shift amount in cm\}\{content to be shifted\}.
+
+Tables can be shifted.
+
+\subsection{Good Footer}
+
+The $\backslash$goodfoot macro will do the footer for you in the form "Page x of n". The page mus be set to fancy first though using the $\backslash$setpagefancy macro.
+
+\section{Appendices}
+
+\subsection{Appendix A - List of Figures}
+
+\listoffigures
+
+\subsection{Appendix B - List of Tables}
+
+\listoftables
+
+\end{document} \ No newline at end of file