Skip to content
Snippets Groups Projects
Commit b64eec71 authored by John Swinbank's avatar John Swinbank
Browse files

Rework document history generation

No longer uses longtable, so it can't span multiple pages, but that seems like
a minor issue for now.
parent f42c4219
Branches
No related tags found
No related merge requests found
......@@ -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,7 +18,6 @@
\RequirePackage{geometry}
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
\RequirePackage{longtable}
\RequirePackage[absolute]{textpos}
\RequirePackage{tabularx}
......@@ -64,40 +63,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
......@@ -136,6 +121,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
%
......@@ -185,29 +193,6 @@
}
\end{textblock*}
\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}
}
% 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.
......@@ -220,5 +205,5 @@
\clearpage
\docChangeRecord{}
\changeRecord
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment