Skip to content
Snippets Groups Projects

Add a document class for ESCAPE

Merged John Swinbank requested to merge u/swinbank/escape-doc-class into trunk
7 files
+ 354
126
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -5,6 +5,21 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{astron}[ASTRON document class]
\newlength{\topMargin}
\newlength{\bottomMargin}
\newlength{\sideMargin}
\newlength{\headHeight}
\newlength{\footSkip}
\newlength{\headSep}
\setlength{\topMargin}{3.5cm}
\setlength{\bottomMargin}{3.5cm}
\setlength{\sideMargin}{2cm}
\setlength{\headHeight}{52.05211pt}
\setlength{\footSkip}{56.9055pt}
\setlength{\headSep}{25.0pt}
\newcommand{\changeRecordName}{Document History}
% Handle various document types, adding appropriate warning messages.
% Document type is specified as a class option; if none is specified, we use "undefined".
\newif\if@hastype
@@ -67,145 +82,21 @@
}
\ProcessOptions\relax
\LoadClass[a4paper,12pt,twoside]{article}
\newlength{\topMargin}
\newlength{\bottomMargin}
\newlength{\sideMargin}
\setlength{\topMargin}{3.5cm}
\setlength{\bottomMargin}{3.5cm}
\setlength{\sideMargin}{2cm}
\RequirePackage[absolute]{textpos}
\RequirePackage{biblatex}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}
\RequirePackage[pdfborder={0 0 0}]{hyperref}
\RequirePackage[nonumberlist,nogroupskip]{glossaries-prefix}
\RequirePackage{graphicx}
\RequirePackage{lastpage}
\RequirePackage{libertinus}
\RequirePackage{microtype}
\RequirePackage{parskip}
\RequirePackage{tabularx}
\RequirePackage{booktabs}
\RequirePackage[capitalize]{cleveref}
% Set up “clever” references.
%
% Use lower-case-p for pages references.
\crefname{page}{page}{pages}
% Abbreviations for appendix when not at the start of a sentence
\crefname{appendix}{Appendix}{Appendices}
\Crefname{appendix}{Appendix}{Appendices}
% Use § for section references, except at the beginning of sentences.
\crefformat{section}{\S#2#1#3}
\crefrangeformat{section}{\S\S#3#1#4--#5#2#6}
\crefmultiformat{section}{\S\S#2#1#3}{ \&~#2#1#3}{, #2#1#3}{ \&~#2#1#3}
\Crefformat{section}{Section~#2#1#3}
\Crefrangeformat{section}{Sections~#3#1#4 to~#5#2#6}
\Crefmultiformat{section}{Sections~#2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
% Set up glossaries
% Standard Definitions
%
\input{astron-abbreviations}
\makeglossaries
% Don't expand these acronyms in the text.
\glsunset{ANTARES}
\glsunset{API}
\glsunset{Apertif}
\glsunset{CPU}
\glsunset{FTE}
\glsunset{FTP}
\glsunset{GB}
\glsunset{GPU}
\glsunset{GUI}
\glsunset{HPC}
\glsunset{HTC}
\glsunset{HTTP}
\glsunset{JIVE}
\glsunset{JSON}
\glsunset{LOFAR}
\glsunset{NWO}
\glsunset{REST}
\glsunset{QA}
\glsunset{RDMA}
\glsunset{SSH}
% Link to document repositories for appropriate e-prints in the bibliography
\DeclareFieldFormat{eprint:sdc-handle}{%
Doc handle\addcolon\space
\href{https://git.astron.nl/astron-sdc/docs/#1/-/releases}{#1}%
}
% Standard bibliography files included in this package
\addbibresource{apertif.bib}
\addbibresource{astron.bib}
\addbibresource{escape.bib}
\addbibresource{general.bib}
\addbibresource{ivoa.bib}
\addbibresource{lofar.bib}
\addbibresource{sdc.bib}
\addbibresource{sdco.bib}
% No need for a fancy font for the URL
\urlstyle{same}
\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]{
\renewcommand{\docTitle}{#1}
}
\newcommand{\docNumber}{Set the document number with \texttt{\textbackslash{}setDocNumber}}
\newcommand{\setDocNumber}[1]{
\renewcommand{\docNumber}{#1}
}
\input{common}
\newcommand{\docRevision}{Set the document revision with \texttt{\textbackslash{}setDocRevision}}
\newcommand{\setDocRevision}[1]{
\renewcommand{\docRevision}{#1}
}
\newcommand{\docDate}{Set the document date with \texttt{\textbackslash{}setDocDate}}
\newcommand{\setDocDate}[1]{
\renewcommand{\docDate}{#1}
}
\newcommand{\docProgram}{Set the document program with \texttt{\textbackslash{}setDocProgram}}
\newcommand{\setDocProgram}[1]{
\renewcommand{\docProgram}{#1}
}
%
% Document history
%
\providecommand{\addChangeRecord}[3]{ #1 & #2 & #3 \tabularnewline \hline}
\newcommand{\docChangeRecord}{
... & ... & ... \tabularnewline \hline
}
\newcommand{\setDocChangeRecord}[1]{\renewcommand{\docChangeRecord}
{
#1
}}
\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
%
Loading