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 @ 10585

Last change on this file since 10585 was 10585, checked in by nicolasmartin, 5 years ago

Shrink SI3 abstract in REFERENCES.bib and add missing \hf{} index entry for .h90 routines in NEMO manual

File size: 5.4 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
23%% Extensions in bundle package
24
25\usepackage{amssymb, graphicx, makeidx, tabularx}
26
27
28%% Configuration
29
30\captionsetup{margin=10pt, font={small}, labelsep=colon, labelfont={bf}}
31\graphicspath{{../../../figures/}}
32\hypersetup{
33   pdftitle={NEMO ocean engine}, pdfauthor={Gurvan Madec, and NEMO System Team},
34   colorlinks
35}
36\idxlayout{font=footnotesize, columns=3}
37\renewcommand{\bibfont}{\footnotesize}
38\renewcommand{\bibsep}{3pt}
39
40
41%% Styles
42%% ==============================================================================
43
44\pagestyle{fancy}
45\bibliographystyle{../main/ametsoc}
46
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}
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
74}
75\def\@makechapterhead#1{
76   \hbox{
77      \huge\LignesVerticales\hspace{-0.5cm}
78      \GrosCarreAvecUnChiffre{\thechapter}\hspace{0.2cm}
79      \hbox{#1}
80   }
81   \par\vskip
821cm
83}
84\def\@makeschapterhead#1{
85   \hbox{
86      \huge\LignesVerticales
87      \hbox{#1}
88   }
89   \par\vskip
902cm
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
103%% Global custom commands: \newcommand{<name>}[<args>][<first argument value>]{<code>}
104%% ==============================================================================
105
106%% NEMO and Fortran in small capitals
107\newcommand{\NEMO}{\textsc{nemo}}
108\newcommand{\fortran}{\textsc{Fortran}}
109\newcommand{\fninety}{\textsc{Fortran 90}}
110
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.}}
119
120%% Inline maths
121\newcommand{\fractext}[2]{\textstyle \frac{#1}{#2}}
122\newcommand{\rdt}{\Delta t}
123
124%% Text env. for Gurvan
125\newcommand{\gmcomment}[1]{}
126
127%% Index entries (italic font for files, preformat for code)
128\newcommand{\hf}[1]{\textit{#1.h90}            \index{h90 file!#1}}
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}}
132\newcommand{\mdl}[1]{\textit{#1.F90}           \index{Modules!#1}}
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}}
136
137%% Maths
138\newcommand{\lt}{\left}
139\newcommand{\rt}{\right}
140\newcommand{\vect}[1]{\ensuremath{\mathbf{#1}}}
141\newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}}
142
143%% Shortened DOI in bibliography
144\newcommand{\doi}[1]{\href{http://dx.doi.org/#1}{doi:#1}}
145
146%% Namelists inclusion
147\newcommand{\nlst}[1]{\forfile{../../../namelists/#1}}
148
149
150%% Minted package: syntax highlighting configuration
151%% ==============================================================================
152
153%% Global highlighting style
154\setminted{style=emacs, fontsize=\scriptsize, breaklines, frame=leftline}
155\setminted[xml]{style=borland} %% Specific per language
156
157%% Oneliner
158\newmint[forline]{fortran}{}   % \forline|...|
159\newmint[xmlline]{xml}{}       % \xmlline|...|
160\newmint[cmd]{console}{}       % \cmd|...|
161
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}
167
168%% File
169\newmintedfile[forfile]{fortran}{}   % \forfile{../namelists/nam...}
170
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{...}
Note: See TracBrowser for help on using the repository browser.