| 1 |
% memlays.sty % extra layouts for membook, extension to layouts package |
| 2 |
|
| 3 |
\ProvidesPackage{memlays}[2002/08/10 v1.0 Extra membook layouts] |
| 4 |
|
| 5 |
\usepackage{layouts} |
| 6 |
|
| 7 |
\providecommand\LMnote[2]{} |
| 8 |
|
| 9 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 10 |
% CHAPTER HEADING |
| 11 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 12 |
|
| 13 |
\LMnote{2010/08/20}{added some baselineskips etc. to make the drawing |
| 14 |
more realistic} |
| 15 |
|
| 16 |
\newcommand{\drawchapter}{% |
| 17 |
% Some default values first |
| 18 |
\l@yltoc{0.85\textwidth}{\l@youthdi} % textwidth |
| 19 |
\l@yltoc{\baselineskip}{\l@youtvdi} % baselineskip |
| 20 |
\ifdrawparameters |
| 21 |
% When drawparameters is TRUE, use a generic layout. |
| 22 |
% Set dimensions and coordinates. |
| 23 |
\Huge \l@youtvdii=\baselineskip \normalsize % Heading baselineskip |
| 24 |
\divide\l@youtvdii by \l@yonepoint |
| 25 |
\l@yltoc{50pt}{\l@youtvpiii} % beforeskip |
| 26 |
\l@yltoc{20pt}{\l@youtvpi} % midskip |
| 27 |
\l@yltoc{40pt}{\l@youtvpii} % afterskip |
| 28 |
\fi |
| 29 |
% Now continue setting all the other drawing lengths and coordinates. |
| 30 |
\l@youtvdiii=\l@youtvpii % afterskip |
| 31 |
\advance\l@youtvdiii by \l@youtparskip |
| 32 |
\advance\l@youtvdiii by \l@youtvdi |
| 33 |
\l@youtvdiv=\l@youtvpi % midskip |
| 34 |
% \advance\l@youtvdiv by \l@youtparskip |
| 35 |
\advance\l@youtvdiv by \l@youtvdii |
| 36 |
\l@youtvdv=\l@youtvpiii % beforeskip |
| 37 |
% \advance\l@youtvdv by \l@youtparskip |
| 38 |
\advance\l@youtvdv by \l@youtvdii |
| 39 |
\l@youtyci=\l@youtvdi % Y coord of base of after text |
| 40 |
\l@youtycii=\l@youtyci % Y coord of base of heading text |
| 41 |
\advance\l@youtycii by \l@youtvdiii |
| 42 |
%% \l@youthdiv=\z@ % 0 or abs(-afterskip) |
| 43 |
% Continue. |
| 44 |
\l@youtyciii=\l@youtycii % Y coord of base Chapter N |
| 45 |
\advance\l@youtyciii by \l@youtvdiv |
| 46 |
\l@youtyciv=\l@youtyciii % Y coord of top of typeblock |
| 47 |
\advance\l@youtyciv by \l@youtvdv |
| 48 |
\l@youtycvi=\l@youtyciv % 3*l@youtvdi + l@youtyciv |
| 49 |
\advance\l@youtycvi by \l@youtvdi |
| 50 |
\advance\l@youtycvi by \l@youtvdi |
| 51 |
\advance\l@youtycvi by \l@youtvdi |
| 52 |
\l@youthdii=\l@youtvdi % a small amount |
| 53 |
\l@youthdiii=\l@youthdii % half a small amount |
| 54 |
\divide\l@youthdiii by \tw@ |
| 55 |
% |
| 56 |
% Draw the picture! |
| 57 |
% |
| 58 |
\begin{center} |
| 59 |
\setlength{\unitlength}{\l@youtunitlength} |
| 60 |
\begin{picture}(\l@youthdi,\l@youtycvi) |
| 61 |
\put(0,\l@youtyci){\begin{picture}(\l@youthdi,\l@youtyciv) |
| 62 |
% |
| 63 |
% Draw the two after heading text lines |
| 64 |
\put(0,0){\l@ylabelfont second line of text following the heading \ldots} |
| 65 |
\put(0,\l@youtyci){\l@ylabelfont This is the start of the after-heading text |
| 66 |
which continues on \ldots} |
| 67 |
% Draw the heading |
| 68 |
\put(0,\l@youtycii){{\Huge The title}} |
| 69 |
% Draw the Chapter |
| 70 |
\put(0,\l@youtyciii){{\huge Chapter 3}} |
| 71 |
% Top of the typeblock |
| 72 |
\put(0,\l@youtyciv){\l@ylabelfont \_\_\_\_ top of the typeblock} |
| 73 |
\testdrawdimensions |
| 74 |
\ifl@ytempif |
| 75 |
% Draw the dimensions if required. First the before skips. |
| 76 |
\put(0,\l@youtyciv){\vector(0,-1){\l@youtvdv}} |
| 77 |
\put(0,\l@youtyciv){\begin{picture}(\l@youthdii,\l@youthdii) |
| 78 |
\put(\l@youthdiii,-\l@youthdii){\makebox(0,0)[tl]% |
| 79 |
{\l@yparamfont \l@ypcmd{beforechapskip} |
| 80 |
+ \l@ypcmd{baselineskip} + \l@ypcmd{topskip} |
| 81 |
}} |
| 82 |
\end{picture}} |
| 83 |
% The midskip |
| 84 |
%% \put(0,\l@youtyciii){\vector(0,-1){\l@youtvdiv}} |
| 85 |
\put(-\l@youthdiii,\l@youtyciii){\vector(0,-1){\l@youtvdiv}} |
| 86 |
\put(0,\l@youtyciii){\begin{picture}(\l@youthdii,\l@youthdii) |
| 87 |
\put(\l@youthdiii,-\l@youthdii){\makebox(0,0)[tl]% |
| 88 |
{\l@yparamfont \l@ypcmd{midchapskip} + \l@ypcmd{baselineskip}}} |
| 89 |
\end{picture}} |
| 90 |
% And finish with the afterskip |
| 91 |
\put(0,\l@youtycii){\vector(0,-1){\l@youtvdiii}} |
| 92 |
\put(0,\l@youtycii){\begin{picture}(\l@youthdii,\l@youthdii) |
| 93 |
\put(\l@youthdiii,-\l@youthdii){\makebox(0,0)[tl]% |
| 94 |
{\l@yparamfont \l@ypcmd{afterchapskip} + \l@ypcmd{baselineskip}}} |
| 95 |
\end{picture}} |
| 96 |
\fi |
| 97 |
\end{picture}} |
| 98 |
% Draw rules. |
| 99 |
\put(0,0){\line(1,0){\l@youthdi}} |
| 100 |
\put(0,\l@youtycvi){\line(1,0){\l@youthdi}} |
| 101 |
\end{picture} |
| 102 |
\end{center} |
| 103 |
\setlength{\unitlength}{1pt} |
| 104 |
% The end of the definition of |\drawheading|. |
| 105 |
} |
| 106 |
|
| 107 |
% Shorthands. |
| 108 |
\newcommand{\chapterdiagram}{\drawparameterstrue\drawchapter} |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 114 |
% HEADERS AND FOOTERS |
| 115 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 116 |
|
| 117 |
|
| 118 |
\newcommand{\headerfooterdiagram}{% |
| 119 |
% some initial values |
| 120 |
\l@yltoc{0.85\textwidth}{\l@youthdi} % textwidth |
| 121 |
\l@yltoc{\baselineskip}{\l@youtvdi} % baselineskip |
| 122 |
% we need 4 x coordinates |
| 123 |
\l@youtxci=\z@ |
| 124 |
\l@youtxciii=\l@youthdi |
| 125 |
\l@youtxciv=\l@youtxciii |
| 126 |
\advance\l@youtxciv by \l@youtvdi |
| 127 |
\l@youtxcii=\l@youtxciii % midway between xci and xciii |
| 128 |
\advance\l@youtxcii by \l@youtxci |
| 129 |
\divide\l@youtxcii by \tw@ |
| 130 |
% we need 8 y coordinates |
| 131 |
\l@youtycii=\l@youtvdi |
| 132 |
\l@youtyciii=\l@youtycii |
| 133 |
\advance\l@youtyciii by \l@youtvdi |
| 134 |
\l@youtyciv=\l@youtyciii |
| 135 |
\advance\l@youtyciv by \l@youtvdi |
| 136 |
\l@youtycvi=\l@youtyciv |
| 137 |
\advance\l@youtycvi by \l@youtvdi |
| 138 |
\advance\l@youtycvi by \l@youtvdi |
| 139 |
\advance\l@youtycvi by \l@youtvdi |
| 140 |
\advance\l@youtycvi by \l@youtvdi |
| 141 |
\advance\l@youtycvi by \l@youtvdi |
| 142 |
\advance\l@youtycvi by \l@youtvdi |
| 143 |
\l@youtycv=\l@youtyciv % midway between yciv and ycvi |
| 144 |
\advance\l@youtycv by \l@youtycvi |
| 145 |
\divide\l@youtycv by \tw@ |
| 146 |
\l@youtycvii=\l@youtycvi |
| 147 |
\advance\l@youtycvii by \l@youtvdi |
| 148 |
\l@youtycviii=\l@youtycvii |
| 149 |
\advance\l@youtycviii by \l@youtvdi |
| 150 |
\l@youtyci=\l@youtycviii |
| 151 |
\advance\l@youtyci by \l@youtvdi |
| 152 |
% we need 1 horizontal distance, which is the diagram width |
| 153 |
% (i.e., \l@youthdi) |
| 154 |
% and one vertical distance, total picture height |
| 155 |
\l@youtvdii=\l@youtycviii |
| 156 |
\advance\l@youtvdii by \l@youtvdi |
| 157 |
\advance\l@youtvdii by \l@youtvdi |
| 158 |
\advance\l@youtvdii by \l@youtvdi |
| 159 |
% and a (half) small amount |
| 160 |
\l@youthdii=\l@youtvdi |
| 161 |
\l@youthdiii=\l@youthdii |
| 162 |
\divide\l@youthdiii by \tw@ |
| 163 |
% |
| 164 |
% Draw the picture |
| 165 |
% |
| 166 |
\begin{center} |
| 167 |
\setlength{\unitlength}{\l@youtunitlength} |
| 168 |
\begin{picture}(\l@youthdi,\l@youtvdii) |
| 169 |
\thinlines |
| 170 |
% draw the horizontals |
| 171 |
\put(0,0){\line(1,0){\l@youthdi}} |
| 172 |
\put(0,\l@youtvdii){\line(1,0){\l@youthdi}} |
| 173 |
% the footer texts |
| 174 |
\put(0,\l@youtyciii){\makebox(0,0)[bl]{left}} |
| 175 |
\put(\l@youtxcii,\l@youtyciii){\makebox(0,0)[b]{center}} |
| 176 |
\put(\l@youtxciii,\l@youtyciii){\makebox(0,0)[br]{right}} |
| 177 |
% the footrule |
| 178 |
\thicklines |
| 179 |
\put(0,\l@youtyciv){\line(1,0){\l@youthdi}} |
| 180 |
\put(\l@youtxciv,\l@youtyciv){\begin{picture}(\l@youthdii,\l@youthdii) |
| 181 |
\put(0,\l@youthdiii){\makebox(0,0)[br]% |
| 182 |
{\l@yparamfont \l@ypcmd{footrule}}} |
| 183 |
\end{picture}} |
| 184 |
% the TYPE BLOCK |
| 185 |
\put(\l@youtxcii,\l@youtycv){\makebox(0,0){THE TYPE BLOCK}} |
| 186 |
% the headrule |
| 187 |
\put(0,\l@youtycvi){\line(1,0){\l@youthdi}} |
| 188 |
\put(\l@youtxciv,\l@youtycvi){\begin{picture}(\l@youthdii,\l@youthdii) |
| 189 |
\put(0,-\l@youthdiii){\makebox(0,0)[tr]% |
| 190 |
{\l@yparamfont \l@ypcmd{headrule}}} |
| 191 |
\end{picture}} |
| 192 |
\thinlines |
| 193 |
% the header texts |
| 194 |
\put(0,\l@youtycvii){\makebox(0,0)[tl]{left}} |
| 195 |
\put(\l@youtxcii,\l@youtycvii){\makebox(0,0)[t]{center}} |
| 196 |
\put(\l@youtxciii,\l@youtycvii){\makebox(0,0)[tr]{right}} |
| 197 |
% the runningwidth |
| 198 |
\put(0,\l@youtycviii){\vector(1,0){\l@youthdi}} |
| 199 |
\put(0,\l@youtycviii){\vector(-1,0){0}} |
| 200 |
\put(\l@youtxcii,\l@youtyci){\makebox(0,0)% |
| 201 |
{\l@yparamfont \l@ypcmd{runningwidth}}} |
| 202 |
\end{picture} |
| 203 |
\setlength{\unitlength}{1pt} |
| 204 |
\end{center} |
| 205 |
} |
| 206 |
|
| 207 |
|
| 208 |
\LMnote{2011/03/15}{We removed the \cs{parskip} effect on \cs{section} |
| 209 |
in one of the latest memoir versions, thus we need this to go away |
| 210 |
from the drawing} |
| 211 |
|
| 212 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 213 |
% SECTIONS |
| 214 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 215 |
|
| 216 |
\renewcommand{\drawheading}[1]{% |
| 217 |
\l@yltoc{\textwidth}{\l@youthdi} % textwidth |
| 218 |
\l@yltoc{\baselineskip}{\l@youtvdi} % baselineskip |
| 219 |
\ifdrawparameters |
| 220 |
\Huge \l@youtvdii=\baselineskip \normalsize % Heading baselineskip |
| 221 |
\divide\l@youtvdii by \l@yonepoint |
| 222 |
\l@yltoc{40pt}{\l@youtvpi} % beforeskip |
| 223 |
\ifruninhead |
| 224 |
\l@yltoc{-72pt}{\l@youtvpii} % afterskip |
| 225 |
\l@yltoc{50pt}{\l@youthpi} % indent |
| 226 |
\else |
| 227 |
\l@yltoc{45pt}{\l@youtvpii} % afterskip |
| 228 |
\l@yltoc{72pt}{\l@youthpi} % indent |
| 229 |
\fi |
| 230 |
\setbox0 = \hbox{{\Huge 3.5 Heading Title }} |
| 231 |
\l@yltoc{\wd0}{\l@youthdv} % width of heading text |
| 232 |
\else |
| 233 |
{#1 \l@youtvdii=\baselineskip\normalfont\normalsize} % heading baselineskip |
| 234 |
\divide\l@youtvdii by \l@yonepoint |
| 235 |
\setbox0 = \hbox{{#1 3.5 Heading Title }} |
| 236 |
\l@yltoc{\wd0}{\l@youthdv} % width of heading text |
| 237 |
\fi |
| 238 |
\l@youtvdiii=\l@youtvpii % afterskip + parskip + textbaselineskip |
| 239 |
\advance\l@youtvdiii by \l@youtparskip |
| 240 |
\advance\l@youtvdiii by \l@youtvdi |
| 241 |
\l@youtvdiv=\l@youtvpi % beforeskip + parskip + headbaselineskip |
| 242 |
\ifnum\l@youtvdiv < \z@ |
| 243 |
\l@youtvdiv = -\l@youtvdiv |
| 244 |
\fi |
| 245 |
\advance\l@youtvdiv by \l@youtparskip |
| 246 |
\advance\l@youtvdiv by \l@youtvdii |
| 247 |
\l@youtyci=\l@youtvdi % Y coord of base of after text |
| 248 |
\l@youtycii=\l@youtyci % Y coord of base of heading text |
| 249 |
\advance\l@youtycii by \l@youtvdiii |
| 250 |
\l@youthdiv=\z@ % 0 or abs(-afterskip) |
| 251 |
\ifnum\l@youtvpii < \z@ |
| 252 |
\l@youthdiv = -\l@youtvpii |
| 253 |
\l@youtvdiii=\l@youtvdi % textbaselineskip |
| 254 |
\l@youtxci=\l@youthpi % X coord of end of heading text |
| 255 |
\advance\l@youtxci by \l@youthdv |
| 256 |
\l@youtxcii=\l@youtxci % X coord of start of after text |
| 257 |
\advance\l@youtxcii by \l@youthdiv |
| 258 |
\l@youtycii=\l@youtvdi % Y coord of base of heading text |
| 259 |
\fi |
| 260 |
\l@youtyciii=\l@youtycii % Y coord of base of prior text |
| 261 |
\advance\l@youtyciii by \l@youtvdiv |
| 262 |
\l@youtyciv=\l@youtyciii % Y coord of top of prior text |
| 263 |
\advance\l@youtyciv by \l@youtvdi |
| 264 |
\l@youtycv=\l@youtyciv % 2*l@youtvdi + l@youtyciv |
| 265 |
\advance\l@youtycv by \l@youtvdi |
| 266 |
\advance\l@youtycv by \l@youtvdi |
| 267 |
\l@youthdii=\l@youtvdi % a small amount |
| 268 |
\l@youthdiii=\l@youthdii % half a small amount |
| 269 |
\divide\l@youthdiii by \tw@ |
| 270 |
\begin{center} |
| 271 |
\setlength{\unitlength}{\l@youtunitlength} |
| 272 |
\begin{picture}(\l@youthdi,\l@youtycv) |
| 273 |
\ifnum\l@youtvpii < \z@ |
| 274 |
\put(0,\l@youtyci){\begin{picture}(\l@youthdi,\l@youtyciv) |
| 275 |
\put(0,0){\l@ylabelfont second line of text following the heading \ldots} |
| 276 |
\ifdrawparameters |
| 277 |
\put(\l@youthpi,\l@youtycii){{\Huge 3.5 Heading Title}} |
| 278 |
\else |
| 279 |
\put(\l@youthpi,\l@youtycii){{#1 3.5 Heading Title}} |
| 280 |
\fi |
| 281 |
\put(\l@youtxcii,\l@youtycii){\l@ylabelfont Start of text \ldots} |
| 282 |
\put(0,\l@youtyciii){\l@ylabelfont \ldots end of last line of preceding text.} |
| 283 |
%% \ifdrawparameters |
| 284 |
\testdrawdimensions |
| 285 |
\ifl@ytempif |
| 286 |
\put(0,\l@youtyciii){\vector(0,-1){\l@youtvdiv}} |
| 287 |
\put(0,\l@youtyciii){\begin{picture}(\l@youthdii,\l@youthdii) |
| 288 |
\put(\l@youthdiii,-\l@youthdii){\makebox(0,0)[tl]% |
| 289 |
{\l@yparamfont \textit{$\|$beforeskip$\|$} + |
| 290 |
\l@ypcmd{baselineskip} |
| 291 |
(of heading font)}} |
| 292 |
\end{picture}} |
| 293 |
\put(0,\l@youtycii){\vector(1,0){\l@youthpi}} |
| 294 |
\put(0,\l@youtycii){\begin{picture}(\l@youthdii,\l@youthdii) |
| 295 |
\put(\l@youthdii,\l@youthdiii){\l@yparamfont \textit{indent}} |
| 296 |
\end{picture}} |
| 297 |
\put(\l@youtxci,\l@youtycii){\vector(1,0){\l@youthdiv}} |
| 298 |
\put(\l@youtxci,\l@youtycii){\begin{picture}(\l@youthdii,\l@youthdii) |
| 299 |
\put(\l@youthdiii,\l@youthdii){\l@yparamfont \textit{afterskip} ($< 0$)} |
| 300 |
\end{picture}} |
| 301 |
\fi |
| 302 |
\end{picture}} |
| 303 |
\else |
| 304 |
\put(0,\l@youtyci){\begin{picture}(\l@youthdi,\l@youtyciv) |
| 305 |
\put(0,0){\l@ylabelfont second line of text following the heading \ldots} |
| 306 |
\put(0,\l@youtyci){\l@ylabelfont This is the start of the after-heading text, |
| 307 |
which continues on \ldots} |
| 308 |
\ifdrawparameters |
| 309 |
\put(\l@youthpi,\l@youtycii){{\Huge 3.5 Heading Title}} |
| 310 |
\else |
| 311 |
\put(\l@youthpi,\l@youtycii){{#1 3.5 Heading Title}} |
| 312 |
\fi |
| 313 |
\put(0,\l@youtyciii){\l@ylabelfont \ldots end of last line of preceding text.} |
| 314 |
%% \ifdrawparameters |
| 315 |
\testdrawdimensions |
| 316 |
\ifl@ytempif |
| 317 |
\put(0,\l@youtyciii){\vector(0,-1){\l@youtvdiv}} |
| 318 |
\put(0,\l@youtyciii){\begin{picture}(\l@youthdii,\l@youthdii) |
| 319 |
\put(\l@youthdiii,-\l@youthdii){\makebox(0,0)[tl]% |
| 320 |
{\l@yparamfont \textit{$\|$beforeskip$\|$} + |
| 321 |
\l@ypcmd{baselineskip} |
| 322 |
(of heading font)}} |
| 323 |
\end{picture}} |
| 324 |
\put(0,\l@youtycii){\vector(1,0){\l@youthpi}} |
| 325 |
\put(0,\l@youtycii){\begin{picture}(\l@youthdii,\l@youthdii) |
| 326 |
\put(\l@youthdii,\l@youthdiii){\l@yparamfont \textit{indent}} |
| 327 |
\end{picture}} |
| 328 |
\put(0,\l@youtycii){\vector(0,-1){\l@youtvdiii}} |
| 329 |
\put(0,\l@youtycii){\begin{picture}(\l@youthdii,\l@youthdii) |
| 330 |
\put(\l@youthdiii,-\l@youthdii){\makebox(0,0)[tl]% |
| 331 |
{\l@yparamfont \textit{afterskip} + |
| 332 |
\l@ypcmd{baselineskip} |
| 333 |
(of text font)}} |
| 334 |
\end{picture}} |
| 335 |
\fi |
| 336 |
\end{picture}} |
| 337 |
\fi |
| 338 |
\put(0,0){\line(1,0){\l@youthdi}} |
| 339 |
\put(0,\l@youtycv){\line(1,0){\l@youthdi}} |
| 340 |
\end{picture} |
| 341 |
\end{center} |
| 342 |
\setlength{\unitlength}{1pt} |
| 343 |
%% \ifdrawparameters\else |
| 344 |
\testprintparameters |
| 345 |
\ifl@ytempif |
| 346 |
\begin{center} |
| 347 |
\begin{footnotesize} |
| 348 |
Lengths are to the nearest pt. \\ |
| 349 |
\begin{ttfamily} |
| 350 |
\begin{tabular}{l@{\hspace{20pt}}l} |
| 351 |
\textit{beforeskip} = \number\l@youtvpi pt & |
| 352 |
\textit{afterskip} = \number\l@youtvpii pt \\ |
| 353 |
\textit{indent} = \number\l@youthpi pt & |
| 354 |
\textrm{(heading font)} |
| 355 |
\l@ycmd{baselineskip} = \number\l@youtvdii pt \\ |
| 356 |
\l@ycmd{parskip} = \number\l@youtparskip pt & |
| 357 |
\textrm{heading font} = \string#1 \\ |
| 358 |
\end{tabular} |
| 359 |
\end{ttfamily}\end{footnotesize} |
| 360 |
\end{center} |
| 361 |
\fi |
| 362 |
} |
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
\endinput |