New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
NEMO_manual.sty in NEMO/trunk/doc/latex/NEMO/main – NEMO

source: NEMO/trunk/doc/latex/NEMO/main/NEMO_manual.sty @ 11022

Last change on this file since 11022 was 11022, checked in by nicolasmartin, 3 years ago

Fix the relative path for the bibliography style file to apply it globally

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