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 NEMO/trunk/doc/latex/global – NEMO

source: NEMO/trunk/doc/latex/global/preamble.tex @ 11577

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

New LaTeX commands \nam and \np to mention namelist content
(Partial commit to serve as a backup before other large edits)
In order to benefit of the syntax highlighting and to have a simpler syntax for
citing namelist block (\nam) and parameter (\np) with an optional variable assignment (\forcode{...}),
at this time the only viable solution I found is to require a double marker for
what it looks like the same item:

  1. Marker with the real name: 'tra_adv' block or 'ln_flx' parameter
  2. Marker with underscore character escaping: 'tra\_adv' block or 'ln\_flx' parameter

Despite many searches and attempts, I did not find a workaround to edit on-the-fly one or
the other marker.
In fact, the problem is on one side that the LaTeX index interprets '_' as a switch for lowering like
in math mode while on the other hand the backslash is considered for Pygments as a typo in Fortran
(red box).

For instance, \nam and \np have as of now the aforementioned 2 mandatory arguments in
the previous order (between braces) + an optional argument for \np when the parameter is defined
(between brackets at the first position):

  • \nam: LaTeX code in the \nam{tra_adv}{tra\_adv} -> PDF ' in the &namtra_adv (namelist X.X) ' with syntax highlighting, the hyperlink and the index entry
  • \np: LaTeX code \np[=.true.]{ln_flx}{ln\_flx} -> PDF ln_flux=.true. with syntax highlighting for the whole string and the entry in the 'parameters' index
File size: 722 bytes
RevLine 
[11176]1
[11433]2%% Specific configuration
3\input{../main/definitions}
4
5%% Global configuration
[11176]6\input{../../global/packages}
7\input{../../global/highlighting}
[11433]8\input{../../global/indexes}
9\input{../../global/styles}
[11515]10\input{../../global/new_cmds}
11%\input{../../global/todonotes}
12
13%% Load hyperref at the end of the preamble to make it work with other pkgs
14\usepackage{hyperref}   %% links
15\hypersetup{
16  colorlinks,
17  citecolor = manualcolor, linkcolor = manualcolor, urlcolor = manualcolor,
[11572]18  final   %% Links even in draft mode
[11515]19}
20
[11572]21%% `\autoref` uncapitalization
22\renewcommand{\appendixautorefname}{appendix}
23\renewcommand{\equationautorefname}{equation}
24\renewcommand{\figureautorefname}{figure}
25\renewcommand{\tableautorefname}{table}
Note: See TracBrowser for help on using the repository browser.