blob: c721bf3c50ef44e9b83e07acd918b9375dbd64d4 (
plain)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
%%
%% This is file `vmargin.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% vmargin.dtx (with options: `package')
%%
%% File: vmargin.dtx Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002,
%% 2004
%% by Volker Kuhlmann <VolkerKuhlmann@GMX.de>
%% All rights are reserved.
%%
%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
\def\filename{vmargin}
\def\fileversion{V2.5}
\def\filedate{2004/07/15}
\@ifundefined{Vmargin}{}{\endinput}
\@ifundefined{documentclass}{
\edef\Vmargin{Style `\filename', \fileversion, \filedate}
\expandafter\everyjob\expandafter{\the\everyjob\typeout{\Vmargin}}
\typeout{\Vmargin}
}{
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\edef\Vmargin{\filedate\space\fileversion\space set document margins (VK)}
\ProvidesPackage{\filename}[\Vmargin]
\edef\Vmargin{Package: \filename\space\Vmargin}
\expandafter\everyjob\expandafter{\the\everyjob\typeout{\Vmargin}}
\typeout{\Vmargin}
}
\newdimen\PaperWidth
\newdimen\PaperHeight
\newif\ifLandscape
\def\setpapersize{\@ifnextchar[{\@@setps}{\@@setps[portrait]}}
\def\@@setps[#1]{%
\@ifundefined{po@#1}{\@name@err{#1}}{\@nameuse{po@#1}}%
\@@@setps}
\def\@@@setps#1{%
\@ifundefined{paper@#1}{\@name@err{#1}}{}%
\csname paper@#1\endcsname}
% \usename{paper@#1} inside arg to \@ifundefined does not work
% with papersize "custom".
\def\po@portrait{\Landscapefalse}
\def\po@landscape{\Landscapetrue}
\def\@po@{\ifLandscape
\dimen0\PaperWidth\PaperWidth\PaperHeight\PaperHeight\dimen0
\fi
\@ifundefined{paperwidth}{}{\paperwidth\PaperWidth}%
\@ifundefined{paperheight}{}{\paperheight\PaperHeight}%
\@ifundefined{pdfpagewidth}{}{\pdfpagewidth\PaperWidth}%
\@ifundefined{pdfpageheight}{}{\pdfpageheight\PaperHeight}%
}
\@ifundefined{PackageError}{
\def\@name@err#1{%
\typeout{*****> \string\setpapersize: illegal parameter: #1}}
}{
\def\@name@err#1{\PackageError{\filename}%
{Paper size or orientation unknown: #1}{}}
}
\def\@defmetricpaper#1#2#3{%
\begingroup
\count0=0
\def\w{\dimen1 }\def\h{\dimen2 }\def\s{\dimen3 }%
\w#2\h#3
\def\l{11}
\loop
\begingroup
\def\t{\the\count0}
\catcode`\t=11 % letter
\expandafter\xdef\csname paper@#1\the\count0\endcsname{%
\PaperWidth\the\w\PaperHeight\the\h\noexpand\@po@}
\endgroup
\s\w\w.5\h\h\s
\ifnum\the\count0<9
\advance\count0 by 1
\repeat
\endgroup
}
\@defmetricpaper{A}{840.9mm}{1189.2mm}
\@defmetricpaper{B}{1000mm}{1414mm}
\@defmetricpaper{C}{917mm}{1297mm}
\let\@defmetricpaper=\relax
\def\paper@USletter{\PaperWidth 8.5in \PaperHeight 11in \@po@}
\def\paper@USlegal{\PaperWidth 8.5in \PaperHeight 14in \@po@}
\def\paper@USexecutive{\PaperWidth 7.25in\PaperHeight 10.5in \@po@}
\def\paper@custom#1#2{\PaperWidth#1\PaperHeight#2\@po@}
\@ifundefined{margin@offset}{%
\def\margin@offset{%
\if@shiftmargins
\oddsidemargin -1truein\evensidemargin\oddsidemargin\topmargin\oddsidemargin
\hoffset\z@\voffset\z@
\else
\oddsidemargin\z@\evensidemargin\z@\topmargin\z@
\hoffset -1truein\voffset\hoffset
\fi
}}{}
\newif\if@shiftmargins
\@shiftmarginsfalse % this MUST be default (pageframe.sty)
\def\shiftmargins{\@shiftmarginstrue}
\newcommand\setmargins[8]{%
\margin@offset
\advance\oddsidemargin #1
\advance\evensidemargin \PaperWidth % = paperwidth - left - width
\advance\evensidemargin -#1
\advance\evensidemargin -#3
\advance\topmargin #2
\textwidth #3
\textheight #4
\headheight #5
\headsep #6
\@ifundefined{footheight}{}{\footheight=#7}%
\footskip #8
\chk@dimen{#1}{#2}{#3}{#4}%
}
\newcommand\setmarginsrb[8]{%
\margin@offset
\textwidth \PaperWidth % = paperwidth
\advance\textwidth -#1 % - left - right
\advance\textwidth -#3
\textheight \PaperHeight % = paperheight - top
\advance\textheight -#2 % - headheight
\advance\textheight -#5 % - headsep
\advance\textheight -#6 % - footskip - bottom
\advance\textheight -#8
\advance\textheight -#4
\advance\oddsidemargin #1
\advance\evensidemargin \PaperWidth % = paperwidth - left - width
\advance\evensidemargin -#1
\advance\evensidemargin -\textwidth
\advance\topmargin #2
\headheight #5
\headsep #6
\@ifundefined{footheight}{}{\footheight=#7}%
\footskip #8
\chk@dimen{#1}{#2}{#3}{#4}%
}
\newcommand\setmargnohf[4]{%
\setmargins{#1}{#2}{#3}{#4}\z@\z@\z@\z@
\pagestyle{empty}}
\newcommand\setmargnohfrb[4]{%
\setmarginsrb{#1}{#2}{#3}{#4}\z@\z@\z@\z@
\pagestyle{empty}}
\newcommand\setmarg[4]{%
\setmargins{#1}{#2}{#3}{#4}%
\headheight\headsep\footheight\footskip}
\newcommand\setmargrb[4]{%
\setmarginsrb{#1}{#2}{#3}{#4}%
\headheight\headsep\footheight\footskip}
\def\chk@dimen#1#2#3#4{%
\dimen0= #1
\advance\dimen0 by#3
\advance\dimen0 -\PaperWidth
\dimen1= #2
\advance\dimen1 by#4
\advance\dimen1 \headheight
\advance\dimen1 \headsep
\advance\dimen1 \footskip
\advance\dimen1 -\PaperHeight
\chk@dimen@err
}
\@ifundefined{PackageError}{
\def\chk@dimen@err{%
\ifnum\dimen0>\z@\typeout{vmargin Warning: Horizontal dimensions
exceed paper width by \the\dimen0}\fi
\ifnum\dimen1>\z@\typeout{vmargin Warning: Vertical dimensions
exceed paper height by \the\dimen1}\fi
}
}{
\def\chk@dimen@err{%
\ifnum\dimen0>\z@\PackageError{\filename}{%
Horizontal dimensions exceed paper width by \the\dimen0}{}\fi
\ifnum\dimen1>\z@\PackageError{\filename}{%
Vertical dimensions exceed paper height by \the\dimen1}{}\fi
}
}
\setpapersize{A4}
\def\@hf@dflt{}
\@ifundefined{DeclareOption}{
}{
\DeclareOption{shiftmargins}{\shiftmargins}
\DeclareOption{portrait}{\Landscapefalse}
\DeclareOption{landscape}{\Landscapetrue}
\DeclareOption{nohf}{\def\@hf@dflt{y}}
\DeclareOption*{\@@@setps{\CurrentOption}}
\ProcessOptions\relax % process options in order of declaration!
}
\if y\@hf@dflt
\setmargnohfrb{35mm}{20mm}{25mm}{15mm}%
\else
\setmarginsrb{35mm}{20mm}{25mm}{15mm}{12pt}{11mm}{0pt}{11mm}%
\fi
\endinput
%%
%% End of file `vmargin.sty'.
|