##// END OF EJS Templates
Made significant improvements to the Sphinx-Latex export...
Jonathan Frederic -
Show More
This diff has been collapsed as it changes many lines, (683 lines changed) Show them Hide them
@@ -0,0 +1,683 b''
1 %%% Copyright Ulf A. Lindgren
2 %%%
3 %%% Note Premission is granted to modify this file under
4 %%% the condition that it is saved using another
5 %%% file and package name.
6 %%%
7 %%% Revision 1.1 (1997)
8 %%%
9 %%% Jan. 8th Modified package name base date option
10 %%% Jan. 22th Modified FmN and FmTi for error in book.cls
11 %%% \MakeUppercase{#}->{\MakeUppercase#}
12 %%% Apr. 6th Modified Lenny option to prevent undesired
13 %%% skip of line.
14 %%% Nov. 8th Fixed \@chapapp for AMS
15 %%%
16 %%% Revision 1.2 (1998)
17 %%%
18 %%% Feb. 11th Fixed appendix problem related to Bjarne
19 %%% Aug. 11th Fixed problem related to 11pt and 12pt
20 %%% suggested by Tomas Lundberg. THANKS!
21 %%%
22 %%% Revision 1.3 (2004)
23 %%% Sep. 20th problem with frontmatter, mainmatter and
24 %%% backmatter, pointed out by Lapo Mori
25 %%%
26 %%% Revision 1.31 (2004)
27 %%% Sep. 21th problem with the Rejne definition streched text
28 %%% caused ugly gaps in the vrule aligned with the title
29 %%% text. Kindly pointed out to me by Hendri Adriaens
30 %%%
31 %%% Revision 1.32 (2005)
32 %%% Jun. 23th compatibility problem with the KOMA class 'scrbook.cls'
33 %%% a remedy is a redefinition of '\@schapter' in
34 %%% line with that used in KOMA. The problem was pointed
35 %%% out to me by Mikkel Holm Olsen
36 %%%
37 %%% Revision 1.33 (2005)
38 %%% Aug. 9th misspelled ``TWELV'' corrected, the error was pointed
39 %%% out to me by George Pearson
40 %%%
41 %%% Revision 1.34 (2007)
42 %%% Added an alternative to Lenny provided by Peter
43 %%% Osborne (2005-11-28)
44 %%% Corrected front, main and back matter, based on input
45 %%% from Bas van Gils (2006-04-24)
46 %%% Jul. 30th Added Bjornstrup option provided by Jean-Marc
47 %%% Francois (2007-01-05).
48 %%% Reverted to \MakeUppercase{#} see rev 1.1, solved
49 %%% problem with MakeUppercase and MakeLowercase pointed
50 %%% out by Marco Feuerstein (2007-06-06)
51
52
53 %%% Last modified Jul. 2007
54
55 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
56 \ProvidesPackage{fncychap}
57 [2007/07/30 v1.34
58 LaTeX package (Revised chapters)]
59
60 %%%% For conditional inclusion of color
61 \newif\ifusecolor
62 \usecolorfalse
63
64
65
66 %%%% DEFINITION OF Chapapp variables
67 \newcommand{\CNV}{\huge\bfseries}
68 \newcommand{\ChNameVar}[1]{\renewcommand{\CNV}{#1}}
69
70
71 %%%% DEFINITION OF TheChapter variables
72 \newcommand{\CNoV}{\huge\bfseries}
73 \newcommand{\ChNumVar}[1]{\renewcommand{\CNoV}{#1}}
74
75 \newif\ifUCN
76 \UCNfalse
77 \newif\ifLCN
78 \LCNfalse
79 \def\ChNameLowerCase{\LCNtrue\UCNfalse}
80 \def\ChNameUpperCase{\UCNtrue\LCNfalse}
81 \def\ChNameAsIs{\UCNfalse\LCNfalse}
82
83 %%%%% Fix for AMSBook 971008
84
85 \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}
86
87
88 %%%%% Fix for Bjarne and appendix 980211
89
90 \newif\ifinapp
91 \inappfalse
92 \renewcommand\appendix{\par
93 \setcounter{chapter}{0}%
94 \setcounter{section}{0}%
95 \inapptrue%
96 \renewcommand\@chapapp{\appendixname}%
97 \renewcommand\thechapter{\@Alph\c@chapter}}
98
99 %%%%% Fix for frontmatter, mainmatter, and backmatter 040920
100
101 \@ifundefined{@mainmatter}{\newif\if@mainmatter \@mainmattertrue}{}
102
103 %%%%%
104
105
106
107 \newcommand{\FmN}[1]{%
108 \ifUCN
109 {\MakeUppercase{#1}}\LCNfalse
110 \else
111 \ifLCN
112 {\MakeLowercase{#1}}\UCNfalse
113 \else #1
114 \fi
115 \fi}
116
117
118 %%%% DEFINITION OF Title variables
119 \newcommand{\CTV}{\Huge\bfseries}
120 \newcommand{\ChTitleVar}[1]{\renewcommand{\CTV}{#1}}
121
122 %%%% DEFINITION OF the basic rule width
123 \newlength{\RW}
124 \setlength{\RW}{1pt}
125 \newcommand{\ChRuleWidth}[1]{\setlength{\RW}{#1}}
126
127 \newif\ifUCT
128 \UCTfalse
129 \newif\ifLCT
130 \LCTfalse
131 \def\ChTitleLowerCase{\LCTtrue\UCTfalse}
132 \def\ChTitleUpperCase{\UCTtrue\LCTfalse}
133 \def\ChTitleAsIs{\UCTfalse\LCTfalse}
134 \newcommand{\FmTi}[1]{%
135 \ifUCT
136 {\MakeUppercase{#1}}\LCTfalse
137 \else
138 \ifLCT
139 {\MakeLowercase{#1}}\UCTfalse
140 \else {#1}
141 \fi
142 \fi}
143
144
145
146 \newlength{\mylen}
147 \newlength{\myhi}
148 \newlength{\px}
149 \newlength{\py}
150 \newlength{\pyy}
151 \newlength{\pxx}
152
153
154 \def\mghrulefill#1{\leavevmode\leaders\hrule\@height #1\hfill\kern\z@}
155
156 \newcommand{\DOCH}{%
157 \CNV\FmN{\@chapapp}\space \CNoV\thechapter
158 \par\nobreak
159 \vskip 20\p@
160 }
161 \newcommand{\DOTI}[1]{%
162 \CTV\FmTi{#1}\par\nobreak
163 \vskip 40\p@
164 }
165 \newcommand{\DOTIS}[1]{%
166 \CTV\FmTi{#1}\par\nobreak
167 \vskip 40\p@
168 }
169
170 %%%%%% SONNY DEF
171
172 \DeclareOption{Sonny}{%
173 \ChNameVar{\Large\sf}
174 \ChNumVar{\Huge}
175 \ChTitleVar{\Large\sf}
176 \ChRuleWidth{0.5pt}
177 \ChNameUpperCase
178 \renewcommand{\DOCH}{%
179 \raggedleft
180 \CNV\FmN{\@chapapp}\space \CNoV\thechapter
181 \par\nobreak
182 \vskip 40\p@}
183 \renewcommand{\DOTI}[1]{%
184 \CTV\raggedleft\mghrulefill{\RW}\par\nobreak
185 \vskip 5\p@
186 \CTV\FmTi{#1}\par\nobreak
187 \mghrulefill{\RW}\par\nobreak
188 \vskip 40\p@}
189 \renewcommand{\DOTIS}[1]{%
190 \CTV\raggedleft\mghrulefill{\RW}\par\nobreak
191 \vskip 5\p@
192 \CTV\FmTi{#1}\par\nobreak
193 \mghrulefill{\RW}\par\nobreak
194 \vskip 40\p@}
195 }
196
197 %%%%%% LENNY DEF
198
199 \DeclareOption{Lenny}{%
200
201 \ChNameVar{\fontsize{14}{16}\usefont{OT1}{phv}{m}{n}\selectfont}
202 \ChNumVar{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont}
203 \ChTitleVar{\Huge\bfseries\rm}
204 \ChRuleWidth{1pt}
205 \renewcommand{\DOCH}{%
206 \settowidth{\px}{\CNV\FmN{\@chapapp}}
207 \addtolength{\px}{2pt}
208 \settoheight{\py}{\CNV\FmN{\@chapapp}}
209 \addtolength{\py}{1pt}
210
211 \settowidth{\mylen}{\CNV\FmN{\@chapapp}\space\CNoV\thechapter}
212 \addtolength{\mylen}{1pt}
213 \settowidth{\pxx}{\CNoV\thechapter}
214 \addtolength{\pxx}{-1pt}
215
216 \settoheight{\pyy}{\CNoV\thechapter}
217 \addtolength{\pyy}{-2pt}
218 \setlength{\myhi}{\pyy}
219 \addtolength{\myhi}{-1\py}
220 \par
221 \parbox[b]{\textwidth}{%
222 \rule[\py]{\RW}{\myhi}%
223 \hskip -\RW%
224 \rule[\pyy]{\px}{\RW}%
225 \hskip -\px%
226 \raggedright%
227 \CNV\FmN{\@chapapp}\space\CNoV\thechapter%
228 \hskip1pt%
229 \mghrulefill{\RW}%
230 \rule{\RW}{\pyy}\par\nobreak%
231 \vskip -\baselineskip%
232 \vskip -\pyy%
233 \hskip \mylen%
234 \mghrulefill{\RW}\par\nobreak%
235 \vskip \pyy}%
236 \vskip 20\p@}
237
238
239 \renewcommand{\DOTI}[1]{%
240 \raggedright
241 \CTV\FmTi{#1}\par\nobreak
242 \vskip 40\p@}
243
244 \renewcommand{\DOTIS}[1]{%
245 \raggedright
246 \CTV\FmTi{#1}\par\nobreak
247 \vskip 40\p@}
248 }
249
250 %%%%%% Peter Osbornes' version of LENNY DEF
251
252 \DeclareOption{PetersLenny}{%
253
254 % five new lengths
255 \newlength{\bl} % bottom left : orig \space
256 \setlength{\bl}{6pt}
257 \newcommand{\BL}[1]{\setlength{\bl}{#1}}
258 \newlength{\br} % bottom right : orig 1pt
259 \setlength{\br}{1pt}
260 \newcommand{\BR}[1]{\setlength{\br}{#1}}
261 \newlength{\tl} % top left : orig 2pt
262 \setlength{\tl}{2pt}
263 \newcommand{\TL}[1]{\setlength{\tl}{#1}}
264 \newlength{\trr} % top right :orig 1pt
265 \setlength{\trr}{1pt}
266 \newcommand{\TR}[1]{\setlength{\trr}{#1}}
267 \newlength{\blrule} % top right :orig 1pt
268 \setlength{\trr}{0pt}
269 \newcommand{\BLrule}[1]{\setlength{\blrule}{#1}}
270
271
272 \ChNameVar{\fontsize{14}{16}\usefont{OT1}{phv}{m}{n}\selectfont}
273 \ChNumVar{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont}
274 \ChTitleVar{\Huge\bfseries\rm}
275 \ChRuleWidth{1pt}
276 \renewcommand{\DOCH}{%
277
278
279 %%%%%%% tweaks for 1--9 and A--Z
280 \ifcase\c@chapter\relax%
281 \or\BL{-3pt}\TL{-4pt}\BR{0pt}\TR{-6pt}%1
282 \or\BL{0pt}\TL{-4pt}\BR{2pt}\TR{-4pt}%2
283 \or\BL{0pt}\TL{-4pt}\BR{2pt}\TR{-4pt}%3
284 \or\BL{0pt}\TL{5pt}\BR{2pt}\TR{-4pt}%4
285 \or\BL{0pt}\TL{3pt}\BR{2pt}\TR{-4pt}%5
286 \or\BL{-1pt}\TL{0pt}\BR{2pt}\TR{-2pt}%6
287 \or\BL{0pt}\TL{-3pt}\BR{2pt}\TR{-2pt}%7
288 \or\BL{0pt}\TL{-3pt}\BR{2pt}\TR{-2pt}%8
289 \or\BL{0pt}\TL{-3pt}\BR{-4pt}\TR{-2pt}%9
290 \or\BL{-3pt}\TL{-3pt}\BR{2pt}\TR{-7pt}%10
291 \or\BL{-6pt}\TL{-6pt}\BR{0pt}\TR{-9pt}%11
292 \or\BL{-6pt}\TL{-6pt}\BR{2pt}\TR{-7pt}%12
293 \or\BL{-5pt}\TL{-5pt}\BR{0pt}\TR{-9pt}%13
294 \or\BL{-6pt}\TL{-6pt}\BR{0pt}\TR{-9pt}%14
295 \or\BL{-3pt}\TL{-3pt}\BR{3pt}\TR{-6pt}%15
296 \or\BL{-3pt}\TL{-3pt}\BR{3pt}\TR{-6pt}%16
297 \or\BL{-5pt}\TL{-3pt}\BR{-8pt}\TR{-6pt}%17
298 \or\BL{-5pt}\TL{-5pt}\BR{0pt}\TR{-9pt}%18
299 \or\BL{-3pt}\TL{-3pt}\BR{-6pt}\TR{-9pt}%19
300 \or\BL{0pt}\TL{0pt}\BR{0pt}\TR{-5pt}%20
301 \fi
302
303 \ifinapp\ifcase\c@chapter\relax%
304 \or\BL{0pt}\TL{14pt}\BR{5pt}\TR{-19pt}%A
305 \or\BL{0pt}\TL{-5pt}\BR{-3pt}\TR{-8pt}%B
306 \or\BL{-3pt}\TL{-2pt}\BR{1pt}\TR{-6pt}\BLrule{0pt}%C
307 \or\BL{0pt}\TL{-5pt}\BR{-3pt}\TR{-8pt}\BLrule{0pt}%D
308 \or\BL{0pt}\TL{-5pt}\BR{2pt}\TR{-3pt}%E
309 \or\BL{0pt}\TL{-5pt}\BR{-10pt}\TR{-1pt}%F
310 \or\BL{-3pt}\TL{0pt}\BR{0pt}\TR{-7pt}%G
311 \or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}%H
312 \or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}%I
313 \or\BL{2pt}\TL{0pt}\BR{-3pt}\TR{1pt}%J
314 \or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}%K
315 \or\BL{0pt}\TL{-5pt}\BR{2pt}\TR{-19pt}%L
316 \or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}%M
317 \or\BL{0pt}\TL{-5pt}\BR{-2pt}\TR{-1pt}%N
318 \or\BL{-3pt}\TL{-2pt}\BR{-3pt}\TR{-11pt}%O
319 \or\BL{0pt}\TL{-5pt}\BR{-9pt}\TR{-3pt}%P
320 \or\BL{-3pt}\TL{-2pt}\BR{-3pt}\TR{-11pt}%Q
321 \or\BL{0pt}\TL{-5pt}\BR{4pt}\TR{-8pt}%R
322 \or\BL{-2pt}\TL{-2pt}\BR{-2pt}\TR{-7pt}%S
323 \or\BL{-3pt}\TL{0pt}\BR{-5pt}\TR{4pt}\BLrule{8pt}%T
324 \or\BL{-7pt}\TL{-11pt}\BR{-5pt}\TR{-7pt}\BLrule{0pt}%U
325 \or\BL{-14pt}\TL{-5pt}\BR{-14pt}\TR{-1pt}\BLrule{14pt}%V
326 \or\BL{-10pt}\TL{-9pt}\BR{-13pt}\TR{-3pt}\BLrule{7pt}%W
327 \or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}\BLrule{0pt}%X
328 \or\BL{-6pt}\TL{-4pt}\BR{-7pt}\TR{1pt}\BLrule{7pt}%Y
329 \or\BL{0pt}\TL{-5pt}\BR{3pt}\TR{-1pt}\BLrule{0pt}%Z
330 \fi\fi
331 %%%%%%%
332 \settowidth{\px}{\CNV\FmN{\@chapapp}}
333 \addtolength{\px}{\tl} %MOD change 2pt to \tl
334 \settoheight{\py}{\CNV\FmN{\@chapapp}}
335 \addtolength{\py}{1pt}
336
337 \settowidth{\mylen}{\CNV\FmN{\@chapapp}\space\CNoV\thechapter}
338 \addtolength{\mylen}{\trr}% MOD change 1pt to \tr
339 \settowidth{\pxx}{\CNoV\thechapter}
340 \addtolength{\pxx}{-1pt}
341
342 \settoheight{\pyy}{\CNoV\thechapter}
343 \addtolength{\pyy}{-2pt}
344 \setlength{\myhi}{\pyy}
345 \addtolength{\myhi}{-1\py}
346 \par
347 \parbox[b]{\textwidth}{%
348 \rule[\py]{\RW}{\myhi}%
349 \hskip -\RW%
350 \rule[\pyy]{\px}{\RW}%
351 \hskip -\px%
352 \raggedright%
353 \CNV\FmN{\@chapapp}\rule{\blrule}{\RW}\hskip\bl\CNoV\thechapter%MOD
354 % \CNV\FmN{\@chapapp}\space\CNoV\thechapter %ORIGINAL
355 \hskip\br% %MOD 1pt to \br
356 \mghrulefill{\RW}%
357 \rule{\RW}{\pyy}\par\nobreak%
358 \vskip -\baselineskip%
359 \vskip -\pyy%
360 \hskip \mylen%
361 \mghrulefill{\RW}\par\nobreak%
362 \vskip \pyy}%
363 \vskip 20\p@}
364
365
366 \renewcommand{\DOTI}[1]{%
367 \raggedright
368 \CTV\FmTi{#1}\par\nobreak
369 \vskip 40\p@}
370
371 \renewcommand{\DOTIS}[1]{%
372 \raggedright
373 \CTV\FmTi{#1}\par\nobreak
374 \vskip 40\p@}
375 }
376
377
378 %
379
380
381 %%%%%% BJORNSTRUP DEF
382
383 \DeclareOption{Bjornstrup}{%
384 \usecolortrue
385 % pzc (Zapf Chancelery) is nice. ppl (Palatino) is cool too.
386 \ChNumVar{\fontsize{76}{80}\usefont{OT1}{pzc}{m}{n}\selectfont}
387 \ChTitleVar{\raggedleft\Large\sffamily\bfseries}
388
389 \setlength{\myhi}{10pt} % Space between grey box border and text
390 \setlength{\mylen}{\textwidth}
391 \addtolength{\mylen}{-2\myhi}
392 \renewcommand{\DOCH}{%
393 \settowidth{\py}{\CNoV\thechapter}
394 \addtolength{\py}{-10pt} % Amount of space by which the
395 % % number is shifted right
396 \fboxsep=0pt%
397 \colorbox[gray]{.85}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}%
398 \kern-\py\raise20pt%
399 \hbox{\color[gray]{.5}\CNoV\thechapter}\\%
400 }
401
402 \renewcommand{\DOTI}[1]{%
403 \nointerlineskip\raggedright%
404 \fboxsep=\myhi%
405 \vskip-1ex%
406 \colorbox[gray]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak%
407 \vskip 40\p@%
408 }
409
410 \renewcommand{\DOTIS}[1]{%
411 \fboxsep=0pt
412 \colorbox[gray]{.85}{\rule{0pt}{40pt}\parbox[b]{\textwidth}{\hfill}}\\%
413 \nointerlineskip\raggedright%
414 \fboxsep=\myhi%
415 \colorbox[gray]{.85}{\parbox[t]{\mylen}{\CTV\FmTi{#1}}}\par\nobreak%
416 \vskip 40\p@%
417 }
418 }
419
420
421 %%%%%%% GLENN DEF
422
423
424 \DeclareOption{Glenn}{%
425 \ChNameVar{\bfseries\Large\sf}
426 \ChNumVar{\Huge}
427 \ChTitleVar{\bfseries\Large\rm}
428 \ChRuleWidth{1pt}
429 \ChNameUpperCase
430 \ChTitleUpperCase
431 \renewcommand{\DOCH}{%
432 \settoheight{\myhi}{\CTV\FmTi{Test}}
433 \setlength{\py}{\baselineskip}
434 \addtolength{\py}{\RW}
435 \addtolength{\py}{\myhi}
436 \setlength{\pyy}{\py}
437 \addtolength{\pyy}{-1\RW}
438
439 \raggedright
440 \CNV\FmN{\@chapapp}\space\CNoV\thechapter
441 \hskip 3pt\mghrulefill{\RW}\rule[-1\pyy]{2\RW}{\py}\par\nobreak}
442
443 \renewcommand{\DOTI}[1]{%
444 \addtolength{\pyy}{-4pt}
445 \settoheight{\myhi}{\CTV\FmTi{#1}}
446 \addtolength{\myhi}{\py}
447 \addtolength{\myhi}{-1\RW}
448 \vskip -1\pyy
449 \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 2pt
450 \raggedleft\CTV\FmTi{#1}\par\nobreak
451 \vskip 80\p@}
452
453 \newlength{\backskip}
454 \renewcommand{\DOTIS}[1]{%
455 % \setlength{\py}{10pt}
456 % \setlength{\pyy}{\py}
457 % \addtolength{\pyy}{\RW}
458 % \setlength{\myhi}{\baselineskip}
459 % \addtolength{\myhi}{\pyy}
460 % \mghrulefill{\RW}\rule[-1\py]{2\RW}{\pyy}\par\nobreak
461 % \addtolength{}{}
462 %\vskip -1\baselineskip
463 % \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 2pt
464 % \raggedleft\CTV\FmTi{#1}\par\nobreak
465 % \vskip 60\p@}
466 %% Fix suggested by Tomas Lundberg
467 \setlength{\py}{25pt} % eller vad man vill
468 \setlength{\pyy}{\py}
469 \setlength{\backskip}{\py}
470 \addtolength{\backskip}{2pt}
471 \addtolength{\pyy}{\RW}
472 \setlength{\myhi}{\baselineskip}
473 \addtolength{\myhi}{\pyy}
474 \mghrulefill{\RW}\rule[-1\py]{2\RW}{\pyy}\par\nobreak
475 \vskip -1\backskip
476 \rule{2\RW}{\myhi}\mghrulefill{\RW}\hskip 3pt %
477 \raggedleft\CTV\FmTi{#1}\par\nobreak
478 \vskip 40\p@}
479 }
480
481 %%%%%%% CONNY DEF
482
483 \DeclareOption{Conny}{%
484 \ChNameUpperCase
485 \ChTitleUpperCase
486 \ChNameVar{\centering\Huge\rm\bfseries}
487 \ChNumVar{\Huge}
488 \ChTitleVar{\centering\Huge\rm}
489 \ChRuleWidth{2pt}
490
491 \renewcommand{\DOCH}{%
492 \mghrulefill{3\RW}\par\nobreak
493 \vskip -0.5\baselineskip
494 \mghrulefill{\RW}\par\nobreak
495 \CNV\FmN{\@chapapp}\space \CNoV\thechapter
496 \par\nobreak
497 \vskip -0.5\baselineskip
498 }
499 \renewcommand{\DOTI}[1]{%
500 \mghrulefill{\RW}\par\nobreak
501 \CTV\FmTi{#1}\par\nobreak
502 \vskip 60\p@
503 }
504 \renewcommand{\DOTIS}[1]{%
505 \mghrulefill{\RW}\par\nobreak
506 \CTV\FmTi{#1}\par\nobreak
507 \vskip 60\p@
508 }
509 }
510
511 %%%%%%% REJNE DEF
512
513 \DeclareOption{Rejne}{%
514
515 \ChNameUpperCase
516 \ChTitleUpperCase
517 \ChNameVar{\centering\Large\rm}
518 \ChNumVar{\Huge}
519 \ChTitleVar{\centering\Huge\rm}
520 \ChRuleWidth{1pt}
521 \renewcommand{\DOCH}{%
522 \settoheight{\py}{\CNoV\thechapter}
523 \parskip=0pt plus 1pt % Set parskip to default, just in case v1.31
524 \addtolength{\py}{-1pt}
525 \CNV\FmN{\@chapapp}\par\nobreak
526 \vskip 20\p@
527 \setlength{\myhi}{2\baselineskip}
528 \setlength{\px}{\myhi}
529 \addtolength{\px}{-1\RW}
530 \rule[-1\px]{\RW}{\myhi}\mghrulefill{\RW}\hskip
531 10pt\raisebox{-0.5\py}{\CNoV\thechapter}\hskip 10pt\mghrulefill{\RW}\rule[-1\px]{\RW}{\myhi}\par\nobreak
532 \vskip -3\p@% Added -2pt vskip to correct for streched text v1.31
533 }
534 \renewcommand{\DOTI}[1]{%
535 \setlength{\mylen}{\textwidth}
536 \parskip=0pt plus 1pt % Set parskip to default, just in case v1.31
537 \addtolength{\mylen}{-2\RW}
538 {\vrule width\RW}\parbox{\mylen}{\CTV\FmTi{#1}}{\vrule width\RW}\par\nobreak%
539 \vskip -3pt\rule{\RW}{2\baselineskip}\mghrulefill{\RW}\rule{\RW}{2\baselineskip}%
540 \vskip 60\p@% Added -2pt in vskip to correct for streched text v1.31
541 }
542 \renewcommand{\DOTIS}[1]{%
543 \setlength{\py}{\fboxrule}
544 \setlength{\fboxrule}{\RW}
545 \setlength{\mylen}{\textwidth}
546 \addtolength{\mylen}{-2\RW}
547 \fbox{\parbox{\mylen}{\vskip 2\baselineskip\CTV\FmTi{#1}\par\nobreak\vskip \baselineskip}}
548 \setlength{\fboxrule}{\py}
549 \vskip 60\p@
550 }
551 }
552
553
554 %%%%%%% BJARNE DEF
555
556 \DeclareOption{Bjarne}{%
557 \ChNameUpperCase
558 \ChTitleUpperCase
559 \ChNameVar{\raggedleft\normalsize\rm}
560 \ChNumVar{\raggedleft \bfseries\Large}
561 \ChTitleVar{\raggedleft \Large\rm}
562 \ChRuleWidth{1pt}
563
564
565 %% Note thechapter -> c@chapter fix appendix bug
566 %% Fixed misspelled 12
567
568 \newcounter{AlphaCnt}
569 \newcounter{AlphaDecCnt}
570 \newcommand{\AlphaNo}{%
571 \ifcase\number\theAlphaCnt
572 \ifnum\c@chapter=0
573 ZERO\else{}\fi
574 \or ONE\or TWO\or THREE\or FOUR\or FIVE
575 \or SIX\or SEVEN\or EIGHT\or NINE\or TEN
576 \or ELEVEN\or TWELVE\or THIRTEEN\or FOURTEEN\or FIFTEEN
577 \or SIXTEEN\or SEVENTEEN\or EIGHTEEN\or NINETEEN\fi
578 }
579
580 \newcommand{\AlphaDecNo}{%
581 \setcounter{AlphaDecCnt}{0}
582 \@whilenum\number\theAlphaCnt>0\do
583 {\addtocounter{AlphaCnt}{-10}
584 \addtocounter{AlphaDecCnt}{1}}
585 \ifnum\number\theAlphaCnt=0
586 \else
587 \addtocounter{AlphaDecCnt}{-1}
588 \addtocounter{AlphaCnt}{10}
589 \fi
590
591
592 \ifcase\number\theAlphaDecCnt\or TEN\or TWENTY\or THIRTY\or
593 FORTY\or FIFTY\or SIXTY\or SEVENTY\or EIGHTY\or NINETY\fi
594 }
595 \newcommand{\TheAlphaChapter}{%
596
597 \ifinapp
598 \thechapter
599 \else
600 \setcounter{AlphaCnt}{\c@chapter}
601 \ifnum\c@chapter<20
602 \AlphaNo
603 \else
604 \AlphaDecNo\AlphaNo
605 \fi
606 \fi
607 }
608 \renewcommand{\DOCH}{%
609 \mghrulefill{\RW}\par\nobreak
610 \CNV\FmN{\@chapapp}\par\nobreak
611 \CNoV\TheAlphaChapter\par\nobreak
612 \vskip -1\baselineskip\vskip 5pt\mghrulefill{\RW}\par\nobreak
613 \vskip 20\p@
614 }
615 \renewcommand{\DOTI}[1]{%
616 \CTV\FmTi{#1}\par\nobreak
617 \vskip 40\p@
618 }
619 \renewcommand{\DOTIS}[1]{%
620 \CTV\FmTi{#1}\par\nobreak
621 \vskip 40\p@
622 }
623 }
624
625 \DeclareOption*{%
626 \PackageWarning{fancychapter}{unknown style option}
627 }
628
629 \ProcessOptions* \relax
630
631 \ifusecolor
632 \RequirePackage{color}
633 \fi
634 \def\@makechapterhead#1{%
635 \vspace*{50\p@}%
636 {\parindent \z@ \raggedright \normalfont
637 \ifnum \c@secnumdepth >\m@ne
638 \if@mainmatter%%%%% Fix for frontmatter, mainmatter, and backmatter 040920
639 \DOCH
640 \fi
641 \fi
642 \interlinepenalty\@M
643 \if@mainmatter%%%%% Fix for frontmatter, mainmatter, and backmatter 060424
644 \DOTI{#1}%
645 \else%
646 \DOTIS{#1}%
647 \fi
648 }}
649
650
651 %%% Begin: To avoid problem with scrbook.cls (fncychap version 1.32)
652
653 %%OUT:
654 %\def\@schapter#1{\if@twocolumn
655 % \@topnewpage[\@makeschapterhead{#1}]%
656 % \else
657 % \@makeschapterhead{#1}%
658 % \@afterheading
659 % \fi}
660
661 %%IN:
662 \def\@schapter#1{%
663 \if@twocolumn%
664 \@makeschapterhead{#1}%
665 \else%
666 \@makeschapterhead{#1}%
667 \@afterheading%
668 \fi}
669
670 %%% End: To avoid problem with scrbook.cls (fncychap version 1.32)
671
672 \def\@makeschapterhead#1{%
673 \vspace*{50\p@}%
674 {\parindent \z@ \raggedright
675 \normalfont
676 \interlinepenalty\@M
677 \DOTIS{#1}
678 \vskip 40\p@
679 }}
680
681 \endinput
682
683
@@ -0,0 +1,92 b''
1 %
2 % sphinxhowto.cls for Sphinx (http://sphinx-doc.org/)
3 %
4
5 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
6 \ProvidesClass{sphinxhowto}[2009/06/02 Document class (Sphinx HOWTO)]
7
8 % 'oneside' option overriding the 'twoside' default
9 \newif\if@oneside
10 \DeclareOption{oneside}{\@onesidetrue}
11 % Pass remaining document options to the parent class.
12 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
13 \ProcessOptions\relax
14
15 % Default to two-side document
16 \if@oneside
17 % nothing to do (oneside is the default)
18 \else
19 \PassOptionsToClass{twoside}{\sphinxdocclass}
20 \fi
21
22 \LoadClass{\sphinxdocclass}
23
24 % Set some sane defaults for section numbering depth and TOC depth. You can
25 % reset these counters in your preamble.
26 %
27 \setcounter{secnumdepth}{2}
28
29 % Change the title page to look a bit better, and fit in with the fncychap
30 % ``Bjarne'' style a bit better.
31 %
32 \renewcommand{\maketitle}{
33 \rule{\textwidth}{1pt}
34 \ifsphinxpdfoutput
35 \begingroup
36 % These \defs are required to deal with multi-line authors; it
37 % changes \\ to ', ' (comma-space), making it pass muster for
38 % generating document info in the PDF file.
39 \def\\{, }
40 \def\and{and }
41 \pdfinfo{
42 /Author (\@author)
43 /Title (\@title)
44 }
45 \endgroup
46 \fi
47 \begin{flushright}
48 \sphinxlogo%
49 {\rm\Huge\py@HeaderFamily \@title} \par
50 {\em\large\py@HeaderFamily \py@release\releaseinfo} \par
51 \vspace{25pt}
52 {\Large\py@HeaderFamily
53 \begin{tabular}[t]{c}
54 \@author
55 \end{tabular}} \par
56 \vspace{25pt}
57 \@date \par
58 \py@authoraddress \par
59 \end{flushright}
60 \@thanks
61 \setcounter{footnote}{0}
62 \let\thanks\relax\let\maketitle\relax
63 %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
64 }
65
66 \let\py@OldTableofcontents=\tableofcontents
67 \renewcommand{\tableofcontents}{
68 \begingroup
69 \parskip = 0mm
70 \py@OldTableofcontents
71 \endgroup
72 \rule{\textwidth}{1pt}
73 \vspace{12pt}
74 }
75
76 \@ifundefined{fancyhf}{
77 \pagestyle{plain}}{
78 \pagestyle{normal}} % start this way; change for
79 \pagenumbering{arabic} % ToC & chapters
80
81 \thispagestyle{empty}
82
83 % Fix the bibliography environment to add an entry to the Table of
84 % Contents.
85 % For an article document class this environment is a section,
86 % so no page break before it.
87 \let\py@OldThebibliography=\thebibliography
88 \renewcommand{\thebibliography}[1]{
89 \phantomsection
90 \py@OldThebibliography{1}
91 \addcontentsline{toc}{section}{\bibname}
92 }
@@ -0,0 +1,133 b''
1 %
2 % sphinxmanual.cls for Sphinx (http://sphinx-doc.org/)
3 %
4
5 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
6 \ProvidesClass{sphinxmanual}[2009/06/02 Document class (Sphinx manual)]
7
8 % chapters starting at odd pages (overridden by 'openany' document option)
9 \PassOptionsToClass{openright}{\sphinxdocclass}
10
11 % 'oneside' option overriding the 'twoside' default
12 \newif\if@oneside
13 \DeclareOption{oneside}{\@onesidetrue}
14 % Pass remaining document options to the parent class.
15 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}}
16 \ProcessOptions\relax
17
18 % Defaults two-side document
19 \if@oneside
20 % nothing to do (oneside is the default)
21 \else
22 \PassOptionsToClass{twoside}{\sphinxdocclass}
23 \fi
24
25 \LoadClass{\sphinxdocclass}
26
27 % Set some sane defaults for section numbering depth and TOC depth. You can
28 % reset these counters in your preamble.
29 %
30 \setcounter{secnumdepth}{2}
31 \setcounter{tocdepth}{1}
32
33 % Change the title page to look a bit better, and fit in with the fncychap
34 % ``Bjarne'' style a bit better.
35 %
36 \renewcommand{\maketitle}{%
37 \begin{titlepage}%
38 \let\footnotesize\small
39 \let\footnoterule\relax
40 \rule{\textwidth}{1pt}%
41 \ifsphinxpdfoutput
42 \begingroup
43 % These \defs are required to deal with multi-line authors; it
44 % changes \\ to ', ' (comma-space), making it pass muster for
45 % generating document info in the PDF file.
46 \def\\{, }
47 \def\and{and }
48 \pdfinfo{
49 /Author (\@author)
50 /Title (\@title)
51 }
52 \endgroup
53 \fi
54 \begin{flushright}%
55 \sphinxlogo%
56 {\rm\Huge\py@HeaderFamily \@title \par}%
57 {\em\LARGE\py@HeaderFamily \py@release\releaseinfo \par}
58 \vfill
59 {\LARGE\py@HeaderFamily
60 \begin{tabular}[t]{c}
61 \@author
62 \end{tabular}
63 \par}
64 \vfill\vfill
65 {\large
66 \@date \par
67 \vfill
68 \py@authoraddress \par
69 }%
70 \end{flushright}%\par
71 \@thanks
72 \end{titlepage}%
73 \cleardoublepage%
74 \setcounter{footnote}{0}%
75 \let\thanks\relax\let\maketitle\relax
76 %\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
77 }
78
79
80 % Catch the end of the {abstract} environment, but here make sure the abstract
81 % is followed by a blank page if the 'openright' option is used.
82 %
83 %\let\py@OldEndAbstract=\endabstract
84 %\renewcommand{\endabstract}{
85 % \if@openright
86 % \ifodd\value{page}
87 % \typeout{Adding blank page after the abstract.}
88 % \vfil\pagebreak
89 % \fi
90 % \fi
91 % \py@OldEndAbstract
92 %}
93
94 % This wraps the \tableofcontents macro with all the magic to get the spacing
95 % right and have the right number of pages if the 'openright' option has been
96 % used. This eliminates a fair amount of crud in the individual document files.
97 %
98 \let\py@OldTableofcontents=\tableofcontents
99 \renewcommand{\tableofcontents}{%
100 \setcounter{page}{1}%
101 \pagebreak%
102 \pagestyle{plain}%
103 {%
104 \parskip = 0mm%
105 \py@OldTableofcontents%
106 \if@openright%
107 \ifodd\value{page}%
108 \typeout{Adding blank page after the table of contents.}%
109 \pagebreak\hspace{0pt}%
110 \fi%
111 \fi%
112 \cleardoublepage%
113 }%
114 \pagenumbering{arabic}%
115 \@ifundefined{fancyhf}{}{\pagestyle{normal}}%
116 }
117
118 % This is needed to get the width of the section # area wide enough in the
119 % library reference. Doing it here keeps it the same for all the manuals.
120 %
121 %\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.6em}}
122 %\renewcommand*\l@subsection{\@dottedtocline{2}{4.1em}{3.5em}}
123
124 % Fix the bibliography environment to add an entry to the Table of
125 % Contents.
126 % For a report document class this environment is a chapter.
127 \let\py@OldThebibliography=\thebibliography
128 \renewcommand{\thebibliography}[1]{
129 \cleardoublepage
130 \phantomsection
131 \py@OldThebibliography{1}
132 \addcontentsline{toc}{chapter}{\bibname}
133 }
@@ -0,0 +1,452 b''
1 %%
2 %% This is file `tabulary.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% tabulary.dtx (with options: `package')
8 %% DRAFT VERSION
9 %%
10 %% File `tabulary.dtx'.
11 %% Copyright (C) 1995 1996 2003 David Carlisle
12 %% This file may be distributed under the terms of the LPPL.
13 %% See 00readme.txt for details.
14 %%
15 \NeedsTeXFormat{LaTeX2e}
16 \ProvidesPackage{tabulary}
17 [2007/10/02 v0.9 tabulary package (DPC)]
18 \RequirePackage{array}
19 \catcode`\Z=14
20 \DeclareOption{debugshow}{\catcode`\Z=9\relax}
21 \ProcessOptions
22 \def\arraybackslash{\let\\=\@arraycr}
23 \def\@finalstrut#1{%
24 \unskip\ifhmode\nobreak\fi\vrule\@width\z@\@height\z@\@depth\dp#1}
25 \newcount\TY@count
26 \def\tabulary{%
27 \let\TY@final\tabular
28 \let\endTY@final\endtabular
29 \TY@tabular}
30 \def\TY@tabular#1{%
31 \edef\TY@{\@currenvir}%
32 {\ifnum0=`}\fi
33 \@ovxx\TY@linewidth
34 \@ovyy\TY@tablewidth
35 \count@\z@
36 \@tempswatrue
37 \@whilesw\if@tempswa\fi{%
38 \advance\count@\@ne
39 \expandafter\ifx\csname TY@F\the\count@\endcsname\relax
40 \@tempswafalse
41 \else
42 \expandafter\let\csname TY@SF\the\count@\expandafter\endcsname
43 \csname TY@F\the\count@\endcsname
44 \global\expandafter\let\csname TY@F\the\count@\endcsname\relax
45 \expandafter\let\csname TY@S\the\count@\expandafter\endcsname
46 \csname TY@\the\count@\endcsname
47 \fi}%
48 \global\TY@count\@ne
49 \TY@width\xdef{0pt}%
50 \global\TY@tablewidth\z@
51 \global\TY@linewidth#1\relax
52 Z\message{^^J^^JTable^^J%
53 Z Target Width: \the\TY@linewidth^^J%
54 Z \string\tabcolsep: \the\tabcolsep\space
55 Z \string\arrayrulewidth: \the\arrayrulewidth\space
56 Z \string\doublerulesep: \the\doublerulesep^^J%
57 Z \string\tymin: \the\tymin\space
58 Z \string\tymax: \the\tymax^^J}%
59 \let\@classz\TY@classz
60 \let\verb\TX@verb
61 \toks@{}\TY@get@body}
62 \let\TY@@mkpream\@mkpream
63 \def\TY@mkpream{%
64 \def\@addamp{%
65 \if@firstamp \@firstampfalse \else
66 \global\advance\TY@count\@ne
67 \edef\@preamble{\@preamble &}\fi
68 \TY@width\xdef{0pt}}%
69 \def\@acol{%
70 \TY@subwidth\col@sep
71 \@addtopreamble{\hskip\col@sep}}%
72 \let\@arrayrule\TY@arrayrule
73 \let\@classvi\TY@classvi
74 \def\@classv{\save@decl
75 \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@
76 \sbox\z@{\d@llarbegin\@nextchar\d@llarend}%
77 \TY@subwidth{\wd\z@}%
78 \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}%
79 \prepnext@tok}%
80 \global\let\@mkpream\TY@@mkpream
81 \TY@@mkpream}
82 \def\TY@arrayrule{%
83 \TY@subwidth\arrayrulewidth
84 \@addtopreamble \vline}
85 \def\TY@classvi{\ifcase \@lastchclass
86 \@acol \or
87 \TY@subwidth\doublerulesep
88 \@addtopreamble{\hskip \doublerulesep}\or
89 \@acol \or
90 \@classvii
91 \fi}
92 \def\TY@tab{%
93 \setbox\z@\hbox\bgroup
94 \let\[$\let\]$%
95 \let\equation$\let\endequation$%
96 \col@sep\tabcolsep
97 \let\d@llarbegin\begingroup\let\d@llarend\endgroup
98 \let\@mkpream\TY@mkpream
99 \def\multicolumn##1##2##3{\multispan##1\relax}%
100 \CT@start\TY@tabarray}
101 \def\TY@tabarray{\@ifnextchar[{\TY@array}{\@array[t]}}
102 \def\TY@array[#1]{\@array[t]}
103 \def\TY@width#1{%
104 \expandafter#1\csname TY@\the\TY@count\endcsname}
105 \def\TY@subwidth#1{%
106 \TY@width\dimen@
107 \advance\dimen@-#1\relax
108 \TY@width\xdef{\the\dimen@}%
109 \global\advance\TY@linewidth-#1\relax}
110 \def\endtabulary{%
111 \gdef\@halignto{}%
112 \let\TY@footnote\footnote%
113 \def\footnote{}% prevent footnotes from doing anything
114 \expandafter\TY@tab\the\toks@
115 \crcr\omit
116 {\xdef\TY@save@row{}%
117 \loop
118 \advance\TY@count\m@ne
119 \ifnum\TY@count>\z@
120 \xdef\TY@save@row{\TY@save@row&\omit}%
121 \repeat}\TY@save@row
122 \endarray\global\setbox1=\lastbox\setbox0=\vbox{\unvbox1
123 \unskip\global\setbox1=\lastbox}\egroup
124 \dimen@\TY@linewidth
125 \divide\dimen@\TY@count
126 \ifdim\dimen@<\tymin
127 \TY@warn{tymin too large (\the\tymin), resetting to \the\dimen@}%
128 \tymin\dimen@
129 \fi
130 \setbox\tw@=\hbox{\unhbox\@ne
131 \loop
132 \@tempdima=\lastskip
133 \ifdim\@tempdima>\z@
134 Z \message{ecs=\the\@tempdima^^J}%
135 \global\advance\TY@linewidth-\@tempdima
136 \fi
137 \unskip
138 \setbox\tw@=\lastbox
139 \ifhbox\tw@
140 Z \message{Col \the\TY@count: Initial=\the\wd\tw@\space}%
141 \ifdim\wd\tw@>\tymax
142 \wd\tw@\tymax
143 Z \message{> max\space}%
144 Z \else
145 Z \message{ \@spaces\space}%
146 \fi
147 \TY@width\dimen@
148 Z \message{\the\dimen@\space}%
149 \advance\dimen@\wd\tw@
150 Z \message{Final=\the\dimen@\space}%
151 \TY@width\xdef{\the\dimen@}%
152 \ifdim\dimen@<\tymin
153 Z \message{< tymin}%
154 \global\advance\TY@linewidth-\dimen@
155 \expandafter\xdef\csname TY@F\the\TY@count\endcsname
156 {\the\dimen@}%
157 \else
158 \expandafter\ifx\csname TY@F\the\TY@count\endcsname\z@
159 Z \message{***}%
160 \global\advance\TY@linewidth-\dimen@
161 \expandafter\xdef\csname TY@F\the\TY@count\endcsname
162 {\the\dimen@}%
163 \else
164 Z \message{> tymin}%
165 \global\advance\TY@tablewidth\dimen@
166 \global\expandafter\let\csname TY@F\the\TY@count\endcsname
167 \maxdimen
168 \fi\fi
169 \advance\TY@count\m@ne
170 \repeat}%
171 \TY@checkmin
172 \TY@checkmin
173 \TY@checkmin
174 \TY@checkmin
175 \TY@count\z@
176 \let\TY@box\TY@box@v
177 \let\footnote\TY@footnote % restore footnotes
178 {\expandafter\TY@final\the\toks@\endTY@final}%
179 \count@\z@
180 \@tempswatrue
181 \@whilesw\if@tempswa\fi{%
182 \advance\count@\@ne
183 \expandafter\ifx\csname TY@SF\the\count@\endcsname\relax
184 \@tempswafalse
185 \else
186 \global\expandafter\let\csname TY@F\the\count@\expandafter\endcsname
187 \csname TY@SF\the\count@\endcsname
188 \global\expandafter\let\csname TY@\the\count@\expandafter\endcsname
189 \csname TY@S\the\count@\endcsname
190 \fi}%
191 \TY@linewidth\@ovxx
192 \TY@tablewidth\@ovyy
193 \ifnum0=`{\fi}}
194 \def\TY@checkmin{%
195 \let\TY@checkmin\relax
196 \ifdim\TY@tablewidth>\z@
197 \Gscale@div\TY@ratio\TY@linewidth\TY@tablewidth
198 \ifdim\TY@tablewidth <\linewidth
199 \def\TY@ratio{1}%
200 \fi
201 \else
202 \TY@warn{No suitable columns!}%
203 \def\TY@ratio{1}%
204 \fi
205 \count@\z@
206 Z \message{^^JLine Width: \the\TY@linewidth,
207 Z Natural Width: \the\TY@tablewidth,
208 Z Ratio: \TY@ratio^^J}%
209 \@tempdima\z@
210 \loop
211 \ifnum\count@<\TY@count
212 \advance\count@\@ne
213 \ifdim\csname TY@F\the\count@\endcsname>\tymin
214 \dimen@\csname TY@\the\count@\endcsname
215 \dimen@\TY@ratio\dimen@
216 \ifdim\dimen@<\tymin
217 Z \message{Column \the\count@\space ->}%
218 \global\expandafter\let\csname TY@F\the\count@\endcsname\tymin
219 \global\advance\TY@linewidth-\tymin
220 \global\advance\TY@tablewidth-\csname TY@\the\count@\endcsname
221 \let\TY@checkmin\TY@@checkmin
222 \else
223 \expandafter\xdef\csname TY@F\the\count@\endcsname{\the\dimen@}%
224 \advance\@tempdima\csname TY@F\the\count@\endcsname
225 \fi
226 \fi
227 Z \dimen@\csname TY@F\the\count@\endcsname\message{\the\dimen@, }%
228 \repeat
229 Z \message{^^JTotal:\the\@tempdima^^J}%
230 }
231 \let\TY@@checkmin\TY@checkmin
232 \newdimen\TY@linewidth
233 \def\tyformat{\everypar{{\nobreak\hskip\z@skip}}}
234 \newdimen\tymin
235 \tymin=10pt
236 \newdimen\tymax
237 \tymax=2\textwidth
238 \def\@testpach{\@chclass
239 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
240 \ifnum \@lastchclass=7 5 \else
241 \ifnum \@lastchclass=8 \tw@ \else
242 \ifnum \@lastchclass=9 \thr@@
243 \else \z@
244 \ifnum \@lastchclass = 10 \else
245 \edef\@nextchar{\expandafter\string\@nextchar}%
246 \@chnum
247 \if \@nextchar c\z@ \else
248 \if \@nextchar l\@ne \else
249 \if \@nextchar r\tw@ \else
250 \if \@nextchar C7 \else
251 \if \@nextchar L8 \else
252 \if \@nextchar R9 \else
253 \if \@nextchar J10 \else
254 \z@ \@chclass
255 \if\@nextchar |\@ne \else
256 \if \@nextchar !6 \else
257 \if \@nextchar @7 \else
258 \if \@nextchar <8 \else
259 \if \@nextchar >9 \else
260 10
261 \@chnum
262 \if \@nextchar m\thr@@\else
263 \if \@nextchar p4 \else
264 \if \@nextchar b5 \else
265 \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi\fi \fi \fi\fi \fi
266 \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi}
267 \def\TY@classz{%
268 \@classx
269 \@tempcnta\count@
270 \ifx\TY@box\TY@box@v
271 \global\advance\TY@count\@ne
272 \fi
273 \let\centering c%
274 \let\raggedright\noindent
275 \let\raggedleft\indent
276 \let\arraybackslash\relax
277 \prepnext@tok
278 \ifnum\@chnum<4
279 \global\expandafter\let\csname TY@F\the\TY@count\endcsname\z@
280 \fi
281 \ifnum\@chnum=6
282 \global\expandafter\let\csname TY@F\the\TY@count\endcsname\z@
283 \fi
284 \@addtopreamble{%
285 \ifcase\@chnum
286 \hfil \d@llarbegin\insert@column\d@llarend \hfil \or
287 \kern\z@
288 \d@llarbegin \insert@column \d@llarend \hfil \or
289 \hfil\kern\z@ \d@llarbegin \insert@column \d@llarend \or
290 $\vcenter\@startpbox{\@nextchar}\insert@column \@endpbox $\or
291 \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
292 \vbox \@startpbox{\@nextchar}\insert@column \@endpbox \or
293 \d@llarbegin \insert@column \d@llarend \or% dubious "s" case
294 \TY@box\centering\or
295 \TY@box\raggedright\or
296 \TY@box\raggedleft\or
297 \TY@box\relax
298 \fi}\prepnext@tok}
299 \def\TY@box#1{%
300 \ifx\centering#1%
301 \hfil \d@llarbegin\insert@column\d@llarend \hfil \else
302 \ifx\raggedright#1%
303 \kern\z@%<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
304 \d@llarbegin \insert@column \d@llarend \hfil \else
305 \ifx\raggedleft#1%
306 \hfil\kern\z@ \d@llarbegin \insert@column \d@llarend \else
307 \ifx\relax#1%
308 \d@llarbegin \insert@column \d@llarend
309 \fi \fi \fi \fi}
310 \def\TY@box@v#1{%
311 \vtop \@startpbox{\csname TY@F\the\TY@count\endcsname}%
312 #1\arraybackslash\tyformat
313 \insert@column\@endpbox}
314 \newdimen\TY@tablewidth
315 \def\Gscale@div#1#2#3{%
316 \setlength\dimen@{#3}%
317 \ifdim\dimen@=\z@
318 \PackageError{graphics}{Division by 0}\@eha
319 \dimen@#2%
320 \fi
321 \edef\@tempd{\the\dimen@}%
322 \setlength\dimen@{#2}%
323 \count@65536\relax
324 \ifdim\dimen@<\z@
325 \dimen@-\dimen@
326 \count@-\count@
327 \fi
328 \loop
329 \ifdim\dimen@<8192\p@
330 \dimen@\tw@\dimen@
331 \divide\count@\tw@
332 \repeat
333 \dimen@ii=\@tempd\relax
334 \divide\dimen@ii\count@
335 \divide\dimen@\dimen@ii
336 \edef#1{\strip@pt\dimen@}}
337 \long\def\TY@get@body#1\end
338 {\toks@\expandafter{\the\toks@#1}\TY@find@end}
339 \def\TY@find@end#1{%
340 \def\@tempa{#1}%
341 \ifx\@tempa\TY@\def\@tempa{\end{#1}}\expandafter\@tempa
342 \else\toks@\expandafter
343 {\the\toks@\end{#1}}\expandafter\TY@get@body\fi}
344 \def\TY@warn{%
345 \PackageWarning{tabulary}}
346 \catcode`\Z=11
347 \AtBeginDocument{
348 \@ifpackageloaded{colortbl}{%
349 \expandafter\def\expandafter\@mkpream\expandafter#\expandafter1%
350 \expandafter{%
351 \expandafter\let\expandafter\CT@setup\expandafter\relax
352 \expandafter\let\expandafter\CT@color\expandafter\relax
353 \expandafter\let\expandafter\CT@do@color\expandafter\relax
354 \expandafter\let\expandafter\color\expandafter\relax
355 \expandafter\let\expandafter\CT@column@color\expandafter\relax
356 \expandafter\let\expandafter\CT@row@color\expandafter\relax
357 \@mkpream{#1}}
358 \let\TY@@mkpream\@mkpream
359 \def\TY@classz{%
360 \@classx
361 \@tempcnta\count@
362 \ifx\TY@box\TY@box@v
363 \global\advance\TY@count\@ne
364 \fi
365 \let\centering c%
366 \let\raggedright\noindent
367 \let\raggedleft\indent
368 \let\arraybackslash\relax
369 \prepnext@tok
370 \expandafter\CT@extract\the\toks\@tempcnta\columncolor!\@nil
371 \ifnum\@chnum<4
372 \global\expandafter\let\csname TY@F\the\TY@count\endcsname\z@
373 \fi
374 \ifnum\@chnum=6
375 \global\expandafter\let\csname TY@F\the\TY@count\endcsname\z@
376 \fi
377 \@addtopreamble{%
378 \setbox\z@\hbox\bgroup\bgroup
379 \ifcase\@chnum
380 \hskip\stretch{.5}\kern\z@
381 \d@llarbegin\insert@column\d@llarend\hskip\stretch{.5}\or
382 \kern\z@%<<<<<<<<<<<<<<<<<<<<<<<<<<<
383 \d@llarbegin \insert@column \d@llarend \hfill \or
384 \hfill\kern\z@ \d@llarbegin \insert@column \d@llarend \or
385 $\vcenter\@startpbox{\@nextchar}\insert@column \@endpbox $\or
386 \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
387 \vbox \@startpbox{\@nextchar}\insert@column \@endpbox \or
388 \d@llarbegin \insert@column \d@llarend \or% dubious s case
389 \TY@box\centering\or
390 \TY@box\raggedright\or
391 \TY@box\raggedleft\or
392 \TY@box\relax
393 \fi
394 \egroup\egroup
395 \begingroup
396 \CT@setup
397 \CT@column@color
398 \CT@row@color
399 \CT@do@color
400 \endgroup
401 \@tempdima\ht\z@
402 \advance\@tempdima\minrowclearance
403 \vrule\@height\@tempdima\@width\z@
404 \unhbox\z@
405 }\prepnext@tok}%
406 \def\TY@arrayrule{%
407 \TY@subwidth\arrayrulewidth
408 \@addtopreamble{{\CT@arc@\vline}}}%
409 \def\TY@classvi{\ifcase \@lastchclass
410 \@acol \or
411 \TY@subwidth\doublerulesep
412 \ifx\CT@drsc@\relax
413 \@addtopreamble{\hskip\doublerulesep}%
414 \else
415 \@addtopreamble{{\CT@drsc@\vrule\@width\doublerulesep}}%
416 \fi\or
417 \@acol \or
418 \@classvii
419 \fi}%
420 }{%
421 \let\CT@start\relax
422 }
423 }
424 {\uccode`\*=`\ %
425 \uppercase{\gdef\TX@verb{%
426 \leavevmode\null\TX@vwarn
427 {\ifnum0=`}\fi\ttfamily\let\\\ignorespaces
428 \@ifstar{\let~*\TX@vb}{\TX@vb}}}}
429 \def\TX@vb#1{\def\@tempa##1#1{\toks@{##1}\edef\@tempa{\the\toks@}%
430 \expandafter\TX@v\meaning\@tempa\\ \\\ifnum0=`{\fi}}\@tempa!}
431 \def\TX@v#1!{\afterassignment\TX@vfirst\let\@tempa= }
432 \begingroup
433 \catcode`\*=\catcode`\#
434 \catcode`\#=12
435 \gdef\TX@vfirst{%
436 \if\@tempa#%
437 \def\@tempb{\TX@v@#}%
438 \else
439 \let\@tempb\TX@v@
440 \if\@tempa\space~\else\@tempa\fi
441 \fi
442 \@tempb}
443 \gdef\TX@v@*1 *2{%
444 \TX@v@hash*1##\relax\if*2\\\else~\expandafter\TX@v@\fi*2}
445 \gdef\TX@v@hash*1##*2{*1\ifx*2\relax\else#\expandafter\TX@v@hash\fi*2}
446 \endgroup
447 \def\TX@vwarn{%
448 \@warning{\noexpand\verb may be unreliable inside tabularx/y}%
449 \global\let\TX@vwarn\@empty}
450 \endinput
451 %%
452 %% End of file `tabulary.sty'.
@@ -15,59 +15,39 b''
15 15 ==========================================================================))
16 16 ((* block header *))
17 17
18 %Import the Sphinx document class.
19 \def\sphinxdocclass{%(docclass)s}
18 \newcommand{\maketitle}{}
19 \newcommand{\tableofcontents}{}
20 \newcommand{\thebibliography}{}
21 \newcommand{\appendix}{}
20 22
21 %[11pt,english]{article}
22 \documentclass[11pt,english]{%(wrapperclass)s}
23 23
24 24 %% Generated by Sphinx (not really.)
25 \usepackage{sphinx}
26
27 \begin{comment}
28 %% TODO: This stuff needs to be filled in
29 %(inputenc)s
30 %(utf8extra)s
31 %(fontenc)s
32 %(babel)s
33 %(fontpkg)s
34 %(fncychap)s
35 %(longtable)s
36 \end{comment}
37
38 \usepackage{sphinx}
25 \def\sphinxdocclass{((* block documentclass *))templates/tex/sphinxmanual((* endblock documentclass *))} %(docclass)s}
26 \documentclass[letterpaper,10pt,english]{((( self.documentclass() )))} %(papersize)s,%(pointsize)s%(classoptions)s]{%(wrapperclass)s}
27 \usepackage[utf8]{inputenc} %(inputenc)s
28 \DeclareUnicodeCharacter{00A0}{\\nobreakspace} %(utf8extra)s
29 \usepackage[T1]{fontenc} %(fontenc)s
30 \usepackage{babel} %(babel)s
31 \usepackage{times} %(fontpkg)s
32 \usepackage[Bjarne]{templates/tex/fncychap} %(fncychap)s
33 \usepackage{longtable} %(longtable)s
34 \usepackage{templates/tex/sphinx}
39 35 \usepackage{multirow}
40 36
41 %%TODO: uncomment and fill this in.
42 %%(preamble)s
43 \title{(((nb.metadata.name)))}
44 \date{(((now.strftime("%B %-d, %Y"))))}
37 %"" (preamble)s
38
39 \title{} %(title)s}
40 \date{} %(date)s}
41 \release{} %(release)s}
42 \author{} %(author)s}
43 \newcommand{\sphinxlogo}{} %(logo)s}
44 \renewcommand{\releasename}{Release} %(releasename)s}
45 \makeindex %(makeindex)s
45 46
46 \begin{comment}
47 Not used by nbconvert yet!
48 \release{%(release)s}
49 \author{%(author)s}
50 \newcommand{\sphinxlogo}{%(logo)s}
51 \renewcommand{\releasename}{%(releasename)s}
52 %(makeindex)s
53 \end{comment}
54 ((* endblock *))
47 ((* endblock header *))
55 48
56 ((= Begining of the document =))
57 ((=
58 \begin{document}
49 ((* block body *))
50 ((* endblock body *))
59 51
60 \begin{comment}
61 Not used by nbconvert yet!
62 %(shorthandoff)s
63 %(maketitle)s
64 %(tableofcontents)s
65 \end{comment}
66 =))
67 ((= End of the document =))
68 ((=
69 \renewcommand{\indexname}
70 \begin{comment}{%(indexname)s}
71 %(printindex)s
72 \end{comment}
73 \end{document}=))
52 ((* block footer *))
53 ((* endblock footer *))
General Comments 0
You need to be logged in to leave comments. Login now