Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
pdflatex -recorder word.tex
pdflatex word.tex
\address{123 Main St.}
{City, State}
\phone{(777) 777-7777}
\fax{(777) 777-7777}
\ProvidesClass{wordreport}[2014/01/01 A domain-specific, Word-like report template]
report blue/.style={
report gray/.style={
report frame/.style={
report blue,
\AddEverypageHook{\begin{tikzpicture}[remember picture, overlay]
\coordinate (top left) at ($ (current page.north west) + (1cm, -1cm) $);
\coordinate (top right) at ($ (current page.north east) + (-1cm, -1cm) $);
\coordinate (bottom left) at ($ (current page.south west) + (1cm, 1cm) $);
\coordinate (bottom right) at ($ (current page.south east) + (-1cm, 1cm) $);
\coordinate (frame top left) at ($ (top left) - (0, 2.5cm) $);
\coordinate (frame top right) at ($ (top right) - (0, 2.5cm) $);
\coordinate (frame bottom left) at ($ (bottom left) + (0, .5cm)$);
\coordinate (frame bottom right) at ($ (bottom right) + (0, .5cm)$);
\coordinate (frame title mid left) at ($ (frame top left) + (1cm, 0) $);
\coordinate (frame title mid right) at ($ (frame top right) + (-1cm, 0) $);
\coordinate (frame title top left) at ($ (frame title mid left) + (0, 3mm) $);
\coordinate (frame title top right) at ($ (frame title mid right) + (0, 3mm) $);
\coordinate (frame title bottom left) at ($ (frame title mid left) - (0, 10mm) $);
\coordinate (frame title bottom right) at ($ (frame title mid right) - (0, 10mm) $);
\node [opacity=0.5] at (top left) [below right]
\node [report blue] at ($ (top left) + (0cm, -1.9cm) $) [right]
{\sffamily TEST REPORT};
\node [report blue] at ($ (top right) + (3mm, -2mm) $) [below left]
Address Information. & \\[.5ex]
\@addressA & \@symbol@phone & \@phone \\
\@addressB & \@symbol@fax & \@fax \\
\@addressC & \@symbol@webaddress & \@webaddress
\node [opacity=0.5, report blue] at ($ (frame bottom left) - (3mm, 0) $) [below right]
\node [opacity=0.5, report blue] at ($ (frame bottom right) + (2mm - 2pt, 0) $) [below left]
Page \thepage\ of \pageref{LastPage}};
\node [report gray] at ($ (frame top right)!.5!(frame top left) $) [below]
\node [report gray] at ($ (frame title bottom left) - (3mm, 0) $) [below right]
Prepared for: & \@prepared@for \\
PO Reference: & \@po@reference
\node [report gray] at ($ (frame title bottom right) + (3mm, 0) $) [below left]
Project Number: & \@project@number \\
Test Report Number: & \@test@report@number
\draw[report frame]
(frame bottom left) --
(frame bottom right);
\draw[report frame]
($ (frame bottom left) + (0cm, 1mm) $) --
(frame top left) --
(frame title mid left);
\draw[report frame]
($ (frame bottom right) + (0cm, 1mm) $) --
(frame top right) --
(frame title mid right);
\draw[report frame]
(frame title top left) rectangle (frame title bottom right);
% Local Variables:
% truncate-lines: t
% TeX-master: "word.tex"
% TeX-PDF-mode: t
% End:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment