summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hep-paper/hep-paper-implementation.dtx
blob: 4e0334f0695560a768a7d778b7ddec773a90f3bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
% \iffalse meta-comment
%
% Copyright (C) 2019 by Jan Hajer
% -----------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% \fi
%
% \iffalse
%
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{hep-paper}[2021/09/01 v2.0 Publications in High Energy Physics]
%<documentation>\ProvidesFile{hep-paper-documentation.tex}[2021/09/01 v2.0 HEP-Paper documentation]
%
%<*documentation>
%
\RequirePackage[l2tabu, orthodox]{nag}
\documentclass{ltxdoc}
\AtBeginDocument{\DeleteShortVerb{\|}}
\AtBeginDocument{\MakeShortVerb{\"}}

\EnableCrossrefs
\CodelineIndex
\RecordChanges

\usepackage[parskip]{hep-paper}

\bibliography{bibliography}

\acronym{PDF}{portable document format}
\acronym{LM}{latin modern}

\usepackage{hologo}

\MacroIndent=1.5em
\AtBeginEnvironment{macrocode}{\renewcommand{\ttdefault}{clmt}}
%</documentation>

%<*driver>
\expandafter\newif\csname ifshort\endcsname
\shortfalse
\begin{document}
\DocInput{hep-paper-implementation.dtx}
\end{document}
%</driver>
%
% \fi
%
% \CheckSum{609}
%
% \CharacterTable
%  {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
%   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
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{v1.0}{2019/01/01}{Initial version of the style file.}
% \changes{v1.1}{2020/01/01}{Transition to documented \hologo{LaTeX} source file.}
% \changes{v1.2}{2020/03/01}{Introduction of package options.}
% \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}
% \changes{v1.4}{2020/09/01}{If possible the compatibility options are selected automatically. Inclusion of PubMed IDs in bibliography.}
% \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.}
% \changes{v1.6}{2020/12/01}{Implementation of the twocolumn mode.}
% \changes{v1.7}{2021/06/01}{Introduction of dedicated style file for the title, acronyms and bibliography macros. Extension of the title macros.}
% \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.}
% \changes{v2.0}{2021/09/01}{Move independent logic into dedicated packages.}
%
% \ifshort
%<*documentation>
% \fi
%
\GetFileInfo{hep-paper.sty}

\title{The \software{hep-paper} package\thanks{This document corresponds to \software{hep-paper}~\fileversion.}}
\subtitle{Publications in high energy physics}
\author{Jan Hajer \email{jan.hajer@unibas.ch}}
\date{\filedate}

% \ifshort
\begin{document}
% \fi

\maketitle

\begin{abstract}
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.
Instead of reinventing the wheel by introducing newly created macros \software{hep-paper} preferably loads third party packages.
\end{abstract}

\tableofcontents\clearpage

\newgeometry{vscale=.8, vmarginratio=3:4, includeheadfoot, left=11em, marginparwidth=4.6cm, marginparsep=3mm, right=7em}

\section{Introduction}

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}.
\begin{verbatim}
\documentclass{article}
\usepackage{hep-paper}
\end{verbatim}
The most notable changes after loading the \software{hep-paper} package is the change of some \hologo{LaTeX} defaults.
The paper and font sizes are set to A4 and \unit[11]{pt}, respectively.
Additionally, the paper geometry is adjusted using the \software{geometry} package \cite{geometry}.
Furthermore, the font is changed to \LM using the \software{hep-font} package \cite{hep-font}.
Finally, \PDF hyperlinks are implemented with the \software{hyperref} package \cite{hyperref}.

\subsection{Options}

\DescribeMacro{paper}
The "paper="\meta{format} option loads the specified paper format.
The possible \meta{formats} are:
"a0", "a1", "a2", "a3", "a4", "a5", "a6",
"b0", "b1", "b2", "b3", "b4", "b5", "b6",
"c0", "c1", "c2", "c3", "c4", "c5", "c6",
"ansia", "ansib", "ansic", "ansid", "ansie",
"letter", "executive", "legal".
The default is "a4".

\DescribeMacro{font}
The "font="\meta{size} option loads the specified font size.
The possible \meta{sizes} are:
"8pt", "9pt", "10pt", "11pt", "12pt", "14pt", "17pt", "20pt".
The default is \unit[11]{pt}.

\DescribeMacro{lang}
The "lang"=\meta{name} option switches the document language.
The default is "british".

\DescribeMacro{sansserif}
The "sansserif" option switches the document including math to sans serif font shape.

\DescribeMacro{oldstyle}
The "oldstyle" option activates the use of oldstyle text- (\texto{123}) in favour of lining- (\textl{123}) figures in text mode.

\DescribeMacro{parskip}
The "parskip" option changes how paragraphs are separated from each other using the \software{parskip} package \cite{parskip}.
The \hologo{LaTeX} default is separation via indentation the "parskip" option switches to separation via vertical space.
\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.}

\DescribeMacro{symbols}
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.
"symbols=false" deactivates loading any additional symbol fonts.

\subsubsection{Deactivation}

The \software{hep-paper} package loads few bigger packages which have a large impact on the document.
The deactivation options can prevent such and other adjustments.

\DescribeMacro{defaults}
The "defaults" option prevents the adjustment of the page geometry and the font size set by the document class.

\DescribeMacro{title}
The "title=false" option deactivates the title page adjustments.

\DescribeMacro{bibliography}
The "bibliography"=\meta{key} option prevents the automatic loading of the \software{hep-bibliography} package \cite{hep-bibliography} if \meta{key}="false".

