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.
Preamble.tex in branches/2017/dev_merge_2017/DOC/TexFiles – NEMO

source: branches/2017/dev_merge_2017/DOC/TexFiles/Preamble.tex @ 9350

Last change on this file since 9350 was 9350, checked in by nicolasmartin, 6 years ago

Add extra message filters and fix too long section titles for ToC

File size: 8.4 KB
RevLine 
[6998]1\documentclass[a4paper,11pt]{book}
2%\documentclass[a4paper,11pt,makeidx]{book} <== may need this to generate index
3
4%  makeindex NEMO_book  <== to regenerate the index
5%  bibtex    NEMO_book  <== to generate  the bibliography
6
[9347]7%% Silence package: filter output messages and warnings
8\usepackage{silence}
[9350]9%%% LaTeX warnings: package and label
[9347]10\WarningFilter*{latex}{Package}
[9350]11\WarningFilter*{latex}{Label}
[9347]12%%% minitoc hints
13\WarningFilter{minitoc(hints)}{W0023}
[9350]14\WarningFilter{minitoc(hints)}{W0024}
[9347]15\WarningFilter{minitoc(hints)}{W0028}
16\WarningFilter{minitoc(hints)}{W0030}
17%%% natbib citation warning "Citation ... multiply defined"
18\WarningFilter*{natbib}{Citation}
19%%% Filter all warnings
20%\WarningsOff*
21
[6998]22%\usepackage[french]{babel}
23%\usepackage{color}
24\usepackage{graphicx}                            % allows insertion of pictures
25%\usepackage{graphics}                           % allows insertion of pictures
26\graphicspath{{Figures/}}                                  % Set global directory for pictures
27%\DeclareGraphicsExtensions{.pdf,.eps}                      % Use .eps for LaTeX2HTML
28%\usepackage{xcolor}                                       % Incompatibility with color -> graphicx
29\usepackage[capbesideposition={top,center}]{floatrow}      % allows captions
30\floatsetup[table]{style=plaintop}                         % beside pictures
31\usepackage[margin=10pt,font={small},                      % Gives small font for captions
32labelsep=colon,labelfont={bf}]{caption}                    %
33\usepackage{enumitem}                                      % allows non-bold description items
34\usepackage{longtable}                                     % allows multipage tables
35%\usepackage{colortbl}                                     % gives coloured panels behind table columns
36
37%hyperref
38\usepackage[pdftitle={NEMO ocean engine},pdfauthor={Gurvan Madec},pdfstartview=FitH,
39bookmarks=true,bookmarksopen=true,breaklinks=true,colorlinks=true,
40linkcolor=blue,anchorcolor=blue,citecolor=blue,filecolor=blue,menucolor=blue,urlcolor=blue]{hyperref}
41% pdfsubject={The preprint document class
42%   elsart},% pdfkeywords={diapycnal diffusion,numerical mixing,z-level models},%%  usage of exteranl hyperlink :  \href{mailto:my_address@wikibooks.org}{my\_address@wikibooks.org}
43%                                                 \url{http://www.wikibooks.org}
44%                                     or         \href{http://www.wikibooks.org}{wikibooks home}
45
46
47%%%% page styles etc................
48\usepackage{fancyhdr}
49\pagestyle{fancy}
50% with this we ensure that the chapter and section
51% headings are in lowercase.
52\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
53\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
54\fancyhf{}             % delete current setting for header and footer
55\fancyhead[LE,RO]{\bfseries\thepage}
56\fancyhead[LO]{\bfseries\hspace{-0em}\rightmark}
57\fancyhead[RE]{\bfseries\leftmark}
58\renewcommand{\headrulewidth}{0.5pt}
59\renewcommand{\footrulewidth}{0pt  }
60\addtolength{\headheight}{2.6pt}   % make space for the rule
61%\addtolength{\headheight}{1.6pt}   % make space for the rule
62% get rid of headers on plain pages
63\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}
64
65
66%%%%  Section number in Margin.......
67% typeset the number of each section in the left margin, with the start of each instance of
68% sectional heading text aligned with the left hand edge of  the body text.
69\makeatletter
70\def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\quad}}
71\makeatother
72
73% Leave blank pages completely empty, w/o header
74\makeatletter
75\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
76  \hbox{}
77  \vspace*{\fill}
78  \vspace{\fill}
79  \thispagestyle{empty}
80  \newpage
81  \if@twocolumn\hbox{}\newpage\fi\fi\fi}
82\makeatother
83
84%%%% define the chapter  style ................
85\usepackage{minitoc}          %In French : \usepackage[french]{minitoc}
86%\usepackage{mtcoff}          % invalidate the use of minitocs
87\usepackage{fancybox}
88
89\makeatletter
90\def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax}
91\def\LignesVerticales{%
92  \let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
93\def\GrosCarreAvecUnChiffre#1{%
94  \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
95 \rlap{\hbox to 1cm{\hss\mbox{\color{white} #1}\hss}}%
96  \vrule height 0pt width 1cm depth 0pt}
97\def\GrosCarreAvecTroisChiffre#1{%
98  \rlap{\vrule height 0.8cm width 1.6cm depth 0.2cm}%
99 \rlap{\hbox to 1.5cm{\hss\mbox{\color{white} #1}\hss}}%
100  \vrule height 0pt width 1cm depth 0pt}
101
102\def\@makechapterhead#1{\hbox{%
103   \huge
104    \LignesVerticales
105    \hspace{-0.5cm}%
106    \GrosCarreAvecUnChiffre{\thechapter}
107    \hspace{0.2cm}\hbox{#1}%
108%    \GrosCarreAvecTroisChiffre{\thechapter}
109%    \hspace{1cm}\hbox{#1}%
110%}\par\vskip 2cm}
111}\par\vskip 1cm}
112\def\@makeschapterhead#1{\hbox{%
113   \huge
114    \LignesVerticales
115    %\hspace{0.5cm}%
116    \hbox{#1}%
117}\par\vskip 2cm}
118\makeatother
119
120%\def\thechapter{\Roman{chapter}}      % chapter number to be Roman
121
122
123%%%%           Mathematics...............
124%\documentclass{amsart}
125\usepackage{xspace}                              % helpd ensure correct spacing after macros
126\usepackage{latexsym,amssymb,amsmath}
127\allowdisplaybreaks[1]           % allow page breaks in the middle of equations
128\usepackage{TexFiles/Styles/math_abbrev}    % use maths shortcuts
129
130\usepackage{times}             % use times font for text
131%\usepackage{mathtime}                          % font for illustrator to work (belleek fonts )
132%\usepackage[latin1]{inputenc}                % allows some unicode removed (agn)
133
134
135%%% essai commande
136\newcommand{\nl}[1]{\texttt{\small{\textcolor{blue}{#1}}}}
137\newcommand{\nlv}[1]{\texttt{\footnotesize#1}\xspace}
138\newcommand{\smnlv}[1]{\texttt{\scriptsize#1}\xspace}
139
140%%%% namelist & code display................................
141\usepackage{alltt,verbatim}   %%  alltt & verbatim for namelist
142% namelists
143\newcommand{\namdisplay}[1]{\begin{alltt}{\tiny\verbatiminput{Namelists/#1}}\end{alltt}\vspace{-10pt}}
144\newcommand{\namtools}[1]{\begin{alltt}{\tiny\verbatiminput{Namelists/#1}}\end{alltt}\vspace{-10pt}}
145% code display
[9346]146\newcommand{\codedisplay} [1] {\begin{alltt}{\tiny {\begin{verbatim} {#1}} \end{verbatim}} \end{alltt}      }
[6998]147
148
149
150%%%% commands for working with text................................
151% command to "comment out" portions of text ({} argument) or not ({#1} argument)
152\newcommand{\amtcomment}[1]{}    % command to "commented out" portions of text or not (#1 in argument)
153\newcommand{\sgacomment}[1]{}    % command to "commented out" portions of
154\newcommand{\gmcomment}[1]{}     % command to "commented out" portions of
[7705]155\newcommand{\sfcomment}[1]{}     % command to "commented out" portions of
[6998]156%                                               % text that span line breaks
157%Red (NR) or Yellow(WARN)
158%\newcommand{\NR}   {\colorbox{red}   {#1}}
159%\newcommand{\WARN} {\colorbox{yellow}{#1}}
160
161
162
163%%% index commands......................
164\usepackage{makeidx}
165%\usepackage{showidx}            % show the index entry
166
167\newcommand{\mdl}[1]{\textit{#1.F90}\index{Modules!#1}}  %module (mdl)
168\newcommand{\rou}[1]{\textit{#1}\index{Routines!#1}}  %module (routine)
169\newcommand{\hf}[1]{\textit{#1.h90}\index{h90 file!#1}}  %module (h90 files)
170\newcommand{\ngn}[1]{\textit{#1}\index{Namelist Group Name!#1}}   %namelist name (nampar)
171\newcommand{\np}[1]{\textit{#1}\index{Namelist variables!#1}}        %namelist variable
172\newcommand{\jp}[1]{\textit{#1}\index{Model parameters!#1}} %model parameter (jp)
173\newcommand{\pp}[1]{\textit{#1}\index{Model parameters!#1}}    %namelist parameter (pp)
174\newcommand{\ifile}[1]{\textit{#1.nc  }\index{Input NetCDF files!#1.nc}}   %input NetCDF files (.nc)
175\newcommand{\key}[1]{\textbf{key\_#1}\index{CPP keys!key\_#1}} %key_cpp (key)
176\newcommand{\NEMO}{\textit{NEMO}\xspace}  %NEMO (nemo)
177
178%%%%   Bibliography   .............
179\usepackage[nottoc,notlof,notlot]{tocbibind}
180\usepackage[square,comma]{natbib}
181\bibpunct{[}{]}{,}{a}{}{;}                           %suppress "," after "et al."
182\providecommand{\bibfont}{\small}
183
184\usepackage{subfiles}                          % Separate compilation of chapters from whole manual
185%\newcommand{\onlyinsubfile}[1]{#1}             % New commands for printing parts according to
186%\newcommand{\notinsubfile}[1]{}                % the file being compiled
187% Commands to use in the documentfile
188%\renewcommand{\onlyinsubfile}[1]{}                      % Appears only if chapter   .tex file is compiled
189%\renewcommand{\notinsubfile}[1]{#1}                     %    "    ""   "" NEMO_book .tex file is compiled
190
191\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
Note: See TracBrowser for help on using the repository browser.