1% ===================================================================== 2% HOL Manual LaTeX Source: layout test file 3% ===================================================================== 4 5\documentclass[12pt]{book} 6\usepackage{fleqn} 7\input{layout.sty} 8 9 10\begin{document} 11 12\setlength{\unitlength}{1mm} 13 14% --------------------------------------------------------------------- 15% \rsize = the width of lines around stuff 16% --------------------------------------------------------------------- 17 18\newlength{\rsize} 19\setlength{\rsize}{0.1mm} 20 21\linethickness{\rsize} 22 23% --------------------------------------------------------------------- 24% \textw = \textwidth - width of two lines 25% \texth = \textheight - width of two lines 26% \headh = \headheigth - width of two lines 27% --------------------------------------------------------------------- 28 29\newlength{\textw} 30\setlength{\textw}{\textwidth} 31\addtolength{\textw}{-2\rsize} 32 33\newlength{\texth} 34\setlength{\texth}{\textheight} 35\addtolength{\texth}{-2\rsize} 36 37\newlength{\headh} 38\setlength{\headh}{\headheight} 39\addtolength{\headh}{-2\rsize} 40 41%\newlength{\footh} 42%\setlength{\footh}{\footheight} 43%\addtolength{\footh}{-2\rsize} 44 45% --------------------------------------------------------------------- 46% \eveninner = size of even-page inner margin 47% \oddouter = size of odd-page outer margin 48% --------------------------------------------------------------------- 49 50\newdimen\eveninner 51\eveninner=210mm 52\advance\eveninner by -1\textwidth 53\advance\eveninner by -1.0in 54\advance\eveninner by -\evensidemargin 55 56\newdimen\oddouter 57\oddouter=210mm 58\advance\oddouter by -1\textwidth 59\advance\oddouter by -1.0in 60\advance\oddouter by -\oddsidemargin 61 62 63% --------------------------------------------------------------------- 64% For frames around things 65% --------------------------------------------------------------------- 66\newbox\textbox 67 68\long\def\Frame#1{\leavevmode 69 \hbox{\vbox{\hrule height\rsize 70 \hbox{\vrule width\rsize #1\vrule width\rsize} 71 \hrule height\rsize}}} 72 73% --------------------------------------------------------------------- 74% Change the head/foot 75% --------------------------------------------------------------------- 76 77\makeatletter 78 79%\def\@oddfoot{\Frame{\vbox to \footh {\vfil {\hbox to \textw{\hfill}\vfil}}}} 80 81%\def\@evenfoot{\Frame{\vbox to \footh {\vfil {\hbox to \textw {\hfill}\vfil}}}} 82 83\def\@evenhead{\Frame{\vbox to \headh {\vspace*{0.5mm} {\hbox to \textw {\hspace*{1mm}\thepage\hfil}\vfil}}}} 84 85\def\@oddhead{\Frame{\vbox to \headh {\vspace*{0.5mm} {\hbox to \textw {\hfil 86\thepage\hspace*{1mm}}\vfil}}}} 87 88\makeatother 89 90% --------------------------------------------------------------------- 91% For converting point dimensions to mm 92% --------------------------------------------------------------------- 93 94\newcount\cnt 95\newcount\cntt 96\newcount\cnttt 97\newdimen\dimn 98 99\def\conv#1{\cntt=#1 \divide\cntt by 186467 100 \dimn=#1 \multiply\dimn by 10 101 \cnt=\dimn \divide\cnt by 186467 102 \cnttt=\cntt \multiply\cnttt by 10 103 \advance\cnt by -\cnttt \the\cntt.\the\cnt\ mm} 104 105\def\addconv#1{\dimn=#1 \advance\dimn by 1in \cntt=\dimn 106 \divide\cntt by 186467 107 \dimn=#1 \advance\dimn by 1in \multiply\dimn by 10 108 \cnt=\dimn \divide\cnt by 186467 109 \cnttt=\cntt \multiply\cnttt by 10 110 \advance\cnt by -\cnttt \the\cntt.\the\cnt\ mm} 111 112 113% --------------------------------------------------------------------- 114% Page 1 115% --------------------------------------------------------------------- 116 117\setbox\textbox=\vbox to \texth {\vfil {\hbox to \textw {\hfil 118 119\begin{tabular}{@{}ll} 120width of text: & \conv{\textwidth} \\ 121height of text: & \conv{\textheight} \\ 122inner margin: & \addconv{\oddsidemargin} \\ 123outer margin: & \conv{\oddouter} \\ 124top margin: & \addconv{\topmargin} \\ 125\end{tabular} 126 127 128\hfil}\vfil}} 129 130\noindent \Frame{\box\textbox} 131 132\newpage 133 134% --------------------------------------------------------------------- 135% Page 2 136% --------------------------------------------------------------------- 137 138\makeatletter 139 140\def\@oddfoot{} 141\def\@evenfoot{} 142 143\makeatother 144 145\setbox\textbox=\vbox to \texth {\vfil {\hbox to \textw {\hfil 146 147\begin{tabular}{@{}ll} 148width of text: & \conv{\textwidth} \\ 149height of text: & \conv{\textheight} \\ 150inner margin: & \conv{\eveninner} \\ 151outer margin: & \addconv{\evensidemargin} \\ 152top margin: & \addconv{\topmargin} \\ 153\end{tabular} 154 155 156\hfil}\vfil}} 157 158\noindent \Frame{\box\textbox} 159 160\newpage 161 162 163 164% --------------------------------------------------------------------- 165% Page 3 166% --------------------------------------------------------------------- 167 168\setbox\textbox=\vbox to \texth {\vfil {\hbox to \textw {\hfil 169 170\begin{tabular}{@{}ll} 171width of text: & \conv{\textwidth} \\ 172height of text: & \conv{\textheight} \\ 173inner margin: & \addconv{\oddsidemargin} \\ 174outer margin: & \conv{\oddouter} \\ 175top margin: & \addconv{\topmargin} \\ 176\end{tabular} 177 178 179\hfil}\vfil}} 180 181\noindent \Frame{\box\textbox} 182\newpage 183 184% --------------------------------------------------------------------- 185% Page 4 186% --------------------------------------------------------------------- 187 188\setbox\textbox=\vbox to \texth {\vfil {\hbox to \textw {\hfil 189 190\begin{tabular}{@{}ll} 191width of text: & \conv{\textwidth} \\ 192height of text: & \conv{\textheight} \\ 193inner margin: & \conv{\eveninner} \\ 194outer margin: & \addconv{\evensidemargin} \\ 195top margin: & \addconv{\topmargin} \\ 196\end{tabular} 197 198 199\hfil}\vfil}} 200 201\noindent \Frame{\box\textbox} 202 203\makeatletter 204 205\def\@oddfoot{\hfil \Frame{\phantom{1}}\hfil} 206\def\@evenfoot{\hfil \Frame{\phantom{1}}\hfil} 207\def\@evenhead{} \def\@oddhead{} 208 209\makeatother 210 211\newpage 212 213% --------------------------------------------------------------------- 214% Page 5 215% --------------------------------------------------------------------- 216 217\setbox\textbox=\vbox to \texth {\vfil {\hbox to \textw {\hfil 218 219\begin{tabular}{@{}ll} 220width of text: & \conv{\textwidth} \\ 221height of text: & \conv{\textheight} \\ 222inner margin: & \conv{\eveninner} \\ 223outer margin: & \addconv{\evensidemargin} \\ 224top margin: & \addconv{\topmargin} \\ 225\end{tabular} 226 227\hfil}\vfil}} 228 229\noindent \Frame{\box\textbox} 230 231\end{document} 232