| 1 |
\RequirePackage{xkvltxp} |
| 2 |
\documentclass{article} |
| 3 |
\usepackage{comment,xspace,lipsum} |
| 4 |
\usepackage[left=3cm,right=3cm]{geometry} |
| 5 |
\usepackage[logdefault,logfinal,strictcheck]{changelayout} |
| 6 |
\usepackage{hyperref} |
| 7 |
\hypersetup{colorlinks=true,linkcolor=red,pdfpagemode=UseThumbs, |
| 8 |
implicit=true,breaklinks=true,citecolor=purple,pdfview=FitH, |
| 9 |
pdfstartview=FitH} |
| 10 |
\xglobal\preparecolorset{rgb}{x}{0}{% |
| 11 |
red1,1.00,0.31,0.31;red2,1.00,0.32,0.33;% |
| 12 |
green1,0.00,0.50,0.00;green2,0.00,0.50,0.25;% |
| 13 |
blue1,0.00,0.00,1.00;blue2,0.00,0.00,0.63;% |
| 14 |
blue3,0.00,0.50,1.00;blue4,0.00,0.50,0.75;% |
| 15 |
cyan1,0.50,0.84,1.00;magenta1,0.50,0.00,0.50;% |
| 16 |
magenta2,0.50,0.00,1.00;magenta3,1.00,0.38,1.00;% |
| 17 |
purple1,0.50,0.00,0.25;purple2,0.50,0.00,0.50;% |
| 18 |
olive1,0.50,0.50,0.00;orange1,1.00,0.50,0.25;% |
| 19 |
yellow1,1.00,1.00,0.00;yellow2,1.00,1.00,0.70% |
| 20 |
} |
| 21 |
\new\let\TC\textcolor |
| 22 |
\newrobustcmd*\stya[1]{\TC{xgreen10}{\texttt{#1}}\xspace} |
| 23 |
\newrobustcmd*\styb[1]{\TC{teal}{\texttt{#1}}\xspace} |
| 24 |
\newrobustcmd*\cmda[1]{\begingroup |
| 25 |
\escapechar=92\endgroup\TC{xgreen10}{\texttt{\string#1}}\xspace} |
| 26 |
\newrobustcmd*\cmdb[1]{\begingroup |
| 27 |
\escapechar=92\endgroup\TC{teal}{\texttt{\string#1}}\xspace} |
| 28 |
\long\csdef{temp1}{% |
| 29 |
\begin{center} |
| 30 |
\makebox[0pt]{\fboxrule2pt% |
| 31 |
\fcolorbox{xred10}{xyellow20}{% |
| 32 |
\parbox{\dimexpr\hsize-3cm}{% |
| 33 |
This package is an extension of Peter Wilson's {\tt changepage} package. |
| 34 |
\par\medskip |
| 35 |
This package can be used with the \texttt{geometry} package, |
| 36 |
but not with any \texttt{memoir} class. I used the \texttt{geometry} |
| 37 |
package in the source file of this document. |
| 38 |
\par\medskip |
| 39 |
All page and text layout parameters can be changed for each |
| 40 |
page using the macros illustrated in the source file of |
| 41 |
this document. Please see the comments in the source file. |
| 42 |
\par\medskip |
| 43 |
This is a preliminary user guide; a more detailed manual |
| 44 |
is in the works.}}} |
| 45 |
\end{center} |
| 46 |
\vspace*{2\baselineskip} |
| 47 |
} |
| 48 |
\long\csdef{temp2}{\section*{Use of \cmda{\adjusttextwidth} |
| 49 |
\\--- with text extending into both margins}\par\lipsum[1-2]} |
| 50 |
\long\csdef{temp3}{\section*{Use of \cmda{\adjusttextwidth} |
| 51 |
with \cmda{switchadjust}}\par\noindent\lipsum[1-2]} |
| 52 |
\long\csdef{temp4}{{\flushright\section*{Use of \cmda{\adjusttextwidth} |
| 53 |
with \cmda{switchadjust}}}\par\noindent\lipsum[1-2]} |
| 54 |
|
| 55 |
\begin{document} |
| 56 |
|
| 57 |
\title{The {\tt changelayout} Package} |
| 58 |
\author{Ahmed Musa\\[.5ex]University of Central Lancashire\\ |
| 59 |
Preston, United Kingdom\\[1ex]\url{[email protected]} |
| 60 |
} |
| 61 |
\maketitle |
| 62 |
|
| 63 |
\begin{comment} |
| 64 |
Make text width smaller by 3cm (1.5cm into each margin): |
| 65 |
\end{comment} |
| 66 |
\adjusttextwidth{leftmargin=1.5cm,rightmargin=1.5cm,content=\csuse{temp1}} |
| 67 |
|
| 68 |
\section*{Default layout (as set with \styb{geometry} package)} |
| 69 |
\lipsum[1-2] |
| 70 |
|
| 71 |
\begin{comment} |
| 72 |
Make text width wider by 2cm (1cm into each margin): |
| 73 |
\end{comment} |
| 74 |
\adjusttextwidth{leftmargin=-1cm,rightmargin=-1cm,textcolor=blue, |
| 75 |
content=\csuse{temp2}} |
| 76 |
|
| 77 |
\section*{Default layout} |
| 78 |
\lipsum[1-2] |
| 79 |
|
| 80 |
\newpage |
| 81 |
\lipsum[1-1] |
| 82 |
|
| 83 |
\begin{comment} |
| 84 |
Make text width wider into right margin by 1.5cm on odd pages. |
| 85 |
'switchadjust' is a boolean for switching left and right margins on |
| 86 |
odd and even pages. This is useful for twoside printing, where |
| 87 |
the user may want the text extended only into outer margins: |
| 88 |
\end{comment} |
| 89 |
|
| 90 |
\adjusttextwidth{switchadjust=true,leftmargin=-0cm,rightmargin=-1.5cm, |
| 91 |
textcolor=xmagenta20,content=\csuse{temp3}} |
| 92 |
|
| 93 |
\newpage |
| 94 |
\lipsum[1-1] |
| 95 |
|
| 96 |
\begin{comment} |
| 97 |
Make text width wider into right margin by 1.5cm, but |
| 98 |
'switchadjust=true' means that it is actually the left margin |
| 99 |
that is made wider on even pages. If the value of 'switchadjust' |
| 100 |
is 'true', you can simply enter 'switchadjust' without value: |
| 101 |
\end{comment} |
| 102 |
|
| 103 |
\adjusttextwidth{switchadjust,leftmargin=-0cm,rightmargin=-1.5cm, |
| 104 |
textcolor=red,content=\csuse{temp4}} |
| 105 |
|
| 106 |
\begin{comment} |
| 107 |
'strictcheck' is a boolean for enforcing strict page number check |
| 108 |
(the idea is from the 'changepage' package). See the |
| 109 |
\usepackage{changelayout} statement above. |
| 110 |
Strict page checking is a safeguard against unlikely changes |
| 111 |
to the kernel page counter by another macro or package. For a |
| 112 |
large document, 'strictcheck' will generate a correspondingly |
| 113 |
large number of labels. This is not expected to be a problem |
| 114 |
with modern implementations of TeX/LaTeX; so I decided to |
| 115 |
retain it. |
| 116 |
\end{comment} |
| 117 |
|
| 118 |
\newpage |
| 119 |
\begin{comment} |
| 120 |
The layout of individual pages can be changed by using |
| 121 |
\changepagelayout or \changetextlayout (they are synonymous). |
| 122 |
|
| 123 |
Both \changetextlayout and \changepagelayout replace (in the |
| 124 |
total sense) the prevailing text/page layout parameters by the |
| 125 |
values submitted by the user through these macros. All the page |
| 126 |
layout parameters (including \marginpar parameters) can be |
| 127 |
changed/replaced by simply submitting (via these macros) |
| 128 |
the new parameter values. |
| 129 |
\end{comment} |
| 130 |
\color{xpurple10} |
| 131 |
\changetextlayout{oddsidemargin=-1cm,evensidemargin=0cm,textheight=550pt, |
| 132 |
textwidth=530pt} |
| 133 |
\section*{Use of \cmda{\changetextlayout}} |
| 134 |
\lipsum[1-4] |
| 135 |
\normalcolor |
| 136 |
|
| 137 |
\newpage |
| 138 |
\resetdefault% |
| 139 |
|
| 140 |
\begin{comment} |
| 141 |
\resetdefault is a command for resetting page/text layout parameters |
| 142 |
to the default values. The default parameters are saved at each run. |
| 143 |
If the 'geometry' package is loaded, the default parameters will be |
| 144 |
those determined by 'geometry'. \resetdefault is very handy for |
| 145 |
recovering from page/text layout changes. |
| 146 |
|
| 147 |
The original and final layout parameters are written into the log |
| 148 |
file (and displayed on the screen) if the user issues the booleans |
| 149 |
'logdefault' and 'logfinal' (respectively) as options to the |
| 150 |
package (preferably at \usepackage). These may be useful when deciding |
| 151 |
on the changes or adjustments to be effected. |
| 152 |
\end{comment} |
| 153 |
|
| 154 |
\begin{comment} |
| 155 |
In addition to \changepagelayout and \changetextlayout, there are |
| 156 |
also \adjustpagelayout and \adjusttextlayout (again these |
| 157 |
are synonymous). |
| 158 |
|
| 159 |
Both \adjustpagelayout and \adjusttextlayout adjust (by adding to or |
| 160 |
subtracting from) the prevailing text/page layout parameters the |
| 161 |
values given by the user. All the text and page layout parameters |
| 162 |
can be 'adjusted' by using these macros. |
| 163 |
\end{comment} |
| 164 |
|
| 165 |
\color{xorange10} |
| 166 |
\adjusttextlayout{oddsidemargin=1cm, evensidemargin=-0cm, textheight=-50pt, |
| 167 |
textwidth=-50pt,topmargin=25pt} |
| 168 |
\section*{Use of \cmda{\adjusttextlayout}} |
| 169 |
\lipsum[1-4] |
| 170 |
\normalcolor |
| 171 |
|
| 172 |
\newpage |
| 173 |
\resetdefault% |
| 174 |
\section*{Default layout --- obtained by issuing \cmda{\resetdefault}} |
| 175 |
\textbf{\large The default is as set initially using the \styb{geometry} package.} |
| 176 |
\par\medskip |
| 177 |
\lipsum[1-4] |
| 178 |
|
| 179 |
|
| 180 |
\end{document} |