Debian Codegraph @

texmf-dist/source/latex/uwa-pif/uwa-pif.dtx

raw
1 % \iffalse meta-comment
2 % Copyright 2019, 2021 Anthony Di Pietro
3 %
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License, either version 1.3
6 % of this license or (at your option) any later version.
7 % The latest version of this license is in
8 % http://www.latex-project.org/lppl.txt
9 % and version 1.3 or later is part of all distributions of LaTeX
10 % version 2005/12/01 or later.
11 %
12 % This work has the LPPL maintenance status `maintained'.
13 %
14 % The Current Maintainer of this work is Anthony Di Pietro.
15 %
16 % This work consists of the files uwa-pif.dtx, uwa-pif.ins, and
17 % uwa-pif-example.tex and the derived files uwa-pif.cls and uwa-pif.pdf.
18 % \fi
19 %
20 % \iffalse
21 %<*driver>
22 \ProvidesFile{uwa-pif.dtx}
23 %</driver>
24 %<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
25 %<class>\ProvidesClass{uwa-pif}
26 %<*class>
27 [2021/09/28 1.0.1 UWA Participant Information Form]
28 %</class>
29 %
30 %<*driver>
31 \documentclass[
32 a4paper,
33 10pt
34 ]{ltxdoc}
35 \usepackage{hypdoc}
36 \PassOptionsToPackage{scale=0.9}{sourcecodepro}
37 \usepackage[regular]{uwa-letterhead}[2021/09/13]
38 \GetFileInfo{uwa-pif.dtx}
39 \setcounter{secnumdepth}{3}
40 \geometry{
41 left=5cm,
42 right=2cm
43 }
44 \hypersetup{colorlinks=true}
45 \date{}
46 \makeatletter
47 \title{%
48 {The UWA Participant Information Form Class} \\
49 {\Large uwa-pif \fileversion{} (\filedate{})}%
50 }
51 \c@IndexColumns = 2
52 \renewcommand*{\uwalh@uwa}{\sffamily}
53 \renewcommand{\uwalh@makeletterhead}{}
54 \makeatother
55 \DoNotIndex{\newcommand, \newenvironment}
56 \DisableCrossrefs
57 \CodelineIndex
58 \RecordChanges
59 \CheckSum{220}
60 \begin{document}
61 \DocInput{uwa-pif.dtx}
62 \end{document}
63 %</driver>
64 % \fi
65 %
66 % \CharacterTable
67 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
68 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
69 % Digits \0\1\2\3\4\5\6\7\8\9
70 % Exclamation \! Double quote \" Hash (number) \#
71 % Dollar \$ Percent \% Ampersand \&
72 % Acute accent \' Left paren \( Right paren \)
73 % Asterisk \* Plus \+ Comma \,
74 % Minus \- Point \. Solidus \/
75 % Colon \: Semicolon \; Less than \<
76 % Equals \= Greater than \> Question mark \?
77 % Commercial at \@ Left bracket \[ Backslash \\
78 % Right bracket \] Circumflex \^ Underscore \_
79 % Grave accent \` Left brace \{ Vertical bar \|
80 % Right brace \} Tilde \~}
81 %
82 % \changes{1.0.0}{2019/08/31}{Initial version}
83 % \changes{1.0.1}{2021/09/28}{
84 % Make HREO statement, closing, and Calibri optional
85 % }
86 %
87 % \maketitle
88 %
89 % \section{Introduction}
90 %
91 % This class generates a Participant Information Form (PIF) for a
92 % human research protocol at the University of Western Australia.
93 %
94 % \section{Usage}
95 %
96 % \subsection{External Dependencies}
97 %
98 % You must supply the university logo (as |uwacrest-blue.pdf| by default).
99 % It is available in SVG format at
100 % \href{https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/img/uwacrest/}
101 % {https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/img/uwacrest/}.
102 %
103 % In accordance with the official PIF template, this class uses the
104 % \href{https://docs.microsoft.com/en-us/typography/font-list/calibri}{Calibri}
105 % typeface by default. The fonts must be installed on the system for this to
106 % work. Calibri is available as part of Microsoft's TrueType core fonts for the
107 % web (\url{https://sourceforge.net/projects/mscorefonts2/}). Alternatively,
108 % you can use the |nocalibri| class option to substitute it with
109 % \href{https://adobe-fonts.github.io/source-sans/}{Source Sans Pro}, the usual
110 % typeface used for university correspondence.
111 %
112 % With the |footer| option, this class uses the
113 % \href{https://docs.microsoft.com/en-us/typography/font-list/arial}{Arial}
114 % typeface by default. The fonts must be installed on the system for this to
115 % work. Arial is also available as part of Microsoft's TrueType core fonts
116 % for the web, and you can use the |noarial| class option to substitute it
117 % with Source Sans Pro.
118 %
119 % \subsection{Class Options}
120 %
121 % \DescribeMacro{\documentclass}
122 % To select the class, add this to your preamble:
123 % \begin{quote}
124 % |\documentclass{uwa-pif}|
125 % \end{quote}
126 %
127 % This class supports the |draft|, |final|, |leqno|, and |fleqn| options
128 % from the |article| base class and the |footer|, |nofooter|, |arial|, and
129 % |noarial| options from the |uwa-letterhead| package.
130 %
131 % You can pass the following options to specify whether to include the
132 % mandatory Human Ethics Research Office (HREO) statement:
133 % \begin{itemize}
134 % \item |hreo|: Include HREO statement (default).
135 % \item |nohreo|: Do not include HREO statement.
136 % \end{itemize}
137 %
138 % You can pass the following options to specify whether to include the
139 % closing:
140 % \begin{itemize}
141 % \item |closing|: Include closing (default).
142 % \item |noclosing|: Do not include closing.
143 % \end{itemize}
144 %
145 % You can pass the following options to specify whether to use the
146 % Calibri typeface:
147 % \begin{itemize}
148 % \item |calibri|: Use Calibri (default).
149 % \item |nocalibri|: Do not use Calibri.
150 % \end{itemize}
151 %
152 % \subsection{Letterhead Fields}
153 %
154 % Use the following commands in the preamble to set the letterhead fields:
155 %
156 % \DescribeMacro{\author}
157 % \begin{minipage}[t]{\textwidth}
158 % |\author|\marg{author} \\
159 % The author of the document. \\
160 % Required
161 % \end{minipage}
162 %
163 % \DescribeMacro{\school}
164 % \begin{minipage}[t]{\textwidth}
165 % |\school|\marg{school} \\
166 % The author's school within the university. \\
167 % Required
168 % \end{minipage}
169 %
170 % \DescribeMacro{\mbdp}
171 % \begin{minipage}[t]{\textwidth}
172 % |\mbdp|\marg{mbdp} \\
173 % The author's \href{http://www.staff.uwa.edu.au/facilities/mail/mbdp}
174 % {mailbag delivery point (MBDP)}. \\
175 % Required
176 % \end{minipage}
177 %
178 % \DescribeMacro{\university}
179 % \begin{minipage}[t]{\textwidth}
180 % |\university|\marg{university} \\
181 % The name of the university. \\
182 % Default: \textit{The University of Western Australia}
183 % \end{minipage}
184 %
185 % \DescribeMacro{\address}
186 % \begin{minipage}[t]{\textwidth}
187 % |\address|\marg{address} \\
188 % The university's address. \\
189 % Default: \textit{35 Stirling Highway, Crawley WA 6009}
190 % \end{minipage}
191 %
192 % \DescribeMacro{\phone}
193 % \begin{minipage}[t]{\textwidth}
194 % |\phone|\marg{phone} \\
195 % The author's phone number. \\
196 % Required
197 % \end{minipage}
198 %
199 % \DescribeMacro{\mobile}
200 % \begin{minipage}[t]{\textwidth}
201 % |\mobile|\marg{mobile} \\
202 % The author's mobile number. \\
203 % Required
204 % \end{minipage}
205 %
206 % \DescribeMacro{\email}
207 % \begin{minipage}[t]{\textwidth}
208 % |\email|\marg{email} \\
209 % The author's email address. \\
210 % Required
211 % \end{minipage}
212 %
213 % \DescribeMacro{\website}
214 % \begin{minipage}[t]{\textwidth}
215 % |\website|\marg{website} \\
216 % The author's website, or their school's website. \\
217 % Omit the scheme (|https://|) and path (|/|). \\
218 % Default: \textit{www.uwa.edu.au}
219 % \end{minipage}
220 %
221 % \DescribeMacro{\footeraddress}
222 % \begin{minipage}[t]{\textwidth}
223 % |\footeraddress|\marg{footeraddress} \\
224 % The university's address, shortened for the first-page footer. \\
225 % Default: \textit{Perth WA 6009 Australia}
226 % \end{minipage}
227 %
228 % \DescribeMacro{\cricos}
229 % \begin{minipage}[t]{\textwidth}
230 % |\cricos|\marg{cricos} \\
231 % The university's \href{http://cricos.education.gov.au/}{CRICOS} provider code. \\
232 % Default: \textit{00126G}
233 % \end{minipage}
234 %
235 % \DescribeMacro{\uwacrest}
236 % \begin{minipage}[t]{\textwidth}
237 % |\uwacrest|\marg{uwacrest} \\
238 % The filename of the UWA crest in PDF format (available in SVG format at
239 % \href{https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/img/uwacrest/}
240 % {https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/img/uwacrest/}). \\
241 % Default: \textit{uwacrest-blue.pdf}
242 % \end{minipage}
243 %
244 % \subsection{Project Fields}
245 %
246 % Use the following commands in the preamble to set the project fields:
247 %
248 % \DescribeMacro{\project}
249 % \begin{minipage}[t]{\textwidth}
250 % |\project|\marg{project} \\
251 % The project's title. \\
252 % Required
253 % \end{minipage}
254 %
255 % \DescribeMacro{\researchers}
256 % \begin{minipage}[t]{\textwidth}
257 % |\researchers|\marg{researchers} \\
258 % The project's researchers. Use |\researcher| for each researcher. \\
259 % Required
260 % \end{minipage}
261 %
262 % \DescribeMacro{\researcher}
263 % \begin{minipage}[t]{\textwidth}
264 % |\researcher|\marg{name}\marg{role} \\
265 % Define a researcher by name and role.
266 % \end{minipage}
267 %
268 % For example, a student project might define its researchers as follows:
269 % \begin{quote}
270 % \begin{verbatim}
271 % \researchers{
272 % \researcher{John Doe}{PhD Student}
273 % \researcher{Jane Doe}{Supervisor}
274 % }
275 % \end{verbatim}
276 % \end{quote}
277 %
278 % \StopEventually{\PrintChanges\PrintIndex}
279 %
280 % \section{Implementation}
281 %
282 % \subsection{Class Options}
283 %
284 % \begin{minipage}{\textwidth}
285 % \begin{macro}{\uwapif@hreo}
286 % \begin{macro}{\uwapif@closing}
287 % \begin{macro}{\uwapif@calibrifont}
288 % Define conditionals for the class options.
289 % \begin{macrocode}
290 \newif\ifuwapif@hreo
291 \newif\ifuwapif@closing
292 \newif\ifuwapif@calibrifont
293 % \end{macrocode}
294 % \end{macro}
295 % \end{macro}
296 % \end{macro}
297 % \end{minipage}
298 %
299 % The |hreo| and |nohreo| options respectively enable and disable
300 % the HREO statement.
301 % \begin{macrocode}
302 \DeclareOption{hreo}{
303 \uwapif@hreotrue
304 }
305 \DeclareOption{nohreo}{
306 \uwapif@hreofalse
307 }
308 % \end{macrocode}
309 %
310 % The |closing| and |noclosing| options respectively enable and disable
311 % the closing.
312 % \begin{macrocode}
313 \DeclareOption{closing}{
314 \uwapif@closingtrue
315 }
316 \DeclareOption{noclosing}{
317 \uwapif@closingfalse
318 }
319 % \end{macrocode}
320 %
321 % The |calibri| and |nocalibri| options respectively enable and disable
322 % the Calibri typeface.
323 % \begin{macrocode}
324 \DeclareOption{calibri}{
325 \uwapif@calibrifonttrue
326 }
327 \DeclareOption{nocalibri}{
328 \uwapif@calibrifontfalse
329 }
330 % \end{macrocode}
331 %
332 % Pass the |draft|, |final|, |leqno|, and |fleqn| options through to the
333 % |article| base class, and pass the |footer|, |nofooter|, |arial|, and
334 % |noarial| options through to the |uwa-letterhead| package.
335 % \begin{macrocode}
336 \DeclareOption{draft}{
337 \PassOptionsToClass{\CurrentOption}{article}
338 }
339 \DeclareOption{final}{
340 \PassOptionsToClass{\CurrentOption}{article}
341 }
342 \DeclareOption{leqno}{
343 \PassOptionsToClass{\CurrentOption}{article}
344 }
345 \DeclareOption{fleqn}{
346 \PassOptionsToClass{\CurrentOption}{article}
347 }
348 \DeclareOption{footer}{
349 \PassOptionsToPackage{\CurrentOption}{uwa-letterhead}
350 }
351 \DeclareOption{nofooter}{
352 \PassOptionsToPackage{\CurrentOption}{uwa-letterhead}
353 }
354 \DeclareOption{arial}{
355 \PassOptionsToPackage{\CurrentOption}{uwa-letterhead}
356 }
357 \DeclareOption{noarial}{
358 \PassOptionsToPackage{\CurrentOption}{uwa-letterhead}
359 }
360 % \end{macrocode}
361 %
362 % Show a warning for unknown options.
363 % \begin{macrocode}
364 \DeclareOption*{
365 \ClassWarning{uwa-pif}{Unknown option '\CurrentOption'}
366 }
367 % \end{macrocode}
368 %
369 % Use the |hreo|, |closing|, and |calibri| options by default.
370 % \begin{macrocode}
371 \ExecuteOptions{
372 hreo,
373 closing,
374 calibri
375 }
376 % \end{macrocode}
377 %
378 % Complete option processing.
379 % \begin{macrocode}
380 \ProcessOptions\relax
381 % \end{macrocode}
382 %
383 % Load the |article| base class with the |a4paper| and |11pt| options.
384 % \begin{macrocode}
385 \PassOptionsToClass{
386 a4paper,
387 11pt
388 }{article}
389 \LoadClass{article}
390 % \end{macrocode}
391 %
392 % \subsection{Page Configuration}
393 %
394 % Use |uwa-letterhead| to configure the page.
395 % \begin{macrocode}
396 \RequirePackage{uwa-letterhead}
397 % \end{macrocode}
398 %
399 % \subsection{Font Configuration}
400 %
401 % Use |fontspec| for access to OpenType and TrueType fonts.
402 % \begin{macrocode}
403 \RequirePackage[no-math]{fontspec}
404 % \end{macrocode}
405 %
406 % Set default fonts.
407 % \begin{macrocode}
408 \sffamily
409 \ifuwapif@calibrifont
410 \setmainfont{Calibri}
411 \setsansfont{Calibri}
412 \fi
413 \renewcommand{\familydefault}{\sfdefault}
414 % \end{macrocode}
415 %
416 % Use |anyfontsize| to support the irregular font sizes required.
417 % \begin{macrocode}
418 \RequirePackage{anyfontsize}
419 % \end{macrocode}
420 %
421 % Use |setspace| to adjust line spacing of HREO statement.
422 % \begin{macrocode}
423 \RequirePackage{setspace}
424 % \end{macrocode}
425 %
426 % \subsection{Heading Configuration}
427 %
428 % Use |titlesec| to configure headings.
429 % \begin{macrocode}
430 \RequirePackage[sf]{titlesec}
431 \titleformat{\section}{\color{black}\bfseries}{\thesection}{1em}{}
432 \titleformat{\subsection}{\color{black}\bfseries\small}{\thesubsection}{1em}{}
433 \titlespacing*{\section}{0pt}{-0.07em}{-0.07em}
434 \titlespacing*{\subsection}{0pt}{-0.07em}{-0.07em}
435 % \end{macrocode}
436 % Disable section numbering.
437 % \begin{macrocode}
438 \setcounter{secnumdepth}{0}
439 % \end{macrocode}
440 %
441 % \subsection{Colour Configuration}
442 %
443 % Use |xcolor| for colour support, and enable |hyperref| compatibility.
444 % \begin{macrocode}
445 \RequirePackage[hyperref]{xcolor}
446 % \end{macrocode}
447 % Define body text colour.
448 % \begin{macrocode}
449 \definecolor{UWAPIFBody}{RGB}{31, 73, 125}
450 % \end{macrocode}
451 %
452 % \subsection{Template Fields}
453 %
454 % Set default values for the letterhead template fields.
455 % \begin{macrocode}
456 \renewcommand*{\uwalh@footermbdp}{459}
457 \renewcommand*{\uwalh@footerphone}{+61 8 6488 3703}
458 \renewcommand*{\uwalh@mobile}{+61 000 000 000}
459 \renewcommand*{\uwalh@footeremail}{[email protected]}
460 % \end{macrocode}
461 %
462 % Redefine macros to set the letterhead template fields
463 % without affecting the first-page footer.
464 % \begin{macrocode}
465 \renewcommand*{\mbdp}[1]{\renewcommand*{\uwalh@mbdp}{#1}}
466 \renewcommand*{\university}[1]{\renewcommand*{\uwalh@university}{#1}}
467 \renewcommand*{\phone}[1]{\renewcommand*{\uwalh@phone}{#1}}
468 \renewcommand*{\mobile}[1]{}
469 \renewcommand*{\email}[1]{\renewcommand*{\uwalh@email}{#1}}
470 % \end{macrocode}
471 %
472 % \begin{minipage}{\textwidth}
473 % \begin{macro}{\uwapif@project}
474 % \begin{macro}{\uwapif@researchers}
475 % Set default values for the template fields.
476 % \begin{macrocode}
477 \newcommand*{\uwapif@project}{}
478 \newcommand*{\uwapif@researchers}{}
479 % \end{macrocode}
480 % \end{macro}
481 % \end{macro}
482 % \end{minipage}
483 %
484 % \begin{minipage}{\textwidth}
485 % \begin{macro}{\project}
486 % \begin{macro}{\researcher}
487 % \begin{macro}{\researchers}
488 % Define macros to set the template fields.
489 % \begin{macrocode}
490 \newcommand*{\project}[1]{\renewcommand*{\uwapif@project}{#1}}
491 \newcommand{\researcher}[2]{#1 & (#2) \\}
492 \newcommand{\researchers}[1]{\renewcommand{\uwapif@researchers}{%
493 \begin{tabular}{@{}ll@{}}
494 #1
495 \end{tabular}%
496 }}
497 % \end{macrocode}
498 % \end{macro}
499 % \end{macro}
500 % \end{macro}
501 % \end{minipage}
502 %
503 % \subsection{Field Validation}
504 %
505 % \begin{macro}{\uwapif@checkfields}
506 % Check that the required template fields are set.
507 % \begin{macrocode}
508 \newcommand{\uwapif@checkfields}{%
509 \uwalh@checkfield{\uwapif@project}{\noexpand\project}
510 \uwalh@checkfield{\uwapif@researchers}{\noexpand\researchers}
511 }
512 % \end{macrocode}
513 % \end{macro}
514 %
515 % \subsection{Document Title}
516 %
517 % \begin{macro}{\uwapif@maketitle}
518 % Generate the title of the Participant Information Form, including the
519 % fields for the project title and researchers.
520 % \begin{macrocode}
521 \newcommand{\uwapif@maketitle}{%
522 \uwapif@checkfields{}%
523 \vspace{-1\baselineskip}\vspace{0.450cm}%
524 \begin{center}%
525 \fontsize{16}{16.96}\selectfont%
526 \textcolor{black}{\textbf{Participant Information Form}}%
527 \normalsize%
528 \end{center}%
529 \vspace{-1\baselineskip}\vspace{0.935cm}
530 \textcolor{black}{\textbf{Project title:}} \uwapif@project{} \\
531 \vspace{-2\baselineskip}\vspace{0.477cm} \\
532 \textcolor{black}{\textbf{Name of Researchers:}} \\
533 \vspace{-2\baselineskip}\vspace{1.025cm} \\
534 \uwapif@researchers{}
535 \vspace{-0.045cm}
536 }
537 % \end{macrocode}
538 % \end{macro}
539 %
540 % \subsection{Closing}
541 %
542 % \begin{macro}{\uwapif@closingvspace}
543 % The vertical space before the closing.
544 % \begin{macrocode}
545 \newlength{\uwapif@closingvspace}
546 \setlength{\uwapif@closingvspace}{2.6cm}
547 % \end{macrocode}
548 % \end{macro}
549 %
550 % \begin{macro}{\uwapif@makeclosing}
551 % Generate the closing.
552 % \begin{macrocode}
553 \newcommand{\uwapif@makeclosing}{%
554 \vspace{\uwapif@closingvspace}%
555 {%
556 \color{black}%
557 Sincerely,
558
559 \@author
560 }
561 }
562 % \end{macrocode}
563 % \end{macro}
564 %
565 % \subsection{HREO Statement}
566 %
567 % \begin{macro}{\uwapif@hreovspace}
568 % The vertical space before the HREO statement.
569 % \begin{macrocode}
570 \newlength{\uwapif@hreovspace}
571 \setlength{\uwapif@hreovspace}{2.55cm}
572 % \end{macrocode}
573 % \end{macro}
574 %
575 % \begin{macro}{\uwapif@hreostatement}
576 % The statement required by the Human Research Ethics Office (HREO).
577 % \begin{macrocode}
578 \newcommand{\uwapif@hreostatement}{%
579 Approval to conduct this research has been provided by the University
580 of Western Australia, in accordance with its ethics review and
581 approval procedures. Any person considering participation in this
582 research project, or agreeing to participate, may raise any questions
583 or issues with the researchers at any time. In addition, any person
584 not satisfied with the response of researchers may raise ethics issues
585 or concerns, and may make any complaints about this research project
586 by contacting the Human Ethics office at UWA on
587 \href{tel:+61-8-6488-4703}{(08)~6488~4703} or by emailing to
588 \href{mailto:[email protected]}{[email protected]}. All
589 research participants are entitled to retain a copy of any Participant
590 Information Form and/or Participant Consent Form relating to this
591 research project.
592 }
593 % \end{macrocode}
594 % \end{macro}
595 %
596 % \begin{macro}{\uwapif@makehreostatement}
597 % Generate the HREO statement.
598 % \begin{macrocode}
599 \newcommand{\uwapif@makehreostatement}{%
600 \vspace{\uwapif@hreovspace}%
601 \hrule%
602 \begin{minipage}{\textwidth}
603 {%
604 \begin{spacing}{1.17}
605 \fontsize{9}{10.8}\selectfont\color{black}%
606 \uwapif@hreostatement{}%
607 \end{spacing}
608 }%
609 \end{minipage}
610 }
611 % \end{macrocode}
612 % \end{macro}
613 %
614 % \subsection{Body Text Font}
615 %
616 % \begin{macro}{\uwapif@bodyfont}
617 % Set the body text font and colour.
618 % \begin{macrocode}
619 \newcommand*{\uwapif@bodyfont}{%
620 \sffamily\fontsize{11}{15.5}\selectfont\color{UWAPIFBody}%
621 }
622 % \end{macrocode}
623 % \end{macro}
624 %
625 % \subsection{Form Generation}
626 %
627 % Automatically generate the title and set the body text font at
628 % the beginning of the document.
629 % \begin{macrocode}
630 \AtBeginDocument{%
631 \uwapif@bodyfont{}%
632 \uwapif@maketitle{}%
633 }
634 % \end{macrocode}
635 %
636 % Automatically add the closing and HREO statement at the end
637 % of the document.
638 % \begin{macrocode}
639 \AtEndDocument{%
640 \ifuwapif@closing\uwapif@makeclosing{}\fi%
641 \ifuwapif@hreo\uwapif@makehreostatement{}\fi%
642 }
643 % \end{macrocode}
644 %
645 % \Finale
646 \endinput