texlive[63865] Master: flexipage (10jul22)

commits+karl at tug.org commits+karl at tug.org
Sun Jul 10 21:58:42 CEST 2022


Revision: 63865
          http://tug.org/svn/texlive?view=revision&revision=63865
Author:   karl
Date:     2022-07-10 21:58:42 +0200 (Sun, 10 Jul 2022)
Log Message:
-----------
flexipage (10jul22)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/flexipage/
    trunk/Master/texmf-dist/doc/latex/flexipage/README.txt
    trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.pdf
    trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.tex
    trunk/Master/texmf-dist/doc/latex/flexipage/flexipage.pdf
    trunk/Master/texmf-dist/source/latex/flexipage/
    trunk/Master/texmf-dist/source/latex/flexipage/flexipage.dtx
    trunk/Master/texmf-dist/source/latex/flexipage/flexipage.ins
    trunk/Master/texmf-dist/tex/latex/flexipage/
    trunk/Master/texmf-dist/tex/latex/flexipage/flexipage.sty
    trunk/Master/tlpkg/tlpsrc/flexipage.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/flexipage/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/flexipage/README.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/flexipage/README.txt	2022-07-10 19:58:42 UTC (rev 63865)
@@ -0,0 +1,20 @@
+LaTeX package flexipage
+Copyright (c) Anton Vrba, 2022
+-------------------------------------------------------------------
+Version:
+  2022/07/09 1.00  Initial release
+Licence:
+  This work may be distributed and/or modified under the conditions
+  of the LaTeX Project Public License, version 1.3c of the license.
+  The latest version of this license is in
+     http://www.latex-project.org/lppl.txt
+     and version 1.3c or later is part of all distributions of LaTeX
+     version 2008-05-04 or later.
+Abstract:
+    The package flexipage allows easy page layout if marginalia is 
+    required. Mid document changes are possible such as: new marginal 
+    width, full width text, and landscape text without marginal. 
+    Partners well with the package sidenotesplus. The package also 
+    aids the layout for book printing, adding binding corrections 
+    and adding page bleed, if required by the printers
+-------------------------------------------------------------------
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/flexipage/README.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.pdf	2022-07-10 19:57:19 UTC (rev 63864)
+++ trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.pdf	2022-07-10 19:58:42 UTC (rev 63865)

Property changes on: trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.tex	2022-07-10 19:58:42 UTC (rev 63865)
@@ -0,0 +1,141 @@
+\documentclass[twoside,8pt]{extarticle}
+\PassOptionsToPackage{
+ paperheight =5in, % inherits from class
+ paperwidth = 4in, % inherits from class
+% inner = , % default 36pt or 0.5in
+% outer = , % 36pt or 0.5in
+% top = , % 36pt or 0.5in
+% bot = , % 36pt or 0.5in
+% binding = 9pt, % 9pt or 0.125in
+ outerbleed = 9pt, % 0pt, but check with your printer
+ innerbleed = 4pt, % 0pt, but check with your printer
+% grid  , % 12 it is just a number
+% marginalgrid =  , % 3 it is just a number
+% marginparsep =  , % 3ex, if using sidenotesplus change to 4 or 5ex
+% headsep = , % inherits from class
+% headheight = , % inherits from class
+% footskip=  , % inherits from class
+ show, % a switch to show frames around the printable areas.
+% fancyhdrOff
+}{flexipage}
+\usepackage{flexipage}
+\usepackage[]{lucimatx}
+\linespread{1.06}
+\usepackage{lipsum}
+\setlipsum{%
+  par-before = \begingroup\color{gray},
+  par-after = \endgroup,
+  sentence-before = \begingroup\color{gray},
+  sentence-after = \endgroup
+}
+
+\usepackage{fancyhdr}
+\pagestyle{fancy}
+\fancyhead[EL,OR]{\thepage}
+\fancyhead[ER]{My New Book}
+\fancyhead[OL]{Chapter 1}
+\renewcommand{\headrulewidth}{0pt}
+
+\usepackage{microtype}
+
+\begin{document}
+
+
+\begin{verbatim}
+\documentclass[twoside,8pt]{extbook}
+\PassOptionsToPackage{
+  paperheight = 5in, %  inherits from class
+  paperwidth =  4in , %  inherits from class
+% inner =         , %  default 36pt or 0.5in
+  outer =         , %          36pt or 0.5in
+% top =           , %          36pt or 0.5in
+% bot =           , %          36pt or 0.5in
+% binding =       , %           9pt or 0.125in
+  outerbleed = 9pt, %           0pt,
+  innerbleed = 4pt, %           0pt,
+% grid =          , %          12
+% marginalgrid =  , %           3
+% marginparsep =  , %           3ex,
+% headsep =       , % inherits from class
+% headheight =    , % inherits from class
+% footskip=       , % inherits from class
+  show            , % a switch to show frames
+% fancyhdrOff       % not using fancyhdr
+}{flexipage}
+\end{verbatim}
+\footnotesize
+
+         \lipsum[10][1-3] \marginpar[{\itshape\tiny\lipsum[1][1-4]}]{\itshape\tiny\lipsum[8]}
+
+         \lipsum[2] \marginpar[{\itshape\tiny\lipsum[1][1-4]}]{\itshape\tiny\lipsum[8][1-5]}
+
+         \lipsum[2][1-6]
+
+~
+
+{\normalsize
+\noindent\verb"\NewMarginPage<6ex>{4}" increases marginal and \verb"\parsep" on next page}
+\NewMarginPage<6ex>{4} % Increase margin size
+
+         \lipsum[3][1-3]  \marginpar[{\itshape\tiny\lipsum[1][1-4]}]{\itshape\tiny\lipsum[10][1-4]}
+
+         \lipsum[1][1-8]
+
+       \lipsum[2][1-7]
+
+~
+
+{\normalsize
+\noindent\verb"\ResetFlexiPage" to original page setup with the narrower margin}
+\ResetFlexiPage
+
+         \lipsum[10][1-5] \marginpar[{\itshape\tiny\lipsum[1][1-4]}]{\itshape\tiny\lipsum[1][1-3]} \lipsum[2]
+
+~
+
+{\normalsize
+\noindent\verb"\Lanscape" enters landscape mode}
+\begin{Landscape} % enter lanscape mode,
+
+         \lipsum[1-4]
+
+~
+
+{\normalsize
+\noindent\verb"\endLandscape" exits landscape mode }
+\end{Landscape} % exit lanscape mode,
+         \lipsum[2][1-5] \marginpar[{\itshape\tiny\lipsum[1][1-4]}]{\itshape\tiny\lipsum[1][1-3]} \lipsum[11]
+
+~
+
+{\normalsize
+\noindent\verb"\begin{landscape}" enters landscape environment}
+ \begin{landscape}
+ \lipsum[2-5]
+ \end{landscape}
+{\normalsize
+\noindent\verb"\end{landscape}" exits landscape environment}
+
+~
+
+ \marginpar[{\itshape\tiny\lipsum[1][1-4]}]{\itshape\tiny\lipsum[1][1-3]}  \lipsum[17]
+
+~
+
+{\normalsize
+\noindent\verb"\NewFullPage" enters full page mode}
+\NewFullPage
+
+         \lipsum[1-4]
+
+~
+
+{\normalsize
+\noindent\verb"\OldMarginPage " restores the previous page format}
+\OldMarginPage
+
+ \marginpar[{\itshape\tiny\lipsum[1][1-4]}]{\itshape\tiny\lipsum[1][1-3]}  \lipsum[17]
+
+
+
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/flexipage/Test-flexipage.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/flexipage/flexipage.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/flexipage/flexipage.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/flexipage/flexipage.pdf	2022-07-10 19:57:19 UTC (rev 63864)
+++ trunk/Master/texmf-dist/doc/latex/flexipage/flexipage.pdf	2022-07-10 19:58:42 UTC (rev 63865)

