Files
MICADO-document-template/template_files/layout.tex
T

109 lines
5.3 KiB
TeX

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Document preamble, adds useful packages and sets up the document.
%FONT AND TYPESETTING
\usepackage[english]{babel} % makes latex aware of your language, so better hyphenating etc
\usepackage[T1]{fontenc} % use the T1 for proper searching and use of ligatures etc
\usepackage[utf8]{inputenc} % use UTF8 encoding for reading source code
\usepackage{helvet} % use the helvetica font. This is very similar to the Arial font
% used in the Office templates.
\usepackage{inconsolata} % use the inconsolata font for code as it looks nice.
\renewcommand{\familydefault}{\sfdefault} % set the text font to helvetica
\usepackage{microtype} % enables microtypesetting
\usepackage{csquotes} % package for writing quotes. Used by 'babel'.
%PAGE LAYOUT
\usepackage{geometry} % adjusts page layout including margins
\geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=5cm} % the page geometry as defined, A4=210x297mm
%MATHS
\usepackage{mathtools} % for the rendering of maths, mathtools includes amsmath
\numberwithin{equation}{section} % reset numbering within a structural object
\numberwithin{figure}{section} % reset numbering within a structural object
%SCIENCE
\usepackage{siunitx} % typesetting of units and quantities with uncertainties etc
\sisetup{detect-all, detect-weight=true, detect-family=true} % if the rest of the text is bold the units will be as well
\sisetup{range-units=single} % don't include units in both parts of an \SIrange
\sisetup{multi-part-units=single} % don't repeat units for multi-part numbers such as numbers with uncertainties
\sisetup{separate-uncertainty} % list values with uncertanties as X\pm Y rather than X(Y).
%FIGURES AND TABLES
\usepackage[labelfont=bf]{caption} % adds bold labels, but normal captions for the figures and tables.
\usepackage{graphicx} % for the rendering of floating graphics
\usepackage{array} % for creating tables
\usepackage{booktabs} % professional looking tables, provides /toprule etc
\usepackage{longtable} % for creating tables that continue on the next page
\usepackage{chngcntr} % for labeling tables such that the section number is included
\counterwithin{table}{section} % change 'section' to 'subsection' or 'subsubsection' if desired.
% PROGRAMMING CODE
\usepackage{listings} % for nicely rendering programming code
\lstloadlanguages{csh, python}
\usepackage{xcolor}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
% Defining the way code looks in the document
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}
%BIBLIOGRAPHY
% relies on .bib files of the applicable documents and the reference documents to be in the right place.
\usepackage[backend=biber,citestyle=numeric-comp,bibstyle=numeric,sorting=none,url=false,eprint=false,isbn=true,doi=true,defernumbers=true]{biblatex}
\addbibresource{references/ApplicableDocuments.bib}
\addbibresource{references/ReferenceDocuments.bib}
%Function that automatically adds keyword to all Reference Documents
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\perdatasource{references/ReferenceDocuments.bib}
\step[fieldset=keywords, fieldvalue={,RD}, append]
}
}
}
% Function that enables applicable documents to appear without citation, using \nocite(*)
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[nocited, final]
\step[fieldsource=keywords, notmatch={RD}, final]
% \step[entrynull]
}
}
}
% OTHER
\usepackage{blindtext} %to print filler text
\usepackage[printonlyused]{acronym} %for defining acronyms. Only acronyms used at least once will appear in the list.
\usepackage{hyperref, bookmark} %turns the references and citations into hyperlinks. This needs to be last on the preamble.
\hypersetup{colorlinks=true,linkcolor=black,citecolor=black,urlcolor=blue} %sets colors of links within the text.
%useful shorthands for common Astronomical Journals
\newcommand{\aap}{Astronomy \& Astrophysics}
\newcommand{\aaps}{Astronomy \& Astrophysics, Supplement}
\newcommand{\mnras}{Monthly Notices of the Royal Astronomical Society}
\newcommand{\procspie}{Proceedings of the International Society for Optical Engineering}
\newcommand{\pasp}{Publications of the Astronomical Society of the Pacific}
\newcommand{\apjs}{The Astrophysical Journal, Supplement}