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.sty in NEMO/trunk/doc/latex/styles – NEMO

source: NEMO/trunk/doc/latex/styles/NEMO.sty @ 11128

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

Create styles folder to gather common files between manuals: NEMO.sty and ametsoc.bst

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