Debian Codegraph @

texmf-dist/doc/latex/hep-paper/hep-paper-documentation.tex

raw
1 %%
2 %% This is file `hep-paper-documentation.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% hep-paper-implementation.dtx (with options: `documentation')
8 %% This is a generated file.
9 %% Copyright (C) 2019-2025 by Jan Hajer
10 %% This file may be distributed and/or modified under the
11 %% conditions of the LaTeX Project Public License, either
12 %% version 1.3c of this license or (at your option) any later
13 %% version. The latest version of this license is in:
14 %% http://www.latex-project.org/lppl.txt
15 %% and version 1.3c or later is part of all distributions of
16 %% LaTeX version 2005/12/01 or later.
17 \ProvidesFile{hep-paper-documentation.tex}[2025/09/01 v2.4 HEP-Paper documentation]
18 \RequirePackage[l2tabu, orthodox]{nag}
19 \documentclass{ltxdoc}
20
21 \renewcommand*\theCodelineNo{\rmfamily\tstyle\footnotesize\arabic{CodelineNo}}
22 \AtBeginEnvironment{macrocode}{\renewcommand*{\ttdefault}{clmt}}
23 \renewcommand*{\MacroFont}{\codestyle}
24 \AtBeginDocument{\DeleteShortVerb{\|}}
25 \AtBeginDocument{\MakeShortVerb{\"}}
26 \EnableCrossrefs
27 \CodelineIndex
28 \RecordChanges
29
30 \usepackage{hologo}
31
32 \usepackage[parskip,oldstyle,font=10pt]{hep-paper}
33 \bibliography{bibliography}
34 \acronym{PDF}{portable document format}
35 \acronym{LM}{latin modern}
36
37 \GetFileInfo{hep-paper.sty}
38
39 \title{The \software{hep-paper} package\thanks{This document corresponds to \software{hep-paper}~\fileversion.}}
40 \subtitle{Publications in high energy physics}
41 \author{Jan Hajer \email{[email protected]}}
42 \date{\filedate}
43
44 \begin{document}
45
46 \maketitle
47
48 \begin{abstract}
49 The \software{hep-paper} package aims to provide a single style file containing most configurations and macros necessary to write appealing publications in High Energy Physics.
50 Instead of reinventing the wheel by introducing newly created macros \software{hep-paper} preferably loads third party packages.
51 \end{abstract}
52
53 \tableofcontents\clearpage
54
55 \newgeometry{vscale=.8, vmarginratio=3:4, includeheadfoot, left=11em, marginparwidth=4.6cm, marginparsep=3mm, right=7em}
56
57 \section{Introduction}
58
59 For usual publications it is enough to load additionally to the "article" class without optional arguments only the \software{hep-paper} package \cite{hep-paper}.
60 \begin{verbatim}
61 \documentclass{article}
62 \usepackage{hep-paper}
63 \end{verbatim}
64 The most notable changes after loading the \software{hep-paper} package is the change of some \hologo{LaTeX} defaults.
65 The paper and font sizes are set to A4 and \unit[11]{pt}, respectively.
66 Additionally, the paper geometry is adjusted using the \software{geometry} package \cite{geometry}.
67 Furthermore, the font is changed to \LM using the \software{hep-font} package \cite{hep-font}.
68 Finally, \PDF hyperlinks are implemented with the \software{hyperref} package \cite{hyperref}.
69
70 \subsection{Options}
71
72 \DescribeMacro{paper}
73 The "paper="\meta{format} option loads the specified paper format.
74 The possible \meta{formats} are:
75 "a0", "a1", "a2", "a3", "a4", "a5", "a6",
76 "b0", "b1", "b2", "b3", "b4", "b5", "b6",
77 "c0", "c1", "c2", "c3", "c4", "c5", "c6",
78 "ansia", "ansib", "ansic", "ansid", "ansie",
79 "letter", "executive", "legal".
80 The default is "a4".
81
82 \DescribeMacro{font}
83 The "font="\meta{size} option loads the specified font size.
84 The possible \meta{sizes} are:
85 "8pt", "9pt", "10pt", "11pt", "12pt", "14pt", "17pt", "20pt".
86 The default is \unit[11]{pt}.
87
88 \DescribeMacro{lang}
89 The "lang"=\meta{name} option switches the document language.
90 The default is "british".
91
92 \DescribeMacro{sansserif}
93 The "sansserif" option switches the document including math to sans serif font shape.
94
95 \DescribeMacro{oldstyle}
96 The "oldstyle" option activates the use of oldstyle text- (\texto{123}) in favour of lining- (\textl{123}) figures in text mode.
97
98 \DescribeMacro{parskip}
99 The "parskip" option changes how paragraphs are separated from each other using the \software{parskip} package \cite{parskip}.
100 The \hologo{LaTeX} default is separation via indentation the "parskip" option switches to separation via vertical space.
101 \footnote{Although the "parskip" option is used for this document, it is recommended only for very few document types such as technical manuals or answers to referees.}
102
103 \DescribeMacro{symbols}
104 The "symbols"=\meta{family} is passed to the \software{hep-math-font} package \cite{hep-math-font} and sets the family of the symbol fonts.
105 "symbols=false" deactivates loading any additional symbol fonts.
106
107 \subsubsection{Deactivation}
108
109 The \software{hep-paper} package loads few bigger packages which have a large impact on the document.
110 The deactivation options can prevent such and other adjustments.
111
112 \DescribeMacro{defaults}
113 The "defaults" option prevents the adjustment of the page geometry and the font size set by the document class.
114
115 \DescribeMacro{title}
116 The "title=false" option deactivates the title page adjustments.
117
118 \DescribeMacro{bibliography}
119 The "bibliography"=\meta{key} option prevents the automatic loading of the \software{hep-bibliography} package \cite{hep-bibliography} if \meta{key}="false".
120
121 \DescribeMacro{glossaries}
122 The "glossaries=false" option deactivates acronyms and the use of the \software{hep-acronym} package \cite{hep-acronym}.
123
124 \DescribeMacro{references}
125 The "references=false" option prevents the \software{cleveref} package \cite{cleveref} from being loaded and deactivates further redefinitions of reference macros.
126
127 \subsubsection{Compatibility}
128
129 The compatibility options activate the compatibility mode for certain classes and packages used for publications in high energy physics.
130 They are mostly suitable combinations of options described in the previous section.
131 If \software{hep-paper} is able to detect the presence of such a class or package, \ie if it is loaded before the \software{hep-paper} package, the compatibility mode is activated automatically.
132
133 \DescribeMacro{beamer}
134 The "beamer" option activates the \software{beamer} \cite{beamer} compatibility mode.
135
136 \DescribeMacro{jhep}
137 The "jhep" option activates the \software{JHEP} \cite{jhep} compatibility mode.
138
139 \DescribeMacro{jcap}
140 The "jcap" option activates the \software{JCAP} \cite{jcap} compatibility mode.
141
142 \DescribeMacro{revtex}
143 The "revtex" option activates the REV\hologo{TeX} \cite{revtex} compatibility mode.
144
145 \DescribeMacro{pos}
146 The "pos" option activates the \software{PoS} compatibility mode.
147
148 \DescribeMacro{springer}
149 The "springer" option activates the compatibility mode the "svjour" class \cite{svjour}.
150
151 \subsubsection{Reactivation}
152
153 The \software{hep-paper} package deactivates unrecommended macros, which can be reactivated manually.
154
155 \DescribeMacro{manualplacement}
156 The "manualplacement" option reactivates manual float placement.
157
158 \DescribeMacro{eqnarray}
159 The "eqnarray" option reactivates the depreciated "eqnarray" environment.
160
161 \section{Macros and environments}
162
163 \DescribeMacro{twocolumn}
164 \DescribeMacro{abstract*}
165 If the global "twocolumn" option is present the page geometry is changed to cover almost the entire page.
166 Additionally the "abstract*" environment is defined that generates a one column abstract and takes care of placing the title information.
167
168 \subsection{Title page} \label{sec:title}
169
170 \DescribeMacro{\series}
171 The "\series"\marg{series} macro is defined using the \software{hep-title} package \cite{hep-title}.
172
173 \DescribeMacro{\title}
174 The \PDF meta information is set according to the "\title"\marg{text} and "\author"\marg{text} information.
175
176 \DescribeMacro{\subtitle}
177 The "\subtitle"\marg{subtitle} macro is defined.
178
179 \DescribeMacro{\editor}
180 \DescribeMacro{\author}
181 \DescribeMacro{\affiliation}
182 \DescribeMacro{\email}
183 The following lines add \eg two authors with different affiliations
184 \begin{verbatim}
185 \author[1]{Author one \email{email one}}
186 \affiliation[1]{Affiliation one}
187 \author[2]{Author two \email{email two}}
188 \affiliation[1,2]{Affiliation two}
189 \end{verbatim}
190
191 \DescribeMacro{\preprint}
192 The "\preprint"\marg{numer} macro places a pre-print number in the upper right corner of the title page.
193
194 \DescribeEnv{abstract}
195 The "abstract" environment is adjusted to not start with an indentation.
196
197 \DescribeMacro{\titlefont}
198 \DescribeMacro{\subtitlefont}
199 \DescribeMacro{\authorfont}
200 \DescribeMacro{\affiliationfont}
201 \DescribeMacro{\preprintfont}
202 Various title font macros are defined, allowing to change the appearance of the "\maketitle" output.
203
204 \subsection{Text}
205
206 \DescribeMacro{inlinelist}
207 \DescribeMacro{enumdescript}
208 The "inlinelist" and "enumdescript" environments are defined.
209
210 \DescribeMacro{\textsc}
211 A bold versions \textbf{\textsc{Small Caps}} and a sans serif version of \textsf{\textsc{Small Caps}} is provided.
212
213 \DescribeMacro{\underline}
214 \DescribeMacro{\overline}
215 The "\underline" macro is redefined to allow line-breaks.
216 The "\overline" macro is extended to also \overline{overline} text outside of math environments.
217
218 \DescribeMacro{\useparskip}
219 \DescribeMacro{\useparindent}
220 If the "parskip" option is activated the "\useparindent" macro switches to the usual parindent mode, while the "\useparskip" macro switches to the parskip mode.
221
222 \subsubsection{References and footnotes}
223
224 \DescribeMacro{\cref}
225 References are extended with the \software{cleveref} package \cite{cleveref}, which allows to \eg just type "\cref"\marg{key} in order to write \enquote{figure 1}.
226 Furthermore, the \software{cleveref} package allows to reference multiple objects within one "\cref"\marg{key1,key2}.
227
228 \DescribeMacro{\cite}
229 Citations are adjusted to not start on a new line in order to avoid the repeated use of "~\cite"\marg{key}.
230
231 \DescribeMacro{\ref}
232 \DescribeMacro{\eqref}
233 \DescribeMacro{\subref}
234 References are also adjusted to not start on a new line.
235
236 \DescribeMacro{\footnote}
237 Footnotes are adjusted to swallow white space before the footnote mark and at the beginning of the footnote text.
238
239 \subsubsection{Acronyms} \label{sec:acronyms}
240
241 The \software{hep-acronym} package \cite{hep-acronym} is loaded.
242 \DescribeMacro{\acronym}
243 \DescribeMacro{\shortacronym}
244 \DescribeMacro{\longacronym}
245 The "\acronym"\meta{*}\oarg{typeset abbreviation} \marg{abbreviation}\meta{*}\marg{definition}\oarg{plural definition} macro generates the singular "\"\meta{abbreviation} and plural "\"\meta{abbreviation}"s" macros.
246 The first star prevents the addition of an \enquote{s} to the abbreviation plural.
247 The second star restores the \hologo{TeX} default of swallowing subsequent white space.
248 The long form is only shown at the first appearance of these macros, later appearances generate the abbreviation with a hyperlink to the long form.
249 The long form is never used in math mode.
250 Capitalization at the beginning of paragraphs and sentences is (mostly) ensured.
251 The "\shortacronym" and "\longacronym" macros are drop-in replacements of the "\acronym" macro showing only the short or long form of their acronym.
252
253 \subsection{Math}
254
255 The \software{hep-math} \cite{hep-math} and \software{hep-math-font} \cite{hep-math-font} packages are loaded.
256 \DescribeMacro{\mathbf}
257 Bold math, via "\mathbf" is improved, \ie ($ A b \Gamma \delta \mathbf A \mathbf b \mathbf \Gamma \mathbf \delta$).
258 Macros switching to "bfseries" such as "\section"\marg{text} are ensured to also typeset math in bold.
259 \DescribeMacro{\text}
260 The "\text"\marg{text} macro makes it possible to write text within math mode, \ie ($ \text A \text b \text \Gamma \text \delta \text{\textbf A} \text{\textbf b} \text{\textbf \Gamma} \text{\textbf \delta}$).
261 \DescribeMacro{\mathsf}
262 The math sans serif alphabet is redefined to be italic sans serif if the main text is serif and italic serif if the main text is sans serif, \ie ($\mathsf A \mathsf b \mathsf \Gamma \mathsf \delta \mathbf{\mathsf A} \mathbf{\mathsf b} \mathbf{\mathsf \Gamma} \mathbf{\mathsf \delta}$).
263 \DescribeMacro{\mathscr}
264 The "\mathcal" font \ie ($\mathcal{ABCD}$) is accompanied by the "\mathscr" font \ie ($\mathscr{ABCD}$).
265 \DescribeMacro{\mathbb}
266 The "\mathbb" font is adjusted depending on the "sansserif" option \ie ($\mathbb{Ah1}$).
267 \DescribeMacro{\mathfrak}
268 Finally, the "\mathfrak" font is also available \ie ($\mathfrak{AaBb12}$).
269
270 \DescribeMacro{\nicefrac}
271 \DescribeMacro{\flatfrac}
272 \DescribeMacro{\textfrac}
273 The "\frac"\marg{number}\marg{number} macro is accompanied by "\nicefrac"\linebreak[1]\marg{number}\linebreak[1]\marg{number}, "\textfrac"\marg{number}\marg{number}, and "\flatfrac"\marg{number}\marg{number} leading to $\frac12$, $\nicefrac12$, \textfrac12, and $\flatfrac12$.
274 \DescribeMacro{\diag}
275 \DescribeMacro{\sgn}
276 Diagonal matrix "\diag" and signum "\sgn" operators are defined.
277
278 \DescribeMacro{\mathdef}
279 The "\mathdef"\marg{name}\oarg{arguments}\marg{code} macro \prefix{re}{defines} macros only within math mode without changing the text mode definition.
280
281 \DescribeMacro{\i}
282 \DescribeMacro{\d}
283 The imaginary unit $\i$ and the differential $\d$ are defined using this functionality.
284
285 \DescribeMacro{\numberwithin}
286 For longer paper it can be useful to re-number the equation in accordance with the section numbering "\numberwithin{equation}{section}".
287 \DescribeMacro{subequations}
288 In order to further reduce the size the of equation counter it can be useful to wrap "align" environments with multiple rows in a "subequations" environment.
289
290 \DescribeMacro{\unit}
291 \DescribeMacro{\inv}
292 The correct spacing for units, \cf \cref{eq:greek}, is provided by the macro "\unit"\oarg{value} \marg{unit} which can also be used in text mode.
293 The macro "\inv"\oarg{power}\marg{text} allows to avoid math mode also for inverse units such as \unit[5]{\inv{fb}} typeset via "\unit[5]{\inv{fb}}".
294
295 Greek letters are adjusted to always be italic and upright in math and text mode, respectively, using the \software{hep-math-font} \cite{hep-math-font} package.
296 This allows differentiations like
297 \begin{align} \label{eq:greek}
298 \sigma &= \unit[5]{fb} \ , & &\mbox{at \unit[5]{\sigma} C.L.} \ , & \mu &= \unit[5]{cm} \ , & l &= \unit[5]{\mu m} \ .
299 \end{align}
300 Additionally, Greek letters can also be directly typed using Unicode.
301
302 \DescribeMacro{\ev}
303 \DescribeMacro{\pdv}
304 \DescribeMacro{\comm}
305 \DescribeMacro{\order}
306 The \software{hep-math} package \cite{hep-math} provides additional macros such as
307 \begin{align}
308 &\ev{\phi} \ ,
309 &&\pdv[f]{x}[y]^2 \ ,
310 &&\comm{A}{B} \ ,
311 &&\order{x^2} \ ,
312 &&\eval{x}_0^\infty \ ,
313 &&\det(M)\ .
314 \end{align}
315
316 \DescribeMacro{\cancel}
317 \DescribeMacro{\slashed}
318 The "\cancel"\marg{characters} macro and the "\slashed" \marg{character} macro allow to $\cancel{\text{cancel}}$ math and use the Dirac slash notation \ie $\slashed \partial$, respectively.
319
320 \DescribeMacro{\overleftright}
321 A better looking over left right arrow is defined \ie $\overleftright{\partial}$.
322
323 \subsection{Floats}
324
325 \DescribeEnv{figure}
326 \DescribeEnv{table}
327 Automatic float placement is adjusted to place a single float at the top of pages and to reduce the number of float pages, using the \software{hep-float} package \cite{hep-float}.
328 The most useful float placement is usually archived by placing the float \emph{in front} of the paragraph it is referenced in first.
329
330 \DescribeEnv{panels}
331 \DescribeMacro{\panel}
332 The "panels" environment provides sub-floats and takes as mandatory argument either the number of sub-floats (default~2) or the width of the first sub-float as fraction of the "\linewidth".
333 Within the "\begin{panels}"\oarg{vertical alignment}\marg{width} environment the "\panel" macro initiates a new sub-float.
334 In the case that the width of the first sub-float has been given as an optional argument to the "panels" environment the "\panel"\marg{width} macro takes the width of the next sub-float as mandatory argument.
335
336 \DescribeMacro{\graphic}
337 \DescribeMacro{\graphics}
338 The "\graphic"\oarg{width}\marg{figure} macro is defined, which is a wrapper for the "\includegraphics"\marg{figure} macro and takes the figure width as fraction of the "\linewidth" as optional argument (default~1).
339 If the graphics are located in a sub-folder its path can be indicated by "\graphics"\marg{subfolder}.
340
341 \subsection{Bibliography} \label{sec:bibliography}
342
343 \DescribeMacro{\bibliography}
344 \DescribeMacro{\printbibliography}
345 The \software{biblatex} package \cite{biblatex} is loaded for bibliography management.
346 The user has to add the line "\bibliography"\marg{my.bib} to the preamble of the document and "\printbibliography" at the end of the document.
347 The bibliography is generated by \software{Biber} \cite{biber}.
348 \software{biblatex} is extended by the \software{hep-bibliography} package \cite{hep-bibliography} to be able to cope with the "collaboration" and "reportNumber" fields provided by \online{https://inspirehep.net}{inspirehep.net} and a bug in the volume number is fixed.
349 Additionally, the PubMed IDs are recognized and \online{https://ctan.org}{ctan.org}, \online{https://github.com}{github.com}, \online{https://gitlab.com}{gitlab.com}, \online{https://bitbucket.org}{bitbucket.org}, \online{https://www.launchpad.net}{launchpad.net}, \online{https://sourceforge.net}{sourceforge.net}, and \online{https://hepforge.org}{hepforge.org} are valid "eprinttype"s.
350 \DescribeMacro{erratum}
351 Errata can be included using the "related" feature.
352 \begin{verbatim}
353 \article{key1,
354 ...,
355 relatedtype="erratum",
356 related="key2",
357 }
358 \article{key2,
359 ...,
360 }
361 \end{verbatim}
362
363 \section{Conclusion}
364
365 The \software{hep-paper} package provides a matching selection of preloaded packages and additional macros enabling the user to focus on the content instead of the layout by reducing the amount of manual tasks.
366 The majority of the loaded packages are fairly lightweight, the others can be deactivated with package options.
367
368 \DescribeMacro{arxiv-collector}
369 \nolinkurl{arxiv.org} \cite{arxiv} requires the setup dependent "bbl" files instead of the original "bib" files, which causes trouble if the local \hologo{LaTeX} version differs from the one used by arXiv.
370 The \software{arxiv-collector} python script \cite{arxiv-collector} alleviates this problem by collecting all files necessary for publication on arXiv (including figures).
371
372 \printbibliography
373
374 \end{document}
375 \endinput
376 %%
377 %% End of file `hep-paper-documentation.tex'.