-
Notifications
You must be signed in to change notification settings - Fork 0
/
PTC-LibUG.tex
1019 lines (923 loc) · 35.4 KB
/
PTC-LibUG.tex
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
% TEX TS-program = pdflatex
\documentclass[%
letterpaper,%
%afourpaper,%
10pt,%
extrafontsizes,%
twoside,
openright,% start each chapter on a recto page
%openany,% start each chapter on the next blank page
%showtrims,% show trim marks
]{memoir}
%\RequirePackage[english]{babel}
%:----- preamble -----
%:draft or final?
\providecommand*{\dfFix}{draft} % fixme
\providecommand*{\dfKey}{final} % showkeys
%:draft, version, year
\newcommand{\PTCDocDraft}{sixth}
\newcommand{\PTCDocVersion}{0.4.3}
\newcommand{\PTCDocYear}{2011}
%:color
\RequirePackage[usenames,dvipsnames,svgnames]{xcolor}
\definecolor{DarkRed}{rgb}{0.545,0,0}
\newcommand{\hlred}[1]{\textcolor{DarkRed}{#1}}% prints in red
\newcommand{\hlblue}[1]{\textcolor{DarkBlue}{#1}}% prints in blue
\newcommand{\redcolor}{\color{Maroon}}% prints in red
\definecolor{etcol}{rgb}{0.345,.1,.6}
%\newcommand{\et}[1]{ \noindent
%{\color{etcol} \rule{\linewidth}{0.5mm} #1
%
%\noindent
%\rule{\linewidth}{0.5mm} } }
\newcommand{\et}[1]{ {\color{etcol} #1 } }
%:fonts
%% memoir provides sizes tiny, scriptsize, footnotesize, small,
%% normalsize, large, Large, LARGE, huge, and Huge.
\RequirePackage[T1]{fontenc}
%\RequirePackage[scaled=0.90]{helvet} % san serif
\RequirePackage[scaled=1.05]{libertine} % san serif
%\renewcommand*\sfdefault{uop} % Optima (san serif)
\RequirePackage[scaled=0.85]{beramono} % monospaced
\RequirePackage[osf,sc]{mathpazo} % Palatino and Pazo math
\RequirePackage{textcomp} % `text companion'
%% improve letterspacing of small caps and all-caps text.
\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase
%\RequirePackage{letterspace}
\RequirePackage{microtype}
\DeclareTextFontCommand{\textsmallcaps}{\scshape}
\newcommand*{\acls}{200}
\newcommand*{\scls}{50}
\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\newcommand{\allcapsspacing}[1]{\textls[\acls]{#1}}
\newcommand{\smallcapsspacing}[1]{\textls[\scls]{#1}}
\newcommand{\allcaps}[1]{\allcapsspacing{\MakeTextUppercase{#1}}}
\newcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{#1}}}
%% use the AMS macros for math
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{mathtools}
%% definition of Lie operators and transforms using Dragt's colon notation
\RequirePackage{liecolon}
%% define graphical clock
%\RequirePackage{clock}
%% define \url
\RequirePackage{url}
%% \pi for units
\protected\def\piunit{\ensuremath{\mathnormal{\pi}}}
%:page layout
%% we want this to print properly on both A4 and US letter
\RequirePackage{layout}
\settrimmedsize{11in}{210mm}{*} % length(US letter) x width(A4)
\setlength{\trimtop}{0pt}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
%\settypeblocksize{222mm}{133mm}{*} % ratio 5:3
%\settypeblocksize{*}{133mm}{1.666} % ratio 5:3
\settypeblocksize{215mm}{*}{0.6} % ratio 5:3
\setlrmargins{25mm}{*}{*} % set spine margin
\setulmargins{25mm}{*}{*} % set upper margin
\setheadfoot{\baselineskip}{3\baselineskip} % head height, foot skip
\setheaderspaces{*}{2\baselineskip}{*} % set head sep
\setmarginnotes{17pt}{102pt}{\baselineskip}
\checkandfixthelayout
%\setlength{\topskip}{1.6\topskip}
%\checkandfixthelayout
%\sloppybottom
%\enlargethispage*{\baselineskip}
%\newcommand{\blankpage}{{\ }\thispagestyle{empty}\cleardoublepage}
\newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage}
%:headers and footers
% make header span full width of page
% place folios on fore edge of headers
% place chapter title near fore edge on verso pages
% place section title near fore edge on recto pages
% leave footer empty---even at start of chapters, etc.
\makepagestyle{fwhead}
\setlength{\headwidth}{\textwidth}
\addtolength{\headwidth}{\marginparsep}
\addtolength{\headwidth}{\marginparwidth}
\makerunningwidth{fwhead}{\headwidth}
\makeheadrule{fwhead}{\headwidth}{0pt}
\makeheadposition{fwhead}{flushright}{flushleft}{}{}
\makepsmarks{fwhead}{%
\nouppercaseheads
\createmark{chapter}{both}{nonumber}{}{}
\createmark{section}{right}{shownumber}{}{{} \space}
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}}
\makeevenhead{fwhead}{\normalfont\thepage\quad\smallcaps{\leftmark}}{}{}
\makeoddhead{fwhead}{}{}{\normalfont\smallcaps{\rightmark}\quad\thepage}
\pagestyle{fwhead}
%% no footer (with folio) at start of part or chapter
\aliaspagestyle{part}{empty}
\aliaspagestyle{chapter}{empty}
%% for the index, we want the header to guide the reader
\usepackage{fixltx2e} % makes LaTeX marking robust in two-column mode
\newcommand{\idxmark}[1]{#1\markboth{#1}{#1}}
%\renewcommand{\idxmark}[1]{#1}
\copypagestyle{index}{fwhead}
\makeevenhead{index}{\normalfont\thepage\quad\rightmark}{}{\leftmark}
\makeoddhead{index}{\rightmark}{}{\normalfont\leftmark\quad\thepage}
%% for the list of FiXmes
\copypagestyle{loxhead}{fwhead}
\makeevenhead{loxhead}{\normalfont\thepage\quad\smallcaps{\englishlistfixmename}}{}{}
\makeoddhead{loxhead}{}{}{\normalfont\smallcaps{\englishlistfixmename}\quad\thepage}
%:styles for ToC, ToF, etc.
%% set indents
\cftsetindents{chapter}{0em}{1.3em}
\cftsetindents{section}{1.3em}{1.8em}
\cftsetindents{subsection}{4.1em}{2.3em}
\cftsetindents{subsubsection}{6.3em}{2.8em}
\cftsetindents{paragraph}{9.1em}{3.3em}
\cftsetindents{subparagraph}{12.4em}{3.8em}
\cftsetindents{figure}{0em}{3.0em}
\cftsetindents{table}{0em}{3.0em}
%% remove dotted leaders
\renewcommand{\cftsectiondotsep}{\cftnodots}
\renewcommand{\cftsubsectiondotsep}{\cftnodots}
\renewcommand{\cftsubsubsectiondotsep}{\cftnodots}
\renewcommand{\cftparagraphdotsep}{\cftnodots}
\renewcommand{\cftsubparagraphdotsep}{\cftnodots}
\renewcommand{\cftfiguredotsep}{\cftnodots}
\renewcommand{\cfttabledotsep}{\cftnodots}
%% modify spacing between chapters
\newlength{\cftchapskip}
\setlength{\cftchapskip}{10pt}
\setlength{\cftbeforechapterskip}{\the\cftchapskip plus 1pt}
\renewcommand*{\insertchapterspace}{%
\addtocontents{lof}{\protect\addvspace{\cftchapskip}}%
\addtocontents{lot}{\protect\addvspace{\cftchapskip}}
}
%% short and long (main) ToC
\makeatletter
\newlength{\tocunitlength}
\newcommand*{\setupshorttoc}{%
\renewcommand*{\contentsname}{Short contents}
\let\oldchangetocdepth\changetocdepth
\let\oldprecistoctext\precistoctext
\renewcommand{\precistoctext}[1]{}
\let\oldcftchapterfillnum\cftchapterfillnum
\renewcommand*{\changetocdepth}[1]{}
\setcounter{tocdepth}{0}% chapters
\renewcommand*{\cftchapterfont}{\hfill\normalfont\itshape}
\renewcommand*{\cftchapterpagefont}{\normalfont\upshape}
\renewcommand*{\cftchapterleader}{ \textperiodcentered\space}
\renewcommand*{\cftchapterafterpnum}{\cftparfillskip}
\renewcommand*{\cftchapterfillnum}[1]{%
{\cftchapterleader}\nobreak
\hbox to 1.5em{\cftchapterpagefont ##1\hfil}\cftchapterafterpnum\par}
\setrmarg{0.05\textwidth}
\setlength{\tocunitlength}{\@tocrmarg}
\addtolength{\tocunitlength}{1.5em}
\let\oldcftpartformatpnum\cftpartformatpnum
\renewcommand*{\cftpartformatpnum}[1]{%
\hbox to\tocunitlength{{\cftpartpagefont ##1}}}
\let\oldcftbookformatpnum\cftbookformatpnum
\renewcommand*{\cftbookformatpnum}[1]{%
\hbox to\tocunitlength{{\cftbookpagefont ##1}}}
}
\newcommand*{\setupparasubsecs}{%
\let\oldnumberline\numberline
\renewcommand*{\cftsubsectionfont}{\normalfont\itshape}
\renewcommand*{\cftsubsectionpagefont}{\normalfont\upshape}
\renewcommand{\l@subsection}[2]{
\ifnum\c@tocdepth > 1\relax
\def\numberline####1{\textit{####1}~}%
\leftskip=\cftsubsectionindent
\rightskip=\@tocrmarg
\advance\rightskip 0pt plus \hsize % raggedright
\parfillskip=\fill
\ifhmode ,\ \else\noindent\fi
\ignorespaces
{\cftsubsectionfont ##1}~{\cftsubsectionpagefont##2}%
\let\numberline\oldnumberline\ignorespaces
\fi}
}
\AtEndDocument{\addtocontents{toc}{\par}}
\newcommand*{\setupmaintoc}{%
\renewcommand{\contentsname}{Contents}
\let\changetocdepth\oldchangetocdepth
\let\precistoctext\oldprecistoctext
\let\cftchapterfillnum\oldcftchapterfillnum
\addtodef{\cftchapterbreak}{\par}{}
\renewcommand*{\cftchapterfont}{\normalfont\itshape}
\renewcommand*{\cftchapterpagefont}{\normalfont\upshape}
\renewcommand*{\cftchapterleader}{ \space}
\renewcommand*{\cftchapterafterpnum}{\cftparfillskip}
\renewcommand*{\cftchapterfillnum}[1]{%
{\cftchapterleader}\nobreak
\hbox to 1.5em{\cftchapterpagefont ##1\hfil}\cftchapterafterpnum\par}
\renewcommand{\cftchapterbreak}{\par\addpenalty{-\@highpenalty}}
\renewcommand*{\cftsectionfont}{\normalfont\upshape}
\renewcommand*{\cftsectionpagefont}{\normalfont\upshape}
\renewcommand*{\cftsectionpresnum}{\normalfont\itshape}
\renewcommand*{\cftsectionleader}{\space}
\renewcommand*{\cftsectionafterpnum}{\cftparfillskip}
\renewcommand*{\cftsectionfillnum}[1]{%
{\cftsectionleader}\nobreak
\hbox to 1.5em{\cftsectionpagefont ##1\hfil}\cftsectionafterpnum\par}
\setpnumwidth{2em}
\setrmarg{3em}
\setcounter{tocdepth}{2} % subsection
\let\cftpartformatpnum\oldcftpartformatpnum
\addtodef{\cftpartbreak}{\par}{}
\let\cftbookformatpnum\oldcftbookformatpnum
\addtodef{\cftbookbreak}{\par}{}
}
\makeatother
%% LoF
\newcommand*{\setuplof}{%
\renewcommand*{\cftfigurefont}{\normalfont\upshape}
\renewcommand*{\cftfigurepagefont}{\normalfont\upshape}
\renewcommand*{\cftfigurepresnum}{\normalfont\itshape}
\renewcommand*{\cftfigureleader}{ \space}
\renewcommand*{\cftfigureafterpnum}{\cftparfillskip}
\renewcommand*{\cftfigurefillnum}[1]{%
{\cftfigureleader}\nobreak
\hbox to 1.5em{\cftfigurepagefont ##1\hfil}\cftfigureafterpnum\par}
}
%% LoT
\newcommand*{\setuplot}{%
\renewcommand*{\cfttablefont}{\normalfont\upshape}
\renewcommand*{\cfttablepagefont}{\normalfont\upshape}
\renewcommand*{\cfttablepresnum}{\normalfont\itshape}
\renewcommand*{\cfttableleader}{ \space}
\renewcommand*{\cfttableafterpnum}{\cftparfillskip}
\renewcommand*{\cfttablefillnum}[1]{%
{\cfttableleader}\nobreak
\hbox to 1.5em{\cfttablepagefont ##1\hfil}\cfttableafterpnum\par}
}
%:chapter style
\makeatletter
\newcommand{\chapterrule}%
{\hrule width \textwidth height \normalrulethickness}
\makechapterstyle{PTCLUGchapstyle}{%
\setlength{\beforechapskip}{3\baselineskip}
\setlength{\afterchapskip}{3.5\baselineskip}
\renewcommand*{\chapnumfont}{\normalfont\Huge\scshape}
\renewcommand*{\chaptitlefont}{\normalfont\Huge\itshape}
\renewcommand*{\printchapternum}{\chapnumfont
\ifanappendix \thechapter \else \textsc{\numtoname{\c@chapter}}\fi}
\renewcommand*{\printchaptername}{\centering}
\renewcommand*{\printchaptertitle}[1]{%
\chapterrule\vskip\onelineskip \raggedleft \chaptitlefont ##1}
\renewcommand*{\afterchaptertitle}{%
\vskip\onelineskip \chapterrule\vskip \afterchapskip}
\renewcommand*{\printchapternonum}{%
\vphantom{\chapnumfont One}
\afterchapternum%
\vskip\topskip}
}
\makeatother
%% set American-style names for numbers
\renewcommand*{\namenumberand}{ }
\renewcommand*{\namenumbercomma}{ }
\chapterstyle{PTCLUGchapstyle}
%:sections and subsections
\setsecnumdepth{section} % enumerate through this sectional division
%% section
\setsecheadstyle{\Large\scshape\raggedright}
\setbeforesecskip{-3.5ex plus -1ex minus -.2ex}
\setaftersecskip{2.5ex plus .2ex}
%% subsection
\setsubsecheadstyle{\large\itshape\raggedright}
%\setsubsecheadstyle{\large\itshape\bfseries\addperiod}
\setbeforesubsecskip{-3.25ex plus -1ex minus -.2ex}
\setaftersubsecskip{1.5ex plus .2ex}
%\setaftersubsecskip{-1em}
%% new thought---a paragraph-style section
\providecommand\newthought[1]{%
\addvspace{.6\baselineskip plus 0.5ex minus 0.2ex}%
\noindent\textsc{#1}%
}
%:epigraphs
%% for epigraphs before title page
\newcommand{\openepigraph}[2]{%
\begin{fullwidth} % environment defined in 'tufte-env'
\Large
\setlength{\baselineskip}{1.5em}
\raggedright
\noindent\textsc{#1}\\[0.5em]% epigraph
% \raggedleft
\noindent\textsc{#2}% source
\end{fullwidth}
}
%% settings for chapter epigraphs
%\setlength{\epigraphwidth}{.382\textwidth} % 1/(1+\Phi) = 0.381966...
\setlength{\beforeepigraphskip}{-\baselineskip}
\setlength{\epigraphrule}{0pt}
%\epigraphfontsize{\small}
%% for epigraphs at chapters use
%\epigraph{<text>}{\textit{<source>}\\ \textsc{<author>}}
%:glossaries
%% main glossary
\makeglossary
\changeglossref{\thesection}
\changeglossnumformat{|hyperpage}
%% PTC command summary
\makeglossary[ptccmds]
\changeglossref[ptccmds]{\thesection}
\changeglossnumformat[ptccmds]{|hyperpage}
%:indices
\makeindex
%\makeindex[xmpls]
\newcommand*{\itpg}[1]{\textit{\hyperpage{#1}}} % italicize main entry
%\showindexmarks % useful for checking index entries
%% index headers are defined above under '%:headers and footers'
%:cross referencing
%% Except for the commands at the end of this section, which
%% reference the title, the cross-referencing commands defined here
%% take an optional argument that must be one or both (in either
%% order) of the characters 'c' (capitalize) and 's' (plural form).
%% They also have starred forms that does not print the reference
%% name (e.g., chapter or figure).
\RequirePackage{suffix}
%% chapters
\renewcommand*{\chapterrefname}{chapter}
\newcommand*{\Chapterrefname}{Chapter}
\newcommand*{\chaptersrefname}{chapters}
\newcommand*{\Chaptersrefname}{Chapters}
\renewcommand*{\Cref}[2][]{\hyperref[cha:#2]{%
\ifthenelse{\isempty{#1}}{\chapterrefname}{%
\ifthenelse{\equal{#1}{s}}{\chaptersrefname}{%
\ifthenelse{\equal{#1}{c}}{\Chapterrefname}{%
\ifthenelse{\equal{#1}{cs}\OR\equal{#1}{sc}}{\Chaptersrefname}{%
\typeout{cross-ref error -- cha:#2}\chapterrefname}}}}~\ref{cha:#2}}}
\WithSuffix\def\Cref*#1{\hyperref[cha:#1]{\ref{cha:#1}}}
%% appendices
\renewcommand*{\appendixrefname}{appendix}
\newcommand*{\Appendixrefname}{Appendix}
\newcommand*{\appendicesrefname}{appendices}
\newcommand*{\Appendicesrefname}{Appendices}
\renewcommand*{\Aref}[2][]{\hyperref[app:#2]{%
\ifthenelse{\isempty{#1}}{\appendixrefname}{%
\ifthenelse{\equal{#1}{s}}{\appendicesrefname}{%
\ifthenelse{\equal{#1}{c}}{\Appendixrefname}{%
\ifthenelse{\equal{#1}{cs}\OR\equal{#1}{sc}}{\Appendicesrefname}{%
\typeout{cross-ref error -- app:#2}\appendixrefname}}}}~\ref{app:#2}}}
\WithSuffix\def\Aref*#1{\hyperref[app:#1]{\ref{app:#1}}}
%% sections
\renewcommand*{\sectionrefname}{\S}
\newcommand*{\Sectionrefname}{Section}
\newcommand*{\sectionsrefname}{\S\S}
\newcommand*{\Sectionsrefname}{Sections}
\renewcommand*{\Sref}[2][]{\hyperref[sec:#2]{%
\ifthenelse{\isempty{#1}}{\sectionrefname}{%
\ifthenelse{\equal{#1}{s}}{\sectionsrefname}{%
\ifthenelse{\equal{#1}{c}}{\Sectionrefname}{%
\ifthenelse{\equal{#1}{cs}\OR\equal{#1}{sc}}{\Sectionsrefname}{%
\typeout{cross-ref error -- sec:#2}\sectionrefname}}}}~\ref{sec:#2}}}
\WithSuffix\def\Sref*#1{\hyperref[sec:#1]{\ref{sec:#1}}}
%% figures
\renewcommand*{\figurerefname}{figure}
\newcommand*{\Figurerefname}{Figure}
\newcommand*{\figuresrefname}{figures}
\newcommand*{\Figuresrefname}{Figures}
\renewcommand*{\fref}[2][]{\hyperref[fig:#2]{%
\ifthenelse{\isempty{#1}}{\figurerefname}{%
\ifthenelse{\equal{#1}{s}}{\figuresrefname}{%
\ifthenelse{\equal{#1}{c}}{\Figurerefname}{%
\ifthenelse{\equal{#1}{cs}\OR\equal{#1}{sc}}{\Figuresrefname}{%
\typeout{cross-ref error -- fig:#2}\figurerefname}}}}~\ref{fig:#2}}}
\WithSuffix\def\fref*#1{\hyperref[fig:#1]{\ref{fig:#1}}}
%% tables
\renewcommand*{\tablerefname}{table}
\newcommand*{\Tablerefname}{Table}
\newcommand*{\tablesrefname}{tables}
\newcommand*{\Tablesrefname}{Tables}
\renewcommand*{\tref}[2][]{\hyperref[tbl:#2]{%
\ifthenelse{\isempty{#1}}{\tablerefname}{%
\ifthenelse{\equal{#1}{s}}{\tablesrefname}{%
\ifthenelse{\equal{#1}{c}}{\Tablerefname}{%
\ifthenelse{\equal{#1}{cs}\OR\equal{#1}{sc}}{\Tablesrefname}{%
\typeout{cross-ref error -- tbl:#2}\tablerefname}}}}~\ref{tbl:#2}}}
\WithSuffix\def\tref*#1{\hyperref[tbl:#1]{\ref{tbl:#1}}}
%% equations
\newcommand*{\equationrefname}{}
\newcommand*{\Equationrefname}{Equation~}
\newcommand*{\equationsrefname}{}
\newcommand*{\Equationsrefname}{Equations~}
\renewcommand*{\eqref}[2][]{\hyperref[eq:#2]{%
\ifthenelse{\isempty{#1}}{\equationrefname}{%
\ifthenelse{\equal{#1}{s}}{\equationsrefname}{%
\ifthenelse{\equal{#1}{c}}{\Equationrefname}{%
\ifthenelse{\equal{#1}{cs}\OR\equal{#1}{sc}}{\Equationsrefname}{%
\typeout{cross-ref error -- eq:#2}\equationrefname}}}}(\ref{eq:#2})}}
\WithSuffix\def\eqref*#1{\hyperref[eq:#1]{(\ref{eq:#1})}}
%% pages
\renewcommand*{\pagerefname}{page}
\newcommand*{\Pagerefname}{Page}
\newcommand*{\pagesrefname}{pages}
\newcommand*{\Pagesrefname}{Pages}
\renewcommand*{\pref}[2][]{\hyperref[#2]{%
\ifthenelse{\isempty{#1}}{\pagerefname}{%
\ifthenelse{\equal{#1}{s}}{\pagesrefname}{%
\ifthenelse{\equal{#1}{c}}{\Pagerefname}{%
\ifthenelse{\equal{#1}{cs}\OR\equal{#1}{sc}}{\Pagesrefname}{%
\typeout{cross-ref error -- page #2}\pagerefname}}}}~\pageref{#2}}}
\WithSuffix\def\pref*#1{\hyperref[#1]{\pageref{#1}}}
%% lines
\newcommand*{\linerefname}{line}
\newcommand*{\Linerefname}{Line}
\newcommand*{\linesrefname}{lines}
\newcommand*{\Linesrefname}{Lines}
\newcommand*{\lref}[2][]{\hyperref[lin:#2]{%
\ifthenelse{\isempty{#1}}{\linerefname}{%
\ifthenelse{\equal{#1}{s}}{\linesrefname}{%
\ifthenelse{\equal{#1}{c}}{\Linerefname}{%
\ifthenelse{\equal{#1}{cs}\OR\equal{#1}{sc}}{\Linesrefname}{%
\typeout{cross-ref error -- lin:#2}\linerefname}}}}~\ref{lin:#2}}}
\WithSuffix\def\lref*#1{\hyperref[lin:#1]{\ref{lin:#1}}}
%% titles
%% These cross-referencing commands do not have options.
\newcommand*{\Tref}[1]{\textit{\titleref{#1}}}
\newcommand*{\TPref}[1]{\textit{\titleref{#1}}, \pref{#1},}
\WithSuffix\def\TPref*#1{\textit{\titleref{#1}}, \pref{#1}}
\newcommand*{\TCref}[1]{\textit{\titleref{cha:#1}}, \Cref{#1},}
\WithSuffix\def\TCref*#1{\textit{\titleref{cha:#1}}, \Cref{#1}}
\newcommand*{\TAref}[1]{\textit{\titleref{app:#1}}, \Aref{#1},}
\WithSuffix\def\TAref*#1{\textit{\titleref{app:#1}}, \Aref{#1}}
\newcommand*{\TSref}[1]{\textit{\titleref{sec:#1}}, \Sref{#1},}
\WithSuffix\def\TSref*#1{\textit{\titleref{sec:#1}}, \Sref{#1}}
\newcommand*{\CTref}[1]{\Cref{#1}, \textit{\titleref{cha:#1}},}
\WithSuffix\def\CTref*#1{\Cref{#1}, \textit{\titleref{cha:#1}}}
\newcommand*{\ATref}[1]{\Aref{#1}, \textit{\titleref{app:#1}},}
\WithSuffix\def\ATref*#1{\Aref{#1}, \textit{\titleref{app:#1}}}
\newcommand*{\STref}[1]{\Sref{#1}, \textit{\titleref{sec:#1}},}
\WithSuffix\def\STref*#1{\Sref{#1}, \textit{\titleref{sec:#1}}}
%% others
\newcommand*{\Bibref}{\hyperref[bib]{\textit{Bibliography}}}
%:text
\frenchspacing
\setlength{\parindent}{1pc}
\strictpagecheck % odd or even page?
%% i.e., e.g., cf., etc.
%\RequirePackage{xspace} % smart trailing space
\newcommand{\hairsp}{\hspace{0.5pt}}% hair space
\newcommand{\mhsp}{\mspace{2mu}}% math hair space
\newcommand{\hquad}{\hskip0.5em\relax}% half quad space
\newcommand{\ie}{\emph{i.\hairsp{}e.}}
\newcommand{\eg}{\emph{e.\hairsp{}g.}}
\newcommand{\cf}{\emph{cf.}}
\newcommand{\etc}{\emph{etc.}}
\newcommand{\capitalize}[2]{\uppercase{#1}#2}
%:lists
\tightlists
\renewcommand{\labelitemi}{\scriptsize\textbullet}
%:graphics
\RequirePackage{graphicx}
%\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
\graphicspath{{./illustrations/}{./illustrations/MetaPost/}{./graphics/}{./figures/}}
%% Note: some figures---and their captions---may not be placed
%% correctly on the page. If multiple processing of the file does
%% not correct this issue, you may need to insert one of the commands
%% \forcerectofloat or \forceversofloat
%% inside the figure (or other float) environment.
%:verbatim environments
%% customise memoir's boxedverbatim environment
%% no sides on 'box'
\bvtopandtail
%% use heavier rule for top and bottom
\renewcommand{\bvtoprulehook}{%
\hrule width\linewidth height\heavyrulewidth \nobreak\vskip-.1pt}
\renewcommand{\bvendrulehook}{\vspace{-.5\bvboxsep}%
\hrule width\linewidth height\heavyrulewidth}
%% use smaller line numbers
\linenumberfont{\scriptsize\rmfamily}
%\settowidth{\bvnumlength}{\footnotesize 9999}
%% increase space between line numbers and verbatim material
\newlength{\bvlinenumsep}
\setlength{\bvlinenumsep}{8pt}
\makeatletter
\def\b@vdoinside{%
\ifbvcountlines\ifbvcountinside%
\makebox[\bvnumlength][r]{%
\vlvnumfont \theb@vlinenumber\hspace{\bvlinenumsep}}%
\fi\fi}
\makeatother
%% define a title/description
\newlength{\bvtitlewidth}
\setlength{\bvtitlewidth}{\textwidth-2\bvboxsep}
\newlength{\bvtitleskip}
\setlength{\bvtitleskip}{.3\bvboxsep+\baselineskip}
\newcommand{\setbvtitlefont}[1]{\def\bvtitlefont{#1}}
\setbvtitlefont{\normalfont}
\newsavebox{\bvtitle}
\newcommand{\clearbvtitle}{% set a strut
\renewcommand{\bvtopmidhook}{\rule{0pt}{\bvtitleskip}\hss}}
\newcommand{\setbvtitle}[1]{%
\ifthenelse{\isempty{#1}}%
{\clearbvtitle}%
{\begin{lrbox}{\bvtitle}\begin{minipage}[b][\height+.3\baselineskip]{\textwidth}%
\hfill\parbox[b]{\bvtitlewidth}{\bvtitlefont#1}\hfill\vspace{.4em}%
\hrule width\linewidth height\lightrulewidth%
\end{minipage}\end{lrbox}
\renewcommand{\bvtopmidhook}{\raisebox{\bvtitleskip}{\usebox{\bvtitle}}}}%
}
%% customise fancyvrb's Verbatim environment
%% NB: some of the macros here use some of the \bv... macros
%\usepackage{fancyvrb} % modified to handle title/description instead of just `label'
\usepackage{fancyvrb_mod} % modified to handle title/description instead of just `label'
%% title
\newsavebox{\fvtitlebox}
\newlength{\fvtitlewidth}
\setlength{\fvtitlewidth}{\textwidth-2\bvboxsep}
\makeatletter
\newcommand{\fvtitle}[1]{%
%\begin{lrbox}{\fvtitle}\begin{minipage}[t][\height+.3\baselineskip]{\textwidth}%
\begin{lrbox}{\fvtitlebox}\enspace\hspace{1pt}\begin{minipage}[b]{\linewidth}%
{\FancyVerbRuleColor\hrule width\linewidth height\FV@FrameRule}%
\vspace{.3\baselineskip}%
\hfill\parbox{\fvtitlewidth}{\bvtitlefont#1}\hfill\vspace{.3\baselineskip}%
{\FancyVerbRuleColor\hrule width\linewidth height\lightrulewidth}%
\vspace{.25\baselineskip}%
\end{minipage}\end{lrbox}\usebox{\fvtitlebox}
}
\makeatother
\newcommand{\setfvtitle}[1]{\fvset{label={\fvtitle{#1}}}}
%% line numbers
\newlength{\fvnumlength}
\newcommand*{\setfvnumlength}[2]{% {<number-example>}{<number-sep>}
\settowidth{\fvnumlength}{#1}
\setlength{\bvlinenumsep}{#2}
}
\setfvnumlength{\footnotesize 999}{8pt}
\newcounter{fvlinemodrem}% remainder for modulo operation
\makeatletter
\newcommand*{\setfvlinenums}[2]{% {<first-line>}{<start-at>}
\c@FancyVerbLine #1\relax \advance\c@FancyVerbLine \m@ne
\ifnum\z@<\linemodnum% we are printing line numbers
\@tempcnta #2\relax
\divide\@tempcnta\linemodnum
\multiply\@tempcnta\linemodnum
\c@fvlinemodrem #2\relax
\advance\c@fvlinemodrem-\@tempcnta
\fi}
\makeatother
\newcommand*{\resetfvlinenumber}{\setcounter{FancyVerbLine}{0}}
\renewcommand{\FancyVerbFormatLine}[1]{% format for line numbers
\makebox[\fvnumlength][r]{%
\vlvnumfont%
\getthelinenumber{FancyVerbLine}{fvlinemodrem}}%
\hspace{\bvlinenumsep}#1}
\renewcommand{\theFancyVerbLine}{\normalfont\arabic{FancyVerbLine}}% format for references
%:extended date and time formats
\RequirePackage[nodayofweek]{datetime}
\settimeformat{xxivtime} % 24-hour time
\renewcommand{\timeseparator}{.} % in form 12.34
\newdateformat{dmydate}{\THEDAY~\monthname[\THEMONTH]\ \THEYEAR}
\newdateformat{ndmydate}{\twodigit{\THEDAY}.\twodigit{\THEMONTH}.\THEYEAR}
%:units
%\RequirePackage{units} % prettier units and non-stacked fractions
\RequirePackage{siunitx} % prettier units and non-stacked fractions
\sisetup{numaddn=\piunit,valuemode=text}
%:other packages
%\RequirePackage{lipsum} % for dummy text
\RequirePackage{longtable} % tables that can cross page breaks
%\RequirePackage{multicol} % small sections of multiple columns
%:FiXme notes
%% use option 'draft' to show, 'final' to suppress
\RequirePackage[\dfFix]{fixme}
%%
%% TeXLive 2008
%% color FiXme logo
%\renewcommand*{\fixmelogo}{\textsf{\redcolor FiXme}}
%\renewcommand*{\fixmenoteprefix}{\fixmelogo\ \textsf{\redcolor Note}}
%% the FiXme package doesn't recognize the memoir class, and
%% hence the 'List of FiXme.s' defaults to the article style
%% use memoir's \newlistof to set up the 'List of FiXme.s' by hand
%% so its format matches the other 'List of ...'s
%\renewcommand*{\listfixmename}{Corrections Needed}
%\newlistof{listofFiXmes}{lox}{\listfixmename}
%\addtodef*{\insertchapterspace}{}{%
% \addtocontents{lox}{\protect\addvspace{\cftchapskip}}}
%% in 'final' mode, we turn this off
%\makeatletter
% \ifx\fixme@note\fixme@note@final\renewcommand{\listofFiXmes}{}\fi
%\makeatother
%%
%% TeXLive 2009
%% color FiXme logo
\renewcommand*{\fixmelogo}{\textsf{\hlred{FiXme}}}
\renewcommand\fxenglishnotename{\textsf{\hlred{Note}}}
\renewcommand\fxenglishnotesname{\textsf{\hlred{Notes}}}
\renewcommand\fxenglishwarningname{\textsf{\hlred{Warning}}}
\renewcommand\fxenglishwarningsname{\textsf{\hlred{Warnings}}}
\renewcommand\fxenglisherrorname{\textsf{\hlred{Error}}}
\renewcommand\fxenglisherrorsname{\textsf{\hlred{Errors}}}
\renewcommand\fxenglishfatalname{\textsf{\hlred{Fatal}}}
\renewcommand\fxenglishfatalsname{\textsf{\hlred{Fatal errors}}}
%% The FiXme package doesn't recognize the memoir class, and
%% hence the 'List of FiXme.s' defaults to the article style.
%% Set the 'book' style by hand
\renewcommand*{\englishlistfixmename}{Corrections Needed} % 2009
\makeatletter
\let\@lox@prtc\@lox@prtc@book
\let\@lox@psttc\@lox@psttc@book
\makeatother
\fxsetface{margin}{\footnotesize\itshape}
%% environment for Desmond to add comments
\newenvironment{Desmond}{\color{MediumBlue}\textit{Desmond}:}{}
%:show latex labels
%% use option 'draft' to show, 'final' to suppress
\RequirePackage[color,\dfKey]{showkeys}
\definecolor{refkey}{rgb}{.8,.8,1}
\definecolor{labelkey}{rgb}{.5,.5,1}
\renewcommand*{\showkeyslabelformat}[1]{%
\raisebox{-1.4ex}{\makebox[.0\width][r]{\normalfont\footnotesize\ttfamily#1}}}
%:hyperref
%% Must load this package in the correct
%% order relative to all other packages.
\RequirePackage{hyperref}
\hypersetup{%
pdfborder = {0 0 0},
bookmarksdepth = section,
hyperfootnotes = false,
colorlinks = true,
citecolor = DarkGreen,
linkcolor = DarkRed,
urlcolor = DarkGreen,
}
%:tufte-latex environments
%% cribbed from the tufte-latex project
\RequirePackage[symmetric,justified,raggedmargins]{tufte-env} % load after hyperref
\def\cplabel{^X} % To get around conflict with underscore package and \newpmemlabel (defined in memoir package)
\usepackage[strings]{underscore} % to use "_" in text
%:PTC code
%% use customised boxedverbatim (above) to create new environment 'ptccode'
%% the optional argument defines a title/description
%\newenvironment{ptccode}[1][]{\setbvtitle{#1}\boxedverbatim}{\endboxedverbatim}
%% line numbers are typeset automatically
%% and continue across calls to ptccode
%% use the following commands to adjust the numbering
%\newcommand*{\setptclinenums}[2]{\setbvlinenums{#1}{#2}}% {<first-line>}{<start-at>}
%\newcommand*{\resetptclinenumber}{\resetbvlinenumber}
%%
%% use customised Verbatim to create new environment 'ptccode'
\DefineVerbatimEnvironment{ptccode}{Verbatim}%
{commandchars=\\\{\},
firstnumber=last,% so line numbers continue across calls, can override
frame=lines,framerule=\heavyrulewidth,framesep=.5\baselineskip}
\let\ptctitle\fvtitle
\let\setptctitle\setfvtitle
\newcommand*{\resetptctitle}{\fvset{label=none}}
%% command to input a PTC source file verbatim
\newcommand{\inputptccode}[2]{%
\VerbatimInput[
label={\ptctitle{#2}},
frame=lines,framerule=\heavyrulewidth,framesep=.5\baselineskip
]{#1}
}
%% line numbers are typeset automatically
%% and continue across calls to ptccode
%% use the following commands to adjust the numbering
%\newcommand*{\resetptclinenumber}{\resetfvlinenumber}
%\newcommand*{\setptclinenums}[2]{\setfvlinenums{#1}{#2}}% {<first-line>}{<start-at>}
\let\resetptclinenumber\resetfvlinenumber
\let\setptclinenums\setfvlinenums % {<first-line>}{<start-at>}
\let\setptcnumlength\setfvnumlength % {<number-example>}{<number-sep>}
%% start line
\linenumberfrequency{1}% use zero (0) to turn off line numbers
%% PTC text
\newcommand{\ptc}[1]{\texttt{#1}}
%% PTC arguments
\newcommand{\ptcarg}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}
\newcommand{\argb}{\ptcarg{bool}}
\newcommand{\argc}{\ptcarg{char}}
\newcommand{\argi}{\ptcarg{int}}
\newcommand{\argr}{\ptcarg{real}}
\newcommand{\args}{\ptcarg{string}}
%% PTC input
\newcommand{\ptcinp}[1]{\texttt{\textsl{#1}}}
%% PTC module, program, subroutine, function, variable
\newcommand{\ptcmod}[1]{\textsf{\textsl{#1}}}
\newcommand{\ptcprg}[1]{\textsf{\bfseries\slshape #1}}
\newcommand{\ptcsub}[1]{\texttt{#1}}
\newcommand{\ptcfun}[1]{\texttt{#1}}
\newcommand{\ptcvar}[1]{\texttt{#1}}
\newcommand{\ptcelm}[1]{\textsf{#1}}
\newcommand{\ptctyp}[1]{\textsf{\textsl{#1}}}
%% Fortran module, program, subroutine, function, variable
\newcommand{\ftnmod}[1]{\textsf{\textsl{#1}}}
\newcommand{\ftnprg}[1]{\texttt{#1}}
\newcommand{\ftnsub}[1]{\texttt{#1}}
\newcommand{\ftnfun}[1]{\texttt{#1}}
\newcommand{\ftnvar}[1]{\texttt{#1}}
%% for PTC Command Summary: new list environment and commands
\makeatletter
\newenvironment{ptccommands}%
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\ptccmdlabel}}%
{\endlist}
\newcommand*{\ptccmdlabel}[1]{\hspace\labelsep\normalfont\ttfamily #1}
\makeatother
%: ...
%% backslash in tt type in OT1/T1
\newcommand{\tuftebs}{\symbol{'134}}
%% a zero-width, flush-right, text box (use to push '\' into left margin
\newcommand{\hangleft}[1]{\makebox[0pt][r]{#1}}
%% command name -- adds backslash automatically
\newcommand{\doccmd}[1]{%
\texttt{\tuftebs#1}%
\index{#1@\protect\hangleft{\texttt{\tuftebs}}\texttt{#1}}}
%% command specification environment
\newenvironment{docspec}{%
\begin{quotation}\ttfamily\parskip0pt\parindent0pt\ignorespaces}{%
\end{quotation}}
%% environment name
\newcommand{\docenv}[1]{\texttt{#1}%
\index{#1@\texttt{#1} environment}%
\index{environments!#1@\texttt{#1}}}
%% package name
\newcommand{\docpkg}[1]{\texttt{#1}%
\index{#1@\texttt{#1} package}%
\index{packages!#1@\texttt{#1}}}
%% document class option name
\newcommand{\docclsopt}[1]{\texttt{#1}%
\index{#1@\texttt{#1} class option}%
\index{class options!#1@\texttt{#1}}}
%:other macros
%% For commands that take an argument, prefer \newcommand* over \newcommand.
%% The former version has better error checking, but does not allow the
%% argument to contain a paragraph break. If you find yourself defining a
%% new command that may contain a long argument, then consider using
%% \newenvironment instead.
\providecommand{\clearemptydoublepage}%
{\clearpage{\pagestyle{empty}\cleardoublepage}}
%% abbreviations
\newcommand{\BNL}{\textls[\scls]{BNL}}
\newcommand{\CEBAF}{\textls[\scls]{CEBAF}}
\newcommand{\Cpp}{\textsc{C\raisebox{0.75pt}{++}}}
\newcommand{\DA}{\textls[\scls]{DA}}
\newcommand{\DNA}{\textls[\scls]{DNA}}
\newcommand{\Fsevens}{\textsc{Fortran$77$}}
\newcommand{\Fninety}{\textsc{Fortran$90$}}
\newcommand{\FPP}{\textls[\scls]{FPP}}
\newcommand{\JLab}{\textsc{JLab}}
\newcommand{\LBNL}{\textls[\scls]{LBNL}}
\newcommand{\LEGO}{\textsc{LEGO}}
\newcommand{\LEGOr}{\textsc{LEGO}$^\text{\textregistered}$}
\newcommand{\LieLib}{\textsc{LieLib}}
\newcommand{\MadX}{\textsc{Mad-X}}
\newcommand{\PSR}{\textls[\scls]{PSR}}
\newcommand{\PTC}{\textls[\scls]{PTC}}
\newcommand{\RHIC}{\textls[\scls]{RHIC}}
\newcommand{\SDGQ}{\textls[\scls]{SDGQ}}
\newcommand{\TPS}{\textls[\scls]{TPS}}
\newcommand{\TPSA}{\textls[\scls]{TPSA}}
%% to set the rule and sep for \fbox
%% e.g. \setfbox{0.5pt}{0pt} for super-tight \fbox [useful for debugging]
\newcommand*{\setfbox}[2]{\setlength{\fboxrule}{#1}\setlength{\fboxsep}{#2}}
%:hyphenation
\hyphenation{sym-plec-tic}
%:includeonly
% for partial compilation
%\includeonly{
% front/cover,
% front/epigraphs,
% front/titles,
% front/copyright,
% front/dedication,
% front/preface,
% front/ackn,
% chapters/chap00,
% chapters/chap01,
% chapters/chap02,
% chapters/chap03, % font issues
% chapters/chap04,
% chapters/chap05,
% chapters/chap06,
% chapters/chap07,
% chapters/chap08,
% chapters/chap09,
% chapters/chap10,
% chapters/chap11,
% chapters/chap12,
% appendices/appenA,
% appendices/appenB,
% appendices/appenC,
% appendices/appenD,
% appendices/appenE,
% appendices/appenF,
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%:----- document -----
\begin{document}
%\layout
%:front matter
\frontmatter
\include{front/cover}
\setcounter{page}{1}
\include{front/epigraphs}
\include{front/titles}
\include{front/copyright}
\killtitle
%% dedication
%\include{front/dedication}
%% table of contents
%% short
\cleardoublepage
\setupshorttoc
\tableofcontents
%% long
\clearpage
\setupparasubsecs
\setupmaintoc
\tableofcontents
%% list of figures
\clearpage
\setuplof
\listoffigures
%% list of tables
\clearpage
\setuplot
\listoftables
%% list of FiXmes
\clearpage
\pagestyle{loxhead}
\thispagestyle{empty}
\listoffixmes
\clearpage
\pagestyle{fwhead}
%% preface
\include{front/preface}
%% acknowledgements
\include{front/ackn}
%:main matter
\mainmatter
\include{chapters/chap00} % internal title page
\include{chapters/chap01} % introduction
\include{chapters/chap02} % overview
\include{chapters/chap03} % modeling accelerators
\include{chapters/chap04} % linking magnets
\include{chapters/chap05} % polymorphism and knobs
\include{chapters/chap06} % computing accelerator properties
\include{chapters/chap07} % tracking routines
\include{chapters/chap08} % geometry routines
\include{chapters/chap09} % symplectic integration and splitting
\include{chapters/chap10}
%\include{chapters/chap11} % space-charge computation
%\include{chapters/chap12} % PTC structure and libraries
\cleardoublepage
\appendixpage
\appendix
\include{appends/appenA} % internal states
\include{appends/appenB} % data types
%\include{appends/appenC} % input to PTC from other codes
%\include{appends/appenD} % flat files
\include{appends/appenE} % geometry tutorial
\include{appends/appenEb} % geometry tutorial
\include{appends/appenF} % splitting tutorial
%\include{appends/appenG} % Solving Maxwell
%:back matter
\backmatter
%\include{chapters/gloss}
%:glossary
%% NB: to add explanatory text before the glossary
%% entries, redefine the command \preglossaryhook
%%
\renewcommand*{\glossaryname}{Concepts}
\renewcommand*{\begintheglossaryhook}{\begin{description}}
\renewcommand*{\atendtheglossaryhook}{\end{description}}
\renewcommand{\glossitem}[4]{\item[#1.] #2 \ \S#3 #4}
%\printglossary
%%
\renewcommand*{\glossaryname}{{\PTC} Command Summary}
\renewcommand*{\begintheglossaryhook}{\begin{ptccommands}}
\renewcommand*{\atendtheglossaryhook}{\end{ptccommands}}
\renewcommand{\glossitem}[4]{\item[#1] #2 \ \S#3 #4}
%\renewcommand{\memgloterm}[1]{\addperiod{\texttt{#1}}}
%\printglossary[ptccmds]
%:bibliography
%\cleardoublepage
\label{bib}
\nocite{Forest:2002:PTC,%
Forest:2006:FPP.PTC,%
Forest:2006:FPPDoc}
\nocite{Forest:1990:HamFree,%
Forest:1992:ContGuide,%
Forest:1997:DynEuclid,%
Forest:1998:BeamDyn,%
Forest:2006:GeomIntegPA}
\bibliographystyle{PTC-LibUG} %% Causes memory overflow