lamme2024-scientific-project/sty/lamme2024.sty

249 lines
6.0 KiB
Plaintext
Raw Normal View History

2024-03-27 19:51:22 +01:00
2024-03-21 19:36:09 +01:00
% Font
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes} % Times New Roman alternative
2024-04-10 13:24:58 +02:00
\usepackage[onehalfspacing]{setspace} % 1.5 interline spacing
\defaultfontfeatures[\rmfamily,\sffamily]{Ligatures=TeX}
2024-04-10 13:24:58 +02:00
\setkomafont{disposition}{\bfseries}
% Float
\RequirePackage{graphicx}
\RequirePackage{float}
\RequirePackage{caption}
\RequirePackage{subcaption}
2024-03-21 19:36:09 +01:00
\RequirePackage{csquotes}
\RequirePackage[english]{babel}
2024-04-17 10:50:29 +02:00
%% Caption
\captionsetup{
labelfont={color=black, bf},
figurename=Figure,
tablename=Table,
font={sf},
labelsep=period,
justification=raggedright,
singlelinecheck=false
}
% Colors
\RequirePackage{xcolor}
\definecolor{lamme2024-blue}{HTML}{008682}
\colorlet{primary}{lamme2024-blue}
\colorlet{primaryLink}{primary!60!blue}
\colorlet{primaryCite}{red!70!primary}
% Math
\RequirePackage{amsmath}
\RequirePackage{amsthm}
\RequirePackage{amssymb}
\usepackage{enumitem}
\usepackage{lipsum}
% References
\usepackage[
maxcitenames=2,
maxbibnames=99, % show all authors in the cited part
style=authoryear-comp,
citestyle=authoryear-comp,
backend=biber,
natbib=true
2024-04-10 13:24:58 +02:00
]{biblatex}
2024-04-08 17:24:40 +02:00
\RequirePackage{doi}
\RequirePackage{xurl}
\RequirePackage{orcidlink}
\RequirePackage[
type={CC},
modifier={by-sa},
version={4.0},
]{doclicense}
\RequirePackage[
2024-04-18 12:49:53 +02:00
%nameinlink,
noabbrev
]{cleveref}
\usepackage[
abbreviations, % create "abbreviations" glossary
%nomain, % don't create "main" glossary
stylemods=longbooktabs, % do the adjustments for the longbooktabs styles,
automake
2024-04-10 13:24:58 +02:00
]{glossaries-extra}
2024-04-08 17:24:40 +02:00
\setabbreviationstyle[acronym]{long-short}
2024-03-21 19:36:09 +01:00
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
urlcolor=primaryLink,
linkcolor=primaryLink,
anchorcolor=primaryLink,
2024-04-18 12:49:53 +02:00
citecolor=primaryCite,
%linktoc=page
}
\newcommand*{\glsplainhyperlink}[2]{%
\begingroup%
\hypersetup{hidelinks}%
\hyperlink{#1}{#2}%
\endgroup%
}
\let\oldgls=\gls
\renewcommand{\gls}[1]{{\hypersetup{hidelinks}%
\oldgls{#1}}}%
\let\oldGls=\Gls
\renewcommand{\Gls}[1]{{\hypersetup{hidelinks}%
\oldGls{#1}}}%
%\renewcommand*{\glstextformat}[1]{\begingroup\hypersetup{hidelinks}#1\endgroup}
%\renewcommand*{\glsdohyperlink}[2]{%
% {\hypersetup{hidelinks=true}\hyperlink{#1}{#2}}}
\renewcommand*{\glsentryfmt}{%
\hypersetup{hidelinks}\glshyperlink[\glsgenentryfmt]{\glslabel}%
}
2024-03-21 19:36:09 +01:00
2024-04-10 13:24:58 +02:00
% Force text on right side, float on left side (does not work well)
\usepackage{sty/floatlefttextright}
2024-03-21 19:36:09 +01:00
\renewcommand\maketitle{\include{titlepage}}
2024-03-27 19:51:22 +01:00
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}
\renewcommand*{\mkbibnameprefix}[1]{\textsc{#1}}
2024-04-08 17:24:40 +02:00
% Ensure summary is on even page
\newcommand*\cleartoleftpage{
2024-04-10 13:24:58 +02:00
\clearpage\ifodd\c@page
\hbox{}
\vspace*{\fill}
\thispagestyle{empty}
\newpage
\fi
}
\usepackage{scrhack}
% From S. Ivanov hdr preamble
\iffalse
\titleformat{\chapter}[frame]
{\itshape\color{primary}}
{\filright
\normalsize
\enspace Chapter \thechapter\enspace}
{10mm}
{\fontsize{35}{20}\selectfont\normalfont\bfseries\filright\hspace{1ex}}
\titleformat{\section}{\Large\normalfont\bfseries\color{primary}}{\thesection \hspace{1ex}}{1ex}{}
\titleformat{\subsection}{\large\normalfont\bfseries\color{primary}}{\thesubsection \hspace{1ex}}{1ex}{}
\titleformat{\subsubsection}{\normalsize\normalfont\bfseries\color{primary}}{}{1ex}{}
\newcommand{\changelocaltocdepth}[1]{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{#1}}%
\setcounter{tocdepth}{#1}%
}
\fi
2024-04-17 10:50:29 +02:00
%
% \usepackage{sty/cleanthesis-extracts}
\RequirePackage[manualmark]{scrlayer-scrpage}
\renewcommand*\chaptermark[1]{%
\markboth{\Ifnumbered{chapter}{\chaptermarkformat}{}}{#1}% <- outdated macro replaced
}
\AfterTOCHead[toc]{\markboth{}{\contentsname}}
\clearpairofpagestyles
\clubpenalty = 10000
\widowpenalty = 10000
\automark[section]{part}
\setlength{\footheight}{120pt} % avoids scrlayer-scrpage warning:
% footheight to low warning
\setlength{\footskip}{185pt} % BAD HACK that moves the foot downwards
\KOMAoption{footwidth}{foot:53pt} % BAD HACK that moves the foot towards
\setkomafont{pagefoot}{\normalfont\footnotesize}
\setkomafont{pagenumber}{\normalfont \fontfamily{\sfdefault}\selectfont \normalsize \bfseries\color{black}}
\renewcommand{\partmark}[1]{%
\markboth{%
% use \@chapapp instead of \chaptername to avoid
% 'Chapter A Appendix ...', thanks to @farbverlust (issue #47)
\fontfamily{\sfdefault}\selectfont
{\color{fgBlue}\textbf{\partname\ \thepart}}%
\quad%
\protect\begin{minipage}[t]{.65\textwidth}%
#1%
\protect\end{minipage}%
}{}%
}
\newlength{\lensectionnumber}
\renewcommand{\sectionmark}[1]{%
\markright{%
\normalsize\fontfamily{\sfdefault}\selectfont\bfseries
\setlength{\lensectionnumber}{0em}
\settowidth{\lensectionnumber}{\textbf{\thesection}\quad}
\protect\begin{minipage}[t]{.72\textwidth}%
{\ }% bad hack to prevent a wrong baseline for the minipage
\protect\raggedleft%
\hangindent=\lensectionnumber%
{\color{black}\textbf{\fontfamily{\sfdefault}\selectfont\thesection}}%
\quad%
#1%
\protect\end{minipage}%
}%
}
\newcommand{\ctfooterline}{%
\color{black}\rule[-90pt]{1.25pt}{100pt}%
}
% Page number for odd (right) pages
\newcommand{\ctfooterrightpagenumber}{%
\ctfooterline%
\hspace*{10pt}%
\begin{minipage}[b]{1.5cm}%
\pagemark\ %
\end{minipage}%
}
%% Page number for even (left) pages
\newcommand{\ctfooterleftpagenumber}{%
\begin{minipage}[b]{1.5cm}%
\raggedleft\pagemark%
\end{minipage}%
\hspace*{10pt}%
\ctfooterline%
}
%% Defines the content for header and footer
\lehead{}
\cehead{}
\rehead{}
\lohead{}
\cohead{}
\rohead{}
\lefoot[% > plain
\ctfooterleftpagenumber%
]{% > srcheadings
\ctfooterleftpagenumber%
\hspace*{0.75cm}%
%\headmark%
}
\cefoot{}
\refoot{}
\lofoot{}
\cofoot{}
\rofoot[% > plain
\ctfooterrightpagenumber%
]{% > srcheadings
%\headmark%
\hspace*{0.75cm}%
\ctfooterrightpagenumber%
}