summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-07-22 22:43:45 +0000
committerKarl Berry <karl@freefriends.org>2009-07-22 22:43:45 +0000
commit7189045dcbf98604e22d04c1064843841bfaac4d (patch)
treeeb53338d32a8095cb2c0348c392c1ff510fc1ddb /Master/texmf-dist
parent982e4c99db04310b07e6c39de52c9268e606701a (diff)
new latex package changelayout 0.1 (21jul09)
git-svn-id: svn://tug.org/texlive/trunk@14369 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/changelayout/README16
-rw-r--r--Master/texmf-dist/doc/latex/changelayout/changelayout-guide.pdfbin0 -> 49789 bytes
-rw-r--r--Master/texmf-dist/doc/latex/changelayout/changelayout-guide.tex133
-rw-r--r--Master/texmf-dist/tex/latex/changelayout/changelayout.sty413
4 files changed, 562 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/changelayout/README b/Master/texmf-dist/doc/latex/changelayout/README
new file mode 100644
index 00000000000..afc6f9f50f3
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/changelayout/README
@@ -0,0 +1,16 @@
+This package is an extension of Peter Wilson's 'changepage' package.
+It can be used to change text and page layout parameters locally
+(per page) or globally (for the whole document). The original
+layout parameters can be recovered at any time during runtime.
+
+Copyright (c) 2009 Ahmed Musa (a.musa@rocketmail.com).
+
+This work may be distributed and/or modified for commercial
+and non-commercial purposes.
+
+The LPPL maintenance status of this software is 'author-maintained'.
+
+This software is provided 'as it is', without warranty of any
+kind, either expressed or implied, including, but not limited to,
+the implied warranties of merchantability and fitness for a
+particular purpose. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/changelayout/changelayout-guide.pdf b/Master/texmf-dist/doc/latex/changelayout/changelayout-guide.pdf
new file mode 100644
index 00000000000..1cb975cfdef
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/changelayout/changelayout-guide.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/changelayout/changelayout-guide.tex b/Master/texmf-dist/doc/latex/changelayout/changelayout-guide.tex
new file mode 100644
index 00000000000..b859ce9546a
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/changelayout/changelayout-guide.tex
@@ -0,0 +1,133 @@
+\documentclass{article}
+\usepackage{lipsum,comment}
+\usepackage[left=3cm,right=3cm]{geometry}
+\usepackage[logdefault,logfinal,strictcheck]{changelayout}
+\usepackage{hyperref}
+\hypersetup{colorlinks=true,linkcolor=red,pdfpagemode=UseThumbs,
+ implicit=true,breaklinks=true,citecolor=purple}
+\xglobal\preparecolorset{rgb}{x}{0}{%
+ red1,1.00,0.31,0.31;%
+ red2,1.00,0.32,0.33;%
+ green1,0.00,0.50,0.00;%
+ green2,0.00,0.50,0.25;%
+ blue1,0.00,0.00,1.00;%
+ blue2,0.00,0.00,0.63;%
+ blue3,0.00,0.50,1.00;%
+ blue4,0.00,0.50,0.75;%
+ cyan1,0.50,0.84,1.00;%
+ magenta1,0.50,0.00,0.50;%
+ magenta2,0.50,0.00,1.00;%
+ magenta3,1.00,0.38,1.00;%
+ purple1,0.50,0.00,0.25;%
+ purple2,0.50,0.00,0.50;%
+ olive1,0.50,0.50,0.00;%
+ orange1,1.00,0.50,0.25%
+}
+\long\def\tempa{%
+ \begin{center}
+ \makebox[0pt]{\fboxrule2pt%
+ \fcolorbox{xred10}{yellow!25}{%
+ \parbox{\dimexpr(\hsize+3cm)}{%
+ This package is an extension of Peter Wilson's {\tt changepage} package.
+ \par\medskip
+ This package can be used with the \texttt{geometry} package,
+ but not with any \texttt{memoir} class. I used the \texttt{geometry} package in the source file of this document.
+ \par\medskip
+ All page and text layout parameters can be changed for each
+ page using the macros illustrated in the source file of
+ this document. Please see the comments in the source file.
+ \par\medskip
+ This is a preliminary user guide; a more detailed manual
+ is in the works.
+ }
+ }
+ }
+ \end{center}\relax
+}
+\begin{document}
+\title{The {\tt changelayout} Package}
+\author{Ahmed Musa\\[.5ex]University of Central Lancashire\\
+ Preston, United Kingdom\\[1ex]\url{a.musa@rocketmail.com}
+}
+\maketitle
+
+\adjusttextwidth{leftmargin=-1.5cm,rightmargin=-1.5cm,content=\tempa}
+\par\bigskip
+
+\lipsum[1-2]
+\par\medskip
+\adjusttextwidth{leftmargin=-1cm,rightmargin=-1cm,textcolor=blue,
+ content=\lipsum[1-2]}
+\par\medskip
+\lipsum[1-2]
+
+\newpage
+\lipsum[1-1]
+\par\medskip
+\adjusttextwidth{switchadjust=true,leftmargin=-0cm,rightmargin=-1.5cm,
+ textcolor=xmagenta20,content=\lipsum[1-2]}
+
+\newpage
+\lipsum[1-1]
+\par\medskip
+\adjusttextwidth{switchadjust=true,leftmargin=-0cm,rightmargin=-1.5cm,
+ textcolor=red,content=\lipsum[1-2]}
+
+\begin{comment}
+ 'switchadjust' is a boolean for switching left and right margins on
+ odd and even pages.
+
+ 'strictcheck' is a boolean for enforcing strict page number check
+ (the idea is from the 'changepage' package). For a large document,
+ 'strictcheck' will generate a corresponding large number of
+ labels. This is not expected to be a problem with modern implementations
+ of TeX/LaTeX.
+\end{comment}
+
+\newpage
+\color{xgreen10}
+\changetextlayout{oddsidemargin=-1cm, evensidemargin=0cm,textheight=550pt,
+ textwidth=515pt}
+\lipsum[1-4]
+\normalcolor
+
+\begin{comment}
+ In addition to \changetextlayout, there is also \changepagelayout.
+ Both \changetextlayout and \changepagelayout replace (in the total sense)
+ the prevailing text/page layout parameters by the values submitted by
+ the user. All the page layout parameters (including \marginparwidth)
+ can be changed/replaced by simply submitting their new values.
+\end{comment}
+
+\newpage
+\resetdefault%
+
+\begin{comment}
+ '\resetdefault' is a command for resetting page/text layout parameters
+ to the default values. The default parameters are saved at each run.
+
+ The original and final layout parameters are written into the log
+ file (and displayed on the screen) by issuing the booleans
+ 'logdefault' and 'logfinal' (respectively) as options to the
+ package (preferably at \usepackage). These may be useful when deciding
+ on the changes or adjustments to be effected.
+\end{comment}
+
+\color{xorange10}
+\adjusttextlayout{oddsidemargin=1cm, evensidemargin=-0cm, textheight=-50pt,
+ textwidth=-50pt,topmargin=25pt}
+\lipsum[1-4]
+
+\begin{comment}
+ In addition to \adjusttextlayout, there is also \adjustpagelayout.
+ Both \adjusttextlayout and \adjustpagelayout adjust (by adding or
+ subtracting) the prevailing text/page layout parameters by the
+ values given by the user. All the text and page layout parameters
+ can be adjusted.
+\end{comment}
+
+\newpage
+\resetdefault%
+\normalcolor
+
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/changelayout/changelayout.sty b/Master/texmf-dist/tex/latex/changelayout/changelayout.sty
new file mode 100644
index 00000000000..a385e5df7f7
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/changelayout/changelayout.sty
@@ -0,0 +1,413 @@
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+% This is file 'changelayout.sty', version 0.1. %
+% %
+% This package can be used to change page and text layout on the fly, %
+% (ie, for specific pages, and, of course, for the entire document). %
+% It is an extension of Peter Wilson's 'changepage' package. %
+% %
+% Copyright (c) 2009 Ahmed Musa (a.musa@rocketmail.com). %
+% %
+% This work may be distributed and/or modified for commercial and %
+% non-commercial purposes. %
+% %
+% The LPPL maintenance status of this software is 'author-maintained'. %
+% %
+% This software is provided 'as it is', without warranty of any kind, %
+% either expressed or implied, including, but not limited to, the %
+% implied warranties of merchantability and fitness for a particular %
+% purpose. %
+%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
+\ProvidesPackage{changelayout}[2009/06/25 v0.1 Change page layout on the fly]
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{etoolbox}
+\RequirePackage{xkeyval}
+\newrobustcmd\cpl@warn[1]{\PackageWarningNoLine{changelayout}{#1}}
+\newrobustcmd\cpl@info[1]{\PackageInfo{changelayout}{#1\@gobble}}
+\newrobustcmd\cpl@err[1]{\PackageError{changelayout}{#1}{\@ehc}}
+\@ifclassloaded{memoir}{%
+ \cpl@err{This package can't be used with\MessageBreak
+ memoir class. I've therefore exited}
+ \expandafter\endinput%
+}{}
+\@ifpackageloaded{xcolor}{%
+ \cpl@info{You've already loaded 'xcolor'\MessageBreak
+ package with options that possibly\MessageBreak
+ differ from my options.\MessageBreak
+ I've not reloaded 'xcolor'}
+}{%
+ \RequirePackage[dvipsnames*,svgnames*,x11names*,table,hyperref]{xcolor}
+ \cpl@info{'xcolor' package loaded with\MessageBreak
+ options 'dvipsnames*', 'svgnames*',\MessageBreak
+ 'x11names*', 'table', 'hyperref'}
+}
+\AtEndPreamble{%
+ \@ifpackageloaded{changepage}{%
+ \cpl@err{This package is a replacement for\MessageBreak
+ 'changepage' package.\MessageBreak
+ It can't be used with 'changepage'}
+ \expandafter\endinput%
+ }{}
+}
+\newrobustcmd*\csmdef[1]{\expandafter\csname#1\endcsname}
+\newrobustcmd*\cpl@numexpr[2]{%
+ \ifstrempty{#2}{%
+ \cpl@err{You can't assign empty argument\MessageBreak
+ to number}}{}
+ \ifcsundef{#1}{%
+ \expandafter\newcount\csname#1\endcsname%
+ \csmdef{#1}=\the\numexpr#2\relax
+ }{\csmdef{#1}=\the\numexpr#2\relax}
+}
+\newrobustcmd*\cpl@dimexpr[2]{%
+ \ifstrempty{#2}{%
+ \cpl@err{You can't assign empty argument\MessageBreak
+ to dimension}}{}
+ \ifcsundef{#1}{%
+ \expandafter\newdimen\csname#1\endcsname%
+ \csmdef{#1}=\the\dimexpr#2\relax
+ }{\csmdef{#1}=\the\dimexpr#2\relax}
+}
+\newrobustcmd\cpl@changetext{%
+ \@colht=\textheight%
+ \@colroom=\textheight%
+ \vsize=\textheight%
+ \columnwidth=\textwidth%
+ \if@twocolumn
+ \cpl@dimexpr{dimen@}{(\columnwidth-\columnsep)/2}
+ \columnwidth=\dimen@%
+ \@firstcolumntrue
+ \fi
+ \hsize=\columnwidth%
+ \linewidth=\hsize%
+}
+\protected@edef\cpl@setdefault{%
+ \noexpand\cpl@dimexpr{cpl@orig@paperwidth}{\paperwidth}%
+ \noexpand\cpl@dimexpr{cpl@orig@paperheight}{\paperheight}%
+ \noexpand\cpl@dimexpr{cpl@orig@textheight}{\textheight}%
+ \noexpand\cpl@dimexpr{cpl@orig@textwidth}{\textwidth}%
+ \noexpand\cpl@dimexpr{cpl@orig@oddsidemargin}{\oddsidemargin}%
+ \noexpand\cpl@dimexpr{cpl@orig@evensidemargin}{\evensidemargin}%
+ \noexpand\cpl@dimexpr{cpl@orig@topmargin}{\topmargin}%
+ \noexpand\cpl@dimexpr{cpl@orig@headsep}{\headsep}%
+ \noexpand\cpl@dimexpr{cpl@orig@headheight}{\headheight}%
+ \noexpand\cpl@dimexpr{cpl@orig@footskip}{\footskip}%
+ \noexpand\cpl@dimexpr{cpl@orig@footins}{\skip\footins}%
+ \noexpand\cpl@dimexpr{cpl@orig@marginparwidth}{\marginparwidth}%
+ \noexpand\cpl@dimexpr{cpl@orig@marginparsep}{\marginparsep}%
+ \noexpand\cpl@dimexpr{cpl@orig@marginparpush}{\marginparpush}%
+ \noexpand\cpl@dimexpr{cpl@orig@columnsep}{\columnsep}%
+ \noexpand\cpl@dimexpr{cpl@orig@columnseprule}{\columnseprule}%
+ \noexpand\cpl@dimexpr{cpl@orig@linewidth}{\linewidth}%
+ \noexpand\cpl@dimexpr{cpl@orig@hoffset}{\hoffset}%
+ \noexpand\cpl@dimexpr{cpl@orig@voffset}{\voffset}%
+ \noexpand\cpl@numexpr{cpl@orig@mag}{\mag}%
+}
+\@onlypreamble\cpl@setdefault%
+\cpl@setdefault%
+\long\def\cpl@print@defaultparams{%
+ ^^J*******************************************************^^J%
+ Original page layout dimensions and booleans^^J%
+ (changelayout package)^^J%
+ \string\paperwidth\space\space\the\cpl@orig@paperwidth^^J%
+ \string\paperheight\space\space\the\cpl@orig@paperheight^^J%
+ \string\textwidth\space\space\the\cpl@orig@textwidth^^J%
+ \string\textheight\space\space\the\cpl@orig@textheight^^J%
+ \string\oddsidemargin\space\space\the\cpl@orig@oddsidemargin^^J%
+ \string\evensidemargin\space\space\the\cpl@orig@evensidemargin^^J%
+ \string\topmargin\space\space\the\cpl@orig@topmargin^^J%
+ \string\headheight\space\space\the\cpl@orig@headheight^^J%
+ \string\headsep\space\space\the\cpl@orig@headsep^^J%
+ \string\footskip\space\space\the\cpl@orig@footskip^^J%
+ \string\marginparwidth\space\space\the\cpl@orig@marginparwidth^^J%
+ \string\marginparsep\space\space\the\cpl@orig@marginparsep^^J%
+ \string\columnsep\space\space\the\cpl@orig@columnsep^^J%
+ \string\columnseprule\space\space\the\cpl@orig@columnseprule^^J%
+ \string\skip\string\footins\space\space\the\cpl@orig@footins^^J%
+ \string\hoffset\space\space\the\cpl@orig@hoffset^^J%
+ \string\voffset\space\space\the\cpl@orig@voffset^^J%
+ \string\mag\space\space\the\cpl@orig@mag^^J%
+ \if@twocolumn\string\@twocolumntrue\space\fi%
+ \if@twoside\string\@twosidetrue\space\fi%
+ \if@mparswitch\string\@mparswitchtrue\space\fi%
+ \if@reversemargin\string\@reversemargintrue\space\fi^^J%
+ (1in=72.27pt, 1cm=28.45pt)^^J%
+ *******************************************************^^J%
+}%
+\@onlypreamble\cpl@print@defaultparams
+\long\def\cpl@print@finalparams{%
+ ^^J+++++++++++++++++++++++++++++++++++++++++++++++++++++++^^J%
+ Final page layout dimensions and booleans^^J%
+ (changelayout package)^^J%
+ \string\paperwidth\space\space\the\paperwidth^^J%
+ \string\paperheight\space\space\the\paperheight^^J%
+ \string\textwidth\space\space\the\textwidth^^J%
+ \string\textheight\space\space\the\textheight^^J%
+ \string\oddsidemargin\space\space\the\oddsidemargin^^J%
+ \string\evensidemargin\space\space\the\evensidemargin^^J%
+ \string\topmargin\space\space\the\topmargin^^J%
+ \string\headheight\space\space\the\headheight^^J%
+ \string\headsep\space\space\the\headsep^^J%
+ \string\footskip\space\space\the\footskip^^J%
+ \string\marginparwidth\space\space\the\marginparwidth^^J%
+ \string\marginparsep\space\space\the\marginparsep^^J%
+ \string\columnsep\space\space\the\columnsep^^J%
+ \string\columnseprule\space\space\the\columnseprule^^J%
+ \string\skip\string\footins\space\space\the\footins^^J%
+ \string\hoffset\space\space\the\hoffset^^J%
+ \string\voffset\space\space\the\voffset^^J%
+ \string\mag\space\space\the\mag^^J%
+ \if@twocolumn\string\@twocolumntrue\space\fi%
+ \if@twoside\string\@twosidetrue\space\fi%
+ \if@mparswitch\string\@mparswitchtrue\space\fi%
+ \if@reversemargin\string\@reversemargintrue\space\fi^^J%
+ (1in=72.27pt, 1cm=28.45pt)^^J%
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++^^J%
+}%
+\protected@edef\cpl@resetdefault{%
+ \noexpand\setlength{\paperwidth}{\cpl@orig@paperwidth}%
+ \noexpand\setlength{\paperheight}{\cpl@orig@paperheight}%
+ \noexpand\setlength{\textheight}{\cpl@orig@textheight}%
+ \noexpand\setlength{\textwidth}{\cpl@orig@textwidth}%
+ \noexpand\setlength{\linewidth}{\cpl@orig@linewidth}%
+ \noexpand\setlength{\oddsidemargin}{\cpl@orig@oddsidemargin}%
+ \noexpand\setlength{\evensidemargin}{\cpl@orig@evensidemargin}%
+ \noexpand\setlength{\topmargin}{\cpl@orig@topmargin}%
+ \noexpand\setlength{\headsep}{\cpl@orig@headsep}%
+ \noexpand\setlength{\headheight}{\cpl@orig@headheight}%
+ \noexpand\setlength{\footskip}{\cpl@orig@footskip}%
+ \noexpand\setlength{\skip\footins}{\cpl@orig@footins}%
+ \noexpand\setlength{\marginparwidth}{\cpl@orig@marginparwidth}%
+ \noexpand\setlength{\marginparsep}{\cpl@orig@marginparsep}%
+ \noexpand\setlength{\marginparpush}{\cpl@orig@marginparpush}%
+ \noexpand\setlength{\columnsep}{\cpl@orig@columnsep}%
+ \noexpand\setlength{\columnseprule}{\cpl@orig@columnseprule}%
+ \noexpand\setlength{\hoffset}{\cpl@orig@hoffset}%
+ \noexpand\setlength{\voffset}{\cpl@orig@voffset}%
+ \noexpand\mag=\cpl@orig@mag%
+ \noexpand\cpl@changetext%
+ \noexpand\cpl@info{Default layout parameters reset}
+}
+\def\cpl@content{No content}
+\def\cpl@textheight{\textheight}
+\def\cpl@textwidth{\textwidth}
+\def\cpl@evensidemargin{\evensidemargin}
+\def\cpl@oddsidemargin{\oddsidemargin}
+\def\cpl@topmargin{\topmargin}
+\def\cpl@headheight{\headheight}
+\def\cpl@headsep{\headsep}
+\def\cpl@footskip{\footskip}
+\def\cpl@footins{\skip\footins}
+\def\cpl@topsep{\topsep}
+\def\cpl@listparindent{\listparindent}
+\def\cpl@parindent{\parindent}
+\def\cpl@parsep{\parsep}
+\def\cpl@parskip{\parskip}
+\def\cpl@leftmargin{\leftmargin}
+\def\cpl@rightmargin{\rightmargin}
+\def\cpl@columnwidth{\columnwidth}
+\def\cpl@columnsep{\columnsep}
+\def\cpl@columnseprule{\columnseprule}
+\def\cpl@marginparwidth{\marginparwidth}
+\def\cpl@marginparsep{\marginparsep}
+\def\cpl@hoffset{\hoffset}
+\def\cpl@voffset{\voffset}
+\def\cpl@textcolor{black}
+\define@boolkey+[KV]{changelay}[cpl@]{reset}[true]{%
+ \cpl@resetdefault}{\cpl@warn{Erroneous value for 'reset' ignored}}
+\define@boolkeys[KV]{changelay}[cpl@]{switchadjust,logdefault,%
+ logfinal,strictcheck,oddpage}[true]{}
+\define@cmdkey[KV]{changelay}[cpl@]{content}[]{}
+\define@cmdkey[KV]{changelay}[cpl@]{textcolor}[black]{}
+\define@cmdkey[KV]{changelay}[cpl@]{textheight}[\textheight]{}
+\define@cmdkey[KV]{changelay}[cpl@]{textwidth}[\textwidth]{}
+\define@cmdkey[KV]{changelay}[cpl@]{evensidemargin}[\evensidemargin]{}
+\define@cmdkey[KV]{changelay}[cpl@]{oddsidemargin}[\oddsidemargin]{}
+\define@cmdkey[KV]{changelay}[cpl@]{topmargin}[\topmargin]{}
+\define@cmdkey[KV]{changelay}[cpl@]{headheight}[\headheight]{}
+\define@cmdkey[KV]{changelay}[cpl@]{headsep}[\headsep]{}
+\define@cmdkey[KV]{changelay}[cpl@]{footskip}[\footskip]{}
+\define@cmdkey[KV]{changelay}[cpl@]{footins}[\skip\footins]{}
+\define@cmdkey[KV]{changelay}[cpl@]{topsep}[\topsep]{}
+\define@cmdkey[KV]{changelay}[cpl@]{listparindent}[\parindent]{}
+\define@cmdkey[KV]{changelay}[cpl@]{parindent}[\parindent]{}
+\define@cmdkey[KV]{changelay}[cpl@]{parsep}[\parsep]{}
+\define@cmdkey[KV]{changelay}[cpl@]{parskip}[\parskip]{}
+\define@cmdkey[KV]{changelay}[cpl@]{leftmargin}[\leftmargin]{}
+\define@cmdkey[KV]{changelay}[cpl@]{rightmargin}[\rightmargin]{}
+\define@cmdkey[KV]{changelay}[cpl@]{columnwidth}[\columnwidth]{}
+\define@cmdkey[KV]{changelay}[cpl@]{columnsep}[\columnsep]{}
+\define@cmdkey[KV]{changelay}[cpl@]{columnseprule}[\columnseprule]{}
+\define@cmdkey[KV]{changelay}[cpl@]{marginparwidth}[\marginparwidth]{}
+\define@cmdkey[KV]{changelay}[cpl@]{marginparsep}[\marginparsep]{}
+\define@cmdkey[KV]{changelay}[cpl@]{hoffset}[\hoffset]{}
+\define@cmdkey[KV]{changelay}[cpl@]{voffset}[\voffset]{}
+\def\do#1{\csdef{cpl@x@#1}{\z@}}
+\docsvlist{textheight,textwidth,evensidemargin,oddsidemargin,topmargin,%
+ headheight,headsep,footskip,footins,topsep,listparindent,%
+ parindent,parsep,parskip,leftmargin,rightmargin,columnwidth,%
+ columnsep,columnseprule,marginparwidth,marginparsep,hoffset,voffset%
+}
+\define@cmdkeys[KV@X]{changelay}[cpl@x@]{%
+ textheight,textwidth,evensidemargin,oddsidemargin,topmargin,%
+ headheight,headsep,footskip,footins,topsep,listparindent,%
+ parindent,parsep,parskip,leftmargin,rightmargin,columnwidth,%
+ columnsep,columnseprule,marginparwidth,marginparsep,hoffset,voffset%
+}[\z@]
+\DeclareOptionX*{\cpl@warn{Unknown option '\CurrentOption' ignored}}
+\ExecuteOptionsX<changelay>{}
+\ProcessOptionsX*<changelay>\relax
+\cpl@numexpr{cpl@cnt@a}{\z@}
+\cpl@numexpr{cpl@mem@c@page}{\z@}
+\def\cpl@xlabel{_x_}
+\gdef\thecpl@mem@c@page{\the\c@page}
+\long\def\cpl@afterelsefi#1\else#2\fi{\fi#1}
+\newrobustcmd\cpl@protected@write[3]{%
+ \begingroup
+ \let\thecpl@mem@c@page\relax
+ #2%
+ \let\protect\@unexpandable@protect
+ \csedef{@tempa}{\write#1{#3}}\@tempa%
+ \endgroup
+ \if@nobreak\ifvmode\nobreak\fi\fi
+}
+\ifcpl@strictcheck\if@filesw\cpl@afterelsefi
+ \def\cpl@mem@label#1{%
+ \@bsphack
+ \cpl@protected@write\@auxout{}%
+ {\cpl@new@mem@label{#1}{\thecpl@mem@c@page}}%
+ \@esphack
+ }
+\else
+ \cpl@err{nofiles: I need to write in the .aux file}
+\fi\fi
+\def\cpl@new@mem@label#1#2{\csgdef{m@#1}{#2}}
+\def\cpl@mem@labelref#1{0\csuse{m@#1}}
+\newrobustcmd\checkifoddpage{%
+ \cpl@oddpagefalse%
+ \ifcpl@strictcheck
+ \global\advance\cpl@cnt@a\@ne
+ \cpl@mem@label{\cpl@xlabel\the\cpl@cnt@a}%
+ \cpl@mem@c@page=\cpl@mem@labelref{\cpl@xlabel\the\cpl@cnt@a}\relax
+ \ifodd\cpl@mem@c@page\cpl@oddpagetrue\fi
+ \else
+ \ifodd\c@page\cpl@oddpagetrue\fi
+ \fi
+}
+\ifcpl@logdefault
+ \cpl@protected@write{16}{}{\cpl@print@defaultparams}
+\fi
+\AtEndDocument{%
+ \ifcpl@logfinal
+ \immediate\write16{\cpl@print@finalparams}
+ \fi
+}
+\newrobustcmd\changetextlayout[1]{%
+ \setkeys[KV]{changelay}{#1}%
+ \setlength\textheight{\cpl@textheight}%
+ \setlength\textwidth{\cpl@textwidth}%
+ \setlength\evensidemargin{\cpl@evensidemargin}%
+ \setlength\oddsidemargin{\cpl@oddsidemargin}%
+ \setlength\columnsep{\cpl@columnsep}%
+ \setlength\columnseprule{\cpl@columnseprule}%
+ \cpl@changetext%
+ \setlength\marginparwidth{\cpl@marginparwidth}%
+ \setlength\marginparsep{\cpl@marginparsep}%
+ \setlength{\footskip}{\cpl@footskip}
+ \setlength{\skip\footins}{\cpl@footins}
+}
+\newrobustcmd\changepagelayout[1]{%
+ \setkeys[KV]{changelay}{#1}%
+ \setlength\textheight{\cpl@textheight}%
+ \setlength\textwidth{\cpl@textwidth}%
+ \setlength\evensidemargin{\cpl@evensidemargin}%
+ \setlength\oddsidemargin{\cpl@oddsidemargin}%
+ \setlength\columnsep{\cpl@columnsep}%
+ \setlength\columnseprule{\cpl@columnseprule}%
+ \cpl@changetext%
+ \setlength\topmargin{\cpl@topmargin}%
+ \setlength\headheight{\cpl@headheight}%
+ \setlength\headsep{\cpl@headsep}%
+ \setlength\footskip{\cpl@footskip}%
+ \setlength{\skip\footins}{\cpl@footins}
+ \setlength\marginparwidth{\cpl@marginparwidth}%
+ \setlength\marginparsep{\cpl@marginparsep}%
+}
+\newrobustcmd\adjusttextlayout[1]{%
+ \setkeys[KV@X]{changelay}{#1}%
+ \addtolength\textheight{\cpl@x@textheight}%
+ \addtolength\textwidth{\cpl@x@textwidth}%
+ \addtolength\evensidemargin{\cpl@x@evensidemargin}%
+ \addtolength\oddsidemargin{\cpl@x@oddsidemargin}%
+ \addtolength\columnsep{\cpl@x@columnsep}%
+ \setlength\columnseprule{\cpl@x@columnseprule}%
+ \cpl@changetext%
+ \addtolength\topmargin{\cpl@x@topmargin}%
+ \addtolength\headsep{\cpl@x@headsep}%
+ \addtolength\marginparwidth{\cpl@x@marginparwidth}%
+ \addtolength\marginparsep{\cpl@x@marginparsep}%
+ \addtolength\footskip{\cpl@x@footskip}%
+ \addtolength{\skip\footins}{\cpl@x@footins}
+}
+\newrobustcmd\adjustpagelayout[1]{%
+ \setkeys[KV@X]{changelay}{#1}%
+ \addtolength\textheight{\cpl@x@textheight}%
+ \addtolength\textwidth{\cpl@x@textwidth}%
+ \addtolength\evensidemargin{\cpl@x@evensidemargin}%
+ \addtolength\oddsidemargin{\cpl@x@oddsidemargin}%
+ \addtolength\columnsep{\cpl@x@columnsep}%
+ \setlength\columnseprule{\cpl@x@columnseprule}%
+ \cpl@x@changetext%
+ \addtolength\topmargin{\cpl@x@topmargin}%
+ \addtolength\headheight{\cpl@x@headheight}%
+ \addtolength\headsep{\cpl@x@headsep}%
+ \addtolength\footskip{\cpl@x@footskip}%
+ \setlength{\skip\footins}{\cpl@x@footins}%
+ \addtolength\marginparwidth{\cpl@x@marginparwidth}%
+ \addtolength\marginparsep{\cpl@x@marginparsep}%
+}
+\newenvironment{cpl@adjustwidth}[2]{%
+ \begin{list}{}{%
+ \topsep=\z@%
+ \partopsep=\z@%
+ \listparindent=\parindent%
+ \parsep=\parskip%
+ \itemsep=\z@%
+ \setlength\leftmargin{#1}%
+ \setlength\rightmargin{#2}%
+ }%
+ \item[]}%
+{\end{list}\ignorespacesafterend}
+\newenvironment{cpl@adjustwidth*}[2]{%
+ \begin{list}{}{%
+ \topsep=\z@%
+ \partopsep=\z@%
+ \listparindent=\parindent%
+ \parsep=\parskip%
+ \itemsep=\z@%
+ \checkifoddpage%
+ \ifcpl@oddpage
+ \setlength\leftmargin{#1}%
+ \setlength\rightmargin{#2}%
+ \else
+ \setlength\leftmargin{#2}%
+ \setlength\rightmargin{#1}%
+ \fi
+ }\item[]}%
+{\end{list}\ignorespacesafterend}
+\newrobustcmd\adjusttextwidth[1]{%
+ \setkeys[KV]{changelay}{#1}%
+ \ifcpl@switchadjust
+ \begin{cpl@adjustwidth*}{\cpl@leftmargin}{\cpl@rightmargin}%
+ \textcolor{\cpl@textcolor}{\cpl@content}%
+ \end{cpl@adjustwidth*}\relax
+ \else
+ \begin{cpl@adjustwidth}{\cpl@leftmargin}{\cpl@rightmargin}%
+ \textcolor{\cpl@textcolor}{\cpl@content}%
+ \end{cpl@adjustwidth}\relax
+ \fi
+}
+\newrobustcmd\resetdefault{%
+ \setkeys[KV]{changelay}{reset=true}%
+}
+
+\endinput \ No newline at end of file