\DescribeMacro{glossaries}
The "glossaries=false" option deactivates acronyms and the use of the \software{hep-acronym} package \cite{hep-acronym}.

\DescribeMacro{references}
The "references=false" option prevents the \software{cleveref} package \cite{cleveref} from being loaded and deactivates further redefinitions of reference macros.

\subsubsection{Compatibility}

The compatibility options activate the compatibility mode for certain classes and packages used for publications in high energy physics.
They are mostly suitable combinations of options described in the previous section.
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.

\DescribeMacro{beamer}
The "beamer" option activates the \software{beamer} \cite{beamer} compatibility mode.

\DescribeMacro{jhep}
The "jhep" option activates the \software{JHEP} \cite{jhep} compatibility mode.

\DescribeMacro{jcap}
The "jcap" option activates the \software{JCAP} \cite{jcap} compatibility mode.

\DescribeMacro{revtex}
The "revtex" option activates the REV\hologo{TeX} \cite{revtex} compatibility mode.

\DescribeMacro{pos}
The "pos" option activates the \software{PoS} compatibility mode.

\DescribeMacro{springer}
The "springer" option activates the compatibility mode the "svjour" class \cite{svjour}.

\subsubsection{Reactivation}

The \software{hep-paper} package deactivates unrecommended macros, which can be reactivated manually.

\DescribeMacro{manualplacement}
The "manualplacement" option reactivates manual float placement.

\DescribeMacro{eqnarray}
The "eqnarray" option reactivates the depreciated "eqnarray" environment.

\section{Macros and environments}

\DescribeMacro{twocolumn}
\DescribeMacro{abstract*}
If the global "twocolumn" option is present the page geometry is changed to cover almost the entire page.
Additionally the "abstract*" environment is defined that generates a one column abstract and takes care of placing the title information.

\subsection{Title page} \label{sec:title}

\DescribeMacro{\series}
The "\series"\marg{series} macro is defined using the \software{hep-title} package \cite{hep-title}.

\DescribeMacro{\title}
The \PDF meta information is set according to the "\title"\marg{text} and "\author"\marg{text} information.

\DescribeMacro{\subtitle}
The "\subtitle"\marg{subtitle} macro is defined.

\DescribeMacro{\editor}
\DescribeMacro{\author}
\DescribeMacro{\affiliation}
\DescribeMacro{\email}
The following lines add \eg two authors with different affiliations
\begin{verbatim}
\author[1]{Author one \email{email one}}
\affiliation[1]{Affiliation one}
\author[2]{Author two \email{email two}}
\affiliation[1,2]{Affiliation two}
\end{verbatim}

\DescribeMacro{\preprint}
The "\preprint"\marg{numer} macro places a pre-print number in the upper right corner of the title page.

\DescribeEnv{abstract}
The "abstract" environment is adjusted to not start with an indentation.

\DescribeMacro{\titlefont}
\DescribeMacro{\subtitlefont}
\DescribeMacro{\authorfont}
\DescribeMacro{\affiliationfont}
\DescribeMacro{\preprintfont}
Various title font macros are defined, allowing to change the appearance of the "\maketitle" output.

\subsection{Text}

\DescribeMacro{inlinelist}
\DescribeMacro{enumdescript}
The "inlinelist" and "enumdescript" environments are defined.

\DescribeMacro{\textsc}
A bold versions \textbf{\textsc{Small Caps}} and a sans serif version of \textsf{\textsc{Small Caps}} is provided.

\DescribeMacro{\underline}
\DescribeMacro{\overline}
The "\underline" macro is redefined to allow line-breaks.
The "\overline" macro is extended to also \overline{overline} text outside of math environments.

\DescribeMacro{\useparskip}
\DescribeMacro{\useparindent}
If the "parskip" option is activated the "\useparindent" macro switches to the usual parindent mode, while the "\useparskip" macro switches to the parskip mode.

\subsubsection{References and footnotes}

\DescribeMacro{\cref}
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}.
Furthermore, the \software{cleveref} package allows to reference multiple objects within one "\cref"\marg{key1,key2}.

\DescribeMacro{\cite}
Citations are adjusted to not start on a new line in order to avoid the repeated use of "~\cite"\marg{key}.

\DescribeMacro{\ref}
\DescribeMacro{\eqref}
\DescribeMacro{\subref}
References are also adjusted to not start on a new line.

\DescribeMacro{\footnote}
Footnotes are adjusted to swallow white space before the footnote mark and at the beginning of the footnote text.

\subsubsection{Acronyms} \label{sec:acronyms}

The \software{hep-acronym} package \cite{hep-acronym} is loaded.
\DescribeMacro{\acronym}
\DescribeMacro{\shortacronym}
\DescribeMacro{\longacronym}
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.
The first star prevents the addition of an \enquote{s} to the abbreviation plural.
The second star restores the \hologo{TeX} default of swallowing subsequent white space.
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.
The long form is never used in math mode.
Capitalization at the beginning of paragraphs and sentences is (mostly) ensured.
The "\shortacronym" and "\longacronym" macros are drop-in replacements of the "\acronym" macro showing only the short or long form of their acronym.

\subsection{Math}

