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
RevLine 
[9376]1%% ==============================================================================
[11128]2%% NEMO.sty: all customizations (packages, styles, cmds)
[9376]3%% ==============================================================================
4
5
[9388]6%% LaTeX packages
7%% ==============================================================================
[11123]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
[9388]23
24%% Extensions in bundle package
[10442]25\usepackage{amssymb, graphicx, makeidx, tabularx}
[9388]26
27%% Configuration
28\captionsetup{margin=10pt, font={small}, labelsep=colon, labelfont={bf}}
[9394]29\idxlayout{font=footnotesize, columns=3}
30\renewcommand{\bibfont}{\footnotesize}
31\renewcommand{\bibsep}{3pt}
[9388]32
33
34%% Styles
35%% ==============================================================================
[9389]36\pagestyle{fancy}
[11128]37\bibliographystyle{../../styles/ametsoc}
[9389]38
[9388]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}
[9389]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
[9388]63}
64\def\@makechapterhead#1{
65   \hbox{
[9389]66      \huge\LignesVerticales\hspace{-0.5cm}
67      \GrosCarreAvecUnChiffre{\thechapter}\hspace{0.2cm}
[9388]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
[10442]92%% Global custom commands: \newcommand{<name>}[<args>][<first argument value>]{<code>}
93%% ==============================================================================
[9388]94
[10442]95%% NEMO and Fortran in small capitals
96\newcommand{\NEMO}{\textsc{nemo}}
97\newcommand{\fortran}{\textsc{Fortran}}
98\newcommand{\fninety}{\textsc{Fortran 90}}
[9376]99
[10442]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.}}
[9376]108
[10442]109%% Inline maths
110\newcommand{\fractext}[2]{\textstyle \frac{#1}{#2}}
111\newcommand{\rdt}{\Delta t}
[9376]112
[10442]113%% Text env. for Gurvan
114\newcommand{\gmcomment}[1]{}
[9376]115
[10585]116%% Index entries (italic font for files, preformat for code)
[11007]117\newcommand{\hf}[1]{\textit{#1.h90}            \index{h90 files!#1}}
[10442]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}}
[10585]121\newcommand{\mdl}[1]{\textit{#1.F90}           \index{Modules!#1}}
[11007]122\newcommand{\ngn}[1]{\texttt{#1}               \index{Namelist Group Names!#1}}
123\newcommand{\np}[1]{\texttt{#1}                \index{Namelist parameters!#1}}
[10442]124\newcommand{\rou}[1]{\texttt{#1}               \index{Routines!#1}}
[9388]125
[10442]126%% Maths
[10544]127\newcommand{\lt}{\left}
128\newcommand{\rt}{\right}
[10442]129\newcommand{\vect}[1]{\ensuremath{\mathbf{#1}}}
130\newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}}
[9388]131
[10442]132%% Namelists inclusion
133\newcommand{\nlst}[1]{\forfile{../../../namelists/#1}}
[9376]134
135
[10442]136%% Minted package: syntax highlighting configuration
137%% ==============================================================================
[9376]138
[10442]139%% Global highlighting style
140\setminted{style=emacs, fontsize=\scriptsize, breaklines, frame=leftline}
141\setminted[xml]{style=borland} %% Specific per language
[9376]142
[10442]143%% Oneliner
144\newmint[forline]{fortran}{}   % \forline|...|
145\newmint[xmlline]{xml}{}       % \xmlline|...|
146\newmint[cmd]{console}{}       % \cmd|...|
[9376]147
[10442]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}
[9376]153
[10442]154%% File
155\newmintedfile[forfile]{fortran}{}   % \forfile{../namelists/nam...}
[9376]156
[10442]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.