Property changes on: trunk/Master/texmf-dist/doc/latex/flexipage/flexipage.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/flexipage/flexipage.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/flexipage/flexipage.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/flexipage/flexipage.dtx	2022-07-10 19:58:42 UTC (rev 63865)
@@ -0,0 +1,818 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2022 by <+author+> <<+email+>>
+% ---------------------------------------------------------------------------
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+%   http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is <+maintainer+>.
+%
+% This work consists of the files flexipage.dtx and flexipage.ins
+% and the derived filebase flexipage.sty.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{flexipage.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+%<package>\ProvidesPackage{flexipage}
+%<*package>
+    [2022/07/09 1.00 Easy page geometry]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{xspace}
+\usepackage{tikz,amsmath, amssymb,bm,color}
+\usetikzlibrary{shapes,arrows}
+\usetikzlibrary{calc}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+  \voffset = -45pt
+  \textheight=210mm
+  \DocInput{flexipage.dtx}
+  \PrintChanges
+%  \PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+%
+%
+% \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         \~}
+%
+%
+% \changes{<+version+>}{<+date+>}{Converted to DTX file}
+%
+% \DoNotIndex{\newcommand,\newenvironment}
+%
+%
+% \providecommand*{\url}{\texttt}
+% \providecommand\lgtarg[1]{{\ttfamily<}\meta{#1}{\ttfamily>}}
+% \GetFileInfo{flexipage.dtx}
+%
+% \title{The \textsf{flexipage} package}
+% \author{Anton Vrba\\\small%
+% Home Page: \url{https://github.com/anton-vrba/flexipage} }
+% \date{\fileversion~from \filedate\\}
+%
+%
+% \maketitle
+%
+%  \begin{abstract}
+% \noindent The package flexipage allows easy page layout if marginalia is required.
+% Mid document changes are possible such as: new marginal width, full width text,
+% and landscape text without marginal. Partners well with the package \textsf{sidenotesplus}.
+% The package also aids the layout for book printing, allowing for binding corrections
+% and adding page bleed, if required,
+% \end{abstract}
+%
+%
+%
+% \noindent The aim is an easy to use the page geometry setup,
+% and allow mid-document changes such as from portrait
+% to landscape, or change the text body width to marginalia width ratio.
+% The philosophy is simple, easy to understand options quickly set up the page geometry:
+% \begin{enumerate}
+%   \item |pageheight| and |pagewidth| of final document, default inherited.
+%   \item Defines page margins |inner|, |outer|, |top| and |bot|. Inner refers to the binding
+%         that is the left side margin of on odd pages in |twoside| documents, or
+%         of pages in |oneside| documents. Page margins surround the printable area.
+%         Default for all |36pt|, or |0.5in|.
+%   \item Add a |binding| correction, default |9pt|.
+%   \item Add an |outerbleed|, increases the papersize by adding a bleed area to the
+%         non bound margins. For the seldom requirement an |innerbleed| adds to the
+%         paperwidth on the inner side.
+%         Refer to your publisher. Default for both |0pt|.
+%   \item Divide the remaining printable area into a vertical |grid|, default |12|.
+%   \item Insert a |marginparsep| (default |3ex|) at the |margingrid| position
+%         counting from the outer edge; 0 is for no
+%         marginalia, 1 is a narrow marginal note area, and 4 is a marginal note area
+%         of one halve the width of the text body area's width when |grid=12|.
+%         The marginal area is placed by the outer edge.
+%   \item The \LaTeX\xspace |headsep|, |headheight| and |footskip| dimension
+%         can also be passed as options, otherwise default to class values.
+%   \item As a visual guide, the option |show| frames the page geometry in the output
+% \end{enumerate}
+%
+% \footnotesize
+% \noindent \begin{tikzpicture}
+%
+% \draw [fill=yellow!30]  (-4,4.4) node (v1) {} rectangle (3,-4.2);
+% \draw[fill=white]  (-3.8,4.2) rectangle (2.8,-4);
+% \draw [color=green, fill=green!20 ] (-2.8,3.6) rectangle (2.2,-3.4);%
+% \draw [fill=orange!10]  (-2.8,3.6) rectangle (0.8,3.4);
+% \draw [fill=orange!10] (1,3) rectangle (2.2,-2.8);
+% \draw  [fill=orange!10](-2.8,3) rectangle (0.8,-2.8);
+% \draw  [fill=violet!10] (-3.8,-4.2) rectangle (v1);
+
+% \draw [loosely dashed, blue] (-3.4,4.2) -- (-3.4,-4);
+% \draw (-2.8,-3.4) -- (0.8,-3.4);
+% \draw [loosely dashed] (1.8,3) -- (1.8,-2.8);
+% \draw [loosely dashed] (1.4,3) -- (1.4,-2.8);
+% \draw [loosely dashed] (0.4,3) -- (0.4,-2.8);
+% \draw [loosely dashed] (0,3) -- (0,-2.8);
+% \draw [loosely dashed] (-0.4,3) -- (-0.4,-2.8);
+% \draw [loosely dashed] (-0.8,3) -- (-0.8,-2.8);
+% \draw [loosely dashed] (-1.2,3) -- (-1.2,-2.8);
+% \draw  [loosely dashed] (-1.6,3) -- (-1.6,-2.8);
+% \draw [loosely dashed](-2,3) -- (-2,-2.8);
+% \draw [loosely dashed](-2.4,3) -- (-2.4,-2.8);
+% \node at (-1.2,3.5) {Header};
+% \node at (-0.9,0.3) {Text Body};
+% \node [rotate=90] at (1.6,0.3) {Marginal};
+% \node [text width=65mm, right ] at (3.5,0.1)
+% {\small  The basic paper geometry for book printing is illustrated to the left.
+% This for odd page numbers, the recto page. The even pages mirror this geometry
+% to maintain verso--recto symmetry.
+% The final page size is the white area. The yellow outer coloured area is the
+% |outerbleed| and the violet colored area on the left is the |innerbleed|, these
+% are trimmed and discarded. Please refer to your publisher if needed.
+%
+% ~~~The green area is the text block containing the text body, the marginal,
+% the header and footer and is defined by the margins |top|,
+% |outer| and |bottom| to the trimmed paper's edge.
+% The inner side (left) vertical dot-dashed line represents the |binding| correction and the |inner|
+% margin is defined from this line.
+%
+% ~~~Here the illustrated text width plus the marginal width are divided into 12 equal |grid=12| divisions
+% with the marginal takin 3 of them, defined by |marginalgrid=3|.
+% .};
+% \node at (-1.2,-3.3) {Footer};
+% \end{tikzpicture}\small
+% \\ Also refer to:
+% \url{https://www.overleaf.com/learn/latex/Single\_sided\_and\_double\_sided\_documents}
+% \normalsize
+%
+% \section{Usage}
+% \subsection{Document preamble}
+% \small
+% \begin{verbatim}
+% \PassOptionsToPackage{
+% % a4paper         , % or another recognised paper size
+% % paperheight =   , %  inherits from class
+% % paperwidth =    , %  inherits from class
+% % inner =         , %  default 36pt or 0.5in
+% % outer =         , %          36pt or 0.5in
+% % top =           , %          36pt or 0.5in
+% % bot =           , %          36pt or 0.5in
+% % binding =       , %           9pt or 0.125in
+% % outerbleed =    , %           0pt, but check with your printer
+% % innerbleed =    , %           0pt, but check with your printer
+% % grid =          , %          12 it is just a number
+% % marginalgrid =  , %           3 it is just a number
+% % marginparsep =  , %           3ex, if using sidenotesplus change to 4 or 5ex
+% % headsep =       , % inherits from class
+% % headheight =    , % inherits from class
+% % footskip=       , % inherits from class
+% % show            , % a switch to show frames around the printable areas.
+% % fancyhdrOff     , % Do not use the fancyhdr package
+% % NoFixMargin       % a possible future requirement
+% }{flexipage}
+% \usepackage{flexipage}
+%   \end{verbatim}
+% \normalsize\vspace{-20pt}
+%
+% \paragraph{Known Issue:} If using the option |show| and the package \textsf{xcolor}
+% is loaded later with options, an error will occur. The reason
+% is that when option |show| is specified the package \textsf{eso-pic} is loaded
+% whch in turns loads \textsf{xcolor} without options.
+%
+% \paragraph{Marginalia Position Issue:} When doing mid document changes to |\textwidth|
+% and |\marginparwidth| then |\marginpar{content}| renders the marginalia to the correct
+% width but places it at the old position. A patch is provided here
+% to correct this issue. Should this ever be fixed in the
+% latex base software then the |NoFixMargin| option would be required.
+%
+% \paragraph{Using \textsf{fancyhdr} package} By default the \textsf{fancyhdr} package
+% is loaded and the |\headerlength| is set to span the page, that is it overhangs the
+% text body. The advantage here is that the header has the same format throughout
+% the document if mid-document layout changes are made. If no such changes are
+% made then use the |fancyhdrOff| and load \textsf{fancyhdr} in your preamble. Now
+% the header does not overhang the text body and is as shown in the previous illustration.
+%
+%
+% The following paper sizes are recognised:
+%
+% ~
+%
+% \begin{tabular}{rlp{2ex}rl}
+% \multicolumn{2}{c}{Standard Paper} & &\multicolumn{2}{c}{Standard Book}  \\
+%        a4paper &210$\times$297mm & &   US-Trade &6$\times$9in \\
+%        a5paper &148$\times$210mm & & UK-B-Format &135$\times$210mm \\
+%        b4paper &250$\times$353mm & & US-B-Format &129$\times$198mm \\
+%        b5paper &176$\times$250mm & &   UK-Royal &156$\times$234mm \\
+%        c4paper &229$\times$324mm & &     Quarto &9.5$\times$12in \\
+%        c5paper &162$\times$229mm & &     Octavo &6$\times$9in \\
+%       b4jpaper &257$\times$364mm & & CrownQuarto &189$\times$246mm \\
+%       b5jpaper &182$\times$257mm & &       Demi &138$\times$216mm \\
+%    letterpaper &8.5$\times$11in \\
+%     legalpaper &8.5$\times$14in \\
+% executivepaper &7.25$\times$10.5in \\
+% \end{tabular}
+
+%
+%\subsection{User Interfaces}
+%
+%
+% \DescribeMacro{\NewMarginPage} Changes text--marginal ratio.
+%  |\NewMarginPage|\oarg{g}\lgtarg{parsep}\marg{m}
+% where optionally the grid count is reset to |grid|=\textit{g}, and marginal  width is
+% determined by |marginalgrid|=\textit{m}. The ratio of the lengths |\textwidth|
+% to |\marginparwidth| is $g-m$ to $n$. The second option changes the |\parsep| length.
+%
+%
+% \DescribeMacro{\NewFullPage} Continues the document with a new page without margins,
+% and is equivalent to |\NewMarginPage|\marg{0}
+%
+%
+%
+% \DescribeMacro{\OldMarginPage}
+% \DescribeMacro{\ResetFlexiPage} After |\NewMarginPage| or |\NewFullPage| revert to
+% the previous page geometry, these are not stacked. |\ResetFlexiPage| reverts to the layout specified in
+% the initial options
+%
+%
+%
+%
+% \DescribeEnv{Landscape}
+% \DescribeEnv{landscape}
+% These two environments provide landscape layouts. The big |Landscape| provides
+% full text block landscape. The small |landscape| environments respects the
+% portrait orientated marginal space which now is white space. Do not use
+% marginalia in landscape mode.
+%
+% \DescribeMacro{\Landscape}
+% \DescribeMacro{\endLandscape}
+% \DescribeMacro{\landscape}
+% \DescribeMacro{\endlandscape} Alternatives to |\begin{Landscape}| $\cdots$  $\cdots$ |\end{Landscape}|
+% %
+%
+% \section{Implementation}
+%
+% \iffalse
+%<*package>
+% \fi
+%
+%    \begin{macrocode}
+\RequirePackage{xparse}   % new LaTeX3 syntax to define macros and environments
+\RequirePackage{l3keys2e} % nice way for option processing
+\RequirePackage{calc}     % length manipulation
+\RequirePackage{fp}       % floating point calculation
+\RequirePackage{ifoddpage}
+\RequirePackage{graphics}  % provides landscaping
+\RequirePackage{mparhack} % not needed here, but the user certainly needs it.
+\RequirePackage{etoolbox} % provides \patchcmd
+% ****** \RequirePackage{eso-pic} only loaded later if option show is specified
+\newlength{\fleximarginparsep}
+\newlength{\flx at paperheight}
+\newlength{\flx at paperwidth}
+\newlength{\flx at temp}
+\newlength{\flx at LSfix}
+\setlength{\flx at LSfix}{0pt}
+\newlength{\flx at lsfix}
+\setlength{\flx at lsfix}{0pt}
+\newlength{\flx at textheigt}
+\newlength{\flx at orgtextwidth}
+\newlength{\flx at oldparsep}
+\newlength{\flx at oparsep}
+\newlength{\flx at binding}
+\newlength{\marginparsepodd}
+\newlength{\marginparsepeven}
+\newlength{\flx at inner}
+\newlength{\flx at outer}
+\newlength{\flx at top}
+\newlength{\flx at bot}
+\newlength{\flx at parsep}
+\newlength{\flx at printarea}
+\newlength{\flx at outerbleed}
+\newlength{\flx at innerbleed}
+\setlength{\flx at binding}  {9pt}
+\setlength{\flx at inner} {36pt}
+\setlength{\flx at outer} {36pt}
+\setlength{\flx at top}   {36pt}
+\setlength{\flx at bot}   {45pt}
+\setlength{\flx at parsep}{3ex}
+\setlength{\flx at outerbleed} {0pt}
+\setlength{\flx at innerbleed} {0pt}
+\FPset\flx at m{3}
+\FPset\flx at g{12}
+\newif\ifSF at frame\SF at framefalse
+\newif\ifFix at Margin\Fix at Margintrue
+\newif\ifUse at fancyhdr\Use at fancyhdrtrue
+%    \end{macrocode}
+%
+%
+%
+%    \begin{macrocode}
+\setlength{\flx at paperheight}{\paperheight}
+\setlength{\flx at paperwidth}{\paperwidth}
+
+\NewDocumentCommand \flx at setpapersize {o o m}{
+\setlength{\flx at paperheight}{#2#3}
+\setlength{\flx at paperwidth}{#2#3}
+}
+
+
+\ExplSyntaxOn
+\keys_define:nn { flexiprint }
+{
+        binding .code:n = \setlength{\flx at binding}{#1},
+          inner .code:n = \setlength{\flx at inner}{#1},
+          outer .code:n = \setlength{\flx at outer}{#1},
+            top .code:n = \setlength{\flx at top}{#1},
+            bot .code:n = \setlength{\flx at bot}{#1},
+   marginparsep .code:n = \setlength{\flx at parsep}{#1},
+    paperheight .code:n = \setlength{\flx at paperheight}{#1},
+     paperwidth .code:n = \setlength{\flx at paperwidth}{#1},
+     outerbleed .code:n = \setlength{\flx at outerbleed}{#1},
+     innerbleed .code:n = \setlength{\flx at innerbleed}{#1},
+           grid .code:n = \FPset\flx at g{#1},
+   marginalgrid .code:n = \FPset\flx at m{#1} ,
+           show .code:n = \SF at frametrue ,
+    NoFixMargin .code:n = \Fix at Marginfalse ,
+        headsep .code:n = \setlength{\headsep}{#1},
+     headheight .code:n = \setlength{\headheight}{#1},
+       footskip .code:n = \setlength{\footskip}{#1},
+    fancyhdrOff .code:n = \Use at fancyhdrfalse,
+        a4paper .code:n = \flx at setpapersize[210][297]{mm},
+        a5paper .code:n = \flx at setpapersize[148][210]{mm},
+        b4paper .code:n = \flx at setpapersize[250][353]{mm},
+        b5paper .code:n = \flx at setpapersize[176][250]{mm},
+        c4paper .code:n = \flx at setpapersize[229][324]{mm},
+        c5paper .code:n = \flx at setpapersize[162][229]{mm},
+       b4jpaper .code:n = \flx at setpapersize[257][364]{mm},
+       b5jpaper .code:n = \flx at setpapersize[182][257]{mm},
+    letterpaper .code:n = \flx at setpapersize[8.5][11]{in},
+     legalpaper .code:n = \flx at setpapersize[8.5][14]{in},
+ executivepaper .code:n = \flx at setpapersize[7.25][10.5]{in},
+      10x8paper .code:n = \flx at setpapersize[8][10]{in},
+       US-Trade .code:n = \flx at setpapersize[6][9]{in},
+    UK-B-Format .code:n = \flx at setpapersize[135][210]{mm},
+    US-B-Format .code:n = \flx at setpapersize[129][198]{mm},
+       UK-Royal .code:n = \flx at setpapersize[156][234]{mm},
+         Quarto .code:n = \flx at setpapersize[9.5][12]{in},
+         Octavo .code:n = \flx at setpapersize[6][9]{in},
+    CrownQuarto .code:n = \flx at setpapersize[189][246]{mm},
+           Demi .code:n = \flx at setpapersize[138][216]{mm},
+}
+\ProcessKeysOptions { flexiprint }
+
+\DeclareExpandableDocumentCommand{\IfNoValueOrEmptyTF}{ m m m }
+{
+ \IfNoValueTF{#1}
+  {#2}
+  {\tl_if_empty:nTF {#1} {#2} {#3}}
+}
+\ExplSyntaxOff
+
+\FPset\flx at oldg{\flx at g}
+\FPset\flx at oldm{\flx at m}
+\FPset\flx at og{\flx at g}
+\FPset\flx at om{\flx at m}
+\setlength{\flx at oparsep}{\flx at parsep}
+\ifUse at fancyhdr
+   \RequirePackage{fancyhdr}
+   \pagestyle{fancy}
+\fi
+
+\setlength{\flx at oldparsep}{\flx at parsep}
+\setlength{\flx at oparsep}{\flx at parsep}
+\addtolength{\flx at binding}{\flx at innerbleed}
+\global\hoffset=0pt
+\global\voffset=0pt
+
+%    \end{macrocode}
+%
+% \begin{macro}{\flx at setpagevertical}
+%    \begin{macrocode}
+\NewDocumentCommand \flx at setpagevertical {} {
+  \setlength{\flx at temp}{\flx at paperwidth+\flx at innerbleed+\flx at outerbleed}
+  \global\paperwidth=\flx at temp
+
+  \setlength{\flx at temp}{\flx at paperheight+2\flx at outerbleed}
+  \global\paperheight=\flx at temp
+
+  \setlength{\flx at temp}{\flx at top+\flx at outerbleed-72pt}
+  \setlength{\topmargin}{\flx at temp}
+
+  \setlength{\flx at temp}{\paperheight - \flx at top %
+            - \headheight - \headsep -\footskip - \flx at bot - 2\flx at outerbleed}
+  \setlength{\textheight}{\flx at temp}
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+\flx at setpagevertical
+\setlength{\flx at textheigt}{\textheight}
+\newlength{\flx at linewidth}
+%    \end{macrocode}
+%
+% \begin{macro}{\flx at setpage}
+%    \begin{macrocode}
+
+\NewDocumentCommand \flx at setpage {} {
+    \FPifgt\flx at m0\relax\else\setlength{\flx at parsep}{0pt}\fi
+    \setlength{\flx at temp}{\flx at binding+\flx at inner-72pt}
+    \global\oddsidemargin=\flx at temp
+
+    \setlength{\flx at linewidth}{\paperwidth-\oddsidemargin-\flx at outer-72pt-\flx at outerbleed}
+    \ifUse at fancyhdr
+       \setlength{\headwidth}{\flx at linewidth}
+    \fi
+    \setlength{\flx at printarea}{\flx at linewidth-\flx at parsep}
+    \FPsub\flx at t\flx at g\flx at m
+    \setlength{\flx at temp}{\flx at printarea * \real{\flx at t}/\real{\flx at g} }
+    \global\textwidth=\flx at temp
+
+    \setlength{\flx at temp}{\flx at printarea * \real{\flx at m}/\real{\flx at g} }
+    \global\marginparwidth=\flx at temp
+    \global\marginparsep=\flx at parsep
+    \if at twoside
+      \setlength{\flx at temp}{\flx at outer+\marginparwidth+\marginparsep-1in+\flx at outerbleed}
+      \global\evensidemargin=\flx at temp
+    \else
+      \global\evensidemargin=\oddsidemargin
+    \fi
+    \global\fleximarginparsep=\marginparsep
+    \global\hsize=\textwidth
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+\flx at setpage
+\flx at orgtextwidth=\textwidth
+\FPset\flx at oldg\flx at g
+\FPset\flx at oldm\flx at m
+\setlength{\flx at oparsep}{\flx at parsep}
+\setlength{\flx at oldparsep}{\flx at parsep}
+%    \end{macrocode}
+%
+%
+% \begin{macro}{\NewMarginPage}
+%    \begin{macrocode}
+\NewDocumentCommand \NewMarginPage {o d<> m} {
+   \FPset\flx at oldg\flx at g
+   \FPset\flx at oldm\flx at m
+   \setlength{\flx at oldparsep}{\flx at parsep}
+   \ResetFlexiPage
+   \IfNoValueOrEmptyTF{#2}{\relax}{\setlength{\flx at parsep}{#2} }
+   \IfNoValueOrEmptyTF{#1}{\relax}{\FPset\flx at g{#1}}
+   \FPset\flx at m{#3}
+   \flx at setpage
+   \flx at marginparcorrection
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\OldMarginPage}
+%    \begin{macrocode}
+\NewDocumentCommand \OldMarginPage {} {
+   \FPset\flx at m\flx at oldm
+   \FPset\flx at g\flx at oldg
+   \flx at ResetFlexiPage
+   \setlength{\flx at parsep}{\flx at oldparsep}
+   \flx at setpage
+   \flx at marginparcorrection
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\NewFullPage}
+%    \begin{macrocode}
+\NewDocumentCommand \NewFullPage {}{
+   \FPset\flx at oldg\flx at g
+   \FPset\flx at oldm\flx at m
+   \setlength{\flx at oldparsep}{\flx at parsep}
+   \flx at ResetFlexiPage
+   \FPset\flx at m{0}
+   \setlength{\flx at parsep}{0pt}
+   \flx at setpage
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\ResetFlexiPage}
+%    \begin{macrocode}
+\NewDocumentCommand \ResetFlexiPage{} {
+   \FPset\flx at oldg\flx at g
+   \FPset\flx at oldm\flx at m
+   \flx at ResetFlexiPage
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\flx at ResetFlexiPage}
+%    \begin{macrocode}
+\NewDocumentCommand \flx at ResetFlexiPage{} {
+   \clearpage
+   \FPset\flx at g\flx at og
+   \FPset\flx at m\flx at om
+   \setlength{\flx at parsep}{\flx at oparsep}
+   \flx at setpage
+   \flx at marginparcorrection
+}
+%    \end{macrocode}
+% \end{macro}%
+%
+% \begin{macro}{\Landscape}
+%    \begin{macrocode}
+\NewDocumentCommand \Landscape {}
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+{
+   \FPset\flx at oldm\flx at m
+   \FPset\flx at oldg\flx at g
+   \setlength{\flx at oldparsep}{\flx at parsep}
+  \clearpage
+  \setlength{\flx at LSfix}{\textheight-\flx at linewidth}
+  \FPset\flx at m{0}
+  \setlength{\flx at parsep}{0ex}
+  \flx at setpage
+  \flx at landscape
+}
+%    \end{macrocode}
+%
+% \begin{macro}{\endLandscape}
+%    \begin{macrocode}
+\NewDocumentCommand \endLandscape {}
+{
+   \flx at endlandscape
+   \FPset\flx at m\flx at oldm
+   \FPset\flx at g\flx at oldg
+   \setlength{\flx at parsep}{\flx at oldparsep}
+   \flx at setpage
+   \setlength{\flx at LSfix}{0pt}
+   \flx at marginparcorrection
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\landscape}
+%    \begin{macrocode}
+\NewDocumentCommand \landscape {}
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+{
+   \FPset\flx at oldm\flx at m
+   \FPset\flx at oldg\flx at g
+   \setlength{\flx at oldparsep}{\flx at parsep}
+  \clearpage
+  \setlength{\flx at LSfix}{\textheight-\textwidth}
+  \FPset\flx at m{0}
+  \setlength{\flx at parsep}{0ex}
+  \flx at landscape
+}
+%    \end{macrocode}
+%
+% \begin{macro}{\endlandscape}
+%    \begin{macrocode}
+\NewDocumentCommand \endlandscape {}
+{
+   \flx at endlandscape
+   \FPset\flx at m\flx at oldm
+   \FPset\flx at g\flx at oldg
+   \setlength{\flx at parsep}{\flx at oldparsep}
+   \flx at setpage
+   \setlength{\flx at LSfix}{0pt}
+   \flx at marginparcorrection
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%  If the page layout includes a marginal these lscape.sty package
+%  respect these
+%
+%
+%    \begin{macrocode}
+%
+
+\def\flx at LS@rot{%
+  \setbox\@outputbox\vbox{\hbox{\rotatebox{90}{\box\@outputbox}}}}
+
+\def\flx at landscape{%
+  \let\flx at LS@makecol=\@makecol
+  \let\flx at LS@makefcolumn=\@makefcolumn
+  \clearpage
+  \begingroup
+  \global\vsize=\textwidth
+  \global\hsize=\textheight
+  \linewidth=\hsize
+  \columnwidth=\hsize
+  \@colroom=\vsize
+  \textheight=\vsize
+  \@colht=\vsize
+  \def\@makecol{\flx at LS@makecol\flx at LS@rot}%
+  \def\@makefcolumn##1{\flx at LS@makefcolumn{##1}\flx at LS@rot}}
+
+\def\flx at endlandscape{%
+  \clearpage
+  \endgroup
+  \global\@colht=\textheight
+  \global\vsize=\textheight
+  \global\@colroom=\textheight}
+%
+%    \end{macrocode}
+%
+%
+%
+% \begin{macro}{\flx at marginparcorrection }
+%
+% Mid-document changes to textwidth are not communicated the LaTeX marginpar
+% routines hence the patch to correct the odd-side marginparsep.
+%
+% lifted from https://tex.stackexchange.com/questions/174605
+%
+% % \end{macro}
+%
+%
+%    \begin{macrocode}
+\NewDocumentCommand\flx at marginparcorrection{}{
+\ifFix at Margin
+   \setlength{\marginparsepodd}{\marginparsep-\flx at orgtextwidth+\textwidth}
+   \setlength{\marginparsepeven}{\marginparsep}
+   \patchcmd{\@addmarginpar}%In this command
+   {\mph at orig@addmarginpar}%...replace this...
+   {\if at twoside\ifodd\c at page\relax%...with this
+         \marginparsep=\marginparsepodd%Page isodd
+      \else%twoside and eveb
+         \marginparsep=\marginparsepeven%Page iseven
+      \fi
+      \else% oneside
+         \marginparsep=\marginparsepodd
+      \fi
+   \mph at orig@addmarginpar}
+   {}%success
+   {\message{Error! Couldn't hook into command   %failure
+   `\string\@addmarginpar'}} %end patch command
+
+   {
+   \def\patcherr{%
+      \message{Error!Couldn't hook into command`\string\@mn@@@marginnote'}}
+      \def\patchok{%
+      \let\patcherr\relax%Only display error if first patch fails
+      \patch%Now patch again.
+   }
+   \def\patch{
+      \patchcmd{\@mn@@@marginnote}%In this command
+         {\kern\marginparsep}%...replace this...
+      {\ifx\@mn at currpage\relax\else%...with this
+         \if at twoside\ifodd\@mn at currpage\relax
+            \kern\marginparsepodd%Page is odd
+         \else
+            \kern\marginparsepeven
+         \fi
+         \else% one side
+            \kern\marginparsepodd
+         \fi
+      \fi}
+      {\message{Patched!}\patchok}%success(recurse)
+      {\patcherr}%fail
+   }
+   \message{Patching`\string\@mn@@@marginnote`!}
+   \patch
+   \global\let\@mn@@@marginnote\@mn@@@marginnote%Makepatch global
+   }
+\fi
+}
+%    \end{macrocode}
+%
+%
+% The package showframe.sty is adapted and localised
+%
+%
+%    \begin{macrocode}
+\ifSF at frame\RequirePackage{eso-pic}\fi  % so that below code can draw frames
+
+\ifSF at frame\AddToShipoutPictureBG{\flx at ShowFramePicture}\fi
+
+\newcommand*\flx at framecolor{\color{green}}
+\newcommand*\flx at frameline{.8pt}
+\newdimen\SF at tempdima
+
+\newcommand\flx at ShowFramePicture{%
+  \begingroup
+    \color{orange}\linethickness{\flx at frameline}%
+    \if at twoside
+       \ifodd\c at page
+          \AtPageUpperLeft{%
+            \put(\flx at innerbleed,-\paperheight+\flx at outerbleed){%
+              \framebox(\paperwidth-\flx at outerbleed-\flx at innerbleed,\paperheight-2\flx at outerbleed){}}}%
+        \else
+          \AtPageUpperLeft{%
+            \put(\flx at outerbleed,-\paperheight+\flx at outerbleed){%
+              \framebox(\paperwidth-\flx at outerbleed-\flx at innerbleed,\paperheight-2\flx at outerbleed){}}}%
+        \fi
+    \else
+       \AtPageUpperLeft{%
+         \put(\flx at innerbleed,-\paperheight+\flx at outerbleed){%
+           \framebox(\paperwidth-\flx at outerbleed-\flx at innerbleed,\paperheight-2\flx at outerbleed){}}}%
+    \fi
+    \flx at framecolor\linethickness{\flx at frameline}%
+    \AtTextLowerLeft{%
+      \put(0,-\flx at LSfix){\framebox(\textwidth,\textheight+\flx at LSfix){}}}%
+
+\ifUse at fancyhdr
+    \if at twoside
+        \ifodd\c at page
+            \AtPageUpperLeft{%
+               \put(\flx at inner+\flx at binding,-\flx at outerbleed-\flx at top-\headheight){%
+                    \framebox(\flx at linewidth,\headheight){}}}%
+            \AtPageUpperLeft{%
+               \put(\flx at inner+\flx at binding,%
+                       -\flx at outerbleed-\flx at top-\headheight-\headsep-\textheight%
+                       -\footskip -\flx at LSfix){%
+                    \line(1,0){\flx at linewidth}}}%
+        \else
+        \AtPageUpperLeft{%
+           \put(\flx at outer+\flx at outerbleed,-\flx at outerbleed-\flx at top-\headheight){%
+            \framebox(\flx at linewidth,\headheight){}}}%
+        \AtPageUpperLeft{%
+           \put(\flx at outer+\flx at outerbleed,%
+                   -\flx at outerbleed-\flx at top-\headheight-\headsep-\textheight%
+                   -\footskip -\flx at LSfix){%
+                \line(1,0){\flx at linewidth}}}%
+
+        \fi
+    \else
+        \AtPageUpperLeft{%
+           \put(\flx at inner+\flx at binding,-\flx at outerbleed-\flx at top-\headheight){%
+            \framebox(\flx at linewidth,\headheight){}}}%
+        \AtPageUpperLeft{%
+           \put(\flx at inner+\flx at binding,%
+                   -\flx at outerbleed-\flx at top-\headheight-\headsep-\textheight%
+                   -\footskip -\flx at LSfix){%
+                \line(1,0){\flx at linewidth}}}%
+    \fi
+%
+\else
+    \AtTextUpperLeft{%
+      \put(0,\headsep){%
+        \framebox(\textwidth,\headheight){}}}%
+    \AtTextLowerLeft{%
+      \put(0,-\footskip-\flx at LSfix){%
+        \line(1,0){\textwidth}}}%
+\fi
+%
+\FPifgt\flx at m 0{%
+    \AtTextLowerLeft{%
+      \SF at tempdima=\textwidth\advance\SF at tempdima\marginparsep%
+      \if at twoside
+        \ifodd\c at page\else
+          \if at mparswitch
+            \SF at tempdima=-\marginparsep\advance\SF at tempdima-\marginparwidth
+          \fi
+        \fi
+      \fi
+      \put(\SF at tempdima,0)%
+        {\framebox(\marginparwidth,\textheight){}}%
+    }%
+  }\fi
+  \endgroup
+}
+%    \end{macrocode}
+%
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \Finale
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/flexipage/flexipage.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/flexipage/flexipage.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/flexipage/flexipage.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/flexipage/flexipage.ins	2022-07-10 19:58:42 UTC (rev 63865)
@@ -0,0 +1,64 @@
+%% Copyright (C) 2022 by Anton Vrba
+%%
+%% Home Page: https://github.com/anton-vrba/sidenotesplus
+%%    Issues: https://github.com/anton-vrba/sidenotesplus/issues
+%% --------------------------------------------------------------------------
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Anton Vrba.
+%%
+%% This work consists of the files sidenotesplus.dtx and sidenotesplus.ins
+%% and the derived filebase sidenotesplus.sty.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+
+\preamble
+
+ Copyright (C) 2022 by Anton Vrba
+ --------------------------------
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either version 1.3
+ of this license or (at your option) any later version.
+ The latest version of this license is in
+    http://www.latex-project.org/lppl.txt
+    and version 1.3c or later is part of all distributions of LaTeX
+    version 2008-05-04 or later.
+
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is Anton Vrba.
+
+
+\endpreamble
+
+\generate{\file{flexipage.sty}{\from{flexipage.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{*                                                           *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX:                    *}
+\Msg{*                                                           *}
+\Msg{*     sidenotesplus.sty                                     *}
+\Msg{*                                                           *}
+\Msg{* To produce the documentation run the file sidenotesplus.dtx *}
+\Msg{* through LaTeX.                                            *}
+\Msg{*                                                           *}
+\Msg{* Happy TeXing!                                             *}
+\Msg{*                                                           *}
+\Msg{*************************************************************}
+
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/flexipage/flexipage.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/flexipage/flexipage.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/flexipage/flexipage.sty	2022-07-10 19:58:42 UTC (rev 63865)
@@ -0,0 +1,446 @@
+%%
+%% This is file `flexipage.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% flexipage.dtx  (with options: `package')
+%% 
+%%  Copyright (C) 2022 by Anton Vrba
+%%  --------------------------------
+%% 
+%%  This work may be distributed and/or modified under the
+%%  conditions of the LaTeX Project Public License, either version 1.3
+%%  of this license or (at your option) any later version.
+%%  The latest version of this license is in
+%%     http://www.latex-project.org/lppl.txt
+%%     and version 1.3c or later is part of all distributions of LaTeX
+%%     version 2008-05-04 or later.
+%% 
+%% 
+%%  This work has the LPPL maintenance status `maintained'.
+%% 
+%%  The Current Maintainer of this work is Anton Vrba.
+%% 
+%% 
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesPackage{flexipage}
+    [2022/07/09 1.00 Easy page geometry]
+
+
+\RequirePackage{xparse}   % new LaTeX3 syntax to define macros and environments
+\RequirePackage{l3keys2e} % nice way for option processing
+\RequirePackage{calc}     % length manipulation
+\RequirePackage{fp}       % floating point calculation
+\RequirePackage{ifoddpage}
+\RequirePackage{graphics}  % provides landscaping
+\RequirePackage{mparhack} % not needed here, but the user certainly needs it.
+\RequirePackage{etoolbox} % provides \patchcmd
+\newlength{\fleximarginparsep}
+\newlength{\flx at paperheight}
+\newlength{\flx at paperwidth}
+\newlength{\flx at temp}
+\newlength{\flx at LSfix}
+\setlength{\flx at LSfix}{0pt}
+\newlength{\flx at lsfix}
+\setlength{\flx at lsfix}{0pt}
+\newlength{\flx at textheigt}
+\newlength{\flx at orgtextwidth}
+\newlength{\flx at oldparsep}
+\newlength{\flx at oparsep}
+\newlength{\flx at binding}
+\newlength{\marginparsepodd}
+\newlength{\marginparsepeven}
+\newlength{\flx at inner}
+\newlength{\flx at outer}
+\newlength{\flx at top}
+\newlength{\flx at bot}
+\newlength{\flx at parsep}
+\newlength{\flx at printarea}
+\newlength{\flx at outerbleed}
+\newlength{\flx at innerbleed}
+\setlength{\flx at binding}  {9pt}
+\setlength{\flx at inner} {36pt}
+\setlength{\flx at outer} {36pt}
+\setlength{\flx at top}   {36pt}
+\setlength{\flx at bot}   {45pt}
+\setlength{\flx at parsep}{3ex}
+\setlength{\flx at outerbleed} {0pt}
+\setlength{\flx at innerbleed} {0pt}
+\FPset\flx at m{3}
+\FPset\flx at g{12}
+\newif\ifSF at frame\SF at framefalse
+\newif\ifFix at Margin\Fix at Margintrue
+\newif\ifUse at fancyhdr\Use at fancyhdrtrue
+\setlength{\flx at paperheight}{\paperheight}
+\setlength{\flx at paperwidth}{\paperwidth}
+
+\NewDocumentCommand \flx at setpapersize {o o m}{
+\setlength{\flx at paperheight}{#2#3}
+\setlength{\flx at paperwidth}{#2#3}
+}
+
+\ExplSyntaxOn
+\keys_define:nn { flexiprint }
+{
+        binding .code:n = \setlength{\flx at binding}{#1},
+          inner .code:n = \setlength{\flx at inner}{#1},
+          outer .code:n = \setlength{\flx at outer}{#1},
+            top .code:n = \setlength{\flx at top}{#1},
+            bot .code:n = \setlength{\flx at bot}{#1},
+   marginparsep .code:n = \setlength{\flx at parsep}{#1},
+    paperheight .code:n = \setlength{\flx at paperheight}{#1},
+     paperwidth .code:n = \setlength{\flx at paperwidth}{#1},
+     outerbleed .code:n = \setlength{\flx at outerbleed}{#1},
+     innerbleed .code:n = \setlength{\flx at innerbleed}{#1},
+           grid .code:n = \FPset\flx at g{#1},
+   marginalgrid .code:n = \FPset\flx at m{#1} ,
+           show .code:n = \SF at frametrue ,
+    NoFixMargin .code:n = \Fix at Marginfalse ,
+        headsep .code:n = \setlength{\headsep}{#1},
+     headheight .code:n = \setlength{\headheight}{#1},
+       footskip .code:n = \setlength{\footskip}{#1},
+    fancyhdrOff .code:n = \Use at fancyhdrfalse,
+        a4paper .code:n = \flx at setpapersize[210][297]{mm},
+        a5paper .code:n = \flx at setpapersize[148][210]{mm},
+        b4paper .code:n = \flx at setpapersize[250][353]{mm},
+        b5paper .code:n = \flx at setpapersize[176][250]{mm},
+        c4paper .code:n = \flx at setpapersize[229][324]{mm},
+        c5paper .code:n = \flx at setpapersize[162][229]{mm},
+       b4jpaper .code:n = \flx at setpapersize[257][364]{mm},
+       b5jpaper .code:n = \flx at setpapersize[182][257]{mm},
+    letterpaper .code:n = \flx at setpapersize[8.5][11]{in},
+     legalpaper .code:n = \flx at setpapersize[8.5][14]{in},
+ executivepaper .code:n = \flx at setpapersize[7.25][10.5]{in},
+      10x8paper .code:n = \flx at setpapersize[8][10]{in},
+       US-Trade .code:n = \flx at setpapersize[6][9]{in},
+    UK-B-Format .code:n = \flx at setpapersize[135][210]{mm},
+    US-B-Format .code:n = \flx at setpapersize[129][198]{mm},
+       UK-Royal .code:n = \flx at setpapersize[156][234]{mm},
+         Quarto .code:n = \flx at setpapersize[9.5][12]{in},
+         Octavo .code:n = \flx at setpapersize[6][9]{in},
+    CrownQuarto .code:n = \flx at setpapersize[189][246]{mm},
+           Demi .code:n = \flx at setpapersize[138][216]{mm},
+}
+\ProcessKeysOptions { flexiprint }
+
+\DeclareExpandableDocumentCommand{\IfNoValueOrEmptyTF}{ m m m }
+{
+ \IfNoValueTF{#1}
+  {#2}
+  {\tl_if_empty:nTF {#1} {#2} {#3}}
+}
+\ExplSyntaxOff
+
+\FPset\flx at oldg{\flx at g}
+\FPset\flx at oldm{\flx at m}
+\FPset\flx at og{\flx at g}
+\FPset\flx at om{\flx at m}
+\setlength{\flx at oparsep}{\flx at parsep}
+\ifUse at fancyhdr
+   \RequirePackage{fancyhdr}
+   \pagestyle{fancy}
+\fi
+
+\setlength{\flx at oldparsep}{\flx at parsep}
+\setlength{\flx at oparsep}{\flx at parsep}
+\addtolength{\flx at binding}{\flx at innerbleed}
+\global\hoffset=0pt
+\global\voffset=0pt
+
+\NewDocumentCommand \flx at setpagevertical {} {
+  \setlength{\flx at temp}{\flx at paperwidth+\flx at innerbleed+\flx at outerbleed}
+  \global\paperwidth=\flx at temp
+
+  \setlength{\flx at temp}{\flx at paperheight+2\flx at outerbleed}
+  \global\paperheight=\flx at temp
+
+  \setlength{\flx at temp}{\flx at top+\flx at outerbleed-72pt}
+  \setlength{\topmargin}{\flx at temp}
+
+  \setlength{\flx at temp}{\paperheight - \flx at top %
+            - \headheight - \headsep -\footskip - \flx at bot - 2\flx at outerbleed}
+  \setlength{\textheight}{\flx at temp}
+}
+\flx at setpagevertical
+\setlength{\flx at textheigt}{\textheight}
+\newlength{\flx at linewidth}
+
+\NewDocumentCommand \flx at setpage {} {
+    \FPifgt\flx at m0\relax\else\setlength{\flx at parsep}{0pt}\fi
+    \setlength{\flx at temp}{\flx at binding+\flx at inner-72pt}
+    \global\oddsidemargin=\flx at temp
+
+    \setlength{\flx at linewidth}{\paperwidth-\oddsidemargin-\flx at outer-72pt-\flx at outerbleed}
+    \ifUse at fancyhdr
+       \setlength{\headwidth}{\flx at linewidth}
+    \fi
+    \setlength{\flx at printarea}{\flx at linewidth-\flx at parsep}
+    \FPsub\flx at t\flx at g\flx at m
+    \setlength{\flx at temp}{\flx at printarea * \real{\flx at t}/\real{\flx at g} }
+    \global\textwidth=\flx at temp
+
+    \setlength{\flx at temp}{\flx at printarea * \real{\flx at m}/\real{\flx at g} }
+    \global\marginparwidth=\flx at temp
+    \global\marginparsep=\flx at parsep
+    \if at twoside
+      \setlength{\flx at temp}{\flx at outer+\marginparwidth+\marginparsep-1in+\flx at outerbleed}
+      \global\evensidemargin=\flx at temp
+    \else
+      \global\evensidemargin=\oddsidemargin
+    \fi
+    \global\fleximarginparsep=\marginparsep
+    \global\hsize=\textwidth
+}
+\flx at setpage
+\flx at orgtextwidth=\textwidth
+\FPset\flx at oldg\flx at g
+\FPset\flx at oldm\flx at m
+\setlength{\flx at oparsep}{\flx at parsep}
+\setlength{\flx at oldparsep}{\flx at parsep}
+\NewDocumentCommand \NewMarginPage {o d<> m} {
+   \FPset\flx at oldg\flx at g
+   \FPset\flx at oldm\flx at m
+   \setlength{\flx at oldparsep}{\flx at parsep}
+   \ResetFlexiPage
+   \IfNoValueOrEmptyTF{#2}{\relax}{\setlength{\flx at parsep}{#2} }
+   \IfNoValueOrEmptyTF{#1}{\relax}{\FPset\flx at g{#1}}
+   \FPset\flx at m{#3}
+   \flx at setpage
+   \flx at marginparcorrection
+}
+\NewDocumentCommand \OldMarginPage {} {
+   \FPset\flx at m\flx at oldm
+   \FPset\flx at g\flx at oldg
+   \flx at ResetFlexiPage
+   \setlength{\flx at parsep}{\flx at oldparsep}
+   \flx at setpage
+   \flx at marginparcorrection
+}
+\NewDocumentCommand \NewFullPage {}{
+   \FPset\flx at oldg\flx at g
+   \FPset\flx at oldm\flx at m
+   \setlength{\flx at oldparsep}{\flx at parsep}
+   \flx at ResetFlexiPage
+   \FPset\flx at m{0}
+   \setlength{\flx at parsep}{0pt}
+   \flx at setpage
+}
+\NewDocumentCommand \ResetFlexiPage{} {
+   \FPset\flx at oldg\flx at g
+   \FPset\flx at oldm\flx at m
+   \flx at ResetFlexiPage
+}
+\NewDocumentCommand \flx at ResetFlexiPage{} {
+   \clearpage
+   \FPset\flx at g\flx at og
+   \FPset\flx at m\flx at om
+   \setlength{\flx at parsep}{\flx at oparsep}
+   \flx at setpage
+   \flx at marginparcorrection
+}
+\NewDocumentCommand \Landscape {}
+{
+   \FPset\flx at oldm\flx at m
+   \FPset\flx at oldg\flx at g
+   \setlength{\flx at oldparsep}{\flx at parsep}
+  \clearpage
+  \setlength{\flx at LSfix}{\textheight-\flx at linewidth}
+  \FPset\flx at m{0}
+  \setlength{\flx at parsep}{0ex}
+  \flx at setpage
+  \flx at landscape
+}
+\NewDocumentCommand \endLandscape {}
+{
+   \flx at endlandscape
+   \FPset\flx at m\flx at oldm
+   \FPset\flx at g\flx at oldg
+   \setlength{\flx at parsep}{\flx at oldparsep}
+   \flx at setpage
+   \setlength{\flx at LSfix}{0pt}
+   \flx at marginparcorrection
+}
+\NewDocumentCommand \landscape {}
+{
+   \FPset\flx at oldm\flx at m
+   \FPset\flx at oldg\flx at g
+   \setlength{\flx at oldparsep}{\flx at parsep}
+  \clearpage
+  \setlength{\flx at LSfix}{\textheight-\textwidth}
+  \FPset\flx at m{0}
+  \setlength{\flx at parsep}{0ex}
+  \flx at landscape
+}
+\NewDocumentCommand \endlandscape {}
+{
+   \flx at endlandscape
+   \FPset\flx at m\flx at oldm
+   \FPset\flx at g\flx at oldg
+   \setlength{\flx at parsep}{\flx at oldparsep}
+   \flx at setpage
+   \setlength{\flx at LSfix}{0pt}
+   \flx at marginparcorrection
+}
+
+\def\flx at LS@rot{%
+  \setbox\@outputbox\vbox{\hbox{\rotatebox{90}{\box\@outputbox}}}}
+
+\def\flx at landscape{%
+  \let\flx at LS@makecol=\@makecol
+  \let\flx at LS@makefcolumn=\@makefcolumn
+  \clearpage
+  \begingroup
+  \global\vsize=\textwidth
+  \global\hsize=\textheight
+  \linewidth=\hsize
+  \columnwidth=\hsize
+  \@colroom=\vsize
+  \textheight=\vsize
+  \@colht=\vsize
+  \def\@makecol{\flx at LS@makecol\flx at LS@rot}%
+  \def\@makefcolumn##1{\flx at LS@makefcolumn{##1}\flx at LS@rot}}
+
+\def\flx at endlandscape{%
+  \clearpage
+  \endgroup
+  \global\@colht=\textheight
+  \global\vsize=\textheight
+  \global\@colroom=\textheight}
+\NewDocumentCommand\flx at marginparcorrection{}{
+\ifFix at Margin
+   \setlength{\marginparsepodd}{\marginparsep-\flx at orgtextwidth+\textwidth}
+   \setlength{\marginparsepeven}{\marginparsep}
+   \patchcmd{\@addmarginpar}%In this command
+   {\mph at orig@addmarginpar}%...replace this...
+   {\if at twoside\ifodd\c at page\relax%...with this
+         \marginparsep=\marginparsepodd%Page isodd
+      \else%twoside and eveb
+         \marginparsep=\marginparsepeven%Page iseven
+      \fi
+      \else% oneside
+         \marginparsep=\marginparsepodd
+      \fi
+   \mph at orig@addmarginpar}
+   {}%success
+   {\message{Error! Couldn't hook into command   %failure
+   `\string\@addmarginpar'}} %end patch command
+
+   {
+   \def\patcherr{%
+      \message{Error!Couldn't hook into command`\string\@mn@@@marginnote'}}
+      \def\patchok{%
+      \let\patcherr\relax%Only display error if first patch fails
+      \patch%Now patch again.
+   }
+   \def\patch{
+      \patchcmd{\@mn@@@marginnote}%In this command
+         {\kern\marginparsep}%...replace this...
+      {\ifx\@mn at currpage\relax\else%...with this
+         \if at twoside\ifodd\@mn at currpage\relax
+            \kern\marginparsepodd%Page is odd
+         \else
+            \kern\marginparsepeven
+         \fi
+         \else% one side
+            \kern\marginparsepodd
+         \fi
+      \fi}
+      {\message{Patched!}\patchok}%success(recurse)
+      {\patcherr}%fail
+   }
+   \message{Patching`\string\@mn@@@marginnote`!}
+   \patch
+   \global\let\@mn@@@marginnote\@mn@@@marginnote%Makepatch global
+   }
+\fi
+}
+\ifSF at frame\RequirePackage{eso-pic}\fi  % so that below code can draw frames
+
+\ifSF at frame\AddToShipoutPictureBG{\flx at ShowFramePicture}\fi
+
+\newcommand*\flx at framecolor{\color{green}}
+\newcommand*\flx at frameline{.8pt}
+\newdimen\SF at tempdima
+
+\newcommand\flx at ShowFramePicture{%
+  \begingroup
+    \color{orange}\linethickness{\flx at frameline}%
+    \if at twoside
+       \ifodd\c at page
+          \AtPageUpperLeft{%
+            \put(\flx at innerbleed,-\paperheight+\flx at outerbleed){%
+              \framebox(\paperwidth-\flx at outerbleed-\flx at innerbleed,\paperheight-2\flx at outerbleed){}}}%
+        \else
+          \AtPageUpperLeft{%
+            \put(\flx at outerbleed,-\paperheight+\flx at outerbleed){%
+              \framebox(\paperwidth-\flx at outerbleed-\flx at innerbleed,\paperheight-2\flx at outerbleed){}}}%
+        \fi
+    \else
+       \AtPageUpperLeft{%
+         \put(\flx at innerbleed,-\paperheight+\flx at outerbleed){%
+           \framebox(\paperwidth-\flx at outerbleed-\flx at innerbleed,\paperheight-2\flx at outerbleed){}}}%
+    \fi
+    \flx at framecolor\linethickness{\flx at frameline}%
+    \AtTextLowerLeft{%
+      \put(0,-\flx at LSfix){\framebox(\textwidth,\textheight+\flx at LSfix){}}}%
+
+\ifUse at fancyhdr
+    \if at twoside
+        \ifodd\c at page
+            \AtPageUpperLeft{%
+               \put(\flx at inner+\flx at binding,-\flx at outerbleed-\flx at top-\headheight){%
+                    \framebox(\flx at linewidth,\headheight){}}}%
+            \AtPageUpperLeft{%
+               \put(\flx at inner+\flx at binding,%
+                       -\flx at outerbleed-\flx at top-\headheight-\headsep-\textheight%
+                       -\footskip -\flx at LSfix){%
+                    \line(1,0){\flx at linewidth}}}%
+        \else
+        \AtPageUpperLeft{%
+           \put(\flx at outer+\flx at outerbleed,-\flx at outerbleed-\flx at top-\headheight){%
+            \framebox(\flx at linewidth,\headheight){}}}%
+        \AtPageUpperLeft{%
+           \put(\flx at outer+\flx at outerbleed,%
+                   -\flx at outerbleed-\flx at top-\headheight-\headsep-\textheight%
+                   -\footskip -\flx at LSfix){%
+                \line(1,0){\flx at linewidth}}}%
+
+        \fi
+    \else
+        \AtPageUpperLeft{%
+           \put(\flx at inner+\flx at binding,-\flx at outerbleed-\flx at top-\headheight){%
+            \framebox(\flx at linewidth,\headheight){}}}%
+        \AtPageUpperLeft{%
+           \put(\flx at inner+\flx at binding,%
+                   -\flx at outerbleed-\flx at top-\headheight-\headsep-\textheight%
+                   -\footskip -\flx at LSfix){%
+                \line(1,0){\flx at linewidth}}}%
+    \fi
+\else
+    \AtTextUpperLeft{%
+      \put(0,\headsep){%
+        \framebox(\textwidth,\headheight){}}}%
+    \AtTextLowerLeft{%
+      \put(0,-\footskip-\flx at LSfix){%
+        \line(1,0){\textwidth}}}%
+\fi
+\FPifgt\flx at m 0{%
+    \AtTextLowerLeft{%
+      \SF at tempdima=\textwidth\advance\SF at tempdima\marginparsep%
+      \if at twoside
+        \ifodd\c at page\else
+          \if at mparswitch
+            \SF at tempdima=-\marginparsep\advance\SF at tempdima-\marginparwidth
+          \fi
+        \fi
+      \fi
+      \put(\SF at tempdima,0)%
+        {\framebox(\marginparwidth,\textheight){}}%
+    }%
+  }\fi
+  \endgroup
+}
+\endinput
+%%
+%% End of file `flexipage.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/flexipage/flexipage.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-07-10 19:57:19 UTC (rev 63864)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-07-10 19:58:42 UTC (rev 63865)
@@ -325,7 +325,7 @@
     fix2col fixcmex fixdif fixfoot fixjfm fixlatvian
     fixltxhyph fixme fixmetodonotes fixpdfmag fiziko
     fjodor
-    flabels flacards flagderiv flashcards flashmovie flipbook flippdf
+    flabels flacards flagderiv flashcards flashmovie flexipage flipbook flippdf
     float floatflt floatrow
     flowchart flowfram fltpoint
     fmp fmtcount

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2022-07-10 19:57:19 UTC (rev 63864)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2022-07-10 19:58:42 UTC (rev 63865)
@@ -506,6 +506,7 @@
 depend flagderiv
 depend flashcards
 depend flashmovie
+depend flexipage
 depend flipbook
 depend flippdf
 depend floatflt

Added: trunk/Master/tlpkg/tlpsrc/flexipage.tlpsrc
===================================================================


More information about the tex-live-commits mailing list.