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

Last change on this file since 11577 was 11577, checked in by nicolasmartin, 13 months 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: 2.6 KB
Line 
1
2%% =================================================================================================
3%% Template structure for reference manuals
4%% =================================================================================================
5
6%% NEMO release version
7\def \version{trunk}
8
9%% Preamble
10%% =================================================================================================
11
12%% Document layout
13\documentclass[fontsize = 10pt, twoside, abstract]{scrreprt}
14
15%% Load configurations
16\input{../../global/preamble}
17
18%% End of common preamble between main and sub-files
19%% Override custom cmds for full manual compilation
20\newcommand{\onlyinsubfile}[1]{#1}
21\newcommand{\notinsubfile}[1]{}
22
23\begin{document}
24
25\renewcommand{\onlyinsubfile}[1]{}
26\renewcommand{\notinsubfile}[1]{#1}
27
28\renewcommand{\biblio}{}
29\renewcommand{\pindex}{}
30
31
32%% Frontmatter
33%% =================================================================================================
34
35\pagenumbering{gobble}   %% Disable page numbering temporarily
36
37%% Title page
38\input{../../global/frontpage}
39
40%% Footer for introductory parts (no header by cleaning default)
41\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}
42
43%% Information page (2nd page)
44\input{../../global/info_page}
45
46\listoffigures
47\listoflistings
48\listoftables
49
50\clearpage
51
52\pagenumbering{roman}
53\ofoot[]{\engine\ Reference Manual} \ifoot[]{\pagemark}
54
55\input{introduction}
56
57%% Table of Contents
58\tableofcontents
59
60\clearpage
61
62
63%% Mainmatter
64%% =================================================================================================
65
66%% Headings for document body
67\pagenumbering{arabic}
68\lohead{Chap.\ \thechapter\ \leftmark} \rehead{Sect.\ \thesection\ \rightmark}
69\ifoot[]{Page\ \pagemark\ of \pageref*{LastPage}}
70
71\include{chapters}
72
73
74%% Appendix
75%% =================================================================================================
76
77\appendix   %% Chapter numbering with letters by now
78\lohead{Apdx\ \thechapter\ \leftmark}
79\include{appendices}
80
81%% Append coding rules for every manual
82\input{../../global/coding_rules}
83
84\clearpage
85
86%% Backmatter
87%% =================================================================================================
88
89%% Bibliography
90\phantomsection
91\addcontentsline{toc}{chapter}{Bibliography}
92\lohead{Bibliography} \rehead{Bibliography}
93\bibliography{../main/bibliography}
94
95\clearpage
96
97%% Indexes
98\phantomsection
99\addcontentsline{toc}{chapter}{Indexes}
100\lohead{Indexes} \rehead{Indexes}
101\printindex[blocks]
102\printindex[keys]
103\printindex[modules]
104\printindex[parameters]
105\printindex[subroutines]
106
107\end{document}
Note: See TracBrowser for help on using the repository browser.