more easy LM 4,5 hw
[light-and-matter.git] / lmlayout.sty
blobd9aacb0081426b53c4afa8ff200d44d36d3d91ec
1 %-------------------- paragraph formatting -------------------
2 %Have to do the \parafmt /after/ the toc, and at the end of various
3 % environments that turn off paragraph indentation. See notes about
4 % paragraph indentation at top of file under design.
5 \newcommand{\normalparafmt}{
6 \setlength{\parindent}{\normalparindent}
7 \setlength{\parskip}{2mm}
9 \newcommand{\parafmt}{
10 \newlength{\normalparindent}% ...has to be after TOC to avoid extra spacing in TOC
11 \setlength{\normalparindent}{6mm}%
12 \normalparafmt
15 %-------------------- page layout dimensions -------------------
16 % standard stuff, see LaTeX companion, p. 85:
17 \setlength{\hoffset}{0mm}
18 \setlength{\textwidth}{113mm}
19 \setlength{\marginparsep}{6mm}
20 \setlength{\columnsep}{6mm}
21 \setlength{\voffset}{-4mm}
22 \setlength{\textheight}{230mm}
23 \setlength{\topmargin}{-12mm}
24 \setlength{\headheight}{4mm}
25 \setlength{\headsep}{8mm}
26 \setlength{\footskip}{15mm}
27 % my stuff:
28 \setlength{\oddsidemargin}{7mm}
29 \newlength{\marginfigwidth}
30 \setlength{\marginfigwidth}{52mm}
31 \newlength{\overhang}
32 \setlength{\overhang}{\marginfigwidth}
33 \addtolength{\overhang}{\columnsep}
34 \setlength{\evensidemargin}{\overhang}
35 \addtolength{\evensidemargin}{-11mm}
36 \newlength{\marginfigoverhang}
37 \setlength{\marginfigoverhang}{\overhang}
38 \newlength{\mysteriousextracolsep}
39 \setlength{\mysteriousextracolsep}{3mm}
40 \addtolength{\marginfigoverhang}{\mysteriousextracolsep}
41 %supposed to =columnsep+marginfigwidth, for wrapfig; extra few mm is empirical
42 % This seems to be right-left dependent; see \margdown macro for the fix.
43 \newlength{\pagewidth}
44 \setlength{\pagewidth}{\textwidth}
45 \addtolength{\pagewidth}{\marginparsep}
46 \addtolength{\pagewidth}{\marginfigwidth}
47 % to allow changing from one layout to another:
48 \newlength{\normaltextwidth}
49 \setlength{\normaltextwidth}{\textwidth}
50 \newlength{\normalesm}
51 \setlength{\normalesm}{\evensidemargin}
52 \newcommand{\normallayout}{
53 \clearpage
54 \setlength{\textwidth}{\normaltextwidth}
55 \setlength{\evensidemargin}{\normalesm}
57 \newcommand{\nomarginlayout}{
58 \normallayout
59 \addtolength{\textwidth}{\marginparwidth}
60 \addtolength{\textwidth}{\marginparsep}
61 \addtolength{\evensidemargin}{-\marginparwidth}
62 \addtolength{\evensidemargin}{-\marginparsep}
64 %---------------------------------------------------------------------------------------------------------------------------------------
65 % The following are for use with \pdfsavepos, etc., and use the same coordinate system: zero in the lower left corner of physical page.
66 \newlength{\evenfigminx}
67 \setlength{\evenfigminx}{1in}
68 \addtolength{\evenfigminx}{\hoffset}
69 \addtolength{\evenfigminx}{\evensidemargin}
70 \addtolength{\evenfigminx}{-\overhang}
71 \addtolength{\evenfigminx}{-\mysteriousextracolsep}
72 \newlength{\evenfigmaxx}
73 \setlength{\evenfigmaxx}{\evenfigminx}
74 \addtolength{\evenfigmaxx}{\marginfigwidth}
75 \newlength{\oddfigminx}
76 \setlength{\oddfigminx}{1in}
77 \addtolength{\oddfigminx}{\hoffset}
78 \addtolength{\oddfigminx}{\oddsidemargin}
79 \addtolength{\oddfigminx}{\textwidth}
80 \addtolength{\oddfigminx}{\marginparsep}
81 \addtolength{\oddfigminx}{\mysteriousextracolsep}
82 \newlength{\oddfigmaxx}
83 \setlength{\oddfigmaxx}{\oddfigminx}
84 \addtolength{\oddfigmaxx}{\marginfigwidth}
85 \newlength{\figmaxy}
86 \setlength{\figmaxy}{\paperheight}% Is this different from pdfpageheight?
87 \addtolength{\figmaxy}{-1in}
88 \addtolength{\figmaxy}{-\voffset}
89 \addtolength{\figmaxy}{-\topmargin}
90 \addtolength{\figmaxy}{-\headheight}
91 \addtolength{\figmaxy}{-\headsep}
92 \newlength{\figminy}
93 \setlength{\figminy}{\figmaxy}
94 \addtolength{\figminy}{-\textheight}
95 \immediate\write18{echo "\the\evenfigminx,\the\evenfigmaxx,\the\oddfigminx,\the\oddfigmaxx,\the\figminy,\the\figmaxy" >geom.pos}