Debian Codegraph @

texmf-dist/source/latex/hep-paper/hep-paper-implementation.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2019-2023 by Jan Hajer
4 % -----------------------------------
5 %
6 % This file may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.3c
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in:
10 %
11 % http://www.latex-project.org/lppl.txt
12 %
13 % and version 1.3c or later is part of all distributions of LaTeX
14 % version 2005/12/01 or later.
15 %
16 % \fi
17 %
18 % \iffalse
19 %
20 %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
21 %<package>\ProvidesPackage{hep-paper}[2025/09/01 v2.4 Publications in High Energy Physics]
22 %<documentation>\ProvidesFile{hep-paper-documentation.tex}[2025/09/01 v2.4 HEP-Paper documentation]
23 %
24 %<*documentation>
25 \RequirePackage[l2tabu, orthodox]{nag}
26 \documentclass{ltxdoc}
27
28 \renewcommand*\theCodelineNo{\rmfamily\tstyle\footnotesize\arabic{CodelineNo}}
29 \AtBeginEnvironment{macrocode}{\renewcommand*{\ttdefault}{clmt}}
30 \renewcommand*{\MacroFont}{\codestyle}
31 \AtBeginDocument{\DeleteShortVerb{\|}}
32 \AtBeginDocument{\MakeShortVerb{\"}}
33 \EnableCrossrefs
34 \CodelineIndex
35 \RecordChanges
36
37 \usepackage{hologo}
38
39 \usepackage[parskip,oldstyle,font=10pt]{hep-paper}
40 \bibliography{bibliography}
41 \acronym{PDF}{portable document format}
42 \acronym{LM}{latin modern}
43 %</documentation>
44
45 %<*driver>
46 \expandafter\newif\csname ifshort\endcsname
47 \shortfalse
48 \begin{document}
49 \DocInput{hep-paper-implementation.dtx}
50 \end{document}
51 %</driver>
52 %
53 % \fi
54 %
55 % \CheckSum{641}
56 %
57 % \CharacterTable
58 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
59 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
60 % Digits \0\1\2\3\4\5\6\7\8\9
61 % Exclamation \! Double quote \" Hash (number) \#
62 % Dollar \$ Percent \% Ampersand \&
63 % Acute accent \' Left paren \( Right paren \)
64 % Asterisk \* Plus \+ Comma \,
65 % Minus \- Point \. Solidus \/
66 % Colon \: Semicolon \; Less than \<
67 % Equals \= Greater than \> Question mark \?
68 % Commercial at \@ Left bracket \[ Backslash \\
69 % Right bracket \] Circumflex \^ Underscore \_
70 % Grave accent \` Left brace \{ Vertical bar \|
71 % Right brace \} Tilde \~}
72 %
73 % \changes{v1.0}{2019/01/01}{Initial version of the style file.}
74 % \changes{v1.1}{2020/01/01}{Transition to documented \hologo{LaTeX} source file.}
75 % \changes{v1.2}{2020/03/01}{Introduction of package options.}
76 % \changes{v1.3}{2020/05/01}{Inclusion of JHEP and JCAP package options. Fix of incompatibility with recent subcaption package version. Move of biblatex datamodel into its own file}
77 % \changes{v1.4}{2020/09/01}{If possible the compatibility options are selected automatically. Inclusion of PubMed IDs in bibliography.}
78 % \changes{v1.5}{2020/10/01}{Reduce the numer of math alphabets used in sans serif mode. Add more title options such as a subtitle. Use standard class options.}
79 % \changes{v1.6}{2020/12/01}{Implementation of the twocolumn mode.}
80 % \changes{v1.7}{2021/06/01}{Introduction of dedicated style file for the title, acronyms and bibliography macros. Extension of the title macros.}
81 % \changes{v1.8}{2021/08/01}{Expand thanks to allow for reference label and fine tune the title page. Reimplement the must relevant macros from the physics package. Make mathrm produce upright Greek.}
82 % \changes{v2.0}{2021/09/01}{Move independent logic into dedicated packages.}
83 % \changes{v2.1}{2022/11/01}{Bug fixes in the underlying packages.}
84 % \changes{v2.2}{2023/07/01}{Bug fixes in the underlying packages.}
85 % \changes{v2.3}{2024/11/01}{Bug fixes in the underlying packages.}
86 % \changes{v2.4}{2025/09/01}{Bug fixes.}
87 %
88 % \ifshort
89 %<*documentation>
90 % \fi
91 %
92 \GetFileInfo{hep-paper.sty}
93
94 \title{The \software{hep-paper} package\thanks{This document corresponds to \software{hep-paper}~\fileversion.}}
95 \subtitle{Publications in high energy physics}
96 \author{Jan Hajer \email{[email protected]}}
97 \date{\filedate}
98
99 % \ifshort
100 \begin{document}
101 % \fi
102
103 \maketitle
104
105 \begin{abstract}
106 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.
107 Instead of reinventing the wheel by introducing newly created macros \software{hep-paper} preferably loads third party packages.
108 \end{abstract}
109
110 \tableofcontents\clearpage
111
112 \newgeometry{vscale=.8, vmarginratio=3:4, includeheadfoot, left=11em, marginparwidth=4.6cm, marginparsep=3mm, right=7em}
113
114 \section{Introduction}
115
116 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}.
117 \begin{verbatim}
118 \documentclass{article}
119 \usepackage{hep-paper}
120 \end{verbatim}
121 The most notable changes after loading the \software{hep-paper} package is the change of some \hologo{LaTeX} defaults.
122 The paper and font sizes are set to A4 and \unit[11]{pt}, respectively.
123 Additionally, the paper geometry is adjusted using the \software{geometry} package \cite{geometry}.
124 Furthermore, the font is changed to \LM using the \software{hep-font} package \cite{hep-font}.
125 Finally, \PDF hyperlinks are implemented with the \software{hyperref} package \cite{hyperref}.
126
127 \subsection{Options}
128
129 \DescribeMacro{paper}
130 The "paper="\meta{format} option loads the specified paper format.
131 The possible \meta{formats} are:
132 "a0", "a1", "a2", "a3", "a4", "a5", "a6",
133 "b0", "b1", "b2", "b3", "b4", "b5", "b6",
134 "c0", "c1", "c2", "c3", "c4", "c5", "c6",
135 "ansia", "ansib", "ansic", "ansid", "ansie",
136 "letter", "executive", "legal".
137 The default is "a4".
138
139 \DescribeMacro{font}
140 The "font="\meta{size} option loads the specified font size.
141 The possible \meta{sizes} are:
142 "8pt", "9pt", "10pt", "11pt", "12pt", "14pt", "17pt", "20pt".
143 The default is \unit[11]{pt}.
144
145 \DescribeMacro{lang}
146 The "lang"=\meta{name} option switches the document language.
147 The default is "british".
148
149 \DescribeMacro{sansserif}
150 The "sansserif" option switches the document including math to sans serif font shape.
151
152 \DescribeMacro{oldstyle}
153 The "oldstyle" option activates the use of oldstyle text- (\texto{123}) in favour of lining- (\textl{123}) figures in text mode.
154
155 \DescribeMacro{parskip}
156 The "parskip" option changes how paragraphs are separated from each other using the \software{parskip} package \cite{parskip}.
157 The \hologo{LaTeX} default is separation via indentation the "parskip" option switches to separation via vertical space.
158 \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.}
159
160 \DescribeMacro{symbols}
161 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.
162 "symbols=false" deactivates loading any additional symbol fonts.
163
164 \subsubsection{Deactivation}
165
166 The \software{hep-paper} package loads few bigger packages which have a large impact on the document.
167 The deactivation options can prevent such and other adjustments.
168
169 \DescribeMacro{defaults}
170 The "defaults" option prevents the adjustment of the page geometry and the font size set by the document class.
171
172 \DescribeMacro{title}
173 The "title=false" option deactivates the title page adjustments.
174
175 \DescribeMacro{bibliography}
176 The "bibliography"=\meta{key} option prevents the automatic loading of the \software{hep-bibliography} package \cite{hep-bibliography} if \meta{key}="false".
177
178 \DescribeMacro{glossaries}
179 The "glossaries=false" option deactivates acronyms and the use of the \software{hep-acronym} package \cite{hep-acronym}.
180
181 \DescribeMacro{references}
182 The "references=false" option prevents the \software{cleveref} package \cite{cleveref} from being loaded and deactivates further redefinitions of reference macros.
183
184 \subsubsection{Compatibility}
185
186 The compatibility options activate the compatibility mode for certain classes and packages used for publications in high energy physics.
187 They are mostly suitable combinations of options described in the previous section.
188 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.
189
190 \DescribeMacro{beamer}
191 The "beamer" option activates the \software{beamer} \cite{beamer} compatibility mode.
192
193 \DescribeMacro{jhep}
194 The "jhep" option activates the \software{JHEP} \cite{jhep} compatibility mode.
195
196 \DescribeMacro{jcap}
197 The "jcap" option activates the \software{JCAP} \cite{jcap} compatibility mode.
198
199 \DescribeMacro{revtex}
200 The "revtex" option activates the REV\hologo{TeX} \cite{revtex} compatibility mode.
201
202 \DescribeMacro{pos}
203 The "pos" option activates the \software{PoS} compatibility mode.
204
205 \DescribeMacro{springer}
206 The "springer" option activates the compatibility mode the "svjour" class \cite{svjour}.
207
208 \subsubsection{Reactivation}
209
210 The \software{hep-paper} package deactivates unrecommended macros, which can be reactivated manually.
211
212 \DescribeMacro{manualplacement}
213 The "manualplacement" option reactivates manual float placement.
214
215 \DescribeMacro{eqnarray}
216 The "eqnarray" option reactivates the depreciated "eqnarray" environment.
217
218 \section{Macros and environments}
219
220 \DescribeMacro{twocolumn}
221 \DescribeMacro{abstract*}
222 If the global "twocolumn" option is present the page geometry is changed to cover almost the entire page.
223 Additionally the "abstract*" environment is defined that generates a one column abstract and takes care of placing the title information.
224
225 \subsection{Title page} \label{sec:title}
226
227 \DescribeMacro{\series}
228 The "\series"\marg{series} macro is defined using the \software{hep-title} package \cite{hep-title}.
229
230 \DescribeMacro{\title}
231 The \PDF meta information is set according to the "\title"\marg{text} and "\author"\marg{text} information.
232
233 \DescribeMacro{\subtitle}
234 The "\subtitle"\marg{subtitle} macro is defined.
235
236 \DescribeMacro{\editor}
237 \DescribeMacro{\author}
238 \DescribeMacro{\affiliation}
239 \DescribeMacro{\email}
240 The following lines add \eg two authors with different affiliations
241 \begin{verbatim}
242 \author[1]{Author one \email{email one}}
243 \affiliation[1]{Affiliation one}
244 \author[2]{Author two \email{email two}}
245 \affiliation[1,2]{Affiliation two}
246 \end{verbatim}
247
248 \DescribeMacro{\preprint}
249 The "\preprint"\marg{numer} macro places a pre-print number in the upper right corner of the title page.
250
251 \DescribeEnv{abstract}
252 The "abstract" environment is adjusted to not start with an indentation.
253
254 \DescribeMacro{\titlefont}
255 \DescribeMacro{\subtitlefont}
256 \DescribeMacro{\authorfont}
257 \DescribeMacro{\affiliationfont}
258 \DescribeMacro{\preprintfont}
259 Various title font macros are defined, allowing to change the appearance of the "\maketitle" output.
260
261 \subsection{Text}
262
263 \DescribeMacro{inlinelist}
264 \DescribeMacro{enumdescript}
265 The "inlinelist" and "enumdescript" environments are defined.
266
267 \DescribeMacro{\textsc}
268 A bold versions \textbf{\textsc{Small Caps}} and a sans serif version of \textsf{\textsc{Small Caps}} is provided.
269
270 \DescribeMacro{\underline}
271 \DescribeMacro{\overline}
272 The "\underline" macro is redefined to allow line-breaks.
273 The "\overline" macro is extended to also \overline{overline} text outside of math environments.
274
275 \DescribeMacro{\useparskip}
276 \DescribeMacro{\useparindent}
277 If the "parskip" option is activated the "\useparindent" macro switches to the usual parindent mode, while the "\useparskip" macro switches to the parskip mode.
278
279 \subsubsection{References and footnotes}
280
281 \DescribeMacro{\cref}
282 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}.
283 Furthermore, the \software{cleveref} package allows to reference multiple objects within one "\cref"\marg{key1,key2}.
284
285 \DescribeMacro{\cite}
286 Citations are adjusted to not start on a new line in order to avoid the repeated use of "~\cite"\marg{key}.
287
288 \DescribeMacro{\ref}
289 \DescribeMacro{\eqref}
290 \DescribeMacro{\subref}
291 References are also adjusted to not start on a new line.
292
293 \DescribeMacro{\footnote}
294 Footnotes are adjusted to swallow white space before the footnote mark and at the beginning of the footnote text.
295
296 \subsubsection{Acronyms} \label{sec:acronyms}
297
298 The \software{hep-acronym} package \cite{hep-acronym} is loaded.
299 \DescribeMacro{\acronym}
300 \DescribeMacro{\shortacronym}
301 \DescribeMacro{\longacronym}
302 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.
303 The first star prevents the addition of an \enquote{s} to the abbreviation plural.
304 The second star restores the \hologo{TeX} default of swallowing subsequent white space.
305 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.
306 The long form is never used in math mode.
307 Capitalization at the beginning of paragraphs and sentences is (mostly) ensured.
308 The "\shortacronym" and "\longacronym" macros are drop-in replacements of the "\acronym" macro showing only the short or long form of their acronym.
309
310 \subsection{Math}
311
312 The \software{hep-math} \cite{hep-math} and \software{hep-math-font} \cite{hep-math-font} packages are loaded.
313 \DescribeMacro{\mathbf}
314 Bold math, via "\mathbf" is improved, \ie ($ A b \Gamma \delta \mathbf A \mathbf b \mathbf \Gamma \mathbf \delta$).
315 Macros switching to "bfseries" such as "\section"\marg{text} are ensured to also typeset math in bold.
316 \DescribeMacro{\text}
317 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}$).
318 \DescribeMacro{\mathsf}
319 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}$).
320 \DescribeMacro{\mathscr}
321 The "\mathcal" font \ie ($\mathcal{ABCD}$) is accompanied by the "\mathscr" font \ie ($\mathscr{ABCD}$).
322 \DescribeMacro{\mathbb}
323 The "\mathbb" font is adjusted depending on the "sansserif" option \ie ($\mathbb{Ah1}$).
324 \DescribeMacro{\mathfrak}
325 Finally, the "\mathfrak" font is also available \ie ($\mathfrak{AaBb12}$).
326
327 \DescribeMacro{\nicefrac}
328 \DescribeMacro{\flatfrac}
329 \DescribeMacro{\textfrac}
330 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$.
331 \DescribeMacro{\diag}
332 \DescribeMacro{\sgn}
333 Diagonal matrix "\diag" and signum "\sgn" operators are defined.
334
335 \DescribeMacro{\mathdef}
336 The "\mathdef"\marg{name}\oarg{arguments}\marg{code} macro \prefix{re}{defines} macros only within math mode without changing the text mode definition.
337
338 \DescribeMacro{\i}
339 \DescribeMacro{\d}
340 The imaginary unit $\i$ and the differential $\d$ are defined using this functionality.
341
342 \DescribeMacro{\numberwithin}
343 For longer paper it can be useful to re-number the equation in accordance with the section numbering "\numberwithin{equation}{section}".
344 \DescribeMacro{subequations}
345 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.
346
347 \DescribeMacro{\unit}
348 \DescribeMacro{\inv}
349 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.
350 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}}".
351
352 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.
353 This allows differentiations like
354 \begin{align} \label{eq:greek}
355 \sigma &= \unit[5]{fb} \ , & &\mbox{at \unit[5]{\sigma} C.L.} \ , & \mu &= \unit[5]{cm} \ , & l &= \unit[5]{\mu m} \ .
356 \end{align}
357 Additionally, Greek letters can also be directly typed using Unicode.
358
359 \DescribeMacro{\ev}
360 \DescribeMacro{\pdv}
361 \DescribeMacro{\comm}
362 \DescribeMacro{\order}
363 The \software{hep-math} package \cite{hep-math} provides additional macros such as
364 \begin{align}
365 &\ev{\phi} \ ,
366 &&\pdv[f]{x}[y]^2 \ ,
367 &&\comm{A}{B} \ ,
368 &&\order{x^2} \ ,
369 &&\eval{x}_0^\infty \ ,
370 &&\det(M)\ .
371 \end{align}
372
373 \DescribeMacro{\cancel}
374 \DescribeMacro{\slashed}
375 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.
376
377 \DescribeMacro{\overleftright}
378 A better looking over left right arrow is defined \ie $\overleftright{\partial}$.
379
380 \subsection{Floats}
381
382 \DescribeEnv{figure}
383 \DescribeEnv{table}
384 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}.
385 The most useful float placement is usually archived by placing the float \emph{in front} of the paragraph it is referenced in first.
386
387 \DescribeEnv{panels}
388 \DescribeMacro{\panel}
389 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".
390 Within the "\begin{panels}"\oarg{vertical alignment}\marg{width} environment the "\panel" macro initiates a new sub-float.
391 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.
392
393 \DescribeMacro{\graphic}
394 \DescribeMacro{\graphics}
395 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).
396 If the graphics are located in a sub-folder its path can be indicated by "\graphics"\marg{subfolder}.
397
398 \subsection{Bibliography} \label{sec:bibliography}
399
400 \DescribeMacro{\bibliography}
401 \DescribeMacro{\printbibliography}
402 The \software{biblatex} package \cite{biblatex} is loaded for bibliography management.
403 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.
404 The bibliography is generated by \software{Biber} \cite{biber}.
405 \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.
406 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.
407 \DescribeMacro{erratum}
408 Errata can be included using the "related" feature.
409 \begin{verbatim}
410 \article{key1,
411 ...,
412 relatedtype="erratum",
413 related="key2",
414 }
415 \article{key2,
416 ...,
417 }
418 \end{verbatim}
419
420 \section{Conclusion}
421
422 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.
423 The majority of the loaded packages are fairly lightweight, the others can be deactivated with package options.
424
425 \DescribeMacro{arxiv-collector}
426 \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.
427 The \software{arxiv-collector} python script \cite{arxiv-collector} alleviates this problem by collecting all files necessary for publication on arXiv (including figures).
428
429 % \ifshort
430 \printbibliography
431
432 \end{document}
433 %
434 %</documentation>
435 % \fi
436 %
437 % \StopEventually{
438 % \printbibliography
439 % \PrintChanges
440 % }
441 %
442 % \addtocontents{toc}{\protect\clearpage}
443 % \clearpage
444 % \appendix
445 %
446 % \section{Options}
447 %
448 %<*package>
449 %
450 % Load the \software{kvoptions} package \cite{kvoptions} and define a "hep" namespace.
451 % \begin{macrocode}
452 \RequirePackage{kvoptions}
453 \SetupKeyvalOptions{
454 family=hep,
455 prefix=hep@
456 }
457 % \end{macrocode}
458 %
459 % \begin{macro}{paper}
460 % Define a "paper="\meta{size} option.
461 % Make A4 paper the default.
462 % \begin{macrocode}
463 \DeclareStringOption[a4]{paper}
464 % \end{macrocode}
465 % \end{macro}
466 %
467 % \begin{macro}{font}
468 % Define a "figures="\meta{size} option.
469 % Make \unit[11]{pt} the default font size.
470 % \begin{macrocode}
471 \DeclareStringOption[11pt]{font}
472 % \end{macrocode}
473 % \end{macro}
474 %
475 % \begin{macro}{lang}
476 % Define the "lang" option, which takes the values provided by the \software{babel} package \cite{babel}.
477 % Make "british" the default language.
478 % \begin{macrocode}
479 \DeclareStringOption[british]{lang}
480 % \end{macrocode}
481 % \end{macro}
482 %
483 % \begin{macro}{sansserif}
484 % Define the option pair "serif" and "sansserif" controling the font shape of the whole document.
485 % \begin{macrocode}
486 \DeclareBoolOption[true]{serif}
487 \DeclareComplementaryOption{sansserif}{serif}
488 % \end{macrocode}
489 % \end{macro}
490 %
491 % \begin{macro}{lining}
492 % Define the "lining" option deactivating the use of text figures in text mode.
493 % \begin{macrocode}
494 \DeclareBoolOption[true]{lining}
495 \DeclareComplementaryOption{oldstyle}{lining}
496 % \end{macrocode}
497 % \end{macro}
498 %
499 % \begin{macro}{parskip}
500 % Define the option pair "parindent" and "parskip" controlling the separation of paragraphs.
501 % \begin{macrocode}
502 \DeclareBoolOption[true]{parindent}
503 \DeclareComplementaryOption{parskip}{parindent}
504 % \end{macrocode}
505 % \end{macro}
506 %
507 % \begin{macro}{symbols}
508 % Provide the "symbols" option allowing to switch the symbol font.
509 % \begin{macrocode}
510 \DeclareStringOption[true]{symbols}
511 % \end{macrocode}
512 % \end{macro}
513 %
514 % \subsection{Deactivation}
515 %
516 % \begin{macro}{defaults}
517 % Define the "defaults" option which deactivates the "paper" and "font" options and prevents the change of the class defaults by this package.
518 % \begin{macrocode}
519 \DeclareBoolOption[false]{defaults}
520 % \end{macrocode}
521 % \end{macro}
522 %
523 % \begin{macro}{title}
524 % Provide the "title" option deactivating redefinitions of title macros.
525 % \begin{macrocode}
526 \DeclareBoolOption[true]{title}
527 % \end{macrocode}
528 % \end{macro}
529 %
530 % \begin{macro}{physics}
531 % Provide the "physics" option for deactivating redefinition of physics macros.
532 % \begin{macrocode}
533 \DeclareBoolOption[true]{physics}
534 % \end{macrocode}
535 % \end{macro}
536 %
537 % \begin{macro}{bibliography}
538 % Provide the "bibliography" option for passing a "style" string to the \software{biblatex} package \cite{biblatex} or disabling the automatic loading of "biblatex".
539 % \begin{macrocode}
540 \DeclareStringOption[numeric-comp]{bibliography}
541 % \end{macrocode}
542 % \end{macro}
543 %
544 % \begin{macro}{glossaries}
545 % Provide the "glossaries" option able to turn of the use of the \software{hep-acronym} package \cite{hep-acronym}.
546 % \begin{macrocode}
547 \DeclareBoolOption[true]{glossaries}
548 % \end{macrocode}
549 % \end{macro}
550 %
551 % \begin{macro}{references}
552 % Provide the "references" option for preventing the \software{cleveref} package from being loaded redefinitions of reference macros.
553 % \begin{macrocode}
554 \DeclareBoolOption[true]{references}
555 % \end{macrocode}
556 % \end{macro}
557 %
558 % \subsection{Compatibility}
559 %
560 % \begin{macro}{beamer}
561 % Provide the "beamer" option for \software{beamer} \cite{beamer} compatibility mode.
562 % \begin{macrocode}
563 \DeclareBoolOption[false]{beamer}
564 % \end{macrocode}
565 % \end{macro}
566 %
567 % \begin{macro}{revtex}
568 % Provide the "revtex" option for REV\hologo{TeX} \cite{revtex} compatibility mode.
569 % \begin{macrocode}
570 \DeclareBoolOption[false]{revtex}
571 % \end{macrocode}
572 % \end{macro}
573 %
574 % \begin{macro}{jhep}
575 % Provide the "jhep" option for JHEP \cite{jhep} compatibility mode.
576 % \begin{macrocode}
577 \DeclareBoolOption[false]{jhep}
578 % \end{macrocode}
579 % \end{macro}
580 %
581 % \begin{macro}{jcap}
582 % Provide the "jcap" option for JCAP \cite{jcap} compatibility mode.
583 % \begin{macrocode}
584 \DeclareBoolOption[false]{jcap}
585 % \end{macrocode}
586 % \end{macro}
587 %
588 % \begin{macro}{pos}
589 % Provide the "pos" option for PoS compatibility mode.
590 % \begin{macrocode}
591 \DeclareBoolOption[false]{pos}
592 % \end{macrocode}
593 % \end{macro}
594 %
595 % \begin{macro}{springer}
596 % Provide the "springer" option for Springer compatibility mode.
597 % \begin{macrocode}
598 \DeclareBoolOption[false]{springer}
599 % \end{macrocode}
600 % \end{macro}
601 %
602 % \begin{macro}{amsart}
603 % Provide the "amsart" option for AMS article compatibility mode.
604 % \begin{macrocode}
605 \DeclareBoolOption[false]{amsart}
606 % \end{macrocode}
607 % \end{macro}
608 %
609 % \subsection{Reactivation}
610 %
611 % \begin{macro}{eqnarray}
612 % Provide the "eqnarray" option for reactivating the "eqnarray" environment.
613 % \begin{macrocode}
614 \DeclareBoolOption[true]{eqnarray}
615 % \end{macrocode}
616 % \end{macro}
617 %
618 % \begin{macro}{manualplacement}
619 % Provide the "manualplacement" option for reactivating the manual placement of floats.
620 % \begin{macrocode}
621 \DeclareBoolOption[false]{manualplacement}
622 % \end{macrocode}
623 % \end{macro}
624 %
625 % \subsection{Process options}
626 %
627 % \begin{macrocode}
628 \ProcessKeyvalOptions*
629 % \end{macrocode}
630 %
631 % Read the class options regarding font and paper size.
632 % \begin{macrocode}
633 \def\hep@get@class#1.cls#2\relax{\def\hep@class{#1}}
634 \def\hep@getclass{\expandafter\hep@get@class\@filelist\relax}
635 \hep@getclass
636 \@ifclasswith{\hep@class}{10pt}{\setkeys{hep}{font=10pt}}{}
637 \@ifclasswith{\hep@class}{12pt}{\setkeys{hep}{font=12pt}}{}
638 \@ifclasswith{\hep@class}{a5paper}{\setkeys{hep}{paper=a5}}{}
639 \@ifclasswith{\hep@class}{b5paper}{\setkeys{hep}{paper=b5}}{}
640 \@ifclasswith{\hep@class}{letterpaper}{\setkeys{hep}{paper=letter}}{}
641 \@ifclasswith{\hep@class}{legalpaper}{\setkeys{hep}{paper=legal}}{}
642 \@ifclasswith{\hep@class}{executivepaper}{%
643 \setkeys{hep}{paper=executive}%
644 }{}
645 % \end{macrocode}
646 %
647 % \subsection{Set compatibility}
648 %
649 % Set the "amsart" compatibility options using the \software{xpatch} package \cite{xpatch}.
650 % \begin{macrocode}
651 \@ifclassloaded{amsart}{\setkeys{hep}{amsart}}{}
652 \ifhep@amsart
653 \setkeys{hep}{defaults, title=false}
654 \RequirePackage{xpatch}
655 \xpretocmd{\@adminfootnotes}{\let\@makefntext\BHFN@OldMakefntext}{}{}
656 \fi
657 % \end{macrocode}
658 %
659 % Set the "springer" compatibility options.
660 % \begin{macrocode}
661 \@ifclassloaded{svjour}{\setkeys{hep}{springer}}{}
662 \@ifclassloaded{svjour2}{\setkeys{hep}{springer}}{}
663 \@ifclassloaded{svjour3}{\setkeys{hep}{springer}}{}
664 \ifhep@springer
665 \setkeys{hep}{defaults, title=false}
666 \let\cl@chapter\undefined
667 \fi
668 % \end{macrocode}
669 %
670 % Set the "pos" compatibility options.
671 % \begin{macrocode}
672 \@ifclassloaded{PoS}{\setkeys{hep}{pos}}{}
673 \ifhep@pos
674 \setkeys{hep}{defaults, title=false, references=false, font=default}
675 \DeclareRobustCommand\boldmath{\@nomath\boldmath\mathversion{bold}}
676 \PassOptionsToPackage{hidelinks}{hyperref}
677 \RequirePackage{hyperref}
678 \fi
679 % \end{macrocode}
680 %
681 % Set the "beamer" compatibility options.
682 % \begin{macrocode}
683 \@ifclassloaded{beamer}{\setkeys{hep}{beamer}}{}
684 \ifhep@beamer
685 \setkeys{hep}{%
686 defaults, title=false, references=false, sansserif, font=default%
687 }
688 \@ifpackageloaded{beamerbasefont}{\usefonttheme{professionalfonts}}{}
689 \setbeamertemplate{navigation symbols}{}
690 \fi
691 % \end{macrocode}
692 %
693 % Set the "revtex" compatibility options.
694 % \begin{macrocode}
695 \@ifclassloaded{revtex4}{\setkeys{hep}{revtex}}{}
696 \@ifclassloaded{revtex4-1}{\setkeys{hep}{revtex}}{}
697 \@ifclassloaded{revtex4-2}{\setkeys{hep}{revtex}}{}
698 \ifhep@revtex
699 \setkeys{hep}{
700 defaults,
701 font=default,
702 title=false,
703 bibliography=false,
704 lang=american,
705 }
706 \RequirePackage{hep-revtex}
707 \fi
708 % \end{macrocode}
709 %
710 % Define the SISSA conditional.
711 % \begin{macrocode}
712 \@ifpackageloaded{jheppub}{\setkeys{hep}{jhep}}{}
713 \@ifpackageloaded{jcappub}{\setkeys{hep}{jcap}}{}
714 \newif\ifhep@sissa
715 \ifhep@jhep\hep@sissatrue
716 \else
717 \ifhep@jcap\hep@sissatrue
718 \else\hep@sissafalse
719 \fi
720 \fi
721 % \end{macrocode}
722 %
723 % Set the SISSA compatibility options.
724 % \begin{macrocode}
725 \ifhep@sissa
726 \setkeys{hep}{defaults, title=false, bibliography=false}
727 \RequirePackage{hep-sissa}
728 \fi
729 \ifhep@jhep
730 \PassOptionsToPackage{\hep@paper paper}{geometry}
731 \RequirePackage{geometry}
732 \geometry{
733 offset=0in,
734 top=.1\paperheight,
735 textheight=.756\paperheight,
736 textwidth=.72\paperwidth,
737 }
738 \fi
739 % \end{macrocode}
740 %
741 % \section{Math}
742 %
743 % Load the \software{hep-math} package \cite{hep-math}.
744 % \begin{macrocode}
745 \ifhep@physics\RequirePackage{hep-math}\fi
746 % \end{macrocode}
747 %
748 % \section{Font} \label{sec:font}
749 %
750 % Load the \software{hep-font} package \cite{hep-font}.
751 % \begin{macrocode}
752 \PassOptionsToPackage{
753 size=\hep@font,
754 sans=\ifhep@serif false\else true\fi,
755 lining=\ifhep@lining true\else false\fi
756 }{hep-font}
757 \RequirePackage{hep-font}
758 % \end{macrocode}
759 %
760 % \subsection{Math fonts}
761 %
762 % Load the \software{hep-math-font} package \cite{hep-math-font}.
763 % \begin{macrocode}
764 \PassOptionsToPackage{symbols=\hep@symbols}{hep-math-font}
765 \RequirePackage{hep-math-font}
766 % \end{macrocode}
767 %
768 % \section{Geometry}
769 %
770 % Load the \software{geometry} package \cite{geometry} and adjust the text width and height.
771 % This step must happen after readjusting the font size in \cref{sec:font}.
772 % \begin{macrocode}
773 \ifhep@defaults\else
774 \RequirePackage{geometry}
775 \geometry{\hep@paper paper, includeheadfoot}
776 \if@twocolumn
777 \geometry{hscale=.85, vscale=.925, vmarginratio=1:1}
778 \geometry{headsep=2ex, footskip=6ex}
779 \setlength{\columnsep}{1.1em}
780 \else
781 \geometry{hscale=.75, vscale=.8, vmarginratio=3:4}
782 \fi
783 \fi
784 % \end{macrocode}
785 %
786 %\begin{macro}{\useparskip}
787 %\begin{macro}{\useparindent}
788 % Load the \software{parskip} package \cite{parskip} if requested and provide two commands switching between the two paragraph modes.
789 % \begin{macrocode}
790 \ifhep@parindent\else
791 \RequirePackage{parskip}
792 \newcommand*{\useparskip}{%
793 \setlength{\parskip}{.5\baselineskip plus 2pt}%
794 \setlength{\parindent}{0pt}%
795 }
796 \newcommand*{\useparindent}{%
797 \setlength{\parskip}{0pt}%
798 \setlength{\parindent}{15pt}%
799 \if@twocolumn\setlength\parindent{1em}
800 \else\setlength\parindent{1.5em}
801 \fi
802 }
803 \fi
804 % \end{macrocode}
805 % \end{macro}
806 % \end{macro}
807 %
808 % \section{Text}
809 %
810 % Load the \software{hep-text} package \cite{hep-text}.
811 % \begin{macrocode}
812 \PassOptionsToPackage{lang=\hep@lang}{hep-text}
813 \RequirePackage{hep-text}
814 % \end{macrocode}
815 %
816 % \section{Floats}
817 %
818 % Adjust the \hologo{LaTeX} float placement defaults using the \software{hep-float} package \cite{hep-float}.
819 % \begin{macrocode}
820 \PassOptionsToPackage{%
821 \ifhep@manualplacement local\else global\fi%
822 }{hep-float}
823 \RequirePackage{hep-float}
824 % \end{macrocode}
825 %
826 % \begin{macro}{\ifhep@journal}
827 % Define a new journal conditional.
828 % \begin{macrocode}
829 \newif\ifhep@journal
830 \ifhep@sissa\hep@journaltrue
831 \else\ifhep@revtex\hep@journaltrue
832 \else\ifhep@pos\hep@journaltrue
833 \else\ifhep@springer\hep@journaltrue
834 \else\hep@journalfalse
835 \fi
836 \fi
837 \fi
838 \fi
839 % \end{macrocode}
840 % \end{macro}
841 %
842 % Prevent the \software{caption} package \cite{caption} from complaining about the journal classes and packages.
843 % \begin{macrocode}
844 \ifhep@journal
845 \setlength\abovecaptionskip{\f@size\p@}
846 \setlength\belowcaptionskip{0\p@}
847 \long\def\@makecaption#1#2{%
848 \vskip\abovecaptionskip
849 \sbox\@tempboxa{#1: #2}%
850 \ifdim \wd\@tempboxa >\hsize
851 #1: #2\par
852 \else
853 \global \@minipagefalse
854 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
855 \fi
856 \vskip\belowcaptionskip%
857 }
858 \fi
859 % \end{macrocode}
860 %
861 % \section{Title page}
862 %
863 % Adjust the title page using the \software{hep-title} package \cite{hep-title}.
864 % \begin{macrocode}
865 \ifhep@title\RequirePackage{hep-title}\fi
866 % \end{macrocode}
867 %
868 % \section{Bibliography}
869 %
870 % Check if bibliography management is requested using the \software{pdftexcmds} package \cite{pdftexcmds}.
871 % And load the \software{hep-bibliography} package \cite{hep-bibliography}
872 % \begin{macrocode}
873 \RequirePackage{pdftexcmds}
874 \ifnum\pdf@strcmp{\hep@bibliography}{false}=0\else
875 \PassOptionsToPackage{style=\hep@bibliography}{hep-bibliography}
876 \RequirePackage{hep-bibliography}
877 \fi
878 % \end{macrocode}
879
880 % \section{Hyperlinks, Footnotes and References} \label{sec:hyperlinks}
881 %
882 % Load the \software{hep-reference} package \cite{hep-reference}.
883 %
884 % \begin{macrocode}
885 \ifhep@references
886 \RequirePackage{hep-reference}
887 % \end{macrocode}
888 %
889 % End of "references" conditional
890 % \begin{macrocode}
891 \fi
892 % \end{macrocode}
893
894 % \section{Acronyms}
895 %
896 % Define acronyms if not deactivated.
897 % Acronyms are implemented in the \software{hep-acronym} package \cite{hep-acronym} and must be loaded after the \software{hyperref} package in \cref{sec:hyperlinks}.
898 % Set the abbreviation style.
899 % \begin{macrocode}
900 \ifhep@glossaries\RequirePackage{hep-acronym}\fi
901 % \end{macrocode}
902 %
903 %</package>
904 %
905 % \section{SISSA compatibility}
906 %
907 %<*sissa>
908 %
909 %\begin{macro}{\arxiv}
910 % Provide the "\arxiv" macro.
911 % \begin{macrocode}
912 \let\arxiv\arxivnumber
913 % \end{macrocode}
914 %\end{macro}
915 %
916 %\begin{macro}{\subtitle}
917 % Provide the "\subtitle" macro.
918 % \begin{macrocode}
919 \newcommand*{\subtitle}[1]{%
920 \let\hep@title\@title%
921 \title{\hep@title: #1}%
922 }
923 % \end{macrocode}
924 %\end{macro}
925 %
926 %\begin{macro}{\author}
927 % Ensure that the affiliation superscript is not in bold font.
928 % \begin{macrocode}
929 \renewcommand{\author}[2][]{%
930 \if!#1!%
931 \auth@toks=\expandafter{\the\auth@toks#2\ }%
932 \else%
933 \auth@toks=\expandafter{%
934 \the\auth@toks#2\textsuperscript{\textnormal{\textit{#1}}}\
935 }%
936 \fi%
937 }
938 % \end{macrocode}
939 %\end{macro}
940 %
941 %\begin{macro}{\email}
942 % Provide the "\email" macro.
943 % \begin{macrocode}
944 \newcommand*\email[2][]{%
945 \global\emailaddtrue%
946 \ifnum\theemail@counter>0%
947 \global\email@toks=\expandafter{\the\email@toks, \@email{#2}}%
948 \else%
949 \global\email@toks=\expandafter{\the\email@toks\@email{#2}}%
950 \fi%
951 \stepcounter{email@counter}%
952 }
953 % \end{macrocode}
954 %\end{macro}
955 %
956 %\begin{environment}{abstract}
957 % Define an "abstract" environment that works within the document using the \software{environ} \cite{environ} and a new auxiliary file.
958 % \begin{macrocode}
959 \RequirePackage{environ}
960 \newcommand{\hep@abstract@file}{\jobname.abs}
961 \newwrite\hep@write@abstract
962 \AtBeginDocument{%
963 \RenewEnviron{abstract}{%
964 \immediate\openout\hep@write@abstract=\hep@abstract@file%
965 \immediate\write\hep@write@abstract{\unexpanded\expandafter{\BODY}}%
966 \immediate\closeout\hep@write@abstract%
967 }%
968 }
969 \IfFileExists{\hep@abstract@file}{%
970 \gdef\@abstract{\input{\hep@abstract@file}}%
971 }{}
972 % \end{macrocode}
973 %\end{environment}
974 %
975 %\begin{macro}{\tableofcontents}
976 %\begin{macro}{\listoffigures}
977 %\begin{macro}{\listoftables}
978 % Disable the "\tableofcontents", "\listoffigures", "\listoftables" macros since the "\maketitle" macro takes care of the journal style.
979 % \begin{macrocode}
980 \let\hep@make@title\maketitle
981 \def\maketitle{\hep@make@title\renewcommand*{\tableofcontents}{}}
982 \renewcommand*{\listoffigures}{}
983 \renewcommand*{\listoftables}{}
984 % \end{macrocode}
985 %\end{macro}
986 %\end{macro}
987 %\end{macro}
988 %
989 % Ensure that hyperlinks are colored correctly.
990 % \begin{macrocode}
991 \AtEndPreamble{
992 \hypersetup{
993 colorlinks=true,
994 linktocpage=true
995 pdfproducer=medialab,
996 pdfa=true,
997 urlcolor=blue,
998 anchorcolor=blue,
999 citecolor=blue,
1000 filecolor=blue,
1001 linkcolor=blue,
1002 menucolor=blue,
1003 pagecolor=blue
1004 }
1005 }
1006 \AtEndPreamble{\@ifpackageloaded{cleveref}{\@cref@nameinlinkfalse}{}}
1007 \AtEndPreamble{\@ifpackageloaded{glossaries}{\glsdisablehyper}{}}
1008 \AtEndPreamble{\@ifpackageloaded{foreign}{
1009 \renewcommand*{\foreignabbrfont}{}
1010 }{}}
1011 % \end{macrocode}
1012 %
1013 % Adjust the lining style in the bibliography.
1014 % \begin{macrocode}
1015 \@ifpackageloaded{nfssext-cfr}{\renewcommand{\bibnumfmt}[1]{[\textt{#1}]}}{}
1016 % \end{macrocode}
1017 %
1018 %</sissa>
1019 %
1020 % \section{Revtex}
1021 %
1022 %<*revtex>
1023 %
1024 % Prevent adjustment of paper size.
1025 % \begin{macrocode}
1026 \PassOptionsToPackage{size=default}{hep-font}
1027 % \end{macrocode}
1028 %
1029 % Provide the "\arxiv" macro.
1030 % \begin{macrocode}
1031 \newcommand*\arxiv[1]{\preprint{%
1032 \textsc{arXiv}: \href{https://arxiv.org/abs/#1}{\nolinkurl{#1}}%
1033 }}
1034 % \end{macrocode}
1035 %
1036 % Provide the "\subtitle" macro.
1037 % \begin{macrocode}
1038 \newcommand*{\subtitle}[1]{\let\hep@title\@title\title{\hep@title: #1}}
1039 % \end{macrocode}
1040 %
1041 % Load the "hyperref" package \cite{hyperref} in order to avoid compilation errors.
1042 % \begin{macrocode}
1043 \RequirePackage{hyperref}
1044 % \end{macrocode}
1045 %
1046 % Allow definition of meta data in the preamble.
1047 % \begin{macrocode}
1048 \frontmatter@init
1049 \let\frontmatter@init\@empty
1050 % \end{macrocode}
1051 %
1052 % Redefine the "\author" macro.
1053 % \begin{macrocode}
1054 \renewcommand*{\author}[2][]{\frontmatter@author{#2}}
1055 % \end{macrocode}
1056 %
1057 % Redefine the "\@affiliation" macro.
1058 % \begin{macrocode}
1059 \renewcommand*\@affiliation[2][]{%
1060 \endgroup%
1061 \let\@AF@join\@affil@join%
1062 \@affil@def{#2}%
1063 }%
1064 % \end{macrocode}
1065 %
1066 % Provide an abstract environment that can be called after "\maketitle" using the \software{environ} package \cite{environ} and an additional auxiliary file.
1067 % \begin{macrocode}
1068 \RequirePackage{environ}
1069 \newcommand{\hep@abstract@file}{\jobname.abs}
1070 \newwrite\hep@write@abstract
1071 % \let\hep@frontmatter@abstractfont\frontmatter@abstractfont
1072 % \def\frontmatter@abstractfont{\hep@frontmatter@abstractfont\rmfamily}
1073 \let\hep@make@title\maketitle%
1074 \def\maketitle{\hep@make@title%
1075 \NewEnviron{abstract}{%
1076 \immediate\openout\hep@write@abstract=\hep@abstract@file%
1077 \immediate\write\hep@write@abstract{\unexpanded\expandafter{\BODY}}%
1078 \immediate\closeout\hep@write@abstract%
1079 \let\abstract\@undefined\let\endabstract\@undefined
1080 }%
1081 }
1082 \IfFileExists{\hep@abstract@file}{\AtBeginDocument{%
1083 \begin{frontmatter@abstract}%
1084 \input{\hep@abstract@file}%
1085 \end{frontmatter@abstract}%
1086 }}{}
1087 % \end{macrocode}
1088 % Prevent the abstract to move to the second page in preprint mode.
1089 % \begin{macrocode}
1090 \RequirePackage{etoolbox}
1091 \patchcmd{\frontmatter@abstract@produce}{
1092 \vskip200\p@\@plus1fil
1093 \penalty-200\relax
1094 }{
1095 \vskip225\p@\@plus1fil
1096 }{}{}
1097 % \end{macrocode}
1098 %
1099 % Ensure that the hyperlinks are colored correctly using the software{xcolor} package \cite{xcolor}.
1100 % \begin{macrocode}
1101 \RequirePackage{xcolor}
1102 \definecolor{linkcolor}{RGB}{46,48,146}
1103 \AtEndPreamble{
1104 \@ifpackageloaded{hyperref}{
1105 \hypersetup{
1106 colorlinks=true,
1107 linkcolor=linkcolor,
1108 citecolor=linkcolor,
1109 urlcolor=linkcolor,
1110 linktocpage=true
1111 }}{}}
1112 \AtEndPreamble{\@ifpackageloaded{cleveref}{\@cref@nameinlinkfalse}{}}
1113 \AtEndPreamble{\@ifpackageloaded{glossaries}{\glsdisablehyper}{}}
1114 \AtBeginShipout{\hypersetup{pdftitle={\@title}}}
1115 % \end{macrocode}
1116 %
1117 % Ensure correct formatting of float captions using the \software{ragged2e} package \cite{ragged2e}.
1118 % \begin{macrocode}
1119 \AtBeginDocument{\@ifpackageloaded{caption}{
1120 \RequirePackage{ragged2e}
1121 \DeclareCaptionFormat{revtex}{#1#2\justifying{#3}}
1122 \captionsetup{font=small, format=revtex}
1123 \captionsetup[sub]{font=small, format=plain}
1124 }{}}
1125 % \end{macrocode}
1126 %
1127 % Fixing the names of figures and tables.
1128 % \begin{macrocode}
1129 \AfterEndPreamble{
1130 \renewcommand{\figurename}{FIG.}
1131 \renewcommand{\tablename}{TABLE}
1132 }
1133 % \end{macrocode}
1134 %
1135 %</revtex>
1136 %
1137 % \section{Tests}
1138 %
1139 % \subsection{JHEP}
1140 %
1141 %<*testJHEP>
1142 %
1143 % \begin{macrocode}
1144 \documentclass[a4paper, 11pt]{article}
1145
1146 \usepackage{jheppub}
1147 \usepackage[lang=english]{hep-paper}
1148 \usepackage[math]{blindtext}
1149
1150 \title{Title}
1151
1152 \author[a]{First author}
1153 \affiliation[a]{First affiliation}
1154 \email{[email protected]}
1155
1156 \author[b]{Second author}
1157 \affiliation[b]{Second affiliation}
1158 \email{[email protected]}
1159
1160 \arxiv{1234.5678}
1161
1162 \begin{document}
1163
1164 \maketitle
1165
1166 \begin{abstract}
1167 \blindtext
1168 \end{abstract}
1169
1170 \Blinddocument
1171
1172 \end{document}
1173 % \end{macrocode}
1174 %
1175 %</testJHEP>
1176 %
1177 % \subsection{JCAP}
1178 %
1179 %<*testJCAP>
1180 %
1181 % \begin{macrocode}
1182 \documentclass[a4paper, 11pt]{article}
1183
1184 \usepackage{jcappub}
1185 \usepackage[lang=english]{hep-paper}
1186 \usepackage[math]{blindtext}
1187
1188 \begin{document}
1189
1190 \title{Title}
1191
1192 \emailAdd{[email protected]}
1193 \author[a]{First author}
1194 \emailAdd{[email protected]}
1195 \author[b]{Second author}
1196 \affiliation[a]{First affiliation}
1197 \affiliation[b]{Second affiliation}
1198
1199 \abstract{\blindtext}
1200
1201 \maketitle
1202
1203 \Blinddocument
1204
1205 \end{document}
1206 % \end{macrocode}
1207 %
1208 %</testJCAP>
1209 %
1210 % \subsection{AMSArt}
1211 %
1212 %<*testAMSArt>
1213 %
1214 % \begin{macrocode}
1215 \documentclass{amsart}
1216
1217 \usepackage[lang=english]{hep-paper}
1218 \usepackage[math]{blindtext}
1219
1220 \title{title}
1221
1222 \author{Author}
1223 \address{Address 1}
1224 \email{[email protected]}
1225 \author{Author 2}
1226 \email{[email protected]}
1227 \address{Address 2}
1228
1229 \date{date}
1230
1231 \begin{document}
1232
1233 \begin{abstract}
1234 \blindtext
1235 \end{abstract}
1236
1237 \maketitle
1238
1239 \Blinddocument
1240
1241 \end{document}
1242 % \end{macrocode}
1243 %
1244 %</testAMSArt>
1245 %
1246 % \subsection{Beamer}
1247 %
1248 %<*testBeamer>
1249 %
1250 % \begin{macrocode}
1251 \documentclass{beamer}
1252
1253 \usepackage[lang=english]{hep-paper}
1254 \usepackage[math]{blindtext}
1255
1256 \title{Title}
1257 \subtitle{Subtitle}
1258 \author{Author}
1259 \institute{Institute}
1260 \date{Event}
1261
1262 \begin{document}
1263
1264 \frame{\titlepage}
1265
1266 \begin{frame}{Frame title}
1267 \blindtext
1268 \end{frame}
1269
1270 \end{document}
1271 % \end{macrocode}
1272 %
1273 %</testBeamer>
1274 %
1275 % \subsection{PoS}
1276 %
1277 %<*testPoS>
1278 %
1279 % \begin{macrocode}
1280 \documentclass{PoS}
1281
1282 \usepackage[lang=english]{hep-paper}
1283 \usepackage[math]{blindtext}
1284
1285 \title{Title}
1286
1287 \author{First author \thanks{[email protected]}}
1288 \author{
1289 \speaker{Second author is speaker}\\
1290 First affiliation\\
1291 E-mail: \email{[email protected]}
1292 }
1293 \author{Third author \thanks{\email{[email protected]}}\\
1294 Second affiliation}
1295 \author{Fourth author\\Third affiliation}
1296 \FullConference{Full conference}
1297 \ShortTitle{Short title}
1298
1299 \begin{abstract}
1300 \blindtext
1301 \end{abstract}
1302
1303 \begin{document}
1304
1305 \Blinddocument
1306
1307 \end{document}
1308 % \end{macrocode}
1309 %
1310 %</testPoS>
1311 %
1312 % \subsection{RevTeX}
1313 %
1314 %<*testRevTeX>
1315 %
1316 % \begin{macrocode}
1317 \documentclass[
1318 aps,
1319 prl,
1320 reprint,
1321 nofootinbib,
1322 nobibnotes,
1323 superscriptaddress,
1324 preprintnumbers,
1325 ]{revtex4-2}
1326
1327 \usepackage{hep-paper}
1328 \usepackage[math]{blindtext}
1329
1330 \title{Title}
1331
1332 \author{First author}
1333 \email[E-mail me at: ]{[email protected]}
1334 \affiliation{First affiliation}
1335 \author{Second author}
1336 \email{[email protected]}
1337 \affiliation{Second affiliation}
1338 \affiliation{Third affiliation}
1339 \author{Third author}
1340 \affiliation{Fourth affiliation}
1341
1342 \arxiv{1234.5678}
1343
1344 \begin{document}
1345
1346 \maketitle
1347
1348 \begin{abstract}
1349 \blindtext
1350 \end{abstract}
1351
1352 \Blinddocument
1353
1354 \end{document}
1355 % \end{macrocode}
1356 %
1357 %</testRevTeX>
1358 %
1359 % \subsection{Springer}
1360 %
1361 %<*testSpringer>
1362 %
1363 % \begin{macrocode}
1364 \documentclass[twocolumn,epjc3]{svjour3}
1365
1366 \usepackage[lang=english]{hep-paper}
1367 \usepackage[math]{blindtext}
1368
1369 \journalname{Journal name}
1370
1371 \title{Title\thanksref{title}}
1372
1373 \titlerunning{Short title}
1374
1375 \subtitle{Subtitle}
1376
1377 \thankstext{title}{Title thanks}
1378
1379 \authorrunning{Short form of author list}
1380
1381 \thankstext{email1}{e-mail: [email protected]}
1382 \thankstext{email2}{e-mail: [email protected]}
1383
1384 \institute{
1385 First address \label{address1} \and
1386 Second address \label{address2} \and
1387 \emph{Present Address:} if needed\label{address3}
1388 }
1389
1390 \date{Received: date / Accepted: date}
1391
1392 \begin{document}
1393
1394 \author{
1395 First Author\thanksref{email1,address1} \and
1396 Second Author\thanksref{email2,address2,address3}
1397 }
1398
1399 \maketitle
1400
1401 \begin{abstract}
1402 \blindtext
1403 \end{abstract}
1404
1405 \Blinddocument
1406
1407 \end{document}
1408 % \end{macrocode}
1409 %
1410 %</testSpringer>
1411 %
1412 % \section{Readme}
1413 %
1414 %<*readme>
1415 %
1416 % \begin{macrocode}
1417 # The `hep-paper` package
1418
1419 A `LaTeX` package for publications in High Energy Physics.
1420
1421 ## Introduction
1422
1423 The `hep-paper` package aims to provide a single style file containing
1424 most configurations and macros necessary to write appealing publications
1425 in High Energy Physics. Instead of reinventing the wheel by introducing
1426 newly created macros `hep-paper` preferably loads third party packages as
1427 long as they are lightweight enough.
1428
1429 For usual publications it is enough to load additionally to the `article`
1430 class without optional arguments only the `hep-paper` package.
1431
1432 \documentclass{article}
1433 \usepackage{hep-paper}
1434
1435 ## Author
1436
1437 Jan Hajer
1438
1439 ## License
1440
1441 This file may be distributed and/or modified under the conditions of the
1442 `LaTeX` Project Public License, either version 1.3c of this license or
1443 (at your option) any later version. The latest version of this license is
1444 in `http://www.latex-project.org/lppl.txt` and version 1.3c or later is
1445 part of all distributions of LaTeX version 2005/12/01 or later.
1446 % \end{macrocode}
1447 %
1448 %</readme>
1449 %
1450 % \Finale
1451 %
1452 \endinput
1453
1454 % \PrintIndex
1455 % makeindex -s gglo.ist -o hep-paper-implementation.gls hep-paper-implementation.glo
1456 % makeindex -s gglo.ist -o hep-paper-implementation.ind hep-paper-implementation.idx
1457
1458 % \begin{macro}{\refstepcounter@...}
1459 % Adjust the "cleveref" "\refstepcounter@noarg" and "\refstepcounter@optarg" to use the "\@currentlabel" in order to fix problems with "\subref".
1460 % \begin{macrocode}
1461 % \def\refstepcounter@noarg#1{%
1462 % \cref@old@refstepcounter{#1}%
1463 % \cref@constructprefix{#1}{\cref@result}%
1464 % \@ifundefined{cref@#1@alias}%
1465 % {\def\@tempa{#1}}%
1466 % {\def\@tempa{\csname cref@#1@alias\endcsname}}%
1467 % \protected@edef\cref@currentlabel{%
1468 % [\@tempa][\arabic{#1}][\cref@result]%
1469 % \noexpand\@currentlabel%
1470 % }% changed
1471 % }
1472 %
1473 % \def\refstepcounter@optarg[#1]#2{%
1474 % \cref@old@refstepcounter{#2}%
1475 % \cref@constructprefix{#2}{\cref@result}%
1476 % \@ifundefined{cref@#1@alias}%
1477 % {\def\@tempa{#1}}%
1478 % {\def\@tempa{\csname cref@#1@alias\endcsname}}%
1479 % \protected@edef\cref@currentlabel{%
1480 % [\@tempa][\arabic{#2}][\cref@result]%
1481 % \noexpand\@currentlabel% changed
1482 % }%
1483 % }
1484 % % \end{macrocode}
1485 % % \end{macro}
1486 %
1487 %
1488 % \RequirePackage{contour}
1489 % \renewcommand*{\ULdepth}{1.8pt}
1490 % \contourlength{0.8pt}
1491 % \newcommand*{\myuline}[1]{%
1492 % \uline{\phantom{#1}}\llap{\contour{white}{#1}}%
1493 % }
1494
1495 % \begin{macro}{\mathpzc}
1496 % Define the "\mathpzc" math script font based on the Zapf Chancery PostScript font.
1497 % \begin{macrocode}
1498 % \DeclareFontFamily{OT1}{pzc}{}
1499 % \DeclareFontShape{OT1}{pzc}{m}{it}{<-> s * [1.15] pzcmi7t}{}
1500 % \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
1501 % \end{macrocode}
1502 % \end{macro}