Debian Codegraph @

texmf-dist/doc/latex/flowfram/samples/sample-book.tex

raw
1 % This file is public domain.
2
3 % arara: pdflatex
4 % arara: pdflatex
5 \documentclass[twoside]{book}
6 %\documentclass[twoside]{memoir}
7 %\documentclass[twoside,headings=optiontoheadandtoc]{scrbook}
8
9 \usepackage[T1]{fontenc}
10 \usepackage{lipsum}
11
12 \usepackage[outer=3in,marginparwidth=2cm]{geometry}
13 \usepackage[draft]{flowfram}
14 \usepackage[hidelinks]{hyperref}
15
16 \onecolumn[all][main]
17
18 \setflowframe*{main}{margin=inner}
19
20 \newdynamicframe{2in}{\typeblockheight}{\typeblockwidth+\columnsep}{0pt}[sidepanel]
21 \setdynamicframe*{sidepanel}{evenx=-2in-\columnsep}
22
23 \flowframsetup{
24 %dynamic-page-style=noadjust,
25 %sections-extra-option = as-original, % memoir
26 %sections-option-keyval , % needed with KOMA's headings setting
27 toc-thumbtabs,
28 matter-thumbtabs=main-only,
29 thumbtab-links=all,
30 %thumbtab-text=rotate-right
31 }
32
33 \makethumbtabs{1in}
34 \setthumbtab{all}{style=textsf,textcolor=white,backcolor=[gray]{0.4}}
35
36 \enableminitoc
37 \appenddfminitoc*{sidepanel}
38
39 % Put headers and footers in dynamic frames
40 \makedfheaderfooter
41
42 \newlength{\xoffset}
43 \computerightedgeodd{\xoffset}
44 \addtolength{\xoffset}{-2cm}
45 \newlength{\yoffset}
46 \computebottomedge{\yoffset}
47
48 \newcommand{\footstyle}[1]{\bfseries\LARGE #1}
49
50 \setdynamicframe*{footer}{oddx=\xoffset,y=\yoffset,width=2cm,height=2cm,
51 backcolor=[gray]{0.5},textcolor=white,style=footstyle}
52
53 \computetopedge{\yoffset}
54 \addtolength{\yoffset}{-2cm}
55 \setdynamicframe*{header}{oddx={\xoffset-8cm},y=\yoffset,width=10cm,height=2cm,
56 backcolor=[gray]{0.8},textcolor=white,style=footstyle}
57
58 % now work out the x offset for the even pages
59
60 \computeleftedgeeven{\xoffset}
61 \setdynamicframe*{footer,header}{evenx=\xoffset}
62
63 \title{Sample}
64 \author{Me}
65
66 \begin{document}
67 \pagenumbering{alph}% ensure unique page anchors
68 \maketitle
69
70 \frontmatter
71 \tableofcontents
72
73 \mainmatter
74 \enablethumbtabs
75
76 \chapter[Samp Chap]{Sample Chapter}
77
78 Some margin text.\marginpar[\hfill $\rightarrow$]{$\leftarrow$}
79 \lipsum[1]
80
81 \section[Samp Sec]{Sample Section}
82
83 \lipsum[2-3]
84
85 \section[Another Sec]{Another Sample Section}
86
87 Some margin text.\marginpar[\hfill $\rightarrow$]{$\leftarrow$}
88 \lipsum[4-50]
89
90 \section[Yet Another Sec]{Yet Another Sample Section}
91
92 \lipsum[1-20]
93
94 \section*[Star Sec][Sec*]{Starred Section}
95
96 \lipsum[21-30]
97
98 \chapter*
99 [Star Cha]
100 [Cha*]
101 {Starred Chapter}
102 \chaptermark{Starred Chapter}
103
104 \lipsum[31-50]
105
106 \chapter[Another Chap (TOC)][Another Chap (Thumb)]{Another Sample Chapter}
107 % KOMA headings=optiontotoc etc:
108 %\chapter[tocentry={Another Chap (TOC)},head={Another Chap (Thumb)}]{Another Sample Chapter}
109
110 \lipsum[1-20]
111
112 \backmatter
113 \chapter{Back Matter Chapter}
114
115 \lipsum
116
117 \section{Back Matter Section}
118
119 \lipsum[11-20]
120
121 \end{document}