The \software{hep-math} \cite{hep-math} and \software{hep-math-font} \cite{hep-math-font} packages are loaded.
\DescribeMacro{\mathbf}
Bold math, via "\mathbf" is improved, \ie ($ A  b  \Gamma \delta \mathbf A \mathbf b \mathbf \Gamma \mathbf \delta$).
Macros switching to "bfseries" such as "\section"\marg{text} are ensured to also typeset math in bold.
\DescribeMacro{\text}
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}$).
\DescribeMacro{\mathsf}
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}$).
\DescribeMacro{\mathscr}
The "\mathcal" font \ie ($\mathcal{ABCD}$) is accompanied by the "\mathscr" font \ie ($\mathscr{ABCD}$).
\DescribeMacro{\mathbb}
The "\mathbb" font is adjusted depending on the "sansserif" option \ie ($\mathbb{Ah1}$).
\DescribeMacro{\mathfrak}
Finally, the "\mathfrak" font is also available \ie ($\mathfrak{AaBb12}$).

\DescribeMacro{\nicefrac}
\DescribeMacro{\flatfrac}
\DescribeMacro{\textfrac}
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$.
\DescribeMacro{\diag}
\DescribeMacro{\sgn}
Diagonal matrix "\diag" and signum "\sgn" operators are defined.

\DescribeMacro{\mathdef}
The "\mathdef"\marg{name}\oarg{arguments}\marg{code} macro \prefix{re}{defines} macros only within math mode without changing the text mode definition.

\DescribeMacro{\i}
\DescribeMacro{\d}
The imaginary unit $\i$ and the differential $\d$ are defined using this functionality.

\DescribeMacro{\numberwithin}
For longer paper it can be useful to re-number the equation in accordance with the section numbering "\numberwithin{equation}{section}".
\DescribeMacro{subequations}
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.

\DescribeMacro{\unit}
\DescribeMacro{\inv}
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.
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}}".

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.
This allows differentiations like
\begin{align} \label{eq:greek}
\sigma &= \unit[5]{fb} \ , & &\mbox{at \unit[5]{\sigma} C.L.} \ , & \mu &= \unit[5]{cm} \ , & l &= \unit[5]{\mu m} \ .
\end{align}
Additionally, Greek letters can also be directly typed using Unicode.

\DescribeMacro{\ev}
\DescribeMacro{\pdv}
\DescribeMacro{\comm}
\DescribeMacro{\order}
The \software{hep-math} package \cite{hep-math} provides additional macros such as
\begin{align}
&\ev{\phi} \ ,
&&\pdv[f]{x}[y]^2 \ ,
&&\comm{A}{B} \ ,
&&\order{x^2} \ ,
&&\eval{x}_0^\infty \ ,
&&\det(M)\ .
\end{align}

\DescribeMacro{\cancel}
\DescribeMacro{\slashed}
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.

\DescribeMacro{\overleftright}
A better looking over left right arrow is defined \ie $\overleftright{\partial}$.

\subsection{Floats}

\DescribeEnv{figure}
\DescribeEnv{table}
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}.
The most useful float placement is usually archived by placing the float \emph{in front} of the paragraph it is referenced in first.

\DescribeEnv{panels}
\DescribeMacro{\panel}
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".
Within the "\begin{panels}"\oarg{vertical alignment}\marg{width} environment the "\panel" macro initiates a new sub-float.
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.

\DescribeMacro{\graphic}
\DescribeMacro{\graphics}
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).
If the graphics are located in a sub-folder its path can be indicated by "\graphics"\marg{subfolder}.

\subsection{Bibliography} \label{sec:bibliography}

\DescribeMacro{\bibliography}
\DescribeMacro{\printbibliography}
The \software{biblatex} package \cite{biblatex} is loaded for bibliography management.
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.
The bibliography is generated by \software{Biber} \cite{biber}.
\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.
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.
\DescribeMacro{erratum}
Errata can be included using the "related" feature.
\begin{verbatim}
\article{key1,
  ...,
  relatedtype="erratum",
  related="key2",
}
\article{key2,
  ...,
}
\end{verbatim}

\section{Conclusion}

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.
The majority of the loaded packages are fairly lightweight, the others can be deactivated with package options.

\DescribeMacro{arxiv-collector}
\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.
The \software{arxiv-collector} python script \cite{arxiv-collector} alleviates this problem by collecting all files necessary for publication on arXiv (including figures).

% \ifshort
\printbibliography

