datalad-handbook/docs/latex/preamble_end.sty
2023-11-06 09:51:24 +01:00

117 lines
3.6 KiB
TeX

\renewcommand{\sphinxstyletheadfamily}{\bfseries}
% make :term: references visually distinct in a print
\renewcommand{\sphinxtermref}[1]{\textsc{#1}}
% better control over the spacing of list items
% MIH: we cannot use enumitem, it messes with the (description) list
% customizations done by sphinx
%\usepackage{enumitem}
\usepackage[labelfont=bf,singlelinecheck=false]{caption}
\usepackage[hang,flushmargin,multiple]{footmisc}
% make sure that loooong URLs always break
\usepackage{xurl}
% make sure all float stay in their respective chapter
%\usepackage[chapter]{placeins}
% make enough room for the auto-generated header content
\setlength{\headheight}{13.6pt}
\usepackage{xcolor}
\definecolor{dataladyellow}{HTML}{FFA200}
\definecolor{dataladblue}{HTML}{7FD5FF}
\definecolor{dataladgray}{HTML}{333333}
\definecolor{windowsblue}{HTML}{126e12}
\definecolor{windowsgreen}{HTML}{66CC33}
\definecolor{windowsyellow}{HTML}{FFCC00}
% nice boxes
\usepackage[skins,breakable,many]{tcolorbox}
\tcbset{breakable}
\tcbset{drop lifted shadow}
\tcbset{sharp corners}
\tcbset{fonttitle=\bfseries}
\tcbset{%
ribbon win/.style={overlay={
\begin{scope}[shift={([xshift=-5mm,yshift=-3mm]frame.north west)}]
\path(0,0) node[inner sep=0] {\includegraphics{win_boxicon}};
\end{scope}}}
}
\tcbset{%
ribbon git/.style={overlay={
\begin{scope}[shift={([xshift=-5mm,yshift=-3mm]frame.north west)}]
\path(0,0) node[inner sep=0] {\includegraphics{git_boxicon}};
\end{scope}}}
}
\tcbset{%
ribbon more/.style={overlay={
\begin{scope}[shift={([xshift=-5mm,yshift=-3mm]frame.north west)}]
\path(0,0) node[inner sep=0] {\includegraphics{more_boxicon}};
\end{scope}}}
}
\tcbset{%
ribbon important/.style={overlay={
\begin{scope}[shift={([xshift=-5mm,yshift=-3mm]frame.north west)}]
\path(0,0) node[inner sep=0] {\includegraphics{important_boxicon}};
\end{scope}}}
}
\newcounter{HandbookWIN}[chapter]
\renewcommand\theHandbookWIN{W\arabic{chapter}.\arabic{HandbookWIN}}
\newtcolorbox[%
use counter*=HandbookWIN,
number within=chapter,
list inside=windowswits]{windowswit}[2][]{%
enhanced, ribbon win, title={#2},
coltitle=dataladgray,
colbacktitle=windowsgreen,
colframe=windowsgreen!70!black, #1
}
\newcounter{HandbookGIT}[chapter]
\renewcommand\theHandbookGIT{G\arabic{chapter}.\arabic{HandbookGIT}}
\newtcolorbox[%
use counter*=HandbookGIT,
number within=chapter,
list inside=gitusernotes]{gitusernote}[2][]{%
enhanced, ribbon git, title={#2},
coltitle=dataladgray,
colbacktitle=dataladblue,
colframe=dataladblue!70!black, #1
}
\newcounter{HandbookFOM}[chapter]
\renewcommand\theHandbookFOM{M\arabic{chapter}.\arabic{HandbookFOM}}
\newtcolorbox[
use counter*=HandbookFOM,
number within=chapter,
list inside=findoutmores]{findoutmore}[2][]{%
enhanced, ribbon more, title={#2},
coltitle=dataladgray,
colbacktitle=dataladyellow,
colframe=dataladyellow!70!black, #1
}
% unnumbered, they are short and placed at the exact position
% must change we there are in-text references
\newtcolorbox[
number within=chapter,
list inside=importantnotes]{importantnote}[2][]{%
enhanced, ribbon important, title={#2},
coltitle=white,
colbacktitle=dataladgray,
colframe=dataladgray!70!black, #1
}
\setcounter{tocdepth}{1}
\setcounter{secnumdepth}{1}
\numberwithin{table}{chapter}
\numberwithin{figure}{chapter}
% natural spacing between (long) numbers and titles in
% any TOC
\renewcommand{\numberline}[1]{#1~}
\newcommand{\findoutmoreiconinline}{\raisebox{-.1em}{\includegraphics[height=.9em]{more_boxicon_inline}}~}
\newcommand{\windowswiticoninline}{\raisebox{-.3em}{\includegraphics[height=1.2em]{win_boxicon}}~}