forked from yochju/general_relativity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlmlayout.sty
95 lines (94 loc) · 3.66 KB
/
lmlayout.sty
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
%-------------------- paragraph formatting -------------------
%Have to do the \parafmt /after/ the toc, and at the end of various
% environments that turn off paragraph indentation. See notes about
% paragraph indentation at top of file under design.
\newcommand{\normalparafmt}{
\setlength{\parindent}{\normalparindent}
\setlength{\parskip}{2mm}
}
\newcommand{\parafmt}{
\newlength{\normalparindent}% ...has to be after TOC to avoid extra spacing in TOC
\setlength{\normalparindent}{6mm}%
\normalparafmt
}
%-------------------- page layout dimensions -------------------
% standard stuff, see LaTeX companion, p. 85:
\setlength{\hoffset}{0mm}
\setlength{\textwidth}{113mm}
\setlength{\marginparsep}{6mm}
\setlength{\columnsep}{6mm}
\setlength{\voffset}{-4mm}
\setlength{\textheight}{230mm}
\setlength{\topmargin}{-12mm}
\setlength{\headheight}{4mm}
\setlength{\headsep}{8mm}
\setlength{\footskip}{15mm}
% my stuff:
\setlength{\oddsidemargin}{7mm}
\newlength{\marginfigwidth}
\setlength{\marginfigwidth}{52mm}
\newlength{\overhang}
\setlength{\overhang}{\marginfigwidth}
\addtolength{\overhang}{\columnsep}
\setlength{\evensidemargin}{\overhang}
\addtolength{\evensidemargin}{-11mm}
\newlength{\marginfigoverhang}
\setlength{\marginfigoverhang}{\overhang}
\newlength{\mysteriousextracolsep}
\setlength{\mysteriousextracolsep}{3mm}
\addtolength{\marginfigoverhang}{\mysteriousextracolsep}
%supposed to =columnsep+marginfigwidth, for wrapfig; extra few mm is empirical
% This seems to be right-left dependent; see \margdown macro for the fix.
\newlength{\pagewidth}
\setlength{\pagewidth}{\textwidth}
\addtolength{\pagewidth}{\marginparsep}
\addtolength{\pagewidth}{\marginfigwidth}
% to allow changing from one layout to another:
\newlength{\normaltextwidth}
\setlength{\normaltextwidth}{\textwidth}
\newlength{\normalesm}
\setlength{\normalesm}{\evensidemargin}
\newcommand{\normallayout}{
\clearpage
\setlength{\textwidth}{\normaltextwidth}
\setlength{\evensidemargin}{\normalesm}
}
\newcommand{\nomarginlayout}{
\normallayout
\addtolength{\textwidth}{\marginparwidth}
\addtolength{\textwidth}{\marginparsep}
\addtolength{\evensidemargin}{-\marginparwidth}
\addtolength{\evensidemargin}{-\marginparsep}
}
%---------------------------------------------------------------------------------------------------------------------------------------
% The following are for use with \pdfsavepos, etc., and use the same coordinate system: zero in the lower left corner of physical page.
\newlength{\evenfigminx}
\setlength{\evenfigminx}{1in}
\addtolength{\evenfigminx}{\hoffset}
\addtolength{\evenfigminx}{\evensidemargin}
\addtolength{\evenfigminx}{-\overhang}
\addtolength{\evenfigminx}{-\mysteriousextracolsep}
\newlength{\evenfigmaxx}
\setlength{\evenfigmaxx}{\evenfigminx}
\addtolength{\evenfigmaxx}{\marginfigwidth}
\newlength{\oddfigminx}
\setlength{\oddfigminx}{1in}
\addtolength{\oddfigminx}{\hoffset}
\addtolength{\oddfigminx}{\oddsidemargin}
\addtolength{\oddfigminx}{\textwidth}
\addtolength{\oddfigminx}{\marginparsep}
\addtolength{\oddfigminx}{\mysteriousextracolsep}
\newlength{\oddfigmaxx}
\setlength{\oddfigmaxx}{\oddfigminx}
\addtolength{\oddfigmaxx}{\marginfigwidth}
\newlength{\figmaxy}
\setlength{\figmaxy}{\paperheight}% Is this different from pdfpageheight?
\addtolength{\figmaxy}{-1in}
\addtolength{\figmaxy}{-\voffset}
\addtolength{\figmaxy}{-\topmargin}
\addtolength{\figmaxy}{-\headheight}
\addtolength{\figmaxy}{-\headsep}
\newlength{\figminy}
\setlength{\figminy}{\figmaxy}
\addtolength{\figminy}{-\textheight}
\immediate\write18{echo "\the\evenfigminx,\the\evenfigmaxx,\the\oddfigminx,\the\oddfigmaxx,\the\figminy,\the\figmaxy" >geom.pos}