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
|
%% memsty.sty For memman
\ProvidesPackage{memsty}[2007/11/01 for memman]
%%\usepackage{layouts}[2001/04/29]
%%\usepackage{verbatim}
%%\usepackage{glossit}
\usepackage{etex}
\usepackage{layouts}[2001/04/29]
\usepackage{url}
\usepackage{fixltx2e}
\usepackage{alltt}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{latexsym}
\usepackage{memfonts}
\usepackage{pifont}
\usepackage[T1]{fontenc}
%%%%%%%%%%%%%%%%%%% kill scale change warning in layouts
\renewcommand*{\setlayoutscale}[1]{\setlength{\l@youtunitlength}{1pt}
\l@youtunitlength= #1\l@youtunitlength
\renewcommand*{\l@youtscale}{#1}}
%%%%%%%%%%%%%%%%%% plainmarkruled pagestyle
\makepagestyle{plainmarkruled}
\makeheadrule{plainmarkruled}{\textwidth}{\normalrulethickness}
\makeevenhead{plainmarkruled}{\scshape\leftmark}{}{}
\makeoddhead{plainmarkruled}{}{}{\scshape\rightmark}
\makeevenfoot{plainmarkruled}{\thepage}{}{}
\makeoddfoot{plainmarkruled}{}{}{\thepage}
\makepsmarks{plainmarkruled}{\@ruledmarks}
%%%%%%%%%%%%%%%%%% index pagestyle
\makepagestyle{index}
\makeheadrule{index}{\textwidth}{\normalrulethickness}
\makeevenhead{index}{\rightmark}{}{\leftmark}
\makeoddhead{index}{\rightmark}{}{\leftmark}
\makeevenfoot{index}{\thepage}{}{}
\makeoddfoot{index}{}{}{\thepage}
\makeindex
%\showindexmarktrue
%%%%%%%%%%%%%%%%%%%%%%% glossary
\makeglossary
\changeglossactual{?}
\changeglossnum{\@currentlabel}
\changeglossnum{\thepage}
\changeglossnumformat{|hyperpage}
\renewcommand*{\glossaryname}{Command summary}
\renewcommand{\glossitem}[4]{%
\sbox\@tempboxa{#1 \space #2 #3 #4}%
\par\hangindent 2em
\ifdim\wd\@tempboxa<0.8\linewidth
#1 \space #2 #3 \dotfill #4\relax
\else
#1 \dotfill #4\\
#2 #3
\fi}
\renewcommand*{\glossarymark}{\markboth{\glossaryname}{\glossaryname}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Short and long ToC
\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\sffamily}
\renewcommand*{\cftchapterpagefont}{\normalfont}
\renewcommand*{\cftchapterleader}{ \textperiodcentered\space}
\renewcommand*{\cftchapterafterpnum}{\cftparfillskip}
%% \setpnumwidth{0em}
%% \setpnumwidth{1.5em}
\renewcommand*{\cftchapterfillnum}[1]{%
{\cftchapterleader}\nobreak
\hbox to 1.5em{\cftchapterpagefont ##1\hfil}\cftchapterafterpnum\par}
\setrmarg{0.3\textwidth}
\setlength{\unitlength}{\@tocrmarg}
\addtolength{\unitlength}{1.5em}
\let\oldcftpartformatpnum\cftpartformatpnum
\renewcommand*{\cftpartformatpnum}[1]{%
\hbox to\unitlength{{\cftpartpagefont ##1}}}
\let\oldcftbookformatpnum\cftbookformatpnum
\renewcommand*{\cftbookformatpnum}[1]{%
\hbox to\unitlength{{\cftbookpagefont ##1}}}}
\newcommand*{\setupparasubsecs}{%
\let\oldnumberline\numberline
\renewcommand*{\cftsubsectionfont}{\itshape}
\renewcommand*{\cftsubsectionpagefont}{\itshape}
\renewcommand{\l@subsection}[2]{
\ifnum\c@tocdepth > 1\relax
\def\numberline####1{\textit{####1}~}%
\leftskip=\cftsubsectionindent
\rightskip=\@tocrmarg
%% \advance\rightskip 0pt plus \hsize % uncomment this for raggedright
%% \advance\rightskip 0pt plus 2em % uncomment this for semi-ragged
\parfillskip=\fill
\ifhmode ,\ \else\noindent\fi
\ignorespaces
{\cftsubsectionfont ##1}~{\cftsubsectionpagefont##2}%
\let\numberline\oldnumberline\ignorespaces
\fi}}
\AtEndDocument{\addtocontents{toc}{\par}}%%% OK
\newcommand*{\setupmaintoc}{%
\renewcommand{\contentsname}{Contents}
\let\changetocdepth\oldchangetocdepth
\let\precistoctext\oldprecistoctext
\let\cftchapterfillnum\oldcftchapterfillnum
\addtodef{\cftchapterbreak}{\par}{}
\renewcommand*{\cftchapterfont}{\normalfont\sffamily}
\renewcommand*{\cftchapterleader}{\sffamily\cftdotfill{\cftchapterdotsep}}
\renewcommand*{\cftchapterafterpnum}{}
\renewcommand{\cftchapterbreak}{\par\addpenalty{-\@highpenalty}}
\setpnumwidth{2.55em}
\setrmarg{3.55em}
\setcounter{tocdepth}{2}
\let\cftpartformatpnum\oldcftpartformatpnum
\addtodef{\cftpartbreak}{\par}{}
\let\cftbookformatpnum\oldcftbookformatpnum
\addtodef{\cftbookbreak}{\par}{}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifpdf
\usepackage[pdftex,
plainpages=false,
pdfpagelabels,
%%% hyperfootnotes=false,
bookmarksnumbered
]{hyperref}
\usepackage{graphicx}
\DeclareGraphicsRule{*}{mps}{*}{}
\else
\usepackage[plainpages=false,
pdfpagelabels,
%%% hyperfootnotes=false,
bookmarksnumbered
]{hyperref}
\usepackage{graphicx}
\DeclareGraphicsRule{*}{eps}{*}{}
\fi
%%% \usepackage{memhfixc} %% now called by hyperref
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Logos
\providecommand*{\tx}{TeX}
\providecommand*{\txbook}{\tx book}
\providecommand*{\ltx}{La\tx}
\providecommand*{\ltxe}{\ltx2e}
\providecommand*{\pdfltx}{pdf\ltx}
\providecommand*{\ixpdfltx}{\index{pdfLaTeX?\pdfltx}}
\providecommand*{\pixpdfltx}{\pdfltx\ixpdfltx} % print & index pdfLaTeX
\providecommand*{\etx}{\texttt{etex}}
\providecommand*{\ixetx}{\index{etex?\etx}}
\providecommand*{\pixetx}{\etx\ixetx} % print & index etex
\providecommand*{\xetx}{Xe\tx}
\providecommand*{\ixxetx}{\index{XeTeX?\xetx}}
\providecommand*{\pixxetx}{\xetx\ixxetx} % print & index XeTeX
\providecommand*{\TeXUG}{\tx{} Users Group}
\providecommand*{\tug}{\textsc{tug}}
\providecommand*{\ixtug}{\index{TUG?\tug}}
\providecommand*{\pixtug}{\tug\ixtug} % print & index TUG
\providecommand*{\cTeXan}{Comprehensive \tx{} Archive Network}
\providecommand*{\ctan}{\textsc{ctan}} % print CTAN
\providecommand*{\ixctan}{\index{CTAN?\ctan}} % index CTAN
\providecommand*{\pixctan}{\ctan\ixctan} % print & index CTAN
\newcommand*{\ctt}{\textsc{ctt}} % print CTT
\newcommand*{\ixctt}{\index{ctt?\ctt}} % index CTT
\newcommand*{\pixctt}{\ctt\ixctt} % print & index CTT
\newcommand*{\prtoc}{ToC} % print ToC
\newcommand*{\prlof}{LoF} % print LoF
\newcommand*{\prlot}{LoT} % print LoT
\newcommand*{\ixtoc}{\index{ToC}} % index ToC
\newcommand*{\ixlof}{\index{LoF}} % index LoF
\newcommand*{\ixlot}{\index{LoT}} % index LoT
\newcommand*{\toc}{\prtoc\ixtoc} % print & index ToC
\newcommand*{\lof}{\prlof\ixlof} % print & index LoF
\newcommand*{\lot}{\prlot\ixlot} % print & index LoT
\newcommand*{\prfrontmatter}{front matter} % macros for frontmatter
\newcommand*{\prFrontmatter}{Front matter}
\newcommand*{\ixfrontmatter}{\index{front matter?\prfrontmatter}}
\newcommand*{\pixfrontmatter}{\prfrontmatter\ixfrontmatter}
\newcommand*{\pixFrontmatter}{\prFrontmatter\ixfrontmatter}
\newcommand*{\prmainmatter}{main matter} % macros for mainmatter
\newcommand*{\prMainmatter}{Main matter}
\newcommand*{\ixmainmatter}{\index{main matter?\prmainmatter}}
\newcommand*{\pixmainmatter}{\prmainmatter\ixmainmatter}
\newcommand*{\pixMainmatter}{\prMainmatter\ixmainmatter}
\newcommand*{\prbackmatter}{back matter} % macros for backmatter
\newcommand*{\prBackmatter}{Back matter}
\newcommand*{\ixbackmatter}{\index{back matter?\prbackmatter}}
\newcommand*{\pixbackmatter}{\prbackmatter\ixbackmatter}
\newcommand*{\pixBackmatter}{\prBackmatter\ixbackmatter}
%%%%%%%% from Typo
\providecommand*{\alltx}{(La)\tx}
\providecommand*{\metafont}{Metafont}
\providecommand*{\pscript}{Post\-Script}
\providecommand*{\ixpscript}{\pscript\index{PostScript}}
\providecommand*{\pdf}{PDF}
\providecommand*{\pixpdf}{\pdf\index{PDF}}
%\providecommand*{\prog}[1]{\Prog{#1}}
%\providecommand*{\ixprog}[1]{\index{#1 program?\prog{#1} program}%
% \index{program!#1?\prog{#1}}}
%\providecommand*{\pixprog}[1]{\prog{#1}\ixprog{#1}}
%%\providecommand*{\ctt}{\texttt{ctt}}
%%\providecommand*{\ixtx}{\index{TeX?\tx}}
%%\providecommand*{\pixtx}{\tx\ixtx}
%%\providecommand*{\ixltx}{\index{LaTeX?\ltx}}
%%\providecommand*{\pixltx}{\ltx\ixltx}
\newcommand*{\theclass}{memoir}
%%% Print and Index macros
\newcommand*{\noidxnum}[1]{}
%% index @ in macrocode
\newcommand*{\idxatincode}{\index{@?\texttt{@}!in macro code}}
\newcommand*{\seeatincode}{see \Sref{sec:alltexcommands}}
% index marking
\newcommand{\idxmark}[1]{#1\markboth{#1}{#1}}
%%%% index pair of sup/sub items
\newcommand*{\indextwo}[2]{\index{#1!#2}\index{#2!#1}}
%%% index pair of sup/sub/sub
\newcommand*{\indexthree}[3]{\index{#1!#2!#3}\index{#2!#1!#3}}
\newcommand*{\Ppstyle}[1]{\textsl{#1}}
\newcommand*{\pstyle}[1]{\Ppstyle{#1}%
\index{#1 pages?\Ppstyle{#1} (pagestyle)}%
\index{pagestyle!#1?\Ppstyle{#1}}} % pagestyle
\newcommand*{\Pcstyle}[1]{\textsl{#1}}
\newcommand*{\cstyle}[1]{\Pcstyle{#1}%
\index{#1 chaps?\Pcstyle{#1} (chapterstyle)}%
\index{chapterstyle!#1?\Pcstyle{#1}}} % chapterstyle
\newcommand*{\Phstyle}[1]{\textsl{#1}}
\newcommand*{\hstyle}[1]{\Phstyle{#1}%
\index{#1 heads?\Phstyle{#1} (headstyles)}%
\index{headstyles!#1?\Phstyle{#1}}} % headstyles
\newcommand*{\Pclass}[1]{\textsf{#1}}
\newcommand*{\Lclass}[1]{\Pclass{#1}%
\index{#1 class?\Pclass{#1} (class)}%
\index{class!#1?\Pclass{#1}}} % class name
\newcommand*{\Iclasssub}[2]{\index{#1 class?\Pclass{#1} (class)!#2}}
\newcommand*{\Mname}{\Pclass{memoir}} % Print memoir
\newcommand*{\Ppack}[1]{\textsf{#1}}
\newcommand*{\Lpack}[1]{\Ppack{#1}%
\index{#1 pack?\Ppack{#1} (package)}%
\index{package!#1?\Ppack{#1}}} % package name
\newcommand*{\Popt}[1]{\textsf{#1}}
\newcommand*{\Lopt}[1]{\Popt{#1}%
\index{#1 opt?\Popt{#1} (option)}%
\index{option!#1?\Popt{#1}}} % option name
\newcommand*{\Pe}[1]{\texttt{#1}} % print env name
\newcommand*{\Ie}[1]{\texttt{#1}\index{#1 env?\texttt{#1} (environment)}%
\index{environment!#1?\texttt{#1}}}
\newcommand*{\Pcn}[1]{\texttt{#1}} % print counter name
\newcommand*{\Icn}[1]{\texttt{#1}\index{#1 cou?\Pcn{#1} (counter)}%
\index{counter!#1?\Pcn{#1}}}
\newcommand*{\Itt}[1]{\texttt{#1}\index{#1tt?\texttt{#1}}}
\newcommand*{\file}[1]{\texttt{#1}} % print a file name
\newcommand*{\ixfile}[1]{% % index a file name
\index{#1 file?\file{#1} (file)}%
\index{file!#1?\file{#1}}}
\newcommand*{\pixfile}[1]{\file{#1}\ixfile{#1}} % print & index a file name
% print and index a length
\newcommand*{\lnc}[1]{\cmdprint{#1}%
\index{\expandafter\@gobble\string#1len?\string\cmdprint{\string#1} (length)}%
\index{length!\expandafter\@gobble\string#1len?\string\cmdprint{\string#1}}}
\newcommand*{\posarg}[1]{\textsf{#1}} % print positioning argument
% index a positioning argument
\newcommand*{\ixposarg}[1]{%
\index{#1 (position argument)?\posarg{#1} (position argument)}}
% print and index a positioning argument
\newcommand*{\pixposarg}[1]{\posarg{#1}\ixposarg{#1}}
% print and index a counter representation
\newcommand*{\pcrep}[1]{\texttt{#1}}
\newcommand*{\ixcrep}[1]{\index{#1 tt?\pcrep{#1}}%
\index{counter representation!#1 tt?\pcrep{#1}}}
\newcommand*{\Icrep}[1]{\texttt{#1}\index{#1 tt?\texttt{#1}}}% % counter representation
\renewcommand*{\Icrep}[1]{\pcrep{#1}\ixcrep{#1}}% % print & index counter rep
\newcommand*{\pixcrep}[1]{\pcrep{#1}\ixcrep{#1}} % print & index counter rep
% print (and index) TeX keywords
\newcommand*{\pkey}[1]{\texttt{#1}} % TeX keywords
\newcommand*{\pixkey}[1]{\pkey{#1}\index{#1 key?\pkey{#1} (keyword)}%
\index{keyword!#1?\pkey{#1}}}
\newcommand*{\patexp}{@-expression} % print @-expression
\newcommand*{\ixatexp}{%
\index{@-expression?\patexp}} % index @-expression
\newcommand*{\pixatexp}{\patexp\ixatexp} % print & index @-expression
\newcommand*{\Pprog}[1]{\textsf{#1}} % print program name
\newcommand*{\Iprog}[1]{\index{#1 prog?\Pprog{#1} (program)}%
\index{program!#1?\Pprog{#1}}} % index program name
\newcommand*{\Iprogsub}[2]{\index{#1 prog?\Pprog{#1} (program)!#2}}
\newcommand*{\Lprog}[1]{\Pprog{#1}\Iprog{#1}} % print & index program name
\DeclareRobustCommand{\Pmakeindex}{\Pprog{MakeIndex}}
\DeclareRobustCommand{\Imakeindex}{\Iprog{MakeIndex}}
\DeclareRobustCommand{\Lmakeindex}{\Lprog{MakeIndex}}
\DeclareRobustCommand{\Pbibtex}{\Pprog{BibTeX}}
\DeclareRobustCommand{\Ibibtex}{\Iprog{BibTeX}}
\DeclareRobustCommand{\Lbibtex}{\Lprog{BibTeX}}
% print and index an \if... \piif{if...}
\newcommand*{\piif}[1]{\cs{#1}\index{#1?\cs{#1}}}
% index command \!
\newcommand*{\iexcl}{\index{"!?\cs{!}}}
% print and index \!
\newcommand*{\pixabang}{\cmdprint{\!}\index{"!?\string\cs{}\texttt{"!}}}
% print and index \\!
\newcommand*{\pixslashbang}{\cmdprint{\\!}\index{"\"\"!?\string\cmdprint{\\}\texttt{"!}}}
\newcommand*{\senv}[1]{\texttt{\bs begin\{#1\}}} % print \begin{env}
\newcommand*{\eenv}[1]{\texttt{\bs end\{#1\}}} % print \end{env}
\newcommand*{\listofx}{`List of\ldots'}
\newcommand*{\Note}{\textbf{NOTE:}}
\newcommand*{\ptrue}{\texttt{true}} % print TRUE
\newcommand*{\pfalse}{\texttt{false}} % print FALSE
\DeclareRobustCommand{\btitle}[1]{\textit{#1}} % print a book/article/etc title
%%% numbers
\let\Mfrac\slashfrac
\newcommand*{\ratio}[2]{{\ensuremath #1 \raise0.2ex\hbox{:} #2}}% or perhaps 0.15ex
\providecommand*{\abyb}[2]{\ensuremath{#1 \times #2}} % e.g., 3 x 4
\providecommand*{\abybm}[3]{\ensuremath{#1 \times #2}\:#3} % e.g., 3 x 4 cm
\providecommand*{\atob}[2]{\ensuremath{#1\!:\!#2}} % e.g., 3:4
\DeclareRobustCommand*{\lb}{\texttt{\char`\{}} % prints {
\DeclareRobustCommand*{\rb}{\texttt{\char`\}}} % prints }
\newcommand*{\foredge}{fore-edge}
\newlength{\pwlayi}\setlength{\pwlayi}{0.45\textwidth} %
\newlength{\pwlayii}\setlength{\pwlayii}{0.45\pwlayi}
\DeclareRobustCommand{\Vprint}[1]{\texttt{\string#1}}
%%%%%% stuff for new LaTeX code environment
% \zeroseps sets list before/after skips to minimum values
\newcommand*{\@zeroseps}{\setlength{\topsep}{\z@}
\setlength{\partopsep}{\z@}
\setlength{\parskip}{\z@}}
\newlength{\gparindent} \setlength{\gparindent}{\parindent}
\setlength{\gparindent}{0.5\parindent}
% now we can do the new environment. This has no extra before/after spacing.
\newenvironment{lcode}{\@zeroseps
\renewcommand{\verbatim@startline}{\verbatim@line{\hskip\gparindent}}
\small\setlength{\baselineskip}{\onelineskip}\verbatim}%
{\endverbatim
\vspace{-\baselineskip}%
\noindent}
%%%%% LaTeX syntax
%%%% control space above/below center environment
\newcommand*{\tightcenter}{%
\topsep=0.25\onelineskip\trivlist \centering\item\relax}
\def\endtightcenter{\endtrivlist}
\newenvironment{syntax}{\begin{tightcenter}
\begin{tabular}{|p{0.9\linewidth}|} \hline}%
{\hline
\end{tabular}
\end{tightcenter}}
%%%%% for demoing chapterstyles
\newcommand*{\chaptext}[1]{The above is a demonstration of the \textit{#1}
chapterstyle. It is one of several styles that come as part of the
\Pclass{memoir} class.}
%%%\renewcommand*{\theHchapter}{\thesheetsequence.\arabic{chapter}}
\newcount\savechapcnt
\newcount\demochapcnt
\newcount\saveseccnt
\newcount\savesubseccnt
\demochapcnt=0
%%\newcommand*{\theHc@demochapcnt}{\thefigure.\arabic{\c@demochapcnt}}
\newcount\savefigcnt
\newcommand*{\demochapcolor}{\definecolor{shadecolor}{gray}{0.75}}
\newenvironment{demochap}[2][\onelineskip]{%
\savechapcnt=\c@chapter
\saveseccnt=\c@section
\savesubseccnt=\c@subsection
\c@chapter=\demochapcnt
%% \stepcounter{demochapcnt}
\counterwithout*{figure}{chapter}
\begin{figure}
%%% \definecolor{shadecolor}{gray}{0.75}
\demochapcolor
\begin{shaded}
\savefigcnt=\c@figure
\begingroup
%% \hrule
\renewcommand{\theHchapter}{\thepage.\thechapter}
\vspace*{#1}
\chapterstyle{#2}
\let\clearforchapter\relax
\let\insertchapterspace\relax
\renewcommand*{\addcontentsline}[3]{}
\renewcommand*{\thispagestyle}[1]{}
\renewcommand*{\markboth}[2]{}
\chapter{Demonstration of the #2 chapter style}
\chaptext{#2}
\vspace{\onelineskip}
\hrule
\endgroup
\end{shaded}
\global\demochapcnt=\c@chapter
\ifnum\demochapcnt>9\relax
\global\demochapcnt=0\relax
\fi
\c@chapter=\savechapcnt
\advance\c@chapter\m@ne
\refstepcounter{chapter}%
%% \stepcounter{chapter}
\begin{center}
\caption{The #2 chapterstyle}\label{dc#2}
\end{center}
\savefigcnt=\c@figure
\global\advance\savefigcnt\m@ne
%% \gdef\theHchapter{\thefigure.\thechapter}
}{%\gdef\theHchapter{\thechapter}
\end{figure}
\counterwithin{figure}{chapter}
\global\c@section=\saveseccnt
\global\c@subsection=\savesubseccnt}
%%% comma separated in-line items
\let\litemize\itemize \let\endlitemize\enditemize
\renewenvironment{litemize}{\renewcommand{\item}{\unskip, }}{}
\newenvironment{lineitems}{\litemize\renewcommand{\item}{\unskip, }}%
{\endlitemize\unskip }
%% typeset stuff in a box
\newdimen\showbinset
\newcommand{\showit}[1]{%
\setlength{\showbinset}{\linewidth}%
\addtolength{\showbinset}{-2\fboxsep}%
\addtolength{\showbinset}{-2\fboxrule}%
\par\vspace{0.5\onelineskip}\noindent
\fbox{\parbox{\showbinset}{{#1}}\vspace{0.5\onelineskip}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VERSALS
% Save file as: DROP.STY Source: FILESERV@SHSU.BITNET
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DROP.DOC <February 17, 1988>
% Macro for dropping and enlarging the first letter(s) of a paragraph.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Macro written by David G. Cantor, and published Fri, 12 Feb 88, in
% TeXhax, 1988 #16.
% Internet: dgc@math.ucla.edu
% UUCP: ...!{ihnp4, randvax, sdcrdcf, ucbvax}!ucla-cs!dgc
%
% Modified for use with LaTeX by Dominik Wujastyk, February 17, 1988
% Internet: dow@wjh12.harvard.edu
% Bitnet: dow@harvunxw.bitnet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This LaTeX macro is for dropping and enlarging the first letter(s) of a
% paragraph. The argument may be one or more letters.
%
% Here is an example of its usage:
%
% \documentstyle[drop]{article}
% \begin{document}
% \drop{IN} THE beginning God created the heaven and the earth. Now the
% earth was unformed and void, and darkness was upon the face of the
% deep; and the spirit of God hovered over the face of the waters.
% \end{document}
%
% Which will produce something along these lines:
%
% I I\ I THE beginning God created the heaven and the earth.
% I I \ I Now the earth was unformed and void, and darkness was
% I I \I upon the face of the deep; and the spirit of God hov-
% ered over the face of the waters.
%
% In the first instance the macro will pause during LaTeX processing and
% ask you for the font you wish to use for you drop capital. When you
% have something that looks good, then comment out box one in DROP.STY,
% and comment in box two, replacing "cmr10 scaled \magstep5" with the font
% of your choice.
%
% In my opinion (DW) there are no fonts available in the standard
% TeX/LaTeX set that are ideal for this use, unless you go down to 9pt or
% 8pt for your text face, and this is too small. If you have Metafont you
% should consider generating a cmr17 font at a magstep of two (about 25pt)
% or three (about 30pt), or even more, depending on the point size of your
% main text. Why not go the whole hog and design some really fancy
% capitals from scratch!
%
%%%%%%%%%%%%%%%%%%%%% BOX ONE %%%%%%%%%%%%%%%%%%%%%%%%%
%\typein[\dropinitialfont]{Font for Dropped initial:} %
%\font\largefont \dropinitialfont %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%%%%%%%%%%%%%%%%%%% BOX TWO %%%%%%%%%%%%%%%%%%%%%%%%%
%\font\largefont= cmr10 scaled \magstep5 %
%\font\largefont= cmbx10 scaled \magstep5 %
%\font\largefont= cmbx17 scaled \magstep3 %
\font\largefont= cmr17 scaled \magstep5 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\drop#1#2{{\noindent
\setbox0\hbox{\largefont #1}\setbox1\hbox{#2}\setbox2\hbox{(}%
\count0=\ht0\advance\count0 by\dp0\count1\baselineskip
\advance\count0 by-\ht1\advance\count0by\ht2
\dimen1=.5ex\advance\count0by\dimen1\divide\count0 by\count1
\advance\count0 by1\dimen0\wd0
\advance\dimen0 by.25em\dimen1=\ht0\advance\dimen1 by-\ht1
\global\hangindent\dimen0\global\hangafter-\count0
\hskip-\dimen0\setbox0\hbox to\dimen0{\raise-\dimen1\box0\hss}%
\dp0=0in\ht0=0in\box0}#2}
% end of DROP.STY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\versal}[1]{{\noindent
\setbox0\hbox{\largefont #1}%
\count0=\ht0 % height of versal
\count1=\baselineskip % baselineskip
\divide\count0 by \count1 % versal height/baselineskip
\dimen1 = \count0\baselineskip % distance to drop versal
\advance\count0 by 1\relax % no of indented lines
\dimen0=\wd0 % width of versal
\global\hangindent\dimen0 % set indentation distance
\global\hangafter-\count0 % set no of indented lines
\hskip-\dimen0\setbox0\hbox to\dimen0{\raise-\dimen1\box0\hss}%
\dp0=0in\ht0=0in\box0}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END VERSALS
\newlength{\gparskip} \setlength{\gparskip}{\parskip}
\typeout{Defining listeg, egsource, egresult, etc}
\newenvironment{listeg}{%
\list{}{%
\listparindent\z@
\itemindent\listparindent
\parsep\z@
\leftmargin\gparindent
\rightmargin\leftmargin}
\item\relax}{\endlist}
% \begin{egsource}{label}
\newcommand*{\egsourcecolor}{\definecolor{shadecolor}{gray}{0.9}}
\newenvironment{egsource}[1]{%
\parskip\z@ \topsep\z@%
\egsourcecolor
\shaded
\listeg\centerline{Source for example~\ref{#1}}%\label{#1}
\vspace{\onelineskip}
\small\setlength{\baselineskip}{\onelineskip}\nobreak\verbatim}%
{\endverbatim\endlisteg\endshaded}%\vskip\onelineskip\noindent}
\newcommand*{\Hline}{\mbox{}\hrulefill\mbox{}} % line across the page
\newcommand*{\shadecodecolor}{\definecolor{shadecolor}{gray}{0.93}}
\newenvironment{shadecode}{\@zeroseps
\shadecodecolor
\renewcommand{\verbatim@startline}{\verbatim@line{\hskip\gparindent}}
\shaded
\small\setlength{\baselineskip}{\onelineskip}\verbatim}%
{\endverbatim
\vspace{-\baselineskip}%
\endshaded
\noindent}
\newenvironment{typeseteg}{%
\list{}{%
\listparindent\gparindent
\itemindent\listparindent
\parsep\gparskip
\leftmargin\gparindent
\rightmargin\leftmargin}
\item\relax}{\endlist}
\newcommand*{\captegresult}{Typeset example}
\newfloat[chapter]{tegresult}{loe}{\captegresult}
\newcommand*{\listegresultsname}{List of typeset examples}
\newlistof{listofegresults}{loe}{\listegresultsname}
\newlistentry[chapter]{tegresult}{loe}{0}
\newcommand*{\egresultcolor}{\definecolor{shadecolor}{gray}{0.9}}
% \begin{egresult}[caption]{label}
\newenvironment{egresult}[2][]{%
\begin{tegresult}
\egresultcolor
\begin{shaded}
\caption{#1}\label{#2}
\vspace{-0.75\onelineskip}
\Hline
\begin{typeseteg}}%
{\end{typeseteg}%
\vspace{-0.5\onelineskip}
\Hline
\end{shaded}
\end{tegresult}}
\newenvironment{egresultplain}[2][]{%
\begin{tegresult}
\egresultcolor
\begin{shaded}
\caption{#1}\label{#2}
\begin{typeseteg}}%
{\end{typeseteg}%
\end{shaded}
\end{tegresult}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% More stuff for showing examples
\newcommand*{\egstart}[1][0pt]{\par\begingroup
\begin{adjustwidth}{-#1}{-#1}%
\centering
\begin{minipage}{0.45\linewidth}}
\newcommand*{\egmid}{%
\end{minipage}\hfill\begin{minipage}{0.45\linewidth}}
\newcommand*{\egend}{%
\end{minipage}\end{adjustwidth}\endgroup\par}
\newoutputstream{egout}
\openoutputfile{\jobname.ego}{egout}
\newcommand*{\shadefigurecolor}{\definecolor{shadecolor}{gray}{0.75}}
\newenvironment{shadefigure}{%
\begin{figure}
\centering
\shadefigurecolor
\begin{shaded}}%
{\end{shaded}\end{figure}}
\newcommand*{\shadetablecolor}{\definecolor{shadecolor}{gray}{0.75}}
\newenvironment{shadetable}{%
\begin{table}
\centering
\shadetablecolor
\begin{shaded}}%
{\end{shaded}\end{table}}
%%%%% Option, etc description list
\newenvironment{plainlist}%
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\plainlistlabel}}%
{\endlist}
\newcommand*{\plainlistlabel}[1]{\hspace\labelsep
\normalfont #1}
\DeclareRobustCommand{\ls}[1]{\texttt{\char`\\#1} (length)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% FROM TITLEPAGES.TEX
\newcommand*{\FSfont}[1]{%
\fontfamily{#1}\selectfont}
\newcommand*{\boxminipage}{%
\@ifnextchar [%]
\@ibxminipage
{\@iiibxminipage c\relax[s]}}
\def\@ibxminipage[#1]{%
\@ifnextchar [%]
{\@iibxminipage{#1}}%
{\@iiibxminipage{#1}\relax[s]}}
\def\@iibxminipage#1[#2]{%
\@ifnextchar [%]
{\@iiibxminipage{#1}{#2}}%
{\@iiibxminipage{#1}{#2}[#1]}}
\let\@bxminto\@empty
\def\@iiibxminipage#1#2[#3]#4{%
\ifx\relax#2\else
\setlength\@tempdimb{#2}%
\def\@bxminto{to\@tempdimb}%
\fi
\leavevmode
\@pboxswfalse
\if #1b\vbox
\else
\if #1t\vtop
\else
\ifmmode \vcenter
\else \@pboxswtrue $\vcenter
\fi
\fi
\fi
% \@bxminto
\bgroup% outermost vbox
\hsize #4
\hrule\@height\fboxrule
\hbox\bgroup% inner hbox
\vrule\@width\fboxrule \hskip\fboxsep
\vbox \@bxminto
\bgroup% innermost vbox
\vskip\fboxsep
\advance\hsize -2\fboxrule \advance\hsize -2\fboxsep
\textwidth\hsize \columnwidth\hsize
\@parboxrestore
\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
\let\@footnotetext\@mpfootnotetext
\let\@listdepth\@mplistdepth \@mplistdepth\z@
\@minipagerestore\@minipagetrue
\everypar{\global\@minipagefalse\everypar{}}}
\def\endboxminipage{%
\par\vskip-\lastskip
\ifvoid\@mpfootins\else
\vskip\skip\@mpfootins\footnoterule\unvbox\@mpfootins\fi
\vskip\fboxsep
\egroup% end innermost vbox
\hskip\fboxsep \vrule\@width\fboxrule
\egroup% end hbox
\hrule\@height\fboxrule
\egroup% end outermost vbox
\if@pboxsw $\fi}
\newlength{\tpheight}\setlength{\tpheight}{0.9\textheight}
\newlength{\txtheight}\setlength{\txtheight}{0.9\tpheight}
\newlength{\tpwidth}\setlength{\tpwidth}{0.9\textwidth}
\newlength{\txtwidth}\setlength{\txtwidth}{0.9\tpwidth}
\newlength{\tdrop} % (already defined)
\newenvironment{showtitle}{%
\begin{boxminipage}[c][\tpheight]{\tpwidth}
\centering\begin{vplace}\begin{minipage}[c][\txtheight]{\txtwidth}}%
{\end{minipage}\end{vplace}\end{boxminipage}}
\definecolor{Dark}{gray}{.2}
\definecolor{Medium}{gray}{.6}
\definecolor{Light}{gray}{.8}
\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}}
%%%%%%%%%%%%%%%%%%
%%%%%%%%% section head designs
\newcommand*{\defaultsecheads}{
\setsecheadstyle{\normalfont\Large\bfseries\raggedright}
\setsecindent{0pt}
\setbeforesecskip{-3.5ex plus -1ex minus -.2ex}
\setaftersecskip{2.3ex plus .2ex}
\setsubsecheadstyle{\normalfont\large\bfseries\raggedright}
\setsubsecindent{0pt}
\setbeforesubsecskip{-3.25ex plus -1ex minus -.2ex}
\setaftersubsecskip{1.5ex plus .2ex}
\setsubsubsecheadstyle{\normalfont\bfseries\raggedright}
\setsubsubsecindent{0pt}
\setbeforesubsubsecskip{-3.25ex plus -1ex minus -.2ex}
\setaftersubsubsecskip{1.5ex plus .2ex}
\setparaheadstyle{\normalfont\bfseries}
\setparaindent{0pt}
\setbeforeparaskip{3.25ex plus 1ex minus .2ex}
\setafterparaskip{-1em}
\setsubparaheadstyle{\normalfont\bfseries}
\setsubparaindent{0pt}
\setbeforesubparaskip{3.25ex plus 1ex minus .2ex}
\setaftersubparaskip{-1em}
}
%%%%%%%%%%%%%% Manual layout and design elements
\newcommand*{\memmansecheads}{
\setsecheadstyle{\normalfont\scshape\raggedright}
\setsecindent{0pt}
\setbeforesecskip{-1.333\onelineskip plus -0.5\onelineskip minus -0.5\onelineskip}
\setaftersecskip{.667\onelineskip plus 0.1\onelineskip}
%%% surround = 2 lines (1.333/.667)
%%% surround = 1 line (.667/.333)
\setsubsecheadstyle{\normalfont\sffamily\raggedright}
\setsubsecindent{0pt}
\setbeforesubsecskip{-.667\onelineskip plus -0.5\onelineskip minus -0.5\onelineskip}
\setaftersubsecskip{0.333\onelineskip plus 0.1\onelineskip}
%%% surround = 1 line (.667/.333)
\setsubsubsecheadstyle{\normalfont\itshape\raggedright}
\setsubsubsecindent{0pt}
\setbeforesubsubsecskip{-0.667\onelineskip plus -0.25\onelineskip minus -0.25\onelineskip}
\setaftersubsubsecskip{0.333\onelineskip plus 0.1\onelineskip}
%%% no surround
\setparaheadstyle{\normalfont\sffamily}
\setparaindent{0pt}
\setbeforeparaskip{1.0\onelineskip plus 0.5\onelineskip minus 0.25\onelineskip}
\setafterparaskip{-1em}
\setsubparaheadstyle{\normalfont\sffamily}
\setsubparaindent{0pt}
\setbeforesubparaskip{1.0\onelineskip plus 0.5\onelineskip minus 0.25\onelineskip}
\setaftersubparaskip{-1em}
}
%%%%%% hypermarks in index
% from email from Lars Madsen
\providecommand{\doidxbookmark}[1]{{\def\@tempa{Symbols}\def\@tempb{#1}%
\centering\bfseries \ifx\@tempa\@tempb @ \else #1\fi\vskip\onelineskip\par}}
\renewcommand{\doidxbookmark}[1]{{\def\@tempa{Symbols}\def\@tempb{#1}%
\centering\bfseries \ifx\@tempa\@tempb Analphabetics \else #1\fi\vskip\onelineskip\par}}
\providecommand{\hyperpage}[1]{#1}
%%% need more space for ToC page numbers
\setpnumwidth{2.55em}
\setrmarg{3.55em}
%%% need more space for ToC section numbers
\cftsetindents{section}{1.5em}{3.0em}
\cftsetindents{subsection}{4.5em}{3.9em}
\cftsetindents{subsubsection}{8.4em}{4.8em}
\cftsetindents{paragraph}{10.7em}{5.7em}
\cftsetindents{subparagraph}{12.7em}{6.7em}
%%% and for LoF and LoT numbers
\cftsetindents{figure}{0em}{3.0em}
\cftsetindents{table}{0em}{3.0em}
%%% set up the page layout
\settrimmedsize{11in}{210mm}{*}
\setlength{\trimtop}{0pt}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\settypeblocksize{7.75in}{33pc}{*}
\setulmargins{4cm}{*}{*}
\setlrmargins{1.25in}{*}{*}
\setmarginnotes{17pt}{51pt}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout
%%% empty pagestyle for Part pages
\aliaspagestyle{part}{empty}
\bibliographystyle{alpha}
%%% subfigures and tables
\newsubfloat{figure}
\newsubfloat{table}
\setcounter{lofdepth}{2}
%%% Set oldstylenums (which here are taken from CMR, not Palatino)
\DeclareRobustCommand{\Moldstyle}[1]{{\Large\oldstylenums{#1}}}
%%%%% Pavlic `fix' for index
\let\original@wrindexm@m\@wrindexm@m
\def\@wrindexm@m{\catcode`\ =10 \original@wrindexm@m}
\typeout{End memsty.sty}
\endinput
|