diff --git a/example/example.tex b/example/example.tex index 06553152b437d28822d8eccbdef2083344ef68fd..1abccfa97a3995f022a1468626d0310bc0c39041 100644 --- a/example/example.tex +++ b/example/example.tex @@ -9,7 +9,7 @@ \setDocProgram{SDC} \setDocChangeRecord{ - \addtohist{1.0}{2020-11-15}{Initial release} + \addChangeRecord{1.0}{2020-11-15}{Initial release} } \setDocAuthors{ @@ -18,12 +18,12 @@ \setDocCheckers{ \addPerson{Checker 1}{A place}{today} - \addPerson{Checker 2 Swinbank}{Another place}{tomorrow} + \addPerson{Checker 2}{Another place}{Tomorrow} } \setDocApprovers{ - \addPerson{Approver 1}{A place}{today} - \addPerson{Approver 2}{Another place}{tomorrow} + \addPerson{Approver 1}{A place}{Today} + \addPerson{Approver 2}{Another place}{Tomorrow} } \setDocAuthorizers{ diff --git a/texmf/tex/latex/astron/astron.cls b/texmf/tex/latex/astron/astron.cls index 8ab2fa7c1e3daba5cfcb0329b212c88f95feb988..517ae396f933381fe0344bcd9829a09f6ecfedde 100644 --- a/texmf/tex/latex/astron/astron.cls +++ b/texmf/tex/latex/astron/astron.cls @@ -5,26 +5,29 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesClass{astron}[ASTRON document class] -\LoadClass[a4paper,12pt,twoside,english]{article} +\LoadClass[a4paper,12pt,twoside]{article} -\RequirePackage{graphicx} -\RequirePackage{geometry} -\geometry{verbose,tmargin=2cm,bmargin=5cm,lmargin=2cm,rmargin=2cm} -\RequirePackage[english]{babel} +\newlength{\topMargin} +\newlength{\bottomMargin} +\newlength{\sideMargin} +\setlength{\topMargin}{3.5cm} +\setlength{\bottomMargin}{3.5cm} +\setlength{\sideMargin}{2cm} + +\RequirePackage[absolute]{textpos} \RequirePackage{fancyhdr} +\RequirePackage{geometry} +\RequirePackage{graphicx} \RequirePackage{lastpage} -\RequirePackage{array} -\RequirePackage{eurosym} -\RequirePackage{tabulary} -\RequirePackage{rotfloat} -%\usepackage{multirow} -\RequirePackage[hidelinks]{hyperref} -\RequirePackage{longtable} -\RequirePackage[absolute]{textpos} +\RequirePackage{microtype} +\RequirePackage{parskip} \RequirePackage{tabularx} -\setlength{\parindent}{0cm} % No indent at start of paragraphs -\setlength{\parskip}{\baselineskip} % Blank line between paragraph +\geometry{tmargin=\topMargin, + bmargin=\bottomMargin, + lmargin=\sideMargin, + rmargin=\sideMargin, + headheight=52.05211pt} \newcommand{\docTitle}{Set the document title with \texttt{\textbackslash{}setDocTitle}} \newcommand{\setDocTitle}[1]{ @@ -59,40 +62,26 @@ % % Document history % -\newenvironment{docHistory}[0]{ - \newpage - \section*{Document History} - \begin{small} - % flush table to the left - \setlength\LTleft{0pt} - \setlength\LTright{\fill} - \addtocounter{table}{-1} - \begin{longtable}{|l|p{.13\textwidth}|p{.68\textwidth}|} - \hline - \textbf{Revision} & \textbf{Date} & \textbf{Description} \\ \hline\hline - \endfirsthead - \hline - \textbf{Revision} & \textbf{Date} & \textbf{Description} \\ \hline\hline - \endhead - \multicolumn{3}{r}{\emph{Continued on next page}} - \endfoot - \endlastfoot -}{ - \end{longtable} - \end{small} - \clearpage +\providecommand{\addChangeRecord}[3]{ #1 & #2 & #3 \tabularnewline \hline} +\newcommand{\docChangeRecord}{ +... & ... & ... \tabularnewline \hline } -\providecommand{\addtohist}[3]{ #1 & #2 & #3 \\\hline} - -\newcommand{\docChangeRecord}{} \newcommand{\setDocChangeRecord}[1]{\renewcommand{\docChangeRecord} { -\clearpage -\begin{docHistory} #1 -\end{docHistory} }} +\newcommand{\changeRecord}{% + \clearpage + \section*{Document History} + \begin{tabularx}{\textwidth}{|X|p{0.13\textwidth}|p{0.68\textwidth}|X|} + \hline + \textbf{Revision} & \textbf{Date} & \textbf{Description} \tabularnewline + \hline\hline + \docChangeRecord + \end{tabularx} + \clearpage +} % % Define authors, approvers, etc for the front page @@ -131,6 +120,29 @@ #1 }} +\newcommand{\authorTable}{% + \begin{tabularx}{\textwidth}{|p{0.35\textwidth}|p{0.35\textwidth}|X|} + \cline{2-3} \cline{3-3} + \multicolumn{1}{c|}{} & + \textbf{\footnotesize{}Organisatie / Organization} & + \textbf{\footnotesize{}Datum / Date} \tabularnewline + \hline + \textbf{\footnotesize{}Auteur(s) / Author(s):\vspace{0.2cm}} & & \tabularnewline + \docAuthors + \hline + \textbf{\footnotesize{}Controle / Checked:\vspace{0.2cm}} & & \tabularnewline + \docCheckers + \hline + \textbf{\footnotesize{}Goedkeuring / Approval:\vspace{0.2cm}} & & \tabularnewline + \docApprovers + \hline + \textbf{\footnotesize{}Autorisatie / Authorization:} & & \tabularnewline + \docAuthorizers + \textbf{\footnotesize{}Handtekening / Signature:\vspace{1cm}} & & \tabularnewline + \hline + \end{tabularx} +} + % % Define headers and footers % @@ -156,46 +168,41 @@ % Construct the title page, history, etc. % \renewcommand{\maketitle}{ -~\\ +\vspace*{4cm} \begin{center} -\vspace{5cm} \LARGE\textbf{\docTitle{}} -\vspace{4cm} \end{center} -\begin{tabularx}{\textwidth}{|p{0.35\textwidth}|p{0.35\textwidth}|X|} -\cline{2-3} \cline{3-3} -\multicolumn{1}{c|}{} & \textbf{\footnotesize{}Organisatie / Organization} & \textbf{\footnotesize{}Datum / Date}\tabularnewline -\hline -\textbf{\footnotesize{}Auteur(s) / Author(s):\vspace{0.2cm}} & & \tabularnewline -\docAuthors -\hline -\textbf{\footnotesize{}Controle / Checked:\vspace{0.2cm}} & & \tabularnewline -\docCheckers -\hline -\textbf{\footnotesize{}Goedkeuring / Approval:\vspace{0.2cm}} & & \tabularnewline -\docApprovers -\hline -\textbf{\footnotesize{}Autorisatie / Authorization:} & & \tabularnewline -\docAuthorizers -\textbf{\footnotesize{}Handtekening / Signature:\vspace{1cm}} & & \tabularnewline -\hline -\end{tabularx} - - -\begin{textblock*}{1\textwidth}(2cm,23.7cm) - -\fbox -{\begin{minipage}{\dimexpr\linewidth-2\fboxrule-2\fboxsep} -\begin{center} -\begin{small} -\textcopyright{} ASTRON 2020.\\ -All rights are reserved. Reproduction in whole or in part is\\ -prohibited without written consent of the copyright owner. -\end{small} -\end{center} -\end{minipage}} +% This position was determined by trial and error; a bit unsatisfying. +\newlength{\copyrightBoxPosition} +\setlength{\copyrightBoxPosition}{25.2cm} + +% Add the copyright notice towards the bottom of the page. +\begin{textblock*}{1\textwidth}(\sideMargin, \copyrightBoxPosition) + \fbox{% + \begin{minipage}{\dimexpr\linewidth-2\fboxrule-2\fboxsep} + \begin{center} + \begin{small} + \textcopyright{} ASTRON 2020.\\ + All rights are reserved. Reproduction in whole or in part is\\ + prohibited without written consent of the copyright owner. + \end{small} + \end{center} + \end{minipage}% + } +\end{textblock*} + +% We generate the author table once (but don't print it) to measure its height, +% then use that to position the textblock* which ultimately contains the table. +% Note the measured height is (approximately) half the full height. +\newlength{\authorTableHalfHeight} +\settoheight{\authorTableHalfHeight}{\authorTable} +\begin{textblock*}{1\textwidth}(\sideMargin, + \dimexpr\copyrightBoxPosition-2\authorTableHalfHeight+\fboxsep) +\authorTable \end{textblock*} -\docChangeRecord{} +\clearpage + +\changeRecord }