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

Last change on this file since 10544 was 10544, checked in by nicolasmartin, 19 months ago

Fixes for LaTeX compilation of NEMO manual

File size: 5.3 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 (italic font for files, preformat for code)
128\newcommand{\ifile}[1]{\textit{#1.nc}          \index{Input NetCDF files!#1.nc}}
129\newcommand{\mdl}[1]{\textit{#1.F90}           \index{Modules!#1}}
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{\ngn}[1]{\texttt{#1}               \index{Namelist Group Name!#1}}
133\newcommand{\np}[1]{\texttt{#1}                \index{Namelist variables!#1}}
134\newcommand{\rou}[1]{\texttt{#1}               \index{Routines!#1}}
135
136%% Maths
137\newcommand{\lt}{\left}
138\newcommand{\rt}{\right}
139\newcommand{\vect}[1]{\ensuremath{\mathbf{#1}}}
140\newcommand{\pd}[2][]{\ensuremath{\frac{\partial #1}{\partial #2}}}
141
142%% Shortened DOI in bibliography
143\newcommand{\doi}[1]{\href{http://dx.doi.org/#1}{doi:#1}}
144
145%% Namelists inclusion
146\newcommand{\nlst}[1]{\forfile{../../../namelists/#1}}
147
148
149%% Minted package: syntax highlighting configuration
150%% ==============================================================================
151
152%% Global highlighting style
153\setminted{style=emacs, fontsize=\scriptsize, breaklines, frame=leftline}
154\setminted[xml]{style=borland} %% Specific per language
155
156%% Oneliner
157\newmint[forline]{fortran}{}   % \forline|...|
158\newmint[xmlline]{xml}{}       % \xmlline|...|
159\newmint[cmd]{console}{}       % \cmd|...|
160
161%% Multi-lines
162\newminted[forlines]{fortran}{}   % \begin{forlines}
163\newminted[xmllines]{xml}{}       % \begin{xmllines}
164\newminted[cmds]{console}{}       % \begin{cmds}
165\newminted[clines]{c}{}           % \begin{clines}
166
167%% File
168\newmintedfile[forfile]{fortran}{}   % \forfile{../namelists/nam...}
169
170%% Inline
171\newmintinline[forcode]{fortran}{fontsize=auto, frame=lines}   % \forcode{...}
172\newmintinline[xmlcode]{xml}{    fontsize=auto, frame=lines}   % \xmlcode{...}
173\newmintinline[snippet]{console}{fontsize=auto, frame=lines}   % \snippet{...}
Note: See TracBrowser for help on using the repository browser.