\end{document}
%
%</documentation>
% \fi
%
% \StopEventually{
% \printbibliography
% \PrintChanges
% }
%
% \addtocontents{toc}{\protect\clearpage}
% \clearpage
% \appendix
%
% \section{Options}
%
%<*package>
%
% Load the \software{kvoptions} package \cite{kvoptions} and define a "hep" namespace.
%    \begin{macrocode}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family=hep,
  prefix=hep@
}
%    \end{macrocode}
%
% \begin{macro}{paper}
% Define a "paper="\meta{size} option.
% Make A4 paper the default.
%    \begin{macrocode}
\DeclareStringOption[a4]{paper}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{font}
% Define a "figures="\meta{size} option.
% Make \unit[11]{pt} the default font size.
%    \begin{macrocode}
\DeclareStringOption[11pt]{font}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{lang}
% Define the "lang" option, which takes the values provided by the \software{babel} package \cite{babel}.
% Make "british" the default language.
%    \begin{macrocode}
\DeclareStringOption[british]{lang}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{sansserif}
% Define the option pair "serif" and "sansserif" controling the font shape of the whole document.
%    \begin{macrocode}
\DeclareBoolOption[true]{serif}
\DeclareComplementaryOption{sansserif}{serif}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{lining}
% Define the "lining" option deactivating the use of text figures in text mode.
%    \begin{macrocode}
\DeclareBoolOption[true]{lining}
\DeclareComplementaryOption{oldstyle}{lining}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{parskip}
% Define the option pair "parindent" and "parskip" controlling the separation of paragraphs.
%    \begin{macrocode}
\DeclareBoolOption[true]{parindent}
\DeclareComplementaryOption{parskip}{parindent}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{symbols}
% Provide the "symbols" option allowing to switch the symbol font.
%    \begin{macrocode}
\DeclareStringOption[true]{symbols}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Deactivation}
%
% \begin{macro}{defaults}
% Define the "defaults" option which deactivates the "paper" and "font" options and prevents the change of the class defaults by this package.
%    \begin{macrocode}
\DeclareBoolOption[false]{defaults}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{title}
% Provide the "title" option deactivating redefinitions of title macros.
%    \begin{macrocode}
\DeclareBoolOption[true]{title}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{physics}
% Provide the "physics" option for deactivating redefinition of physics macros.
%    \begin{macrocode}
\DeclareBoolOption[true]{physics}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{bibliography}
% Provide the "bibliography" option for passing a "style" string to the \software{biblatex} package \cite{biblatex} or disabling the automatic loading of "biblatex".
%    \begin{macrocode}
\DeclareStringOption[numeric-comp]{bibliography}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{glossaries}
% Provide the "glossaries" option able to turn of the use of the \software{hep-acronym} package \cite{hep-acronym}.
%    \begin{macrocode}
\DeclareBoolOption[true]{glossaries}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{references}
% Provide the "references" option for preventing the \software{cleveref} package from being loaded redefinitions of reference macros.
%    \begin{macrocode}
\DeclareBoolOption[true]{references}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Compatibility}
%
% \begin{macro}{beamer}
% Provide the "beamer" option for \software{beamer} \cite{beamer} compatibility mode.
%    \begin{macrocode}
\DeclareBoolOption[false]{beamer}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{revtex}
% Provide the "revtex" option for REV\hologo{TeX} \cite{revtex} compatibility mode.
%    \begin{macrocode}
\DeclareBoolOption[false]{revtex}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{jhep}
% Provide the "jhep" option for JHEP \cite{jhep} compatibility mode.
%    \begin{macrocode}
\DeclareBoolOption[false]{jhep}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{jcap}
% Provide the "jcap" option for JCAP \cite{jcap} compatibility mode.
%    \begin{macrocode}
\DeclareBoolOption[false]{jcap}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{pos}
% Provide the "pos" option for PoS compatibility mode.
%    \begin{macrocode}
\DeclareBoolOption[false]{pos}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{springer}
% Provide the "springer" option for Springer compatibility mode.
%    \begin{macrocode}
\DeclareBoolOption[false]{springer}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{amsart}
% Provide the "amsart" option for AMS article compatibility mode.
%    \begin{macrocode}
\DeclareBoolOption[false]{amsart}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Reactivation}
%
% \begin{macro}{eqnarray}
% Provide the "eqnarray" option for reactivating the "eqnarray" environment.
%    \begin{macrocode}
\DeclareBoolOption[true]{eqnarray}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{manualplacement}
% Provide the "manualplacement" option for reactivating the manual placement of floats.
%    \begin{macrocode}
\DeclareBoolOption[false]{manualplacement}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Process options}
%
%    \begin{macrocode}
\ProcessKeyvalOptions*
%    \end{macrocode}
%
% Read the class options regarding font and paper size.
%    \begin{macrocode}
\def\hep@get@class#1.cls#2\relax{\def\hep@class{#1}}
\def\hep@getclass{\expandafter\hep@get@class\@filelist\relax}
\hep@getclass
\@ifclasswith{\hep@class}{10pt}{\setkeys{hep}{font=10pt}}{}
\@ifclasswith{\hep@class}{12pt}{\setkeys{hep}{font=12pt}}{}
\@ifclasswith{\hep@class}{a5paper}{\setkeys{hep}{paper=a5}}{}
\@ifclasswith{\hep@class}{b5paper}{\setkeys{hep}{paper=b5}}{}
\@ifclasswith{\hep@class}{letterpaper}{\setkeys{hep}{paper=letter}}{}
\@ifclasswith{\hep@class}{legalpaper}{\setkeys{hep}{paper=legal}}{}
\@ifclasswith{\hep@class}{executivepaper}{%
  \setkeys{hep}{paper=executive}%
}{}
%    \end{macrocode}
%
% \subsection{Set compatibility}
%
% Set the "amsart" compatibility options.
%    \begin{macrocode}
\@ifclassloaded{amsart}{\setkeys{hep}{amsart}}{}
\ifhep@amsart
  \setkeys{hep}{defaults, title=false}
  \RequirePackage{xpatch}
  \xpretocmd{\@adminfootnotes}{\let\@makefntext\BHFN@OldMakefntext}{}{}
\fi
%    \end{macrocode}
%
% Set the "springer" compatibility options.
%    \begin{macrocode}
\@ifclassloaded{svjour}{\setkeys{hep}{springer}}{}
\@ifclassloaded{svjour2}{\setkeys{hep}{springer}}{}
\@ifclassloaded{svjour3}{\setkeys{hep}{springer}}{}
\ifhep@springer
  \setkeys{hep}{defaults, title=false}
  \let\cl@chapter\undefined
\fi
%    \end{macrocode}
%
% Set the "pos" compatibility options.
%    \begin{macrocode}
\@ifclassloaded{PoS}{\setkeys{hep}{pos}}{}
\ifhep@pos
  \setkeys{hep}{defaults, title=false}
  \DeclareRobustCommand\boldmath{\@nomath\boldmath\mathversion{bold}}
