summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/phfextendedabstract/phfextendedabstract.dtx
blob: 87cddfcee189f78b05e04c97ee0f809928950ed6 (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
% \iffalse meta-comment
%
% Copyright (C) 2021 by Philippe Faist <philippe.faist@bluewin.ch>
% -------------------------------------------------------
% 
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% 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.3 or later is part of all distributions of LaTeX 
% version 2005/12/01 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{phfextendedabstract.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesClass{phfextendedabstract}
%<*package>
    [2021/09/08 v1.0 phfextendedabstract class]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{xcolor}
\usepackage[preset=xpkgdoc]{phfnote}
\usepackage{needspace}

\makeatletter
\newsavebox\phfeaDocVirtualPage@contents
\newenvironment{phfeaDocVirtualPage}{%
  \par%
  \begingroup%
  \makeatletter%
  \begin{lrbox}{\phfeaDocVirtualPage@contents}%
  \begin{minipage}{12cm}\relax%
    \def\rmdefault{cmr}\def\sfdefault{cmbr}\normalfont%
    \def\shortlipsum{Lorem ipsum dolor sit amet, consectetuer
      adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
      adipiscing vitae, felis. Curabitur dictum gravida
      mauris. Nam arcu libero, nonummy eget, consectetuer id,
      vulputate a, magna.}%
    \let\RequirePackage\@gobble%
    \def\morepagecontents{\par\vspace{1em}\centering\ldots}%
    \ignorespaces%
  }%
  {%
  \end{minipage}%
  \end{lrbox}%
  %%\centering%
  \begin{tcolorbox}[text width=6cm,sharp corners,%
    before={\par\vspace{5pt}\centering\nopagebreak\parindent=0pt},after={\par\vspace{5pt}},%
    leftrule=0.4pt,toprule=0.4pt,rightrule=0.6pt,bottomrule=0.6pt,%
    colframe=black,colback=white]%
    \scalebox{0.5}{\usebox{\phfeaDocVirtualPage@contents}}%
  \end{tcolorbox}%
  %%\par%
  \endgroup%
}
\def\phfeaSectionDecoration{% only for doc purposes
  \raisebox{0.2ex}{{%
      \notesmaller[0.4]\phfeaSectionDecorationSymbol}}%
  \hspace*{1.5ex}%
}
\def\phfeaSectionDecorationSymbol{\ensuremath{\blacksquare}}% only for doc purposes
\def\phfeaParagraphDecoration{% only for doc purposes
  \raisebox{0.2ex}{{%
      \notesmaller[0.6]\phfeaParagraphDecorationSymbol}}%
  \hspace*{1ex}%
}
\def\phfeaParagraphDecorationSymbol{\ensuremath{\triangleright}}% only for doc purposes

\def\eqsign@{=}
\def\eqsign{\protect\eqsign@}
\robustify\eqsign
\makeatother

\def\RevTeX{{\small R\raise-0.2ex\hbox{\textsc{ev}}}\TeX}

\EnableCrossrefs         
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{phfextendedabstract.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \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}{2021/07/29}{Initial version}
%
% \GetFileInfo{phfextendedabstract.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment,\def,\gdef,\edef,\xdef,\if,\else,\fi,\ifx}
% 
% \title{\phfqitltxPkgTitle{phfextendedabstract}}
% \author{Philippe Faist\quad\email{philippe.faist@bluewin.ch}}
% \date{\pkgfmtdate\filedate}
%
% \maketitle
%
% \begin{abstract}
%   \pkgname{phfextendedabstract}---Typeset extended abstracts for conferences,
%   such as often encountered in quantum information theory.
% \end{abstract}
%
% \inlinetoc
%
% \section{Introduction}
%
% Several conferences in Quantum Information Theory (and presumably in other
% fields, too) require the submission of \emph{extended abstracts}.  An extended
% abstract is a summary of a scientific result, presented at a high level, and
% consisting of at most a small handful of pages.
%
% I found myself repeatedly copying my \LaTeX\ preamble from one submission to
% another with definitions for a format that I elaborated and liked.  So at some
% point I collected the main definitions into this class file.
% 
% The \pkgname{phfextendedabstract} class sets up the document for an extended
% abstract submission as a single-column document, typeset by default at 11
% point size, with at most two sectioning levels (|\section|\,s and
% |\paragraph|\,s).  It is based on the \RevTeX\ class.
%
% The extended abstract style looks approximately like this:
% \nopagebreak
% \iffalse COMMENT: Spacings are copied/emulated ! They might appear wrong!! \fi
% \begin{phfeaDocVirtualPage}
%   {\parskip=8pt\relax
%     {\sffamily\Large\centering Title of my extended abstract\par}
%     {\centering Author One,\ \ Author Two,\ \  and\ \ Author Three\par}
%   }\vspace{0.2cm}
%   \parskip=3pt\relax
%   
%   \noindent{\normalfont\normalsize\sffamily\fontseries{sb}\selectfont
%     \makebox[0pt][r]{\phfeaSectionDecoration}Introduction.}
%   \shortlipsum
%   
%   \noindent{\normalfont\normalsize\sffamily\fontseries{sb}\selectfont
%     \makebox[0pt][r]{\phfeaSectionDecoration}Results.}
%   \shortlipsum
%   
%   \noindent{\normalfont\normalsize\sffamily\small
%     \makebox[0pt][r]{\phfeaParagraphDecoration}First result.}
%   \ldots
%
%   \noindent{\normalfont\normalsize\sffamily\small
%     \makebox[0pt][r]{\phfeaParagraphDecoration}Second result.}
%   \ldots
%
%   \noindent{\normalfont\normalsize\sffamily\fontseries{sb}\selectfont
%     \makebox[0pt][r]{\phfeaSectionDecoration}Discussion.}
%   \shortlipsum   
%  \hspace*{1.5ex}%
%
% \end{phfeaDocVirtualPage}
%
%
% \section{Main features}
%
% Here are the main features of the \pkgname{phfextendedabstract} class:
% \begin{itemize}
% \item The class \pkgname{phfextendedabstract} loads the \pkgname{revtex4-2}
%   class, so you can directly use \RevTeX's features such as author
%   affiliations, etc.
%
% \item Only two sectioning commands are enabled: |\section| and |\paragraph|.
%   Both have run-in headings.  If you find yourself needing additional
%   sectioning levels, it might be that your extended abstract is too detailed
%   and you might want to think about how to keep it at a higher level.  It
%   might also be that \pkgname{phfextendedabstract} is too limited for your
%   needs.
%
%   By default, section and paragraphs have ``decorations'' (by default a symbol
%   in the margin) to guide the reader through the overall high-level structure
%   of the document.  (Disable them with the |noheadingdecorations| class
%   option.)
%
% \item You can easily scale all vertical spacing dimensions (section and
%   paragraph spacing, vertical space around theorems and list environments,
%   etc.) by a common factor with a class option.  Do you have those extra two
%   lines that make you exceed your 3-page limit?  Try squeezing everything
%   together with a class option like |compressverticalspacing=0.7|.
%
% \item The \pkgname{phfnote} package is loaded in order to provide a set of
%   default \LaTeX\ packages and set up hyperlinks.  A generous default set of
%   standard LaTeX packages are loaded, including \pkgname{caption} and
%   \pkgname{enumitem}; see \pkgname{phfnote}'s documentation for the option
%   |pkgset=extended|.
%
%   \textbf{You are expected to include
%   \phfverb{\usepackage}\phfverb{{hyperref}} somewhere in your preamble.}  We
%   deliberately don't include \pkgname{hyperref} when loading the class in
%   order to give you greater control of package loading order (most packages
%   you might want to use must be loaded before \pkgname{hyperref}).
%
% \item The page margins are tweaked with the \pkgname{geometry} package.
%   (Simply call |\geometry{...}| if you'd like to further change them.  Refer
%   to the \pkgname{geometry} package's documentation.)
%
% \item Lists, i.e.\@ the |itemize| and |enumerate| environments, are customized
%   using the \pkgname{enumitem} package so that they take up less space.  You
%   also get a |enumerate*| environment that typesets its items in-line, in a
%   single paragraph.
%   
%   (Note that this customization won't work if you choose to load a package set
%   via a |pkgset=| option that doesn't include \pkgname{enumitem}.)
%
% \item By default we load the \pkgname{phfthm} package and set a customized
%   theorem style so that it stands out but also so that it contrasts well with
%   the section and paragraph headings.
%
% \end{itemize}
%
% Check out the class option documentation in \autoref{sec:class-options} to get
% a better idea of how to customize \pkgname{phfextendedabstract}'s behavior!
%
%
% \section{Example Usage}
%
% Here's a simple template:
% \begin{verbatim}
% \documentclass[papertype=a4paper]{phfextendedabstract}
%
% \usepackage{hyperref}
%
% \begin{document}
% \title{Title goes here}
% \author{Author 1}
% \author{Author 2}
% \maketitle
% 
% \section{Introduction.}
% Lorem ipsum ...
%
% \section{Results.}
% We had some cool results about
% \begin{enumerate*} % inline enumeration
% \item a first result,
% \item a second result, % and
% \item a final result.
% \end{enumerate*}
%
% \paragraph{First result.}
% Here's a first result ...
%
% \paragraph{Second result.}
% Here's another result ...
%
% ...
%
% \end{document}
% \end{verbatim}
%
% (Try it out!)
%
%
% \section{Class options}
% \label{sec:class-options}
%
% Here is a summary of class options:
% \begin{pkgoptions}
% \item[papertype=a4paper,letterpaper,\meta{paper type},\meta{empty}] Specify
%   the paper type to use (A4 or letter).  The argument given to this option is
%   directly specified as an option to the underlying \RevTeX\ class.
% \item[ptsize=10pt,11pt,12pt] Default font size to use.  Again the argument
%   given to this option is directly specified as an option to the underlying
%   \RevTeX\ class.
% \item[sectiondecorations=\meta{true or false}] Whether or not to ``decorate''
%   section headings, by default with a small black square typeset in the margin
%   of the section heading.
% \item[paragraphdecorations=\meta{true or false}] Whether or not to
%   ``decorate'' paragraph headings, by default with a small right-pointing
%   outlined triangle typeset in the margin of the paragraph heading.
% \item[noheadingdecorations] Shorthand for
%   |sectiondecorations=false,paragraphdecorations=false|.
% \item[compressverticalspacing=\meta{factor}] Real factor by which to multiply
%   the vertical spacing between sections, paragraphs, theorems, paragraphs,
%   list environments such as |itemize| and |enumerate|, etc.  If you need to
%   compress the sections a bit to fit more content on a fixed number of pages
%   (e.g.\@ because of page number constraints), you can set this option to a
%   factor that's less than one.  A \meta{factor} that's less than one
%   compresses sections together, a \meta{factor} equal to |1| does nothing, and
%   a \meta{factor} greater than one expands the sections further apart.
% \item[loadtheorems=\meta{true or false}] If |loadtheorems=true| (the default),
%   then the \pkgname{phfthm} package is loaded with some suitable default
%   options and a custom theorem style.  (The theorem style
%   |phfextendedabstractthm| is defined regardless of this package option.)
% \item[sansstyle=\meta{true or false}] Use sans serif style by default for the
%   main title as well as for section and paragraph headings.  For greater
%   degree of control, see \autoref{sec:customize-title-and-headings-style}.
% \item[usehyperref=\meta{true or false}] Should we set up the document for use
%   with the \pkgname{hyperref} package or not?  This option influences how we
%   load the \pkgname{phfnote} package.  If this option is set to |true| (the
%   default), then the \pkgname{phfnote} package is loaded with
%   |hyperrefdefs={defer,noemail}|.  This means that the document is set up for
%   use with \pkgname{hyperref}, although you will still need to say
%   |\usepackage{hyperref}| somewhere in your preamble.  If |usehyperref=false|,
%   then the \pkgname{phfnote} package is loaded with hyperref options disabled.
%
%   (The |noemail| option is specified to \pkgname{phfnote} to avoid
%   interference with \RevTeX's own |\email| command used to specify email
%   addresses for individual authors.)
% \item[pkgset=\meta{\pkgname{phfnote} package set name}] The \pkgname{phfnote}
%   package (which we load internally) loads a bunch of standard packages for
%   your convenience, such as \pkgname{enumitem} or \pkgname{microtype}.  You
%   can influence this behavior by specifying a ``package set'' to load.  By
%   default, the |pkgset=extended| package set is loaded.  If you don't want to
%   load any additional packages beyond those that are strictly necessary, use
%   |pkgset=none| or |pkgset=minimal|.  See \pkgname{phfnote}'s documentation
%   for the package option |pkgset=...| for more information and a list of
%   possible package set names.
% \end{pkgoptions}
% 
%
% \section{Macros and environments}
%
% \subsection{Sections and paragraphs}
%
% \DescribeMacro{\section} \DescribeMacro{\paragraph} This class only provides
% two sectioning levels: |\section| and |\paragraph|.  Both produce run-in
% headings.
%
% By default, sections and paragraphs produce a small ``decoration'' in the left
% margin, to guide the reader's eye through the document's high-level structure.
%
% You can disable/enable section and paragraph decorations with the
% |sectiondecorations|, |paragraphdecorations| and |noheadingdecorations| class
% options.
%
% The |\section| and |\paragraph| macros also accept a special syntax: If they
% are immediately followed by an exclamation mark (|!|), then they do not
% produce the corresponding decoration.  E.g.:
% \begin{verbatim}
% \section!{A section heading without its decoration}
% \end{verbatim}
%
% Also, section and paragraphs will not produce any horizontal space if the
% title is empty.  You can use this feature to produce the spacing and
% decoration of a section, but not the heading:
% \begin{verbatim}
% \section{} This line has the vertical spacing and decoration
% associated with a section, but with no run-in heading.
%
% \section!{} This line has the vertical spacing associated
% with a section, but with no decoration or run-in heading.
% \end{verbatim}
%
% You can also use the additional syntax |<|\emph{\ldots}|>| to specify a custom
% decoration instead of the default one.  (But you should only use this
% sparingly! Redefine |\phfeaSectionDecorationSymbol| if you want to change the
% symbol for all sections!)  For instance:
%
% \begin{verbatim}
% \section<\guilsinglright>{} \emph{Manuscript in preparation.}
% \end{verbatim}
%
% Here's a summary of the argument structure for |\section| and |\paragraph|:
%
% |\section|{\large\textbar}|\paragraph|
% \emph{[} |*| \emph{]} \emph{[} |!| \emph{]}
% \emph{[} |<|\meta{decoration}|>| \emph{]}
% \emph{[} \oarg{alt title} \emph{]}
% \marg{title}
% 
% The optional star and optional alternative title are passed on to the standard
% \LaTeX\ sectioning commands.  The alternative title is typically used for the
% table of contents and for PDF bookmarks.
%
% \DescribeMacro{\phfeaSectionDecoration}
% \DescribeMacro{\phfeaParagraphDecoration} You can use the
% |\phfeaSectionDecoration{<symbol>}| and |\phfeaParagraphDecoration{<symbol>}|
% to manually place a section or paragraph decoration at any place:
% \begin{verbatim}
% \phfeaSectionDecoration{$\to$} Check out our website at
% \href{https://github.com/phfaist/phfqitltx}{github.com/phfaist/phfqitltx}
% \end{verbatim}
%
% If the |sectiondecorations=false| class option was specified, the macro
% |\phfeaSectionDecoration{...}| produces no output.  Similarly,
% |\phfeaParagraphDecoration{...}| does nothing if |paragraphdecoration=false|
% was specified.
%
% \DescribeMacro{\phfeaSectionDecorationSymbol}
% \DescribeMacro{\phfeaParagraphDecorationSymbol}
% The default section and paragraph symbols (including size and vertical
% adjustments) are stored in the |\phfeaSectionDecorationSymbol| and
% |\phfeaParagraphDecorationSymbol| macros.  You can redefine these macros to
% set custom decoration symbols:
% \begin{verbatim}
% \renewcommand{\phfeaSectionDecorationSymbol}{\Large$\Rightarrow$}
% \renewcommand{\phfeaParagraphDecorationSymbol}{\raisebox{1pt}{\tiny $>$}}
% \end{verbatim}
%
% You can customize section and paragraph headings, including spacing and style,
% by redefining the following macros.
%
% \DescribeMacro{\phfeaSectionBeforeSkip}
% \DescribeMacro{\phfeaSectionAfterHSkip} The macro |\phfeaSectionBeforeSkip|
% (it's a macro, not a length) is used to specify the vertical spacing before a
% new section heading.  The macro (not length) |\phfeaSectionAfterHSkip| is the
% horizontal space between the end of the section heading and the beginning of
% the section text contents.  You can redefine these macros to set your custom
% spacings.  (If you're looking to compress the vertical spacings to save on the
% number of pages, look at the |compressverticalspacings=| class option and the
% |\phfeaVerticalSpacingCompressionFactor| macro.)
%
% \DescribeMacro{\phfeaParagraphBeforeSkip}
% \DescribeMacro{\phfeaParagraphAfterHSkip} The macros
% |\phfeaParagraphBeforeSkip| and |\phfeaParagraphAfterHSkip| behave similarly
% for paragraphs.
%
% \DescribeMacro{\phfeaSectionStyle} \DescribeMacro{\phfeaParagraphStyle} The
% macros |\phfeaSectionStyle| and |\phfeaParagraphStyle| are used to set the
% style of the section and paragraph headings.  By default, the default
% sans/heading style is used at the normal size and in bold face series for
% sections, and the normal sans style is used at a smaller size for paragraph
% headings.
%
% \DescribeMacro{\phfeaSectionFormatHeading}
% \DescribeMacro{\phfeaParagraphFormatHeading} The macros
% |\phfeaSectionFormatHeading{...}| and |\phfeaParagraphFormatHeading{...}| can
% be redefined to format the section and paragraph headings, respectively.  You
% can redefine these macros to add punctuation, to capitalize the title, etc.
% For instance:
% \begin{verbatim}
% \renewcommand\phfeaSectionFormatHeading[1]{\MakeUppercase{#1}\ ---}
% \end{verbatim}
%
% The macros |\phfeaSectionFormatHeading{...}| and
% |\phfeaParagraphFormatHeading{...}| are not called if the section/paragraph
% title argument is empty.
%
%
% \subsection{Vertical spacing}
%
% \DescribeMacro{\phfeaVerticalSpacingCompressionFactor} To
% conveniently globally adjust the vertical spacings in the document (including
% the section and paragraph vertical spacings, as well as the spacing above and
% below theorems, itemize, and enumerate environments), you can also use the
% |compressverticalspacing=X| class option.  Alternatively, you can redefine the
% macro |\phfeaVerticalSpacingCompressionFactor| to the desired compression
% factor:
% \begin{verbatim}
% \renewcommand\phfeaVerticalSpacingCompressionFactor{0.7}
% \end{verbatim}
%
% \DescribeMacro{\phfeaDefineTheoremStyle} Because the theorem style
% |phfextendedabstracthm| is defined at the time that the class is loaded, any
% customization of |\phfeaVerticalSpacingCompressionFactor| and
% |\phfeaListsVerticalSkip| that happen later in the preamble aren't taken into
% account.  If you change these values in your preamble, you should call
% |\phfeaDefineTheoremStyle| to redefine the theorem style after your
% customization.
%
% \DescribeMacro{\phfeaDisplayVerticalSpacingFactorWeight} The
% vertical spacing factor also affects the vertical spacing around equations,
% but to a lesser extent. (Compressing the space around the equations by too
% much would not look nice.) For the spacing between equations, we take the
% weighted average of $1$ and the vertical spacing compression factor, where the
% weight is given in the macro |\phfeaDisplayVerticalSpacingFactorWeight|.  A
% weight of |0| means the vertical compression factor doesn't affect the
% vertical spacing around equations at all; a weight of |1| means the spacing
% around the equations is scaled exactly by the vertical compression factor.
%
% \DescribeMacro{\phfeaParskipVerticalSpacingFactorWeight} A similar mechanism
% happens for how we adjust |\parskip|, the spacing between paragraphs.
%
%
% \subsection{List environments}
%
% \DescribeEnv{enumerate*} This class provides an |enumerate|-like
% environment which typesets its items inline, as a list.  For example, here is
% an inline paragraph with (a) one, (b) two, and (c) three points.
% \iffalse yeah, I cheated for this doc code, whatever \fi
%
% The |enumerate*| can be used exactly like you'd use the |enumerate|
% environment from the \pkgname{enumitem} package, for instance:
% \begin{verbatim}
% here is an inline paragraph with \begin{enumerate*}[label=(\alph*)]
% \item one,
% \item two,
% \item three
% \end{enumerate*}
% points.
% \end{verbatim}
%
% Check \pkgname{enumitem}'s documentation for inline lists.  You can specify
% for instance the keys |before={{}}|, |itemjoin={{ }}|, and \relax\relax\relax
% |itemjoin*={{ and }}| either as an optional argument to
% |\begin{enumerate*}| \iffalse\end{enumerate*}\fi or using
% |\setlist|:
% \begin{verbatim}
% \setlist[enumerate*]{%
%   itemjoin*={{ et }}%
% }
% \end{verbatim}
%
% \DescribeMacro{\phfeaListsVerticalSkip} \DescribeMacro{\phfeaListsItemSep}
% \DescribeMacro{\phfeaListsParSep} For (non-inline) list environments such as
% |itemize| and |enumerate|, you can redefine |\phfeaListsVerticalSkip|,
% |\phfeaListsItemSep|, and |\phfeaListsParSep| to set the |topsep|, |itemsep|
% and |parsep| properties of all of \pkgname{enumitem}'s list environments.
% These correspond to the vertical space above and below lists, the space
% between items, and the space between paragraphs within an item.  All these
% spacings automatically get compressed according to the
% |\phfeaVerticalSpacingCompressionFactor|.
%
% Note that |\phfeaListsVerticalSkip| is also used for the spacing above and
% below theorem environments.
%
%
% \subsection{Customization of the main title and general headings style}
% \label{sec:customize-title-and-headings-style}
%
% \DescribeMacro{\phfeaHeadingStyle} The macro |\phfeaHeadingStyle| is defined to be
% |\sffamily|, unless the |sansstyle=false| class option is provided
% in which case the macro expands to nothing.  You can redefine it to give a
% different general style to your main title and your section and paragraph
% headings.
%
% \DescribeMacro{\phfeaTitleStyle} The macro |\phfeaTitleStyle| sets the font
% style for the main document title.  By default the macro is defined to
% |\phfeaHeadingStyle\Large|.  Redefine this macro to change the title style.
%
% For instance, if you prefer \RevTeX's own simple boldface title, you can use:
% \begin{verbatim}
% \renewcommand\phfeaTitleStyle{\bfseries}
% \end{verbatim}
%
%
%
%
%
% \StopEventually{\vskip 3cm plus 2cm minus 2cm\relax\PrintChanges
%     \vskip 3cm plus 2cm minus 2cm\relax\PrintIndex}
%
%
%
% \section{Implementation}
%
% Here come the gory details.
%
%
% \paragraph{Class options}
% We process these first, to see which options we should pass on to
% \RevTeX.
%    \begin{macrocode}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{%
  family=phfea,%
  prefix=phfeaopt@%
}
\DeclareStringOption[]{papertype}
\DeclareStringOption[11pt]{ptsize}
\DeclareBoolOption[true]{sectiondecorations}
\DeclareBoolOption[true]{paragraphdecorations}
\DeclareVoidOption{noheadingdecorations}{%
  \phfeaopt@sectiondecorationsfalse
  \phfeaopt@paragraphdecorationsfalse
}
\DeclareBoolOption[true]{loadtheorems}
\DeclareBoolOption[true]{sansstyle}
\DeclareStringOption[1]{compressverticalspacing}
\DeclareBoolOption[true]{usehyperref}
\DeclareStringOption[extended]{pkgset}
\ProcessKeyvalOptions*
%    \end{macrocode}
%
%
% \paragraph{Load \RevTeX, the base class}
%
%    \begin{macrocode}
\providecommand\phfea@revtexopts{%
  aps,pra,%
  notitlepage,reprint,%
  onecolumn,tightenlines,%
  superscriptaddress,%
  nofootinbib%
}
\PassOptionsToClass{%
  \phfea@revtexopts,%
  \phfeaopt@ptsize,%
  \phfeaopt@papertype,%
}{revtex4-2}
\LoadClass{revtex4-2}
%    \end{macrocode}
%
% We will also need the \pkgname{xparse} command for defining some of our
% commands.
%    \begin{macrocode}
\RequirePackage{xparse}
%    \end{macrocode}
% 
% \paragraph{Load \pkgname{phfnote} for the basic document setup}
%
%    \begin{macrocode}
\PassOptionsToPackage{%
  preset=reset,%
  pkgset=\phfeaopt@pkgset,%
  \ifphfeaopt@usehyperref
    hyperrefdefs={defer,noemail},%
  \fi
}{phfnote}
\RequirePackage{phfnote}
%    \end{macrocode}
%
%
% \paragraph{Page geometry}
%
% Set a default page geometry.  Works both for A4 paper and for letter paper.
% It's optimized for 11pt size, though.
%    \begin{macrocode}
\RequirePackage{geometry}
\geometry{hmargin=0.75in,vmargin=0.75in,marginparwidth=0.5in,marginparsep=0.125in}
%    \end{macrocode}
% 
%
% \paragraph{Default sans serif font}
%
% \begin{macro}{\phfeaHeadingStyle}
%   Unless instructed not to do so, \iffalse load the ``Source Sans Pro'' font
%   as default sans serif font, using the semibold glyphs in place of bold.  By
%   default, this font will \else set the sans serif font family to \fi be used
%   for section headings and the main title.
%    \begin{macrocode}
\ifphfeaopt@sansstyle
  \def\phfeaHeadingStyle{\sffamily}
\else
  \def\phfeaHeadingStyle{}
\fi
%    \end{macrocode}
% \end{macro}
%
%
% \paragraph{Default title format}
%
% \begin{macro}{\phfeaTitleStyle}
%   Change \RevTeX\ title format.  Title style can be customized by redefining
%   |\phfeaTitleStyle|.
%    \begin{macrocode}
\def\phfeaTitleStyle{\phfeaHeadingStyle\Large}
\def\frontmatter@title@format{\phfeaTitleStyle\centering\parskip\z@skip}
%    \end{macrocode}
% \end{macro}
%
%
% \paragraph{Vertical spacing compression factor}
%
% Define a general factor by which the section and paragraph spacings will be
% compressed.  This macro is set by the |compressverticalspacing=X| package
% option.
%    \begin{macrocode}
\edef\phfeaVerticalSpacingCompressionFactor{\phfeaopt@compressverticalspacing}
%    \end{macrocode}
%
% Tool for scaling glue expressions (for use with our vertical compression
% factor):\footnote{Thanks \url{https://tex.stackexchange.com/a/198966/32188}\,!}
%    \begin{macrocode}
\def\phfea@scaleglue#1#2{% {factor}{glueexpr}
  \glueexpr#2*\numexpr\dimexpr#1pt\relax\relax/65536\relax
}
\def\phfea@scalegluedpt#1#2{% {factor given as dimexpr in pt}{glueexpr}
  \glueexpr#2*\numexpr#1\relax/65536\relax
}
%    \end{macrocode}
%
% Adjust spacing around display equations according to the vertical compression
% factor.  Do this only at the beginning of the document, since the user might
% still want to adjust |\phfeaVerticalSpacingCompressionFactor| in their
% preamble.
%
% \begin{macro}{\phfeaDisplayVerticalSpacingFactorWeight}
% We only apply a fraction of the scaling, because it's ugly if we compress
% equations too much.  Define |\phfeaDisplayVerticalSpacingFactorWeight| as $w$ and
% $\alpha$ as the vertical scaling factor.  The new skips are computed as
% \begin{equation*}
%   \phfverb{oldskip}\quad\rightarrow\quad
%     (1-w)\,\phfverb{oldskip} + w\,\alpha\,\phfverb{oldskip}\ .
% \end{equation*}
% (For $w=0$ we have $\phfverb{oldskip}\rightarrow\phfverb{oldskip}$.  For $w=1$
% the full scaling factor is applied,
% $\phfverb{oldskip}\rightarrow \alpha\,\phfverb{oldskip}$.)  By default,
% $w=1/2$:
%    \begin{macrocode}
\def\phfeaDisplayVerticalSpacingFactorWeight{.5}
%    \end{macrocode}
% \end{macro}
% Tool to compute the new spacing for each of the relevant display-related
% skips:
%    \begin{macrocode}
\def\phfea@adjustskipweighted#1#2{%
  #1=\glueexpr
    \phfea@scalegluedpt{%
      \dimexpr 1\p@ - #2\p@\relax
    }{#1}%
    +
    \phfea@scaleglue{%
      #2%
    }{%
      \phfea@scaleglue{%
        \phfeaVerticalSpacingCompressionFactor
      }{%
        #1
      }%
    }%
    \relax
}
%    \end{macrocode}
% And schedule this adjustment to be carried out at the beginning of the
% document.
%    \begin{macrocode}
\AtBeginDocument{%
  \phfea@adjustskipweighted\abovedisplayskip\phfeaDisplayVerticalSpacingFactorWeight
  \phfea@adjustskipweighted\belowdisplayskip\phfeaDisplayVerticalSpacingFactorWeight
  \phfea@adjustskipweighted\abovedisplayshortskip\phfeaDisplayVerticalSpacingFactorWeight
  \phfea@adjustskipweighted\belowdisplayshortskip\phfeaDisplayVerticalSpacingFactorWeight
}
%    \end{macrocode}
%
% \begin{macro}{\phfeaParskipVerticalSpacingFactorWeight}
%   A similar mechanism affects how we adjust the paragraph skip length
%   |\parskip|.
%    \begin{macrocode}
\def\phfeaParskipVerticalSpacingFactorWeight{1}
\AtBeginDocument{%
  \phfea@adjustskipweighted\parskip\phfeaParskipVerticalSpacingFactorWeight
}
%    \end{macrocode}
% \end{macro}
% 
% \paragraph{Setup specific for sectioning}
%
% By design, there are only two sectioning levels in a
% \pkgname{phfextendedabstract} document: sections (|\section|) and paragraphs
% (|\paragraph|).  Any other sectioning command (e.g., |\subsection|) will
% produce an error.
%
% Neither of these two section levels is numbered.
%    \begin{macrocode}
\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{1}
%    \end{macrocode}
%
% \begin{macro}{\phfeaSectionBeforeSkip}
% \begin{macro}{\phfeaSectionAfterHSkip}
% \begin{macro}{\phfeaSectionStyle}
% \begin{macro}{\phfeaSectionDecoration}
% \begin{macro}{\phfeaSectionDecorationSymbol}
%   Some helper and customization macros for |\section|.
%    \begin{macrocode}
\def\phfeaSectionBeforeSkip{1.5ex plus 0.8ex minus 0.25ex}
\def\phfeaSectionAfterHSkip{1em plus 0.2em}
\def\phfeaSectionStyle{\normalfont\normalsize\phfeaHeadingStyle\bfseries}
\def\phfeaSectionFormatHeading#1{#1}
\def\phfeaSectionDecorationSymbol{%
  \raisebox{0.2ex}{{\notesmaller[0.4]{\ensuremath{\blacksquare}}}}}
\ifphfeaopt@sectiondecorations
  \def\phfeaSectionDecoration#1{%
    \makebox[\z@][r]{{#1}\hspace*{1.5ex}}%
  }
\else
  \def\phfeaSectionDecoration#1{}
\fi
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \needspace{5\baselineskip}
% \begin{macro}{\phfeaParagraphBeforeSkip}
% \begin{macro}{\phfeaParagraphAfterHSkip}
% \begin{macro}{\phfeaParagraphStyle}
% \begin{macro}{\phfeaParagraphDecoration}
% \begin{macro}{\phfeaParagraphDecorationSymbol}
%   Same helper and customization macros, now for |\paragraph|.
%    \begin{macrocode}
\def\phfeaParagraphBeforeSkip{0.6ex plus 0.4ex minus 0.1ex}
\def\phfeaParagraphAfterHSkip{0.75em plus 0.15em}
\def\phfeaParagraphStyle{\normalfont\normalsize\phfeaHeadingStyle\small}
\def\phfeaParagraphFormatHeading#1{#1}
\def\phfeaParagraphDecorationSymbol{%
  \raisebox{0.2ex}{{\notesmaller[0.6]{\ensuremath{\triangleright}}}}}
\ifphfeaopt@paragraphdecorations
  \def\phfeaParagraphDecoration#1{%
    \makebox[\z@][r]{{#1}\hspace*{1ex}}%
  }
\else
  \def\phfeaParagraphDecoration#1{}
\fi
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% 
% Now we redefine |\section| and |\paragraph| for formatting.  Also allow
% |\section!| and |\paragraph!| that remove the decoration and |\section<...>|
% and |\paragraph<...>| that replace the decoration.  In all cases, the indent
% is removed if the main argument (section/paragraph title) is an empty
% argument.  We also accept a starred version and an optional argument, and pass
% those on to |\@startsection|; these options are sometimes useful in order to
% work around fragile tokens in the title, etc.
%
% We start with the generic code that will call |\@startsection| for both
% sections and paragraphs.  The generic code will be given the level number (|1|
% or |2|) and will produce the correct |\@startsection| code for that level,
% fetching its information from the correctly named macros.  We first define
% some simple definitions that specify where to look for those level-specific
% macros.
%    \begin{macrocode}
\def\phfea@ss@levelname#1{\ifcase#1\or section\or paragraph\fi}
\def\phfea@ss@levelName#1{\ifcase#1\or Section\or Paragraph\fi}
\def\phfea@ss@get#1#2{% <levelno><MacroPostfixName>
  \csname phfea\phfea@ss@levelName{#1}#2\endcsname}
\def\phfea@ss@getnoexpand#1#2{% <levelno><MacroPostfixName>
  \expandafter\noexpand\csname phfea\phfea@ss@levelName{#1}#2\endcsname}
%    \end{macrocode}
%
% \begin{macro}{\phfea@startsection}
%   We now define the main internal |\phfea@startsection| macro which will
%   produce the correct |\@startsection| command for the given section level.
%   The arguments to |\phfea@startsection| are:
%   \begin{itemize}[itemsep=0pt,topsep=0pt]
%   \item[\#1:] level number, |1| or |2|;
%   \item[\#2:] an optional star;
%   \item[\#3:] an optional |!| character (meaning, don't display the decoration);
%   \item[\#4:] an optional |<|\meta{decoration tokens}|>| argument to
%     replace the decoration;
%   \item[\#5:] an optional argument, the alternative title to write in the AUX
%     file (e.g.\@ for use in the table of contents);
%   \item[\#6:] a mandatory argument, the title of the section/paragraph.
%   \end{itemize}
%    \begin{macrocode}
\newtoks\phfea@ss@decorationtoks
\newtoks\phfea@ss@alttitle
\newtoks\phfea@ss@title
\NewDocumentCommand{\phfea@startsection}{m s t! d<> o m}{%
%    \end{macrocode}
% Store the alternative title and title in token registers.
%    \begin{macrocode}
  \phfea@ss@decorationtoks={#4}%
  \phfea@ss@alttitle={#5}%
  \phfea@ss@title={#6}%
%    \end{macrocode}
% Inform the user in case of option inconsistencies or redundancies.
%    \begin{macrocode}
  \IfNoValueF{#4}{%
    \IfBooleanT{#3}{%
      \PackageWarning{phfextendedabstract}{section/paragraph: `!'
        modifier ignored when custom decoration `<...>' is specified}%
    }%
  }%
%    \end{macrocode}
% Now define a temporary macro |\x| that will contain the correct code for a
% call to \LaTeX' low-level |\@startsection| command.  Remember to prefix all
% macros by |\noexpand| unless they should be expanded in the preparation of
% that code for |\@startsection|.  \LaTeX' |\@startsection| takes a lot of
% arguments, let's be careful not to miss any.  Also, we can use the convenient
% construct |\phfea@ss@getnoexpand{#1}{XyzProperty}| which in this |\edef| will
% expand to
% |\noexpand\phfea|\emph{$\langle$}|Section|\emph{\textbar}\relax
% |Paragraph|\emph{$\rangle$}|XyzProperty|.
%    \begin{macrocode}
  \edef\x{%
    \noexpand\@startsection{\phfea@ss@levelname{#1}}%
%    \end{macrocode}
% First come the \meta{level number} and \meta{indent} arguments:
%    \begin{macrocode}
      {#1}%
      {\z@}%
%    \end{macrocode}
% Then comes the \meta{before skip} argument.  Use |\phfea@scaleglue| to account for
% the vertical compression factor.
%    \begin{macrocode}
      {%
        \noexpand\phfea@scaleglue{\noexpand\phfeaVerticalSpacingCompressionFactor}{%
          \noexpand\glueexpr\phfea@ss@getnoexpand{#1}{BeforeSkip}\noexpand\relax
        }%
      }%
%    \end{macrocode}
% Then comes the \meta{after skip} argument.  Set the after skip to zero if the
% title is empty, otherwise specify the given
% |\phfeaSection/ParagraphAfterHSkip| as a negative value to indicate we want a
% run-in heading.  Note that while the syntax `|1.5\glueexpr...|' doesn't
% preserve plus/minus stretchability components as it coerces the glue to a
% dimen, the syntax `|-\glueexpr...|' does preserve these components (presumably
% because $-1$ is integer?).
%    \begin{macrocode}
      {\if\relax\detokenize{#6}\relax
          \noexpand\z@
        \else
          -\noexpand\glueexpr\phfea@ss@getnoexpand{#1}{AfterHSkip}\noexpand\relax
        \fi}%
%    \end{macrocode}
% The \meta{style} argument to specify the section heading's font style.  We
% provide a decoration, possibly a custom decoration if provided with the
% |<...>| syntax; we remove the default decoration if the no-decoration argument
% (a |!| character) was specified.
%    \begin{macrocode}
      {%
        \IfNoValueTF{#4}{%
          \IfBooleanTF{#3}{% with "!", no custom decoration --> nothing
          }{% no "!", no custom decoration
            \phfea@ss@getnoexpand{#1}{Decoration}%
            \phfea@ss@getnoexpand{#1}{DecorationSymbol}%
          }%
        }{% with custom decoration (ignores "!" argument)
          \phfea@ss@getnoexpand{#1}{Decoration}%
          {\the\phfea@ss@decorationtoks}%
        }%
        \phfea@ss@getnoexpand{#1}{Style}%
      }%
%    \end{macrocode}
% An optional |*| indicates the starred version of the sectioning commands.  If
% the user increased the |secnumcounter| to have numbered sections, then the
% starred variant gives a section heading without any section number or TOC
% entry.
%    \begin{macrocode}
      \IfBooleanT{#2}{*}%
%    \end{macrocode}
% Now comes the optional \meta{alternative title} argument that will be written
% to the AUX file.  We always provide this argument to |\@startsection|,
% specifying by default the main title argument |#6| (non-starred variant) or an
% empty argument (for a starred variant).  We do this because otherwise,
% |\@startsection| will copy all the other commands we add in its argument
% (e.g., title formatting, etc.) and will write them to the AUX file.
%    \begin{macrocode}
      \IfValueTF{#4}{[\the\phfea@ss@alttitle]}{%
        \IfBooleanTF{#2}{[]}{[\the\phfea@ss@title]}%
      }%
%    \end{macrocode}
% Finally, this is the main \meta{section title} argument.  
% If the title is not empty, we also provide the title wrapped in a
% corresponding |\phfeaSection/ParagraphFormatHeading| macro call.  Everything
% should be protected in |\texorpdfstring| calls to avoid \emph{pdflatex} from
% complaining about invalid junk in PDF bookmark strings.
%    \begin{macrocode}
      {%
        \if\relax\detokenize{#6}\relax\else
          \noexpand\texorpdfstring{%
            \phfea@ss@getnoexpand{#1}{FormatHeading}{\the\phfea@ss@title}%
          }{%
            \the\phfea@ss@title
          }%
        \fi
      }%
  }%
  %\message{**** EMITTING @startsection: |\detokenize\expandafter{\x}| ***}%
  \x
}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\section}
% \begin{macro}{\paragraph}
%   Define |\section| and |\paragraph| as sectioning levels 1 and 2.
%    \begin{macrocode}
\def\section{\phfea@startsection{1}}
\def\paragraph{\phfea@startsection{2}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% 
% Provide an explanative error message if the user attempts to use
% |\subsection|, |\subsubsection| or |\subparagraph|.
%    \begin{macrocode}
\def\phfea@nosectioncmd#1{%
  \ClassError{phfextendedabstract}{%
    %
    There is no `\string#1' command in `phfextendedabstract'
    documents.  You can only use `\string\section' and
    `\string\paragraph'.  If you find yourself needing additional
    sectioning levels, it might be that your extended abstract is too
    detailed and you should stick to a higher level description of
    your results.  If you do need additional section levels, it is
    likely that you will be better off with a different document
    class.  If you'd like to stick with `phfextendedabstract' and you
    really know what you're doing, then you could redefine the
    sectioning commands as necessary based on `\string\@startsection'
    as is done in standard LaTeX classes.  Good luck!
    %
  }{}%
}
\def\phfea@nosectioncmd@def#1{%
  \def#1{\phfea@nosectioncmd#1}%
}
\phfea@nosectioncmd@def\part
\phfea@nosectioncmd@def\chapter
\phfea@nosectioncmd@def\subsection
\phfea@nosectioncmd@def\subsubsection
\phfea@nosectioncmd@def\subparagraph
%    \end{macrocode}
%
%
% \paragraph{Set up itemization and enumeration environments}
%
% Provide customizable lengths for lists via macros (item sep,
% paragraph sep and vertical skip above and below list environments).
% \begin{macro}{\phfeaListsVerticalSkip}
% \begin{macro}{\phfeaListsItemSep}
% \begin{macro}{\phfeaListsParSep}
%    \begin{macrocode}
\def\phfeaListsVerticalSkip{0.6ex plus 0.4ex minus 0.1ex}
\def\phfeaListsItemSep{0.3ex plus 0.15ex minus 0.1ex}
\def\phfeaListsParSep{0.7\parskip}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% Prepare the commands to run to configure \pkgname{enumitem} correctly in an
% internal macro which we will call if \pkgname{enumitem} is indeed loaded.
%    \begin{macrocode}
\def\phfea@setup@enumitem{%
%    \end{macrocode}
% Apply the spacings.
%    \begin{macrocode}
  \setlist{%
    itemsep={%
      \phfea@scaleglue{%
        \phfeaVerticalSpacingCompressionFactor}{\phfeaListsItemSep}},
    parsep={%
      \phfea@scaleglue{%
        \phfeaVerticalSpacingCompressionFactor}{\phfeaListsParSep}},
    topsep={%
      \phfea@scaleglue{%
        \phfeaVerticalSpacingCompressionFactor}{\phfeaListsVerticalSkip}},
  }%
%    \end{macrocode}
% \begin{environment}{enumerate*}
% Create the |enumerate*| list enumeration environment.
%    \begin{macrocode}
  \newlist{enumerate*}{enumerate*}{1}
  \setlist[enumerate*]{
    label={(\roman*)},
    before={},
    itemjoin={{ }},
    itemjoin*={{ and }}
  }%
}
%    \end{macrocode}
% \end{environment}
% And now, check if \pkgname{enumitem} is loaded and apply the definitions.
%    \begin{macrocode}
\@ifpackageloaded{enumitem}{\phfea@setup@enumitem}{}
%    \end{macrocode}
% 
%
% \paragraph{Setup specific for theorems}
%
% Create a new theorem style called |extendedabstracthm|.  Note that if
% \pkgname{amsthm} (or similar) wasn't loaded, then |\newtheoremstyle| isn't
% defined.  In that case, we simply won't define the new theorem style right
% now.
%    \begin{macrocode}
\def\phfeaDefineTheoremStyle{%
  \newtheoremstyle{phfextendedabstractthm}%
    {\phfea@scaleglue{%
        \phfeaVerticalSpacingCompressionFactor}{\phfeaListsVerticalSkip}}%
    {\phfea@scaleglue{%
        \phfeaVerticalSpacingCompressionFactor}{\phfeaListsVerticalSkip}}%
    {\itshape}%
    {\z@}%
    {\bfseries\itshape}%
    {:}%
    {0.8em}%
    {\thmname{##1\thmnumber{ ##2}\thmnote{ (##3)}}}%
}
%    \end{macrocode}
% Ensure we create our new theorem style (only if |\newtheoremstyle| is
% available) and load our \pkgname{phfthm} package.  Make sure we don't load
% \pkgname{phfthm} if we were asked not to load theorems in the class options.
%    \begin{macrocode}
\ifdefined\newtheoremstyle
  \phfeaDefineTheoremStyle
\fi
\ifphfeaopt@loadtheorems
  \ifdefined\newtheoremstyle\else
    \ClassError{phfextendedabstract}{%
      %
      Impossible to load theorems (`loadtheorems=true') because there
      is no \string\newtheoremstyle\space command that was defined.
      Consider setting `pkgset=...' so that a theroems-related package
      (e.g., amsthm) is loaded!  (e.g. `pkgset=minimal', `pkgset=rich'
      or `pkgset=extended').  Alternatively, set the class option
      `loadtheorems=false' and you can then manually define any
      theorem environments you'd like using your favorite pacakges.
      %
    }{}
  \fi
  \PassOptionsToPackage{proofref=false,theoremstyle=phfextendedabstractthm}{phfthm}
  \RequirePackage{phfthm}
\fi
%    \end{macrocode}
%
% \iffalse
% \paragraph{References section}
%
% Have a simple section for references.  If you'd like to restore \RevTeX'
% ornament you can simply do |\let\bibsection\rtxapsbibsection|.
%    \begin{XXXmacrocode}
%% \let\rtxapsbibsection\bibsection
%% \def\bibsection{%
%%   \par\section{\refname}\leavevmode\par\addvspace{4pt}\relax
%% %%  \par\noindent\rule{6em}{.4pt}\par\addvspace{6pt}\relax
%% }
%    \end{XXXmacrocode}
% \fi
%
%
%\Finale
\endinput