Debian Codegraph @

texmf-dist/doc/latex/practicalreports/practicalreports.tex

raw
1 \documentclass[12pt]{article}
2
3 \usepackage[right=1in, top=1in, left=1in, bottom=1in]{geometry}
4
5 \usepackage[parfill]{parskip}
6
7 \usepackage{practicalreports}
8
9
10 \begin{document}
11
12 \begin{titlepage}
13 \vspace*{\fill}
14 \begin{center}
15 {\Huge \textbf{practicalreports} Documentation}\\[0.5cm]
16 {\Large Version: 2.0.3}\\[0.4cm]
17 {\Large Date: $7^{th}$ of October 2019}\\[0.2cm]
18 {\small Author: Justin Cawood}
19 \end{center}
20 \vspace*{\fill}
21 \end{titlepage}
22
23 \tableofcontents
24 \newpage
25
26 \section{Practical Reports Package}
27 This package provides macros for displaying scientific notation, simple title pages, tables, figures, headers footers.
28
29 \section{Importing the Package}
30 Import the package by typing $\backslash$usepackage\{practicalreports\} at the top of the tex file.
31
32 \section{Required Packages}
33 All of the below packages are required for the macros within this package. They should be installed when you install this package
34
35 \begin{itemize}
36 \item \textbf{array}
37 \item \textbf{mathtools}
38 \item \textbf{longtable}
39 \item \textbf{scrextend}
40 \item \textbf{float}
41 \item \textbf{fancyhdr}
42 \item \textbf{lastpage}
43 \item \textbf{pdfpages}
44 \item \textbf{pdffor}
45 \end{itemize}
46
47
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49
50 \section{Exponent Macro}
51 This macro is much quicker and easier than the rest of the scientific notation macros in this package.
52
53 \subsection{How to use it}
54 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}.
55
56 \subsection{Useful tricks}
57 \textbf{\!\!\! If you are already in math mode use $\backslash$e instead\!\!\! }
58
59 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}.
60
61
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63
64 \section{Setting the page to fancy}
65 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}
66
67 \newfigure{Normal Page}{Normal page}{normal_page.png}{normal_page}
68
69 \newfigure{Setting the page to fancy}{Output of the macro $\backslash$setpagefancy}{fancy_page.png}{fancy_page}
70
71 \subsection{Headers}
72 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}.
73
74 $\backslash$header\{left header\}\{center header\}\{right header\} this will display
75
76 \newfigure{Adding a fancy header}{Output of the macro $\backslash$header\{left header\}\{center header\}\{right header\}}{fancy_header.png}{fancy_header}
77
78 \subsection{Footers}
79 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}.
80
81 $\backslash$footer\{left footer\}\{center footer\}\{right footer\} this will display
82
83 \newfigure{Adding a fancy footer}{Output of the macro $\backslash$footer\{left footer\}\{center footer\}\{right footer\}}{fancy_footer.png}{fancy_footer}
84
85
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87
88 \section{Title Page}
89 To create a title page, at the beginning of the document after the $\backslash$begin\{document\} type $\backslash$newtitlepage\{Title\}\{Author\}\{Date\}
90 An example is shown below and the result is shown in \reffigure{new-title-page}
91
92
93 \newfigure{New title page}{Result of $\backslash$newtitlepage\{Title\}\{Author\}\{Date\}}{new_title_page.png}{new-title-page}
94
95 \section{Figures}
96 These macros can include figures and reference them in a tex file.
97
98 \subsection{Including a Figure}
99 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.
100
101 \newfigure{Example Figure}{Result of using $\backslash$newfigure\{Caption\}\{Description\}\{file name\}\{reference\}}{example_figure.jpeg}{example-figure}
102
103 \subsection*{Scaling Figures}
104 This macro allows you to shrink figures that are two large or expand figures that are too small.
105 The macro is in the form
106
107 $\backslash$newsfigure\{Caption\}\{Description\}\{file\_ name.jpg\}\{reference\}\{scale factor\}
108
109 \subsubsection{Shrink Example}
110 \reffigure{example-shrink-figure}, shows an example of decreasing the size of a figure.
111
112 \newsfigure{Example Figure}{Result of using $\backslash$newsfigure\{Caption\}\{Description\}\{file name\}\{reference\}\{0.4\}}{example_figure.jpeg}{example-shrink-figure}{0.4}
113
114 \subsubsection{Expand Example}
115 \reffigure{example-expand-figure}, shows an example of increasing the size of a figure.
116
117 \newsfigure{Example Figure}{Result of using $\backslash$newsfigure\{Caption\}\{Description\}\{file name\}\{reference\}\{1.6\}}{example_figure.jpeg}{example-expand-figure}{1.6}
118
119 \subsection{Referencing a Figure}
120 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.
121
122 $\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.
123
124
125 \section{Tables}
126 These macros can create normal tables, long tables and reference tables.
127 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.
128
129 \subsection{Creating a Table}
130 To create a normal table use the macro
131
132 $\backslash$newtable\{Caption\}
133 \{Column Data Positioning\}
134 \{Column Headings\}
135 \{Table Data\}\\
136 \{Reference\}
137
138 It is often more readable to type the macro in the form below.
139
140 $\backslash$newtable\{Caption\} \\
141 \{Column Data Positioning\} \\
142 \{Column Headings\} \\
143 \{Table Data\} \\
144 \{Reference\}
145
146 An example of a normal table is show below and the output is \reftable{Normal-Table}
147
148 $\backslash$newtable\{Normal Table Example\} \\
149 \{lcr\} \\
150 \{Left Positioned Column \& Center Positioned Column \& Right Positioned Column\} \\
151 \{1 \& 2 \& 3 $\backslash$ $\backslash$ \\
152 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
153 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
154 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
155 1 \& 2 \& 3\} \\
156 \{Normal-Table\}
157
158 \newtable{Normal Table Example}
159 {lcr}
160 {Left Positioned Column & Center Positioned Column & Right Positioned Column} {1 & 2 & 3 \\
161 1 & 2 & 3 \\
162 1 & 2 & 3 \\
163 1 & 2 & 3 \\
164 1 & 2 & 3}
165 {Normal-Table}
166
167 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.
168
169 \subsection{Creating a Long Table}
170 The long table macro is very similar to the normal table macro
171 To create a long table use the macro
172
173 $\backslash$newlongtable\{Caption\}
174 \{Column Data Positioning\}
175 \{Column Headings\}
176 \{Table Data\}
177 \{Reference\}
178
179 It is often more readable to type the macro in the form below.
180
181 $\backslash$newlongtable\{Caption\} \\
182 \{Column Data Positioning\} \\
183 \{Column Headings\} \\
184 \{Table Data\} \\
185 \{Reference\}
186
187 An example of a long table is show below and the output is \reftable{Long-Table}
188
189 $\backslash$newlongtable\{Long Table Example\} \\
190 \{lcr\} \\
191 \{Left Positioned Column \& Center Positioned Column \& Right Positioned Column\} \\
192 \{1 \& 2 \& 3 $\backslash$ $\backslash$ \\
193 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
194 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
195 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
196 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
197 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
198 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
199 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
200 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
201 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
202 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
203 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
204 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
205 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
206 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
207 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
208 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
209 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
210 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
211 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
212 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
213 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
214 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
215 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
216 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
217 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
218 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
219 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
220 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
221 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
222 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
223 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
224 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
225 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
226 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
227 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
228 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
229 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
230 1 \& 2 \& 3 $\backslash$ $\backslash$ \\
231 1 \& 2 \& 3\} \\
232 \{Long-Table\}
233
234 \newlongtable{Long Table Example}
235 {lcr}
236 {Left Positioned Column & Center Positioned Column & Right Positioned Column}
237 {1 & 2 & 3 \\
238 1 & 2 & 3 \\
239 1 & 2 & 3 \\
240 1 & 2 & 3 \\
241 1 & 2 & 3 \\
242 1 & 2 & 3 \\
243 1 & 2 & 3 \\
244 1 & 2 & 3 \\
245 1 & 2 & 3 \\
246 1 & 2 & 3 \\
247 1 & 2 & 3 \\
248 1 & 2 & 3 \\
249 1 & 2 & 3 \\
250 1 & 2 & 3 \\
251 1 & 2 & 3 \\
252 1 & 2 & 3 \\
253 1 & 2 & 3 \\
254 1 & 2 & 3 \\
255 1 & 2 & 3 \\
256 1 & 2 & 3 \\
257 1 & 2 & 3 \\
258 1 & 2 & 3 \\
259 1 & 2 & 3 \\
260 1 & 2 & 3 \\
261 1 & 2 & 3 \\
262 1 & 2 & 3 \\
263 1 & 2 & 3 \\
264 1 & 2 & 3 \\
265 1 & 2 & 3 \\
266 1 & 2 & 3 \\
267 1 & 2 & 3 \\
268 1 & 2 & 3 \\
269 1 & 2 & 3 \\
270 1 & 2 & 3 \\
271 1 & 2 & 3 \\
272 1 & 2 & 3 \\
273 1 & 2 & 3 \\
274 1 & 2 & 3 \\
275 1 & 2 & 3 \\
276 1 & 2 & 3}
277 {Long-Table}
278
279 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.
280
281 The column positioning for a long table is the same as for a normal table.
282
283 \subsection{Referencing a Table}
284 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.
285 Below is an example of referencing tables.
286
287 $\backslash$reftable\{Normal-Table\} is the example normal table used in this manual.
288 This will output "\reftable{Normal-Table} is the example normal table used in this manual."
289
290 Another example is shown below
291
292 $\backslash$reftable\{Long-Table\} is the example long table used in this manual.
293 This will output "\reftable{Long-Table} is the example normal table used in this manual."
294
295 \section{Boxing Content}
296 To place a box around content simply use the macro $\backslash$boxanswer\{Content To be boxed\} this will output
297
298 \boxanswer{Content To be boxed}
299
300 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
301
302 $\backslash$boxanswer\{$\backslash$text\{Content To be boxed\}\}
303 This will display
304
305 \boxanswer{\text{Content To be boxed}}
306
307 Most of the time this will be used to box an answer to a maths question. An example of this is shown below.
308
309 $\backslash$boxanswer\{$y = mx + c \\
310 E = mc^2\\
311 E = hf$\}
312
313 This will out put
314
315 \boxanswer{y = mx + c \\
316 E = mc^2\\
317 E = hf}
318
319 \section{Other Macros}
320
321 \subsection{Shift}
322 The shift macro allows you to shift content left or right. $\backslash$shift\{shift amount in cm\}\{content to be shifted\}.
323
324 Tables can be shifted.
325
326 \subsection{Good Footer}
327
328 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.
329
330 \subsection{Join Multiple Reports}
331 To combine multiple pdf files together into one single pdf file use the macro $\backslash$joinpdfs\{\}. You don't need the file extension just list all the pdf files that you wish to join as follows.
332
333 $\backslash$joinpdfs\{pdf\_1, pdf\_2, pdf\_3, pdf\_4, .....\}.
334
335 This macro should be used in a new tex file because the pdf files will be joined as one file with the name of the tex file this macro is used in.
336
337 The pdf files being joined must be in the same directory as the tex file this macro is used in.
338
339 \section{Appendices}
340
341 \subsection{Appendix A - List of Figures}
342
343 \listoffigures
344
345 \subsection{Appendix B - List of Tables}
346
347 \listoftables
348
349 \end{document}