\fi
%    \end{macrocode}
%
% Set the "beamer" compatibility options.
%    \begin{macrocode}
\@ifclassloaded{beamer}{\setkeys{hep}{beamer}}{}
\ifhep@beamer
  \setkeys{hep}{defaults, title=false, references=false, sansserif}
  \@ifpackageloaded{beamerbasefont}{\usefonttheme{professionalfonts}}{}
  \setbeamertemplate{navigation symbols}{}
\fi
%    \end{macrocode}
%
% Set the "revtex" compatibility options.
%    \begin{macrocode}
\@ifclassloaded{revtex4}{\setkeys{hep}{revtex}}{}
\@ifclassloaded{revtex4-1}{\setkeys{hep}{revtex}}{}
\@ifclassloaded{revtex4-2}{\setkeys{hep}{revtex}}{}
\ifhep@revtex
  \setkeys{hep}{defaults, title=false, bibliography=false, lang=american}
\fi
%    \end{macrocode}
%
% Define the SISSA conditional.
%    \begin{macrocode}
\@ifpackageloaded{jheppub}{\setkeys{hep}{jhep}}{}
\@ifpackageloaded{jcappub}{\setkeys{hep}{jcap}}{}
\newif\ifhep@sissa
\ifhep@jhep\hep@sissatrue
\else
  \ifhep@jcap\hep@sissatrue
  \else\hep@sissafalse
  \fi
\fi
%    \end{macrocode}
%
% Set the SISSA compatibility options.
%    \begin{macrocode}
\ifhep@sissa
  \setkeys{hep}{defaults, title=false, bibliography=false}
  \PassOptionsToPackage{
    colorlinks=true, linktocpage=true, pdfproducer=medialab, pdfa=true,
    urlcolor=blue, anchorcolor=blue, citecolor=blue, filecolor=blue,
    linkcolor=blue, menucolor=blue, pagecolor=blue
  }{hyperref}
  \AtBeginDocument{\renewcommand{\foreignabbrfont}{}}
\fi
%
% \section{Font}
%
% Set the whole text to sans serif if requested.
%    \begin{macrocode}
\ifhep@serif\else
  \renewcommand{\familydefault}{\sfdefault}
\fi
%    \end{macrocode}
%
% Load the hep-font package.
%    \begin{macrocode}
\RequirePackage[lining=\ifhep@lining true\else false \fi]{hep-font}
%    \end{macrocode}
%
% \subsection{Math fonts}
%
% Load the hep-math-font package.
%    \begin{macrocode}
\RequirePackage[symbols=\hep@symbols]{hep-math-font}
%    \end{macrocode}
%
% \subsection{Font size} \label{sec:font size}
%
% Undefine previously defined font sizes and load the \hologo{LaTeX} font size file corresponding to the font size option.
%    \begin{macrocode}
\ifhep@defaults\else
  \def\hep@remove@pt#1pt{#1}
  \edef\hep@pt@size{\expandafter\hep@remove@pt\hep@font}
  \let\small\relax
  \let\footnotesize\relax
  \let\scriptsize\relax
  \let\tiny\relax
  \let\large\relax
  \let\Large\relax
  \let\LARGE\relax
  \let\huge\relax
  \let\Huge\relax
  \input{size\hep@pt@size.clo}
\fi
%    \end{macrocode}
%
% \section{Geometry}
%
% Load the \software{geometry} package \cite{geometry} and adjust the text width and height.
% This step must happen after readjusting the font size in \cref{sec:font size}.
%    \begin{macrocode}
\ifhep@defaults\else
  \RequirePackage{geometry}
  \geometry{\hep@paper paper, includeheadfoot}
  \if@twocolumn
    \geometry{hscale=.85, vscale=.925, vmarginratio=1:1}
    \geometry{headsep=2ex, footskip=6ex}
    \setlength{\columnsep}{1.1em}
  \else
    \geometry{hscale=.75, vscale=.8, vmarginratio=3:4}
  \fi
\fi
%    \end{macrocode}
%
%\begin{macro}{\useparskip}
%\begin{macro}{\useparindent}
% Load the \software{parskip} package \cite{parskip} if requested and provide two commands switching between the two paragraph modes.
%    \begin{macrocode}
\ifhep@parindent\else
\RequirePackage{parskip}
\newcommand{\useparskip}{%
  \setlength{\parskip}{.5\baselineskip plus 2pt}%
  \setlength{\parindent}{0pt}%
}
\newcommand{\useparindent}{%
  \setlength{\parskip}{0pt}%
  \setlength{\parindent}{15pt}%
  \if@twocolumn\setlength\parindent{1em}
  \else\setlength\parindent{1.5em}
  \fi
}
\fi
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \section{Text}
%
% Load the \software{hep-text} package \cite{hep-text}.
%    \begin{macrocode}
\RequirePackage[lang=\hep@lang]{hep-text}
%    \end{macrocode}
%
% \section{Math}
%
%    \begin{macrocode}
\ifhep@physics\RequirePackage{hep-math}\fi
%    \end{macrocode}
%
% \section{Floats}
%
% Adjust the \hologo{LaTeX} float placement defaults
%    \begin{macrocode}
\RequirePackage[
  manualplacement=\ifhep@manualplacement true\else false \fi
]{hep-float}
%    \end{macrocode}
%
% \begin{macro}{\ifhep@journal}
% Define a new journal conditional.
%    \begin{macrocode}
\newif\ifhep@journal
\ifhep@sissa\hep@journaltrue
\else\ifhep@revtex\hep@journaltrue
  \else\ifhep@pos\hep@journaltrue
    \else\ifhep@springer\hep@journaltrue
      \else\hep@journalfalse
      \fi
    \fi
  \fi
