[9376] | 1 | %% ============================================================================== |
---|
[10442] | 2 | %% NEMO_manual.sty: all customizations (packages, styles, cmds) |
---|
[9376] | 3 | %% ============================================================================== |
---|
| 4 | |
---|
| 5 | |
---|
[9388] | 6 | %% LaTeX packages |
---|
| 7 | %% ============================================================================== |
---|
| 8 | |
---|
[10125] | 9 | \usepackage{natbib} %% bib |
---|
| 10 | \usepackage{caption} %% caption |
---|
| 11 | \usepackage{xcolor} %% color |
---|
| 12 | \usepackage{times} %% font |
---|
| 13 | \usepackage{hyperref} %% hyper |
---|
| 14 | \usepackage{idxlayout} %% index |
---|
| 15 | \usepackage{enumitem} %% list |
---|
| 16 | \usepackage{minted} %% listing |
---|
| 17 | \usepackage{amsmath} %% maths |
---|
| 18 | \usepackage{fancyhdr} %% page |
---|
| 19 | \usepackage{minitoc} %% toc |
---|
| 20 | \usepackage{subfiles} %% subdocs |
---|
| 21 | \usepackage[utf8]{inputenc} %% input encoding |
---|
[9388] | 22 | |
---|
| 23 | %% Extensions in bundle package |
---|
| 24 | |
---|
[10442] | 25 | \usepackage{amssymb, graphicx, makeidx, tabularx} |
---|
[9388] | 26 | |
---|
| 27 | |
---|
| 28 | %% Configuration |
---|
| 29 | |
---|
| 30 | \captionsetup{margin=10pt, font={small}, labelsep=colon, labelfont={bf}} |
---|
[10146] | 31 | \graphicspath{{../../../figures/}} |
---|
[9388] | 32 | \hypersetup{ |
---|
[10442] | 33 | pdftitle={NEMO ocean engine}, pdfauthor={Gurvan Madec, and NEMO System Team}, |
---|
[9388] | 34 | colorlinks |
---|
| 35 | } |
---|
[9394] | 36 | \idxlayout{font=footnotesize, columns=3} |
---|
| 37 | \renewcommand{\bibfont}{\footnotesize} |
---|
| 38 | \renewcommand{\bibsep}{3pt} |
---|
[9388] | 39 | |
---|
| 40 | |
---|
| 41 | %% Styles |
---|
| 42 | %% ============================================================================== |
---|
| 43 | |
---|
[9389] | 44 | \pagestyle{fancy} |
---|
[10146] | 45 | \bibliographystyle{../main/ametsoc} |
---|
[9389] | 46 | |
---|
[9388] | 47 | %% Additionnal fonts |
---|
| 48 | |
---|
| 49 | \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | %% Page layout |
---|
| 53 | |
---|
| 54 | \fancyhf{} |
---|
| 55 | \fancyhead[LE,RO]{\bfseries\thepage} |
---|
| 56 | \fancyhead[LO]{\bfseries\hspace{-0em}\rightmark} |
---|
| 57 | \renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}} |
---|
| 58 | \fancyhead[RE]{\bfseries\leftmark} |
---|
| 59 | \renewcommand{\chaptermark}[1]{\markboth{#1}{}} |
---|
| 60 | \renewcommand{\headrulewidth}{0.5pt} |
---|
| 61 | \renewcommand{\footrulewidth}{0pt } |
---|
| 62 | \addtolength{\headheight}{2.6pt} |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | %% Catcodes |
---|
| 66 | |
---|
| 67 | \makeatletter |
---|
| 68 | \def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax} |
---|
| 69 | \def\LignesVerticales{\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV} |
---|
[9389] | 70 | \def\GrosCarreAvecUnChiffre#1{ |
---|
| 71 | \rlap{\vrule height 0.8cm width 1cm depth 0.2cm} |
---|
| 72 | \rlap{\hbox to 1cm{\hss\mbox{\color{white} #1}\hss}} |
---|
| 73 | \vrule height 0pt width 1cm depth 0pt |
---|
[9388] | 74 | } |
---|
| 75 | \def\@makechapterhead#1{ |
---|
| 76 | \hbox{ |
---|
[9389] | 77 | \huge\LignesVerticales\hspace{-0.5cm} |
---|
| 78 | \GrosCarreAvecUnChiffre{\thechapter}\hspace{0.2cm} |
---|
[9388] | 79 | \hbox{#1} |
---|
| 80 | } |
---|
| 81 | \par\vskip |
---|
| 82 | 1cm |
---|
| 83 | } |
---|
| 84 | \def\@makeschapterhead#1{ |
---|
| 85 | \hbox{ |
---|
| 86 | \huge\LignesVerticales |
---|
| 87 | \hbox{#1} |
---|
| 88 | } |
---|
| 89 | \par\vskip |
---|
| 90 | 2cm |
---|
| 91 | } |
---|
| 92 | \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else |
---|
| 93 | \hbox{} |
---|
| 94 | \vspace*{\fill} |
---|
| 95 | \vspace{\fill} |
---|
| 96 | \thispagestyle{empty} |
---|
| 97 | \newpage |
---|
| 98 | \if@twocolumn\hbox{}\newpage\fi\fi\fi} |
---|
| 99 | \def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\quad}} |
---|
| 100 | \makeatother |
---|
| 101 | |
---|
| 102 | |
---|
[10442] | 103 | %% Global custom commands: \newcommand{<name>}[<args>][<first argument value>]{<code>} |
---|
| 104 | %% ============================================================================== |
---|
[9388] | 105 | |
---|
[10442] | 106 | %% NEMO and Fortran in small capitals |
---|
| 107 | \newcommand{\NEMO}{\textsc{nemo}} |
---|
| 108 | \newcommand{\fortran}{\textsc{Fortran}} |
---|
| 109 | \newcommand{\fninety}{\textsc{Fortran 90}} |
---|
[9376] | 110 | |
---|
[10442] | 111 | %% Common aliases |
---|
| 112 | \renewcommand{\deg}[1][]{\ensuremath{^{\circ}#1}} |
---|
| 113 | \newcommand{\zstar }{\ensuremath{z^\star}} |
---|
| 114 | \newcommand{\sstar }{\ensuremath{s^\star}} |
---|
| 115 | \newcommand{\ztilde}{\ensuremath{\tilde z}} |
---|
| 116 | \newcommand{\stilde}{\ensuremath{\tilde s}} |
---|
| 117 | \newcommand{\ie}{\ensuremath{i.e.}} |
---|
| 118 | \newcommand{\eg}{\ensuremath{e.g.}} |
---|
[9376] | 119 | |
---|
[10442] | 120 | %% Inline maths |
---|
| 121 | \newcommand{\fractext}[2]{\textstyle \frac{#1}{#2}} |
---|
| 122 | \newcommand{\rdt}{\Delta t} |
---|
[9376] | 123 | |
---|
[10442] | 124 | %% Text env. for Gurvan |
---|
| 125 | \newcommand{\gmcomment}[1]{} |
---|
[9376] | 126 | |
---|
[10585] | 127 | %% Index entries (italic font for files, preformat for code) |
---|
| 128 | \newcommand{\hf}[1]{\textit{#1.h90} \index{h90 file!#1}} |
---|
[10442] | 129 | \newcommand{\ifile}[1]{\textit{#1.nc} \index{Input NetCDF files!#1.nc}} |
---|
| 130 | \newcommand{\jp}[1]{\texttt{#1} \index{Model parameters!#1}} |
---|
| 131 | \newcommand{\key}[1]{\texttt{\textbf{key\_#1}} \index{CPP keys!key\_#1}} |
---|
[10585] | 132 | \newcommand{\mdl}[1]{\textit{#1.F90} \index{Modules!#1}} |
---|
[10442] | 133 | \newcommand{\ngn}[1]{\texttt{#1} \index{Namelist Group Name!#1}} |
---|
| 134 | \newcommand{\np}[1]{\texttt{#1} \index{Namelist variables!#1}} |
---|
| 135 | \newcommand{\rou}[1]{\texttt{#1} \index{Routines!#1}} |
---|
[9388] | 136 | |
---|
[10442] | 137 | %% Maths |
---|
[10544] | 138 | \newcommand{\lt}{\left} |
---|
| 139 | \newcommand{\rt}{\right} |
---|
[10442] | 140 | \newcommand{\vect}[1]{\ensuremath{\mathbf{#1}}} |
---|
| 141 | \newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}} |
---|
[9388] | 142 | |
---|
[10442] | 143 | %% Shortened DOI in bibliography |
---|
| 144 | \newcommand{\doi}[1]{\href{http://dx.doi.org/#1}{doi:#1}} |
---|
[9376] | 145 | |
---|
[10442] | 146 | %% Namelists inclusion |
---|
| 147 | \newcommand{\nlst}[1]{\forfile{../../../namelists/#1}} |
---|
[9376] | 148 | |
---|
| 149 | |
---|
[10442] | 150 | %% Minted package: syntax highlighting configuration |
---|
| 151 | %% ============================================================================== |
---|
[9376] | 152 | |
---|
[10442] | 153 | %% Global highlighting style |
---|
| 154 | \setminted{style=emacs, fontsize=\scriptsize, breaklines, frame=leftline} |
---|
| 155 | \setminted[xml]{style=borland} %% Specific per language |
---|
[9376] | 156 | |
---|
[10442] | 157 | %% Oneliner |
---|
| 158 | \newmint[forline]{fortran}{} % \forline|...| |
---|
| 159 | \newmint[xmlline]{xml}{} % \xmlline|...| |
---|
| 160 | \newmint[cmd]{console}{} % \cmd|...| |
---|
[9376] | 161 | |
---|
[10442] | 162 | %% Multi-lines |
---|
| 163 | \newminted[forlines]{fortran}{} % \begin{forlines} |
---|
| 164 | \newminted[xmllines]{xml}{} % \begin{xmllines} |
---|
| 165 | \newminted[cmds]{console}{} % \begin{cmds} |
---|
| 166 | \newminted[clines]{c}{} % \begin{clines} |
---|
[9376] | 167 | |
---|
[10442] | 168 | %% File |
---|
| 169 | \newmintedfile[forfile]{fortran}{} % \forfile{../namelists/nam...} |
---|
[9376] | 170 | |
---|
[10442] | 171 | %% Inline |
---|
| 172 | \newmintinline[forcode]{fortran}{fontsize=auto, frame=lines} % \forcode{...} |
---|
| 173 | \newmintinline[xmlcode]{xml}{ fontsize=auto, frame=lines} % \xmlcode{...} |
---|
| 174 | \newmintinline[snippet]{console}{fontsize=auto, frame=lines} % \snippet{...} |
---|