Debian Codegraph @

texmf-dist/source/latex/uwa-letterhead/uwa-letterhead.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-letterhead.dtx, uwa-letterhead.ins, and
17 % uwa-letterhead-example.tex and the derived files uwa-letterhead.sty and
18 % uwa-letterhead.pdf.
19 % \fi
20 %
21 % \iffalse
22 %<*driver>
23 \ProvidesFile{uwa-letterhead.dtx}
24 %</driver>
25 %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
26 %<package>\ProvidesPackage{uwa-letterhead}
27 %<*package>
28 [2021/09/13 1.0.1 UWA Letterhead]
29 %</package>
30 %
31 %<*driver>
32 \documentclass[
33 a4paper,
34 10pt
35 ]{ltxdoc}
36 \usepackage{hypdoc}
37 \PassOptionsToPackage{scale=0.9}{sourcecodepro}
38 \usepackage[
39 regular,
40 nouwafont,
41 noarial
42 ]{uwa-letterhead}[2021/09/13]
43 \GetFileInfo{uwa-letterhead.dtx}
44 \setcounter{secnumdepth}{3}
45 \geometry{
46 left=5cm,
47 right=2cm
48 }
49 \hypersetup{colorlinks=true}
50 \date{}
51 \makeatletter
52 \title{%
53 {The UWA Letterhead Package} \\
54 {\Large uwa-letterhead \fileversion{} (\filedate{})}%
55 }
56 \renewcommand{\uwalh@makeletterhead}{}
57 \c@IndexColumns = 2
58 \makeatother
59 \DoNotIndex{\newcommand, \newenvironment}
60 \DisableCrossrefs
61 \CodelineIndex
62 \RecordChanges
63 \CheckSum{561}
64 \begin{document}
65 \DocInput{uwa-letterhead.dtx}
66 \end{document}
67 %</driver>
68 % \fi
69 %
70 % \CharacterTable
71 % {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
72 % 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
73 % Digits \0\1\2\3\4\5\6\7\8\9
74 % Exclamation \! Double quote \" Hash (number) \#
75 % Dollar \$ Percent \% Ampersand \&
76 % Acute accent \' Left paren \( Right paren \)
77 % Asterisk \* Plus \+ Comma \,
78 % Minus \- Point \. Solidus \/
79 % Colon \: Semicolon \; Less than \<
80 % Equals \= Greater than \> Question mark \?
81 % Commercial at \@ Left bracket \[ Backslash \\
82 % Right bracket \] Circumflex \^ Underscore \_
83 % Grave accent \` Left brace \{ Vertical bar \|
84 % Right brace \} Tilde \~}
85 %
86 % \changes{1.0.0}{2019/08/31}{Initial version}
87 % \changes{1.0.1}{2021/09/13}{Make first-page footer optional}
88 %
89 % \maketitle
90 %
91 % \section{Introduction}
92 %
93 % This package generates the letterhead of The University of Western Australia.
94 %
95 % \section{Usage}
96 %
97 % \subsection{External Dependencies}
98 %
99 % You must supply the university logo (as |uwacrest-blue.pdf| by default).
100 % It is available in SVG format at
101 % \href{https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/img/uwacrest/}
102 % {https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/img/uwacrest/}.
103 %
104 % The letterhead uses the
105 % \href{https://docs.microsoft.com/en-us/typography/font-list/arial}{Arial}
106 % typeface for the first-page footer and the
107 % \href{https://www.brand.uwa.edu.au/}{UWA Slab} typeface for headings.
108 % The fonts must be installed on the system for this to work. Arial is
109 % available as part of Microsoft's TrueType core fonts for the web
110 % (\url{https://sourceforge.net/projects/mscorefonts2/}), and UWA Slab is
111 % available from the UWA website
112 % (\url{https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/fonts/uwa/}).
113 % Alternatively, you can use the |noarial| and |nouwafont| package options
114 % to substitute these with the body text typeface.
115 %
116 % \subsection{Package Options}
117 %
118 % \DescribeMacro{\usepackage}
119 % To load the package, add this to your preamble:
120 % \begin{quote}
121 % |\usepackage{uwa-letterhead}|
122 % \end{quote}
123 %
124 % You can pass the following options to specify the font weights:
125 % \begin{itemize}
126 % \item |light|: Use light and semibold fonts (default).
127 % \item |regular|: Use regular and bold fonts.
128 % \end{itemize}
129 %
130 % You can pass the following options to specify whether to use UWA Slab
131 % for headings:
132 % \begin{itemize}
133 % \item |uwafont|: Use UWA Slab for headings (default).
134 % \item |nouwafont|: Use the body text typeface for headings.
135 % \end{itemize}
136 %
137 % You can pass the following options to specify whether to include the
138 % first-page footer:
139 % \begin{itemize}
140 % \item |footer|: Include the first-page footer.
141 % \item |nofooter|: Do not include the first-page footer (default).
142 % \end{itemize}
143 %
144 % You can pass the following options to specify whether to use Arial
145 % for the first-page footer:
146 % \begin{itemize}
147 % \item |arial|: Use Arial for the first-page footer (default).
148 % \item |noarial|: Use the body text typeface for the first-page footer.
149 % \end{itemize}
150 %
151 % \subsection{Letterhead Fields}
152 %
153 % Use the following commands in the preamble to set the letterhead fields:
154 %
155 % \DescribeMacro{\author}
156 % \begin{minipage}[t]{\textwidth}
157 % |\author|\marg{author} \\
158 % The author of the document. \\
159 % Required
160 % \end{minipage}
161 %
162 % \DescribeMacro{\school}
163 % \begin{minipage}[t]{\textwidth}
164 % |\school|\marg{school} \\
165 % The author's school within the university. \\
166 % Required
167 % \end{minipage}
168 %
169 % \DescribeMacro{\mbdp}
170 % \begin{minipage}[t]{\textwidth}
171 % |\mbdp|\marg{mbdp} \\
172 % The author's
173 % \href{https://www.uniprint.uwa.edu.au/mail/mailbag-delivery-points}
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
232 % \href{http://cricos.education.gov.au/}{CRICOS} provider code. \\
233 % Default: \textit{00126G}
234 % \end{minipage}
235 %
236 % \DescribeMacro{\uwacrest}
237 % \begin{minipage}[t]{\textwidth}
238 % |\uwacrest|\marg{uwacrest} \\
239 % The filename of the UWA crest in PDF format (available in SVG format at
240 % \href{https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/img/uwacrest/}
241 % {https://static-listing.weboffice.uwa.edu.au/visualid/core-rebrand/img/uwacrest/}). \\
242 % Default: \textit{uwacrest-blue.pdf}
243 % \end{minipage}
244 %
245 % \StopEventually{\PrintChanges\PrintIndex}
246 %
247 % \section{Implementation}
248 %
249 % \subsection{Package Options}
250 %
251 % \begin{minipage}{\textwidth}
252 % \begin{macro}{\uwalh@uwafont}
253 % \begin{macro}{\uwalh@footer}
254 % \begin{macro}{\uwalh@arialfont}
255 % Define conditionals for the package options.
256 % \begin{macrocode}
257 \newif\ifuwalh@uwafont
258 \newif\ifuwalh@footer
259 \newif\ifuwalh@arialfont
260 % \end{macrocode}
261 % \end{macro}
262 % \end{macro}
263 % \end{macro}
264 % \end{minipage}
265 %
266 % The |uwafont| and |nouwafont| options respectively enable and disable
267 % using the UWA Slab for headings.
268 % \begin{macrocode}
269 \DeclareOption{uwafont}{
270 \uwalh@uwafonttrue
271 }
272 \DeclareOption{nouwafont}{
273 \uwalh@uwafontfalse
274 }
275 % \end{macrocode}
276 %
277 % The |footer| and |nofooter| options respectively enable and disable
278 % the first-page footer.
279 % \begin{macrocode}
280 \DeclareOption{footer}{
281 \uwalh@footertrue
282 }
283 \DeclareOption{nofooter}{
284 \uwalh@footerfalse
285 }
286 % \end{macrocode}
287 %
288 % The |arial| and |noarial| options respectively enable and disable
289 % using Arial for the first-page footer.
290 % \begin{macrocode}
291 \DeclareOption{arial}{
292 \uwalh@arialfonttrue
293 }
294 \DeclareOption{noarial}{
295 \uwalh@arialfontfalse
296 }
297 % \end{macrocode}
298 %
299 % The |light| option uses light and semibold fonts.
300 % \begin{macrocode}
301 \DeclareOption{light}{
302 \PassOptionsToPackage{
303 default,
304 light,
305 semibold
306 }{sourcesanspro}
307 \PassOptionsToPackage{
308 light,
309 semibold
310 }{sourcecodepro}
311 }
312 % \end{macrocode}
313 % The |regular| option uses regular and bold fonts.
314 % \begin{macrocode}
315 \DeclareOption{regular}{
316 \PassOptionsToPackage{
317 default,
318 regular,
319 bold
320 }{sourcesanspro}
321 \PassOptionsToPackage{
322 regular,
323 bold
324 }{sourcecodepro}
325 }
326 % \end{macrocode}
327 %
328 % Use the |uwafont|, |nofooter|, |arial|, and |light| options by default.
329 % \begin{macrocode}
330 \ExecuteOptions{
331 uwafont,
332 nofooter,
333 arial,
334 light
335 }
336 % \end{macrocode}
337 %
338 % Complete option processing.
339 % \begin{macrocode}
340 \ProcessOptions\relax
341 % \end{macrocode}
342 %
343 % \subsection{Page Configuration}
344 %
345 % Use |geometry| to configure the page margins.
346 % \begin{macrocode}
347 \RequirePackage[
348 margin=1cm,
349 top=1.7cm,
350 left=2.5cm,
351 bottom=2.2cm,
352 right=2.5cm
353 ]{geometry}
354 % \end{macrocode}
355 % Disable page numbering.
356 % \begin{macrocode}
357 \pagestyle{empty}
358 % \end{macrocode}
359 %
360 % \subsection{Font Configuration}
361 %
362 % Use |fontspec| for access to OpenType and TrueType fonts.
363 % \begin{macrocode}
364 \RequirePackage[no-math]{fontspec}
365 % \end{macrocode}
366 %
367 % Set default fonts.
368 % \begin{macrocode}
369 \RequirePackage{sourcesanspro}
370 \RequirePackage{sourcecodepro}
371 % \end{macrocode}
372 %
373 % Set font for headings.
374 % \begin{macrocode}
375 \ifuwalh@uwafont
376 \newfontfamily{\uwalh@uwa}{UWA}
377 \else
378 \newcommand*{\uwalh@uwa}{\sffamily}
379 \fi
380 % \end{macrocode}
381 %
382 % Set font for first-page footer.
383 % \begin{macrocode}
384 \ifuwalh@footer
385 \ifuwalh@arialfont
386 \newfontfamily{\uwalh@arial}{Arial}
387 \else
388 \newcommand*{\uwalh@arial}{\sffamily}
389 \fi
390 \else
391 \newcommand*{\uwalh@arial}{\sffamily}
392 \fi
393 % \end{macrocode}
394 %
395 % \subsection{Paragraph Configuration}
396 %
397 % Use |microtype| to enable microtypographic extensions.
398 % \begin{macrocode}
399 \RequirePackage{microtype}
400 % \end{macrocode}
401 %
402 % Delineate paragraphs with vertical space rather than indentation.
403 % \begin{macrocode}
404 \parindent0pt
405 \setlength{\parskip}{0.8\baselineskip}
406 % \end{macrocode}
407 %
408 % \subsection{Heading Configuration}
409 %
410 % Use |titlesec| to configure headings.
411 % \begin{macrocode}
412 \RequirePackage[sf]{titlesec}
413 \titleformat{\section}{\color{black}\Large\uwalh@uwa}{\thesection}{1em}{}
414 \titleformat{\subsection}{\color{black}\large\uwalh@uwa}{\thesubsection}{1em}{}
415 \titlespacing*{\section}{0em}{2\baselineskip}{0em}
416 \titlespacing*{\subsection}{0em}{\baselineskip}{0em}
417 % \end{macrocode}
418 %
419 % Disable section numbering.
420 % \begin{macrocode}
421 \setcounter{secnumdepth}{0}
422 % \end{macrocode}
423 %
424 % \subsection{Hyperlink Configuration}
425 %
426 % Use |hyperref| for hyperlinks, disabling visual indicators by default.
427 % \begin{macrocode}
428 \RequirePackage{hyperref}
429 \hypersetup{
430 colorlinks=false,
431 pdfborder={0 0 0}
432 }
433 % \end{macrocode}
434 % Do not typeset URLs in a different font by default.
435 % \begin{macrocode}
436 \urlstyle{same}
437 % \end{macrocode}
438 %
439 % \subsection{Colour Configuration}
440 %
441 % Use |xcolor| for colour support, and enable |hyperref| compatibility.
442 % \begin{macrocode}
443 \RequirePackage[hyperref]{xcolor}
444 % \end{macrocode}
445 % Define letterhead colours.
446 % \begin{macrocode}
447 \definecolor{UWALetterheadBlue}{RGB}{33, 64, 154}
448 \definecolor{UWALetterheadGold}{RGB}{221, 177, 10}
449 \definecolor{UWALetterheadFooter}{RGB}{77, 77, 79}
450 % \end{macrocode}
451 %
452 % \subsection{Miscellaneous Packages}
453 %
454 % Use |stringstrings| to remove spaces from phone numbers.
455 % \begin{macrocode}
456 \RequirePackage{stringstrings}
457 % \end{macrocode}
458 %
459 % Use |textpos| in |absolute| mode to place letterhead elements
460 % at arbitrary positions on the page.
461 % \begin{macrocode}
462 \RequirePackage[absolute]{textpos}
463 % \end{macrocode}
464 %
465 % Use |graphicx| to add the university logo.
466 % \begin{macrocode}
467 \RequirePackage{graphicx}
468 % \end{macrocode}
469 %
470 % \subsection{Letterhead Layout}
471 %
472 % \begin{minipage}{\textwidth}
473 % \begin{macro}{\uwalh@bluewidth}
474 % \begin{macro}{\uwalh@goldwidth}
475 % \begin{macro}{\uwalh@barheight}
476 % \begin{macro}{\uwalh@barleft}
477 % \begin{macro}{\uwalh@bartop}
478 % Define dimensions and positions for the coloured bar at the top
479 % of the letterhead.
480 % \begin{macrocode}
481 \newlength{\uwalh@bluewidth}
482 \setlength{\uwalh@bluewidth}{4.79cm}
483 \newlength{\uwalh@goldwidth}
484 \setlength{\uwalh@goldwidth}{14.41cm}
485 \newlength{\uwalh@barwidth}
486 \setlength{\uwalh@barwidth}{\uwalh@bluewidth}
487 \addtolength{\uwalh@barwidth}{\uwalh@goldwidth}
488 \newlength{\uwalh@barheight}
489 \setlength{\uwalh@barheight}{0.59cm}
490 \newlength{\uwalh@barleft}
491 \setlength{\uwalh@barleft}{\paperwidth}
492 \addtolength{\uwalh@barleft}{-1\uwalh@barwidth}
493 \newlength{\uwalh@bartop}
494 \setlength{\uwalh@bartop}{0cm}
495 % \end{macrocode}
496 % \end{macro}
497 % \end{macro}
498 % \end{macro}
499 % \end{macro}
500 % \end{macro}
501 % \end{minipage}
502 %
503 % \begin{minipage}{\textwidth}
504 % \begin{macro}{\uwalh@logowidth}
505 % \begin{macro}{\uwalh@logoheight}
506 % \begin{macro}{\uwalh@logoleft}
507 % \begin{macro}{\uwalh@logotop}
508 % Define dimensions and position of the university logo.
509 % \begin{macrocode}
510 \newlength{\uwalh@logowidth}
511 \setlength{\uwalh@logowidth}{5cm}
512 \newlength{\uwalh@logoheight}
513 \setlength{\uwalh@logoheight}{1.64cm}
514 \newlength{\uwalh@logoleft}
515 \setlength{\uwalh@logoleft}{1.78cm}
516 \newlength{\uwalh@logotop}
517 \setlength{\uwalh@logotop}{1.58cm}
518 % \end{macrocode}
519 % \end{macro}
520 % \end{macro}
521 % \end{macro}
522 % \end{macro}
523 % \end{minipage}
524 %
525 % \begin{minipage}{\textwidth}
526 % \begin{macro}{\uwalh@addresswidth}
527 % \begin{macro}{\uwalh@addresstop}
528 % \begin{macro}{\uwalh@addressleft}
529 % Define width and position of the address block.
530 % \begin{macrocode}
531 \newlength{\uwalh@addresswidth}
532 \setlength{\uwalh@addresswidth}{6.25cm}
533 \newlength{\uwalh@addresstop}
534 \setlength{\uwalh@addresstop}{1.71cm}
535 \newlength{\uwalh@addressleft}
536 \setlength{\uwalh@addressleft}{12.25cm}
537 % \end{macrocode}
538 % \end{macro}
539 % \end{macro}
540 % \end{macro}
541 % \end{minipage}
542 %
543 % \begin{macro}{\uwalh@vspaceatstart}
544 % The vertical space at the start of the document before the title.
545 % \begin{macrocode}
546 \newlength{\uwalh@vspaceatstart}
547 \setlength{\uwalh@vspaceatstart}{3.34cm}
548 % \end{macrocode}
549 % \end{macro}
550 %
551 % \subsection{Internal Macros}
552 %
553 % \begin{macro}{\uwalh@noadvance}
554 % \begin{macro}{\uwalh@noadvancewidth}
555 % Add text without advancing the current position.
556 % \begin{macrocode}
557 \newlength{\uwalh@noadvancewidth}
558 \newcommand{\uwalh@noadvance}[1]{%
559 \settowidth{\uwalh@noadvancewidth}{#1}%
560 #1\hspace*{-1\uwalh@noadvancewidth}%
561 }
562 % \end{macrocode}
563 % \end{macro}
564 % \end{macro}
565 %
566 % \subsection{Template Fields}
567 %
568 % \begin{minipage}{\textwidth}
569 % \begin{macro}{\uwalh@school}
570 % \begin{macro}{\uwalh@mbdp}
571 % \begin{macro}{\uwalh@footermbdp}
572 % \begin{macro}{\uwalh@university}
573 % \begin{macro}{\uwalh@footeruniversity}
574 % \begin{macro}{\uwalh@address}
575 % \begin{macro}{\uwalh@footeraddress}
576 % \begin{macro}{\uwalh@cricos}
577 % \begin{macro}{\uwalh@uwacrest}
578 % \begin{macro}{\uwalh@phone}
579 % \begin{macro}{\uwalh@footerphone}
580 % \begin{macro}{\uwalh@mobile}
581 % \begin{macro}{\uwalh@email}
582 % \begin{macro}{\uwalh@footeremail}
583 % \begin{macro}{\uwalh@website}
584 % Set default values for the template fields.
585 % \begin{macrocode}
586 \newcommand*{\uwalh@school}{}
587 \newcommand*{\uwalh@mbdp}{}
588 \newcommand*{\uwalh@footermbdp}{}
589 \newcommand*{\uwalh@university}{The University of Western Australia}
590 \newcommand*{\uwalh@footeruniversity}{The University of Western Australia}
591 \newcommand*{\uwalh@address}{35 Stirling Highway, Crawley WA 6009}
592 \newcommand*{\uwalh@footeraddress}{Perth WA 6009 Australia}
593 \newcommand*{\uwalh@cricos}{00126G}
594 \newcommand*{\uwalh@uwacrest}{uwacrest-blue.pdf}
595 \newcommand*{\uwalh@phone}{}
596 \newcommand*{\uwalh@footerphone}{}
597 \newcommand*{\uwalh@mobile}{}
598 \newcommand*{\uwalh@email}{}
599 \newcommand*{\uwalh@footeremail}{}
600 \newcommand*{\uwalh@website}{www.uwa.edu.au}
601 % \end{macrocode}
602 % \end{macro}
603 % \end{macro}
604 % \end{macro}
605 % \end{macro}
606 % \end{macro}
607 % \end{macro}
608 % \end{macro}
609 % \end{macro}
610 % \end{macro}
611 % \end{macro}
612 % \end{macro}
613 % \end{macro}
614 % \end{macro}
615 % \end{macro}
616 % \end{macro}
617 % \end{minipage}
618 %
619 % \begin{minipage}{\textwidth}
620 % \begin{macro}{\school}
621 % \begin{macro}{\mbdp}
622 % \begin{macro}{\university}
623 % \begin{macro}{\address}
624 % \begin{macro}{\phone}
625 % \begin{macro}{\mobile}
626 % \changes{1.0.1}{2021/09/13}{Make mobile optional without first-page footer}
627 % \begin{macro}{\email}
628 % \begin{macro}{\website}
629 % \begin{macro}{\footeraddress}
630 % \begin{macro}{\cricos}
631 % \begin{macro}{\uwacrest}
632 % Define macros to set the template fields.
633 % \begin{macrocode}
634 \newcommand*{\school}[1]{\renewcommand*{\uwalh@school}{#1}}
635 \newcommand*{\mbdp}[1]{%
636 \renewcommand*{\uwalh@mbdp}{#1}%
637 \renewcommand*{\uwalh@footermbdp}{#1}%
638 }
639 \newcommand*{\university}[1]{%
640 \renewcommand*{\uwalh@university}{#1}%
641 \renewcommand*{\uwalh@footeruniversity}{#1}%
642 }
643 \newcommand*{\address}[1]{\renewcommand*{\uwalh@address}{#1}}
644 \newcommand*{\footeraddress}[1]{\renewcommand*{\uwalh@footeraddress}{#1}}
645 \newcommand*{\phone}[1]{%
646 \renewcommand*{\uwalh@phone}{#1}%
647 \renewcommand*{\uwalh@footerphone}{#1}%
648 }
649 \newcommand*{\mobile}[1]{\renewcommand*{\uwalh@mobile}{#1}}
650 \newcommand*{\email}[1]{%
651 \renewcommand*{\uwalh@email}{#1}%
652 \renewcommand*{\uwalh@footeremail}{#1}%
653 }
654 \newcommand*{\website}[1]{\renewcommand*{\uwalh@website}{#1}}
655 \newcommand*{\cricos}[1]{\renewcommand*{\uwalh@cricos}{#1}}
656 \newcommand*{\uwacrest}[1]{\renewcommand*{\uwalh@uwacrest}{#1}}
657 % \end{macrocode}
658 % \end{macro}
659 % \end{macro}
660 % \end{macro}
661 % \end{macro}
662 % \end{macro}
663 % \end{macro}
664 % \end{macro}
665 % \end{macro}
666 % \end{macro}
667 % \end{macro}
668 % \end{macro}
669 % \end{minipage}
670 %
671 % \subsection{Document Title}
672 %
673 % \begin{macro}{\@maketitle}
674 % The default |\@maketitle| forces a new page, adds vertical space
675 % at the top of the page, and includes the author and date, all of
676 % which are inappropriate when using the letterhead; so redefine
677 % |\@maketitle| without those parts.
678 % \begin{macrocode}
679 \def\@maketitle{%
680 \begin{center}%
681 \let\footnote\thanks
682 {\LARGE \uwalh@uwa \@title \par}%
683 \end{center}%
684 \par
685 \vskip 1.5em%
686 }
687 % \end{macrocode}
688 % \end{macro}
689 %
690 % \begin{macro}{\maketitle}
691 % The default |\maketitle| handles the |twocolumn| and |title page| options,
692 % both of which are inappropriate when using the letterhead, so redefine
693 % |\maketitle| without those parts.
694 % \begin{macrocode}
695 \renewcommand\maketitle{\par
696 \begingroup
697 \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
698 \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
699 \long\def\@makefntext##1{\parindent 1em\noindent
700 \hb@[email protected]{%
701 \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
702 \global\@topnum\z@
703 \@maketitle
704 \thispagestyle{empty}\@thanks
705 \endgroup
706 \setcounter{footnote}{0}%
707 \global\let\thanks\relax
708 \global\let\maketitle\relax
709 \global\let\@maketitle\relax
710 \global\let\@thanks\@empty
711 \global\let\@author\@empty
712 \global\let\@date\@empty
713 \global\let\@title\@empty
714 \global\let\title\relax
715 \global\let\author\relax
716 \global\let\date\relax
717 \global\let\and\relax
718 }
719 % \end{macrocode}
720 % \end{macro}
721 %
722 % \subsection{Letterhead Components}
723 %
724 % \begin{macro}{\uwalh@bar@blue}
725 % The blue part of the coloured bar at the top of the letterhead.
726 % \begin{macrocode}
727 \newcommand{\uwalh@bar@blue}{%
728 \colorbox{UWALetterheadBlue}{%
729 \parbox[b][\uwalh@barheight]{\uwalh@bluewidth}{\vfill\hfill}%
730 }%
731 }
732 % \end{macrocode}
733 % \end{macro}
734 %
735 % \begin{macro}{\uwalh@bar@gold}
736 % The gold part of the coloured bar at the top of the letterhead.
737 % \begin{macrocode}
738 \newcommand{\uwalh@bar@gold}{%
739 \colorbox{UWALetterheadGold}{%
740 \parbox[b][\uwalh@barheight]{\uwalh@goldwidth}{\vfill\hfill}%
741 }%
742 }
743 % \end{macrocode}
744 % \end{macro}
745 %
746 % \begin{macro}{\uwalh@bar}
747 % Add the coloured bar at the top of the letterhead.
748 % \begin{macrocode}
749 \newcommand{\uwalh@bar}{%
750 \addtolength{\uwalh@barwidth}{12pt}
751 \begin{textblock*}{\uwalh@barwidth}(\uwalh@barleft, \uwalh@bartop)
752 \uwalh@bar@blue{}%
753 \uwalh@bar@gold{}%
754 \end{textblock*}%
755 }
756 % \end{macrocode}
757 % \end{macro}
758 %
759 % \begin{macro}{\uwalh@logo}
760 % Add the university logo.
761 % \begin{macrocode}
762 \newcommand{\uwalh@logo}{%
763 \begin{textblock*}{\uwalh@logowidth}(\uwalh@logoleft, \uwalh@logotop)
764 \includegraphics[
765 width=\uwalh@logowidth,
766 height=\uwalh@logoheight
767 ]{\uwalh@uwacrest}
768 \end{textblock*}%
769 }
770 % \end{macrocode}
771 % \end{macro}
772 %
773 % \begin{macro}{\uwalh@addressblock}
774 % Add the address block.
775 % \begin{macrocode}
776 \newcommand{\uwalh@addressblock}{%
777 \begin{textblock*}%
778 {\uwalh@addresswidth}(\uwalh@addressleft, \uwalh@addresstop)
779 \begin{minipage}[t]{\uwalh@addresswidth}
780 \sffamily\fontsize{11.19}{13.49}\selectfont%
781 \@author{} \\
782 \uwalh@school{}, M\uwalh@mbdp{} \\
783 \uwalh@university{} \\
784 \uwalh@address{} \\
785 \noblanks[q]{\uwalh@phone}%
786 Tel: \href{tel:\thestring}{\uwalh@phone} \\
787 Email: \href{mailto:\uwalh@email}{\uwalh@email} \\
788 \href{https://\uwalh@website/}{\uwalh@website}
789 \end{minipage}
790 \end{textblock*}%
791 }
792 % \end{macrocode}
793 % \end{macro}
794 %
795 % \begin{macro}{\uwalh@fpf@address}
796 % The address component of the first-page footer.
797 % \begin{macrocode}
798 \newcommand{\uwalh@fpf@address}{%
799 \begin{minipage}[t]{4.94cm}
800 \vspace*{-1\parskip}%
801 \rule{\textwidth}{1pt}%
802 \vspace{-1\baselineskip}\vspace{0.45cm} \\
803 \hspace*{0.005cm}\uwalh@footeruniversity{} \\
804 \hspace*{0.005cm}M\uwalh@footermbdp{} \uwalh@footeraddress{}
805 \end{minipage}%
806 }
807 % \end{macrocode}
808 % \end{macro}
809 %
810 % \begin{macro}{\uwalh@fpf@phone}
811 % The phone component of the first-page footer.
812 % \begin{macrocode}
813 \newcommand{\uwalh@fpf@phone}{%
814 \begin{minipage}[t]{4.945cm}
815 \vspace*{-1\parskip}%
816 \rule{\textwidth}{1pt}%
817 \vspace{-1\baselineskip}\vspace{0.45cm} \\
818 \uwalh@noadvance{\textcolor{UWALetterheadBlue}{\textbf{T}}}%
819 \hspace{0.375cm}%
820 \noblanks[q]{\uwalh@footerphone}%
821 \href{tel:\thestring}{\uwalh@footerphone} \\
822 \uwalh@noadvance{\textcolor{UWALetterheadBlue}{\textbf{M}}}%
823 \hspace{0.375cm}%
824 \noblanks[q]{\uwalh@mobile}%
825 \href{tel:\thestring}{\uwalh@mobile}
826 \end{minipage}%
827 }
828 % \end{macrocode}
829 % \end{macro}
830 %
831 % \begin{macro}{\uwalh@fpf@email}
832 % The email component of the first-page footer.
833 % \begin{macrocode}
834 \newcommand{\uwalh@fpf@email}{%
835 \begin{minipage}[t]{5.31cm}
836 \vspace*{-1\parskip}%
837 \rule{\textwidth}{1pt}%
838 \vspace{-1\baselineskip}\vspace{0.45cm} \\
839 \uwalh@noadvance{\textcolor{UWALetterheadBlue}{\textbf{E}}}%
840 \hspace{0.38cm}%
841 \href{mailto:\uwalh@footeremail}{\uwalh@footeremail} \\
842 \vspace{-1\baselineskip}\vspace{-0.018cm} \\
843 {\uwalh@arial\fontsize{5}{6.7}\selectfont%
844 CRICOS Provider Code \uwalh@cricos{}%
845 }%
846 \end{minipage}%
847 }
848 % \end{macrocode}
849 % \end{macro}
850 %
851 % \begin{macro}{\uwalh@firstpagefooter}
852 % Add the first-page footer.
853 % \begin{macrocode}
854 \newcommand{\uwalh@firstpagefooter}{%
855 \begin{textblock*}{16cm}(2.5cm, 27.35cm)
856 {%
857 \microtypesetup{activate=false}%
858 \vspace*{-1\parskip}\vspace*{10.88pt}%
859 \uwalh@arial\fontsize{7.5}{8.7}\selectfont%
860 \color{UWALetterheadFooter}%
861 \uwalh@fpf@address{}%
862 \hspace{0.402cm}%
863 \uwalh@fpf@phone{}%
864 \hspace{0.402cm}%
865 \uwalh@fpf@email{}%
866 \microtypesetup{activate=true}%
867 }%
868 \end{textblock*}%
869 }
870 % \end{macrocode}
871 % \end{macro}
872 %
873 % \subsection{Field Validation}
874 %
875 % \begin{macro}{\uwalh@checkfield}
876 % Check that a required template field is set.
877 % \begin{macrocode}
878 \newcommand{\uwalh@checkfield}[2]{%
879 \setbox0=\hbox{#1\unskip}\ifdim\wd0=0pt
880 \@latex@warning@no@line{No #2given}
881 \else
882 \relax%
883 \fi%
884 }
885 % \end{macrocode}
886 % \end{macro}
887 %
888 % \begin{macro}{\uwalh@checkfields}
889 % Check that the required template fields are set.
890 % \begin{macrocode}
891 \newcommand{\uwalh@checkfields}{%
892 \uwalh@checkfield{\uwalh@school}{\noexpand\school}
893 \uwalh@checkfield{\uwalh@mbdp}{\noexpand\mbdp}
894 \uwalh@checkfield{\uwalh@phone}{\noexpand\phone}
895 \ifuwalh@footer\uwalh@checkfield{\uwalh@mobile}{\noexpand\mobile}\fi
896 \uwalh@checkfield{\uwalh@email}{\noexpand\email}
897 }
898 % \end{macrocode}
899 % \end{macro}
900 %
901 % \subsection{Letterhead Generation}
902 %
903 % \begin{macro}{\uwalh@makeletterhead}
904 % Generate the letterhead.
905 % \begin{macrocode}
906 \newcommand{\uwalh@makeletterhead}{%
907 \uwalh@checkfields{}%
908 \uwalh@bar{}%
909 \uwalh@logo{}%
910 \uwalh@addressblock{}%
911 \ifuwalh@footer\uwalh@firstpagefooter{}\fi%
912 \vspace*{\uwalh@vspaceatstart}%
913 }
914 % \end{macrocode}
915 % \end{macro}
916 %
917 % Automatically generate the letterhead at the beginning of the document.
918 % \begin{macrocode}
919 \AtBeginDocument{\uwalh@makeletterhead}
920 % \end{macrocode}
921 %
922 % \Finale
923 \endinput