\fi
%    \end{macrocode}
% \end{macro}
%
% Prevent the \software{caption} package \cite{caption} from complaining about the journal classes and packages.
%    \begin{macrocode}
\ifhep@journal
  \setlength\abovecaptionskip{\f@size\p@}
  \setlength\belowcaptionskip{0\p@}
  \long\def\@makecaption#1#2{%
    \vskip\abovecaptionskip
    \sbox\@tempboxa{#1: #2}%
    \ifdim \wd\@tempboxa >\hsize
      #1: #2\par
    \else
      \global \@minipagefalse
      \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
    \fi
    \vskip\belowcaptionskip%
  }
\fi
%    \end{macrocode}
%
% Readjust the document captions to look like the original revtex captions using the \software{ragged2e} package \cite{ragged2e}.
%    \begin{macrocode}
\ifhep@revtex
  \RequirePackage{ragged2e}
  \DeclareCaptionFormat{revtex}{#1#2\justifying{#3}}
  \captionsetup{font=small, format=revtex}
  \captionsetup[sub]{font=footnotesize, format=plain}
  \renewcommand{\figurename}{Figure}
  \renewcommand{\tablename}{Table}
\fi
%    \end{macrocode}
%
% \section{Title page}
%
% Begin of "title" conditional.
%    \begin{macrocode}
\ifhep@title\RequirePackage{hep-title}\fi
%    \end{macrocode}
%
% \section{Bibliography}
%
% Check if bibliography management is requested using the \software{pdftexcmds} package \cite{pdftexcmds}.
%    \begin{macrocode}
\RequirePackage{pdftexcmds}
\ifnum\pdf@strcmp{\hep@bibliography}{false}=0\else
  \RequirePackage[style=\hep@bibliography]{hep-bibliography}
\fi
%    \end{macrocode}

% \section{Hyperlinks, Footnotes and References} \label{sec:hyperlinks}
%
% Load the \software{hyperref} package \cite{hyperref} enable Unicode encoding and hide links.
%
%    \begin{macrocode}
\RequirePackage{hyperref}
\hypersetup{
  pdfencoding=auto, psdextra,
  hidelinks, linktoc=all, breaklinks=true,
  pdfcreator={}, pdfproducer={}
}
%    \end{macrocode}
% Set the \PDF meta data according to the paper information and ensure that unnecessary information is suppressed.
%
%    \begin{macrocode}
\pdfstringdefDisableCommands{\def\varepsilon{\textepsilon}}
\pdfstringdefDisableCommands{\def\to{\textrightarrow}}
\AtBeginDocument{
  \pdfstringdefDisableCommands{\let\ensuremath\@gobble}
  \pdfstringdefDisableCommands{\let\mathsurround\@gobble}
  \pdfstringdefDisableCommands{\let\unskip\@gobble}
  \pdfstringdefDisableCommands{\let\thanks\@gobble}
  \pdfstringdefDisableCommands{\let\footnote\@gobble}
  \pdfstringdefDisableCommands{\let\\\@gobble}
}
\ifhep@revtex
  \AtBeginShipout{\hypersetup{pdftitle={\@title}}}
\else
  \ifhep@beamer\else
    \AtBeginDocument{\hypersetup{pdftitle={\@title}}}
  \fi
\fi
\ifhep@title
  \AtBeginDocument{\hypersetup{pdfauthor=\AB@authlist}}
\else
  \ifhep@beamer\else
    \ifhep@pos\else\AtBeginDocument{\hypersetup{pdfauthor={\@author}}}\fi
  \fi
\fi
%    \end{macrocode}

% \subsection{Footnotes}
%
% Place a hyperlink from the footnote back to its referencing label using the \software{footnotebackref} package \cite{footnotebackref}.
%    \begin{macrocode}
\def\BackrefFootnoteTag{}
\RequirePackage{footnotebackref}
%    \end{macrocode}
%
% \begin{macro}{\footnote}
% Ensure that no spaces appear before the footmark or at the beginning of the footnote.
%    \begin{macrocode}
\let\@foot@note\footnote
\renewcommand{\footnote}[1]{\unskip\@foot@note{\ignorespaces#1}}
%    \end{macrocode}
% \end{macro}

% \subsection{References}
%
% Begin of "references" conditional
%    \begin{macrocode}
\ifhep@references
%    \end{macrocode}
%
% \begin{macro}{\cref}
% Improve reference using the \software{cleveref} package \cite{cleveref}.
%
%    \begin{macrocode}
\RequirePackage[noabbrev, nameinlink]{cleveref}
\newcommand{\creflastconjunction}{, and\nobreakspace}
\crefname{enumi}{point}{points}
\crefname{inlinelisti}{point}{points}
%    \end{macrocode}
% \end{macro}
%
%\begin{macro}{\no@break@before}
% Define a macro able to prevent line breaks.
%    \begin{macrocode}
\newcommand\no@break@before{%
  \relax\ifvmode\else%
    \ifhmode%
      \ifdim\lastskip > 0pt%
        \relax\unskip\nobreakspace%
      \fi%
    \fi%
  \fi%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ref}
% Adjust "\ref"\marg{key} in order to prevent preceding line breaks.
%    \begin{macrocode}
\let\hep@ref\ref
\AtBeginDocument{\renewcommand\ref{\no@break@before\hep@ref}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\eqref}
% Adjust "\eqref"\marg{key} in order to prevent preceding line breaks.
%    \begin{macrocode}
\renewcommand\eqref{\no@break@before\labelcref}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subref}
% Adjust "\subref"\marg{key} in order to prevent preceding line breaks.
%    \begin{macrocode}
\let\hep@subref\subref
\renewcommand\subref{\no@break@before\hep@subref}
\renewcommand*\subcaption@ref[2]{\begingroup%
  \caption@setoptions{sub}%
  \subcaption@reffmt\p@subref{\hep@ref#1{sub@#2}}%
\endgroup}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcref}
% Provide the "\subcref" macro.
%    \begin{macrocode}
\newcommand{\subcref}[1]{\cref{sub@#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\eqcrefname}
% Define the "\eqcrefname" macro for named equation types.
%    \begin{macrocode}
\NewDocumentCommand{\eqcrefname}{mmo}{
  \crefname{#1}{#2}{\IfValueTF{#3}{#3}{#2s}}
  \creflabelformat{#1}{(##2##1##3)}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\labelcrefrange}
% Define the missing "\labelcrefrange"\marg{key1}\marg{key2} macro.
%    \begin{macrocode}
\DeclareRobustCommand{\labelcrefrange}[2]{%
  \@crefrangenostar{labelcref}{#1}{#2}%
}
%    \end{macrocode}
% \end{macro}
%
% Adjust the title page
%    \begin{macrocode}
\ifhep@title
  \labelcrefmultiformat{affiliation}{#2#1#3}{%
    \textsuperscript,#2#1#3}{\textsuperscript,#2#1#3%
  }{%
    \textsuperscript,#2#1#3%
  }
  \labelcrefrangeformat{affiliation}{#3#1#4\textsuperscript{--}#5#2#6}
%   \thanksmarkseries{alph}
\fi
%    \end{macrocode}
%
% End of "references" conditional
%    \begin{macrocode}
\fi
%    \end{macrocode}

% \subsection{Citations}
%
% \begin{macro}{\cite}
% Adjust "\cite"\marg{key} in order to prevent preceding line breaks.
%    \begin{macrocode}
\let\hep@cite\cite
\renewcommand\cite{\no@break@before\hep@cite}
%    \end{macrocode}
% \end{macro}
%
% \section{Acronyms}
%
% Define acronyms if not deactivated.
%    \begin{macrocode}
%    \end{macrocode}
%
% 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}.
% Set the abbreviation style.
%    \begin{macrocode}
\ifhep@glossaries\RequirePackage{hep-acronym}\fi
%    \end{macrocode}
%
%</package>
%
% \section{Tests}
%
% \subsection{JHEP}
%
%<*testJHEP>
%
%    \begin{macrocode}
\documentclass[a4paper, 11pt]{article}

\usepackage{jheppub}
\usepackage[lang=english]{hep-paper}
\usepackage[math]{blindtext}

\begin{document}

\title{Title}

\emailAdd{first@email.com}
\author[a]{First author}
\emailAdd{second@email.com}
\author[b]{Second author}
\affiliation[a]{First affiliation}
\affiliation[b]{Second affiliation}

\abstract{\blindtext}

\maketitle

\Blinddocument

\end{document}
%    \end{macrocode}
%
%</testJHEP>
%
% \subsection{JCAP}
%
%<*testJCAP>
%
%    \begin{macrocode}
\documentclass[a4paper, 11pt]{article}

\usepackage{jcappub}
\usepackage[lang=english]{hep-paper}
\usepackage[math]{blindtext}

\begin{document}

\title{Title}

\emailAdd{first@email.com}
\author[a]{First author}
\emailAdd{second@email.com}
\author[b]{Second author}
\affiliation[a]{First affiliation}
\affiliation[b]{Second affiliation}

\abstract{\blindtext}

\maketitle

\Blinddocument

\end{document}
%    \end{macrocode}
%
%</testJCAP>
%
% \subsection{AMSArt}
%
%<*testAMSArt>
%
%    \begin{macrocode}
\documentclass{amsart}

\usepackage[lang=english]{hep-paper}
\usepackage[math]{blindtext}

\title{title}

\author{Author}
\address{Address 1}
\email{first@email.com}
\author{Author 2}
\email{second@email.com}
\address{Address 2}

\date{date}

\begin{document}

\begin{abstract}
\blindtext
\end{abstract}

\maketitle

\Blinddocument

\end{document}
%    \end{macrocode}
%
%</testAMSArt>
%
% \subsection{Beamer}
%
%<*testBeamer>
%
%    \begin{macrocode}
\documentclass{beamer}

\usepackage[lang=english]{hep-paper}
\usepackage[math]{blindtext}

\title{Title}
\subtitle{Subtitle}
\author{Author}
\institute{Institute}
\date{Event}

\begin{document}

\frame{\titlepage}

\begin{frame}{Frame title}
\blindtext
\end{frame}

\end{document}
%    \end{macrocode}
%
%</testBeamer>
%
% \subsection{PoS}
%
%<*testPoS>
%
%    \begin{macrocode}
\documentclass{PoS}

\usepackage[lang=english,title=false]{hep-paper}
\usepackage[math]{blindtext}

\title{Title}

\author{First author \thanks{first@email.com}}
\author{
\speaker{Second author is speaker}\\
First affiliation\\
E-mail: \email{second@email.com}
}
\author{Third author \thanks{\email{third@email.com}}\\Second affiliation}
\author{Fourth author\\Third affiliation}
\FullConference{Full conference}
\ShortTitle{Short title}

\begin{abstract}
\blindtext
\end{abstract}

\begin{document}

\Blinddocument

\end{document}
%    \end{macrocode}
%
%</testPoS>
%
% \subsection{RevTeX}
%
%<*testRevTeX>
%
%    \begin{macrocode}
\documentclass[
 aps,
 prl,
 reprint,
 nofootinbib,
 nobibnotes,
 superscriptaddress,
 preprintnumbers,
]{revtex4-2}

\usepackage{hep-paper}
\usepackage[math]{blindtext}

\begin{document}

\title{Title}

\author{First author}
\email[E-mail me at: ]{first@email.com}
\affiliation{First affiliation}
\author{Second author}
\email{second@email.com}
\affiliation{Second affiliation}
\affiliation{Third affiliation}
\author{Third author}
\affiliation{Fourth affiliation}

\begin{abstract}
\blindtext
\end{abstract}

\maketitle

\Blinddocument

\end{document}
%    \end{macrocode}
%
%</testRevTeX>
%
% \subsection{Springer}
%
%<*testSpringer>
%
%    \begin{macrocode}
\documentclass[twocolumn,epjc3]{svjour3}

\usepackage[lang=english]{hep-paper}
\usepackage[math]{blindtext}

\journalname{Journal name}

\title{Title\thanksref{title}}

\titlerunning{Short title}

\subtitle{Subtitle}

\thankstext{title}{Title thanks}

\authorrunning{Short form of author list}

\thankstext{email1}{e-mail: first@email.com}
\thankstext{email2}{e-mail: second@email.com}

\institute{
  First address \label{address1} \and
  Second address \label{address2} \and
  \emph{Present Address:} if needed\label{address3}
}

\date{Received: date / Accepted: date}

\begin{document}

\author{
  First Author\thanksref{email1,address1} \and
  Second Author\thanksref{email2,address2,address3}
}

\maketitle

\begin{abstract}
\blindtext
\end{abstract}

\Blinddocument

\end{document}
%    \end{macrocode}
%
%</testSpringer>
%
% \section{Readme}
%
%<*readme>
%
%    \begin{macrocode}
# The `hep-paper` package

A `LaTeX` package for publications in High Energy Physics.

## Introduction

The `hep-paper` package aims to provide a single style file containing most configurations and macros necessary to write appealing publications in High Energy Physics.
Instead of reinventing the wheel by introducing newly created macros `hep-paper` preferably loads third party packages as long as they are lightweight enough.

For usual publications it is enough to load additionally to the `article` class without optional arguments only the `hep-paper` package.

    \documentclass{article}
    \usepackage{hep-paper}

## Author

Jan Hajer

## License

This file may be distributed and/or modified under the conditions of the `LaTeX` Project Public License, either version 1.3c of this license or (at your option) any later version.
The latest version of this license is in `http://www.latex-project.org/lppl.txt` and version 1.3c or later is part of all distributions of LaTeX version 2005/12/01 or later.
%    \end{macrocode}
%
%</readme>
%
% \Finale

\endinput

% \PrintIndex
% makeindex -s gglo.ist -o hep-paper-implementation.gls hep-paper-implementation.glo
% makeindex -s gglo.ist -o hep-paper-implementation.ind hep-paper-implementation.idx

% \begin{macro}{\refstepcounter@...}
% Adjust the "cleveref" "\refstepcounter@noarg" and "\refstepcounter@optarg" to use the "\@currentlabel" in order to fix problems with "\subref".
%    \begin{macrocode}
% \def\refstepcounter@noarg#1{%
%   \cref@old@refstepcounter{#1}%
%   \cref@constructprefix{#1}{\cref@result}%
%   \@ifundefined{cref@#1@alias}%
%     {\def\@tempa{#1}}%
%     {\def\@tempa{\csname cref@#1@alias\endcsname}}%
%   \protected@edef\cref@currentlabel{%
%     [\@tempa][\arabic{#1}][\cref@result]%
%     \noexpand\@currentlabel%
%   }% changed
% }
%
% \def\refstepcounter@optarg[#1]#2{%
%   \cref@old@refstepcounter{#2}%
%   \cref@constructprefix{#2}{\cref@result}%
%   \@ifundefined{cref@#1@alias}%
%     {\def\@tempa{#1}}%
%     {\def\@tempa{\csname cref@#1@alias\endcsname}}%
%   \protected@edef\cref@currentlabel{%
%     [\@tempa][\arabic{#2}][\cref@result]%
%     \noexpand\@currentlabel% changed
%   }%
% }
% %    \end{macrocode}
% % \end{macro}
%
%
% \RequirePackage{contour}
% \renewcommand{\ULdepth}{1.8pt}
% \contourlength{0.8pt}
% \newcommand{\myuline}[1]{%
%   \uline{\phantom{#1}}\llap{\contour{white}{#1}}%
% }

% \begin{macro}{\mathpzc}
% Define the "\mathpzc" math script font based on the Zapf Chancery PostScript font.
%    \begin{macrocode}
% \DeclareFontFamily{OT1}{pzc}{}
% \DeclareFontShape{OT1}{pzc}{m}{it}{<-> s * [1.15] pzcmi7t}{}
% \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
%    \end{macrocode}
% \end{macro}