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

Merge branch 'u/swinbank/escape-doc-class' into trunk

parents 6d8db988 9b8c8f21
No related branches found
No related tags found
1 merge request!30Add a document class for ESCAPE
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
./: ./:
.: .:
bibtex bibtex
img
ls-R ls-R
tex tex
...@@ -9,9 +10,16 @@ tex ...@@ -9,9 +10,16 @@ tex
bib bib
./bibtex/bib: ./bibtex/bib:
apertif.bib
astron.bib astron.bib
escape.bib
general.bib
ivoa.bib
lofar.bib lofar.bib
sdc.bib sdc.bib
sdco.bib
./img:
./tex: ./tex:
...@@ -24,3 +32,8 @@ astron ...@@ -24,3 +32,8 @@ astron
astron-abbreviations.tex astron-abbreviations.tex
astron-logo.pdf astron-logo.pdf
astron.cls astron.cls
common.tex
escape-galaxy-mind.png
escape-logo.png
escape.cls
flag-eu.png
...@@ -5,6 +5,21 @@ ...@@ -5,6 +5,21 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesClass{astron}[ASTRON document class] \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. % Handle various document types, adding appropriate warning messages.
% Document type is specified as a class option; if none is specified, we use "undefined". % Document type is specified as a class option; if none is specified, we use "undefined".
\newif\if@hastype \newif\if@hastype
...@@ -67,145 +82,21 @@ ...@@ -67,145 +82,21 @@
} }
\ProcessOptions\relax \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. % Standard Definitions
\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
% %
\input{astron-abbreviations} \input{common}
\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}
}
\newcommand{\docRevision}{Set the document revision with \texttt{\textbackslash{}setDocRevision}} \newcommand{\docRevision}{Set the document revision with \texttt{\textbackslash{}setDocRevision}}
\newcommand{\setDocRevision}[1]{ \newcommand{\setDocRevision}[1]{
\renewcommand{\docRevision}{#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{\docProgram}{Set the document program with \texttt{\textbackslash{}setDocProgram}}
\newcommand{\setDocProgram}[1]{ \newcommand{\setDocProgram}[1]{
\renewcommand{\docProgram}{#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 % Define authors, approvers, etc for the front page
% %
......
\LoadClass[a4paper,12pt,twoside]{article}
\RequirePackage[absolute]{textpos}
\RequirePackage{biblatex}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}
\RequirePackage[pdfborder={0 0 0}]{hyperref}
\RequirePackage[nonumberlist,nogroupskip]{glossaries-prefix}
\RequirePackage{fontspec}
\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
%
\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,
footskip=\footSkip,
headsep=\headSep,
headheight=\headHeight}
\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}
}
\newcommand{\docDate}{Set the document date with \texttt{\textbackslash{}setDocDate}}
\newcommand{\setDocDate}[1]{
\renewcommand{\docDate}{#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*{\changeRecordName{}}
\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}
}
texmf/tex/latex/astron/escape-galaxy-mind.png

1.41 MiB

texmf/tex/latex/astron/escape-logo.png

344 KiB

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{escape}[ESCAPE document class]
%
% Basic project details
%
% These refer to ESCAPE, but in principle we could reuse the document class for some other project.
\newcommand{\projectTitle}{European Science Cluster of Astronomy \& Particle physics ESFRI research Infrastructure}
\newcommand{\projectAcronym}{ESCAPE}
\newcommand{\grantAgreement}{824064}
\newcommand{\projectInstrument}{Research and Innovation Action (RIA)}
\newcommand{\projectTopic}{Connecting ESFRI infrastructures through Cluster projects (INFRA-EOSC-4-2018)}
\newcommand{\projectStart}{2019-02-04}
\newcommand{\projectDuration}{42 Months}
\newcommand{\projectWeb}{\href{https://www.projectescape.eu}{www.projectescape.eu}}
\newcommand{\changeRecordName}{Versioning and contribution history}
%
% Other document metadata
%
% Must be set by the user
\newcommand{\workPackage}{Set the work package with \texttt{\textbackslash{}setWorkPackage}}
\newcommand{\setWorkPackage}[1]{
\renewcommand{\workPackage}{#1}
}
\newcommand{\leadAuthor}{Set the document author with \texttt{\textbackslash{}setLeadAuthor}}
\newcommand{\setLeadAuthor}[1]{
\renewcommand{\leadAuthor}{#1}
}
\newcommand{\otherAuthors}{Set the contributing authors with \texttt{\textbackslash{}setOtherAuthors}}
\newcommand{\setOtherAuthors}[1]{
\renewcommand{\otherAuthors}{#1}
}
\newcommand{\dueDate}{Set the due date with \texttt{\textbackslash{}setDueDate}}
\newcommand{\setDueDate}[1]{
\renewcommand{\dueDate}{#1}
}
\newcommand{\dueMonth}{Set the due month with \texttt{\textbackslash{}setDueMonth}}
\newcommand{\setDueMonth}[1]{
\renewcommand{\dueMonth}{#1}
}
%
% Page layout for this document type
%
\newlength{\topMargin}
\newlength{\bottomMargin}
\newlength{\sideMargin}
\newlength{\footSkip}
\newlength{\headSep}
\newlength{\headHeight}
\setlength{\topMargin}{3.5cm}
\setlength{\bottomMargin}{2.5cm}
\setlength{\sideMargin}{1.25cm}
\setlength{\footSkip}{40pt}
\setlength{\headSep}{10pt}
\setlength{\headHeight}{75pt}
%
% Document options set the “dissemination levels”
%
\newcommand{\pu}{\phantom{X}}
\newcommand{\pp}{\phantom{X}}
\newcommand{\re}{\phantom{X}}
\newcommand{\co}{\phantom{X}}
\DeclareOption{pu}{
\renewcommand{\pu}{X}
}
\DeclareOption{pp}{
\renewcommand{\pp}{X}
}
\DeclareOption{re}{
\renewcommand{\re}{X}
}
\DeclareOption{co}{
\renewcommand{\co}{X}
}
\ProcessOptions\relax
\input{common}
% Default font for ESCAPE documents is Calibri
% But if we can't find it (e.g. in CI), don't worry about it
\IfFontExistsTF{Calibri}{\setmainfont{Calibri}}{}
%
% Define headers and footers
%
\pagestyle{fancy}
\fancyhf{}
\lhead{
\IfFontExistsTF{Arial}{\setmainfont{Arial}}{}
\fontsize{8}{10}\selectfont
\includegraphics[width=2.0cm]{escape-logo.png}\\
\docNumber{} -- \docTitle{}}
\rhead{
\raisebox{1.8cm}{
\IfFontExistsTF{Arial}{\setmainfont{Arial}}{}
\fontsize{8}{10}\selectfont
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{>{\raggedright}ll}
Project No & 824064\tabularnewline
Date & \docDate{}\tabularnewline
\end{tabular}
}}
\cfoot{
\IfFontExistsTF{Calibri}{\setmainfont{Calibri}}{}
\begin{tabularx}{\textwidth}{@{}lXll@{}}
\includegraphics[width=1cm]{flag-eu}\hspace{0.3cm} &
\fontsize{8}{10}\selectfont
\parbox[][1.3cm][t]{14.2cm}{\raggedright{ESCAPE -- The European Science Cluster of Astronomy \& Particle Physics ESFRI Research Infrastructures has received funding from the European Union’s Horizon 2020 research and innovation programme under the Grant Agreement n° 824064}} &
\parbox[][1.2cm][t]{0.5cm}{\thepage} &
\includegraphics[width=1cm]{escape-galaxy-mind}
\tabularnewline
\end{tabularx}
}
\renewcommand{\headrulewidth}{0.25pt}
\renewcommand{\footrulewidth}{0pt}
%
% Create the title page
%
% Vertical positions throughout were "eyeballed" — they work ok for a document
% with a title which spans two lines, but will probably break otherwise.
%
\renewcommand{\maketitle}{
\thispagestyle{empty}
\begin{textblock*}{1\textwidth}(\sideMargin, 1cm)
\begin{center}
\includegraphics[width=6cm]{escape-logo.png}
\end{center}
\end{textblock*}
\begin{textblock*}{1\textwidth}(\sideMargin, 8cm){
\IfFontExistsTF{Arial}{\setmainfont{Arial}}{}
\fontsize{10}{12}\selectfont
\renewcommand{\arraystretch}{1.5}
\hyphenpenalty=10000
\begin{tabularx}{\textwidth}{p{0.25\textwidth}X}
Project Title & \projectTitle{}\tabularnewline
Project Acronym & \projectAcronym{}\tabularnewline
Grant Agreement No & \grantAgreement{}\tabularnewline
Instrument & \projectInstrument{}\tabularnewline
Topic & \projectTopic{}\tabularnewline
Start Date of Project & \projectStart{}\tabularnewline
Duration of Project & \projectDuration{}\tabularnewline
Project Website & \projectWeb{}\tabularnewline
\end{tabularx}}
\renewcommand{\arraystretch}{1}
\end{textblock*}
\begin{textblock*}{1\textwidth}(\sideMargin, 14.2cm)
\centering
\begin{minipage}{0.7\textwidth}
\centering
\hyphenpenalty=10000
\LARGE\textbf{\docNumber{} -- \docTitle{}}
\end{minipage}
\end{textblock*}
\begin{textblock*}{1\textwidth}(\sideMargin, 16.5cm)
\renewcommand{\arraystretch}{1.5}
\hyphenpenalty=10000
\begin{tabularx}{\textwidth}{p{0.25\textwidth}X}
Work Package & \workPackage{}\tabularnewline
Lead Author (Org) & \leadAuthor{}\tabularnewline
\raggedright{Contributing Author(s) (Org)} & \otherAuthors{}\tabularnewline
Due Date & \dueDate{} (\dueMonth{}) \tabularnewline
Date & \docDate{} \tabularnewline
Version & \vcsRevision{} \tabularnewline
\end{tabularx}
\renewcommand{\arraystretch}{1}
\end{textblock*}
\begin{textblock*}{1\textwidth}(\sideMargin, 22.5cm)
\begin{tabular}{lll}
\multicolumn{3}{l}{Dissemination Level}\tabularnewline
\fbox{\pu{}} & PU: & Public\tabularnewline
\fbox{\pp{}} & PP: & Restricted to other programme participants (including the Commission)\tabularnewline
\fbox{\re{}} & RE: & Restricted to a group specified by the consortium (including the Commission)\tabularnewline
\fbox{\co{}} & CO: & Confidential, only for members of the consortium (including the Commission)\tabularnewline
\end{tabular}
\end{textblock*}
\phantom{Need some text to clear the page}
\clearpage
\changeRecord
\section*{Disclaimer}
ESCAPE - The European Science Cluster of Astronomy \& Particle Physics ESFRI Research Infrastructures has received funding from the European Union’s Horizon 2020 research and innovation programme under the Grant Agreement n° 210506816.
\clearpage
}
texmf/tex/latex/astron/flag-eu.png

1.81 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment