summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-11-06 23:23:31 +0000
committerKarl Berry <karl@freefriends.org>2011-11-06 23:23:31 +0000
commit570faa64575114a193a756a944ac1300c0523288 (patch)
tree558b749a6d3f855e2bff1906d3319ef690cadfe2 /Master
parent088ee55192f2246a33905239efb4f1bda60c233b (diff)
canoniclayout 0.4 (6nov11)
git-svn-id: svn://tug.org/texlive/trunk@24523 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/canoniclayout/README10
-rw-r--r--Master/texmf-dist/doc/latex/canoniclayout/canoniclayout.pdfbin494382 -> 474321 bytes
-rw-r--r--Master/texmf-dist/source/latex/canoniclayout/canoniclayout.dtx290
-rw-r--r--Master/texmf-dist/tex/latex/canoniclayout/canoniclayout.sty47
4 files changed, 239 insertions, 108 deletions
diff --git a/Master/texmf-dist/doc/latex/canoniclayout/README b/Master/texmf-dist/doc/latex/canoniclayout/README
index ffa1f48d252..1f9c5860351 100644
--- a/Master/texmf-dist/doc/latex/canoniclayout/README
+++ b/Master/texmf-dist/doc/latex/canoniclayout/README
@@ -1 +1,9 @@
-a small extension to the memoir class for a page layout based on circles \ No newline at end of file
+Canoniclayout v.04
+
+Canoniclayout is a small extension that allows to design a canonic layout based on the great circle inscribed within the page and tangent to the horizontal sides of the type block rectangle. The margins reflect the trimmed page shape ratio, therefore the type block principal diagonal coincides with the corresponding page diagonal; this layout is especially good for ISO shapes but can be used with many other traditional book page shapes.
+
+This work is released under the Latex Project Pubblic Licence v.1.3. The LPPL is distributed with any TeX system distribution and can be found also in any CTAN archive.
+
+Claudio Beccari 2011
+Author maintained
+claudio dot beccari at gmail dot com
diff --git a/Master/texmf-dist/doc/latex/canoniclayout/canoniclayout.pdf b/Master/texmf-dist/doc/latex/canoniclayout/canoniclayout.pdf
index 0eaff8e39e8..7b3e05f3204 100644
--- a/Master/texmf-dist/doc/latex/canoniclayout/canoniclayout.pdf
+++ b/Master/texmf-dist/doc/latex/canoniclayout/canoniclayout.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/canoniclayout/canoniclayout.dtx b/Master/texmf-dist/source/latex/canoniclayout/canoniclayout.dtx
index cff4dc127dd..0855bd860ec 100644
--- a/Master/texmf-dist/source/latex/canoniclayout/canoniclayout.dtx
+++ b/Master/texmf-dist/source/latex/canoniclayout/canoniclayout.dtx
@@ -6,14 +6,14 @@
\preamble
______________________________________________________
The canoniclayout package for LaTeX
- Copyright (C) 2010 Claudio Beccari
+ Copyright (C) 2010-2011 Claudio Beccari
All rights reserved
License information appended
\endpreamble
\postamble
-Copyright 2010 Claudio Beccari
+Copyright 2011 Claudio Beccari
Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
@@ -42,11 +42,11 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
%<package>\NeedsTeXFormat{LaTeX2e}[2009/01/01]
%<package>\ProvidesPackage{canoniclayout}%
%<*package>
- [2010/12/04 v.0.2 Canonic layout circumscribed to a circle]
+ [2011/11/05 v.0.3 Canonic layout circumscribed to a circle]
%</package>
%<*driver>
-\documentclass{ltxdoc}
-\paperwidth=220mm\paperheight=280mm
+\documentclass[a4paper]{ltxdoc}
+\paperwidth=210mm\paperheight=297mm
\pdfpagewidth=\paperwidth \pdfpageheight=\paperheight
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
@@ -56,26 +56,32 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
\usepackage{amsmath,array,booktabs}
\usepackage{pict2e}[2009/06/01]%
\usepackage{color}
+\usepackage{canoniclayout}
\hfuzz 10pt
-%\makeatletter
+
\newcommand*\class[1]{\textsf{#1}}
\newcommand*\pack[1]{\textsf{#1}}
\newcommand*\prog[1]{\textsl{#1}}
\newcommand*\file[1]{\texttt{#1}}
\definecolor{grigio}{gray}{.75}
+
\makeatletter
-\def\ps@title{\ps@plain
-\def\@oddhead{\dimen256=\dimexpr\headheight+\topmargin+1in-\paperheight\relax
-\dimen258=\dimexpr\oddsidemargin+1in\relax
+\def\cblayoutdestro{\dimen256=\dimexpr\headheight+\topmargin+1in-\paperheight\relax
+\dimen258=\dimexpr\oddsidemargin+1in\relax
+\dimen262=1mm\relax
+\dimen260=\dimexpr \paperwidth*\p@/\dimen262\relax
+\dimen264=\dimexpr \paperheight-\topmargin-\headheight-1in-\headsep-\textheight\relax
\begin{picture}(0,0)(\strip@pt\dimen258,-\strip@pt\dimen256)
-\put(0,0){\unitlength=\dimexpr\paperwidth/220\relax % rounded expression
-\let\ul\unitlength
-\put(0,0){\framebox(220,280){}}
+\put(0,0){\unitlength=\p@
+\put(0,0){\framebox(\strip@pt\paperwidth,\strip@pt\paperheight){}}
\color{red}
-\put(20.742,33.6){\makebox(0,0)[bl]{\color{grigio}\rule{172.86\ul}{220\ul}}}
-\put(110,143.6){\circle{220}}
- \Line(0,280)(220,0)}
+\put(\strip@pt\dimen258,\strip@pt\dimen264){\makebox(0,0)[bl]{\color{grigio}\rule{\textwidth}{\textheight}}}
+ \Line(0,\strip@pt\paperheight)(\strip@pt\paperwidth,0)
+ \put(\strip@pt\dimexpr\paperwidth/2\relax,\strip@pt\dimexpr\dimen264+\textheight/2\relax){\circle{\strip@pt\paperwidth}}
+}
\end{picture}}
+\def\ps@title{\ps@plain
+\def\@oddhead{\cblayoutdestro}
\let\@evenhead\@oddhead}
\allowdisplaybreaks
\begin{document}
@@ -89,24 +95,21 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
%</driver>
% \fi
%
-% \CheckSum{115}
+% \CheckSum{211}
% \begin{abstract}
-% This package is a small extension to the memoir class that allows to determine the page
+% This package is a small extension that allows to determine the page
% parameters for a canonical layout where the text block is placed onto the page in such a
-% way as: $(a)$ its diagonal coincides with the page relevant diagonal, and $(b)$ the
+% way as: $(a)$ its diagonal coincides with the page relevant diagonal, and $(b)$ the
% circle inscribed within the text block is also tangent to the page sides. The text
% block width to height ratio is kept equal to the page ratio, as well as the inner to
-% outer and the top to bottom margin ratios.
+% outer and the upper to lower margin ratios.
%
% The canonical layout determined by this package is laid down on this very page; of
-% course the actual text block does not fit the text block grid, because this
-% documentation is typeset by means of the \texttt{ltxdoc} document clssa, that uses
-% different layout paramenters. At the same time the classical layout, conceived fot two
-% sided printing, gets properly compared with a standard (one sided printing) \LaTeX\
-% layout.\footnote{Actually the \texttt{ltxdoc} class default paper size is the letter
-% paper; here we rounded a little bit the letter paper dimensions to integer millimeter
-% values of 220\,mm $\times$ 280\,mm. See the discussion about the convenience od such
-% layout when the main font size is considered.}
+% course the actual text block fits the text block grid, because this
+% documentation is typeset by means of the \texttt{ltxdoc} document class, that by
+% itself would use other layout parameters, but that is has been arrayed so as to invoke
+% this very package. This allows you to immediately evaluate this traditional layout and
+% see if it fits to your needs.
% \end{abstract}
%
% \begin{multicols}{2}
@@ -117,7 +120,10 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
% As any user of the \class{memoir} class knows well, this class allows to customize the
% page layout virtually without any limitation; such limitations are connected mainly with
% the user inconsistent data that miss to specify necessary information or give unnecessary
-% and contrasting information.
+% and contrasting information. Also other classes and/or packages allow the customized
+% design of the page layout; some other classes, such as the standard ones, do not have any
+% facility for customizing the page geometry, unless the user invokes suitable packages,
+% such as \pack{geometry} or \pack{tyeparea}, just to male a couple of well known examples.
%
% Many packages exist in order to specify a named layout; this package \pack{canoniclayout}
% is another one that computes the page parameters to determine the horizontal and vertical
@@ -177,15 +183,17 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
%
% It must also be noticed, in the sketch on the left, that the page rectangle is a golden
% one; therefore also the type block is a golden rectangle; the inner to the outer margin
-% ratio is the golden section value so as this same ratio exists between the top and the
-% bottom margin. This canonical layout implies that the type block height is equal to the
+% ratio is the golden section value so as this same ratio exists between the upper and the
+% lower margin. This canonical layout implies that the type block height is equal to the
% page width.
-% Therefore this canonical layout is not suited when the page width is small compared
+%
+% Therefore this canonical layout is not suited when the page width is too small compared
% to the page height: with the golden section\footnote{Here we denote $\phi=1,618\dots$
% with the name of \emph{golden number}, and its reciprocal $\varphi=0,618\dots$ with the
% name of \emph{golden section}.} this ratio is 0.618, with the ISO paper shape, in the
% sketch on the center, this ratio is 0,707, and so on.
-% But it is equally unsuitable with squarish pages, such as the scketch on the right where
+%
+% But it is equally unsuitable with squarish pages, such as the sketch on the right where
% the page proportions conform with the USA letter paper size: the type block leaves little
% space for the margins, as it is evident from the properties of the canonical circle, which
% is tangent to the page lateral sides and to the type block horizontal sides; to the limit
@@ -195,16 +203,16 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
% If one plays a little with the drawing of figure~\ref{fig:canoniclayout} and applies what
% has been described in the Introduction, may easily derive the following formulas:
%\begin{align}
-%&\text{Page shape ratio:}& x&=b/h \label{equ:1}\\
-%&\text{Inner margin:}& I&=bx(1-x)/(1+x) \\
-%&\text{External margin:}& E&=b(1-x)/(1+x) \\
-%&\text{Top margin:}& T&=hx(1-x)/(1+x) \\
-%&\text{Bottom margin:}& B&=h(1-x)/(1+x) \\
-%&\text{Text width:}& W&=xb \\
-%&\text{Text height:}& H&=b \\
-%&\text{Circle center abscissa:}&C_x&=0.5b \\
-%&\text{Circle center ordinate:}&C_y&=h(1-x)/(1+x)+b/2\\
-%&\text{Circle radius:}& R&=0.5b \label{equ:10}
+%&\text{Page shape ratio:}& x&=b/h \label{equ:1} \\
+%&\text{Inner margin:}& I&=bx(1-x)/(1+x) \\
+%&\text{External margin:}& E&=b(1-x)/(1+x) \\
+%&\text{Top margin:}& T&=hx(1-x)/(1+x) \\
+%&\text{Bottom margin:}& B&=h(1-x)/(1+x) \\
+%&\text{Text width:}& W&=xb \\
+%&\text{Text height:}& H&=b \\
+%&\text{Circle center abscissa:}&C_x&=0.5b \\
+%&\text{Circle center ordinate:}&C_y&=h(1-x)/(1+x)+b/2 \\
+%&\text{Circle radius:}& R&=0.5b \label{equ:10}
%\end{align}
% whose results are summarized in table~\ref{tab:canoniclayout} for three common values of
% the shape factor and for the letter paper shape ratio.
@@ -217,28 +225,29 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
%\begin{tabular}{l@{\qquad}*4{>{$}c<{$}}}
%\toprule
% &\multicolumn4c{Canon} \\
-%\multicolumn1c{Quantity}& \phi:1 & 3:2 & \sqrt2:1 & 11:8.5\\
+%\multicolumn1c{Quantity} & \phi:1 & 3:2 & \sqrt2:1 & 11:8.5\\
%\midrule
-% Page shape ratio &0,618~ &0,666~ &0,707~ &0,773~ \\
-% Inner margin &0,146b &0,133b &0,121b &0,099b \\
-% External margin &0,236b &0,200b &0,172b &0,128b \\
-% Top margin &0,146h &0,133h &0,121h &0,099h \\
-% Bottom margin &0,236h &0,200h &0,172h &0,128h \\
-% Text width & 0,618b &0,666b &0,707b &0,773b \\
-% Text height & b & b & b &b \\
-% Circle center abscissa & b/2 & b/2 & b/2 &b/2 \\
-% Circle center ordinate & 0,545h &0,533h &0,526h &0,515h \\
-% Circle radius & b/2 & b/2 & b/2 &b/2 \\
+% Page shape ratio &0,618~ &0,666~ &0,707~ &0,773~ \\
+% Inner margin &0,146b &0,133b &0,121b &0,099b \\
+% External margin &0,236b &0,200b &0,172b &0,128b \\
+% Upper margin &0,146h &0,133h &0,121h &0,099h \\
+% Lower margin &0,236h &0,200h &0,172h &0,128h \\
+% Text width & 0,618b &0,666b &0,707b &0,773b \\
+% Text height & b & b & b &b \\
+% Circle center abscissa & b/2 & b/2 & b/2 &b/2 \\
+% Circle center ordinate & 0,545h &0,533h &0,526h &0,515h \\
+% Circle radius & b/2 & b/2 & b/2 &b/2 \\
%\bottomrule
%\end{tabular}
%\end{table}
%
% Actually the formulas~\ref{equ:1}--\ref{equ:10}, and their numerical evaluations reported
% in table~\ref{tab:canoniclayout}, are just for general information. The actual
-% computations are performed by this package, by means of the \class{memoir} built-in
-% facilities. But it can be easily seen that as the trimmed page becomes more squarish, the
+% computations are performed by this package, either by means of the \class{memoir} built-in
+% facilities or by explicit computations that exploit the $\varepsilon$-\TeX\ extensions.
+% But it can be easily seen that as the trimmed page becomes more squarish, the
% page size ratio tends to one, ad the margins become smaller and smaller. Therefore it
-% seems that thsi layout is most suited for intermediate page ratios, such as the ISO one
+% seems that this layout is most suited for intermediate page ratios, such as the ISO one
% or the common European book size of 170\,mm $\times$ 240\,mm with a ratio of 0,708.
%
% \section{Usage}
@@ -258,24 +267,24 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
% At the same time if this page layout is chosen, the font normal size should be selected on
% the actual text block width; it is possible that the golden ratio type block, on a golden
% rectangle paper obtained by trimming an ISO A4 stock paper, might be suitable with a 10pt
-% normal font size (exactly 66 characters per line with 10pt Latin Modern fonts), while a full
-% ISO A4 paper yields a type block that might be more suited for a 12pt normal font size (86
-% characters with 10pt Latin Modern fonts). The computations might be left to the
+% normal font size (exactly 66 characters per line with 10pt Latin Modern fonts), while a
+% full ISO A4 paper yields a type block that might be more suited for a 12pt normal font
+% size (86 characters with 10pt Latin Modern fonts). The computations might be left to the
% \class{memoir} class commands, but it's better the user is aware of this particular point.
% For his/her sake this package provides the command |\currentfontletters| (to be used
-% only after |\begin{document}|, because specific font packages might be loaded after the page
-% layout has been computed; in any case the command is ``text producing'', therefore it can't
-% be used while in the preamble!) that types out a sentence such as ``The number of characters
-% in one text line with the current font is $nn$'', where the $nn$ is the actual number
-% printed out. If such number is much larger than the ideal Bringhurst range of $66\pm5$, it's
-% wiser to chose a larger normal font size.
+% only after |\begin{document}|, because specific font packages might be loaded after the
+% page layout has been computed; in any case the command is ``text producing'', therefore
+% it can't be used while in the preamble!) that types out a sentence such as ``The number
+% of characters in one text line with the current font is $nn$'', where the $nn$ is the
+% actual number printed out. If such number is much larger than the ideal Bringhurst range
+% of $66\pm5$, it's wiser to chose a larger normal font size.
% In any case the alternative command |\charactersperpage| types out the same information,
% the number of lines and the estimated number of characters per page. These commands are
% supposed to be useful while setting up the complete preliminary parameters for the page
% layout.
%
% Just to have a comparison, table~\ref{tab:sizes} displays the number of characters in one
-% line of text for several fonts and for page sizes A4 and A5.
+% line of text for several fonts and for page sizes A4, A5, and B5.
%
%\begin{table}
%\caption{Text line lengths measured in average number
@@ -324,11 +333,10 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
% relationship between the paper size, the page size and the type block size.
%
% As a final remark it's worth noting that a single pass of \prog{pdflatex} on this
-% \texttt{canoniclayout.dtx} file
-% produces at the same time both the \file{canoniclayout.sty} package file and the
-% documentation \file{canoniclayout.pdf} file. After running \prog{pdflatex} move
-% \file{canoniclayout.sty} to a \file{tex/latex/canoniclayout/} folder and
-% \file{canoniclayout.pdf} to a \file{doc/latex\discretionary{}{/}{/}canoniclayout/} one;
+% \file{canoniclayout.dtx} file produces at the same time both the \file{canoniclayout.sty}
+% package file and the documentation \file{canoniclayout.pdf} file. After running
+% \prog{pdflatex} move \file{canoniclayout.sty} to a \file{tex/latex/canoniclayout/} folder
+% and \file{canoniclayout.pdf} to a \file{doc/latex\discretionary{}{/}{/}canoniclayout/} one;
% if such folders don't exist, create them on your personal \TeX\ tree. After moving these
% files remember to refresh the file name data base.
%
@@ -361,18 +369,28 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
\expandaftter\endinput
\fi
% \end{macrocode}
-% Now we can determine the page shape factor and we save it into the control sequence
-% |\CLshape|. The trick of multiplying by |p@|, a length of 1\,pt, is a simple trick for
-% reducing the shape ratio to a length whose numerical value is exactly the ratio we are
-% interested in. By stripping the `pt' part from this dimension value we remain with the
-% real number we want to keep in memory. Of course we need also the reciprocal value so
-% that we have to perform this calculation two times with different factors.
+%
+% In order to have this layout work with the \class{memoir} class or with any other
+% class we have to test the fact they they package has been loaded within the preamble
+% of a \class{memoir} styled document; according to the result of this test we can exploit
+% the \class{memoir} facilities for determining the page geometry, or we have to carry out
+% the complete computations ourselves.
+% \begin{macrocode}
+\@ifclassloaded{memoir}{% }% balancing brace
+% \end{macrocode}
+% Working with the \class{memoir} facilities, we can determine the page shape factor
+% and we save it into the control sequence |\CLshape|. The trick of multiplying by |p@|,
+% a length of 1\,pt, is a simple trick for reducing the shape ratio to a length whose
+% numerical value is exactly the ratio we are interested in. By stripping the `pt' part
+% from this dimension value we remain with the real number we want to keep in memory.
+% Of course we need also the reciprocal value, therefore we have to perform this
+% calculation a second time with different factors.
% This ``strange'' way of computing real ratios derives from the ability of the
% $\varepsilon$-\TeX\ engine to scale lengths with a higher computational precision than
% ``normal'' \TeX\ can do with the standard dimension and integer operations. In facts
% all the computational operations are performed in the CPU registers and the intermediate
% first result of the multiplication is kept into a double length register, so that no bits
-% are rounded or truncated; the division operation is performed then with a double length
+% are rounded or truncated; the division operation is performed with a double length
% numerator and a single length denominator, so that, again, almost no information is lost
% at the inevitable end of the division algorithm with a non vanishing remainder.
% \begin{macrocode}
@@ -382,7 +400,7 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
\edef\CLinvshape{\strip@pt\dimen@}
% \end{macrocode}
% We then assign the text height, thanks to the fact that the canonical layout has the
-% block height just long as the page width, due to the circle property mentioned in the
+% block height just as long as the page width, due to the circle property mentioned in the
% Introduction; in any case the formulas~\ref{equ:1}--\ref{equ:10} and
% table~\ref{tab:canoniclayout} confirm this property for any shape.
% \begin{macrocode}
@@ -399,25 +417,101 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
% \end{macrocode}
%
-% We now use the |\checkandfixthelayout| so that it prints the page parameters to the
-% \file{.log} file.
+% We now use the |\checkandfixthelayout| so that it adjusts the type block dimensions
+% to an integer number of lines in the normal font and eventually prints the page
+% parameters to the% \file{.log} file.
% \begin{macrocode}
\checkandfixthelayout
% \end{macrocode}
-% Just for testing the number of character in a line the following macros are provided.
+%
+% At this point we are finished with the computations if the \class{memoir} class is the active one, nut we need to perform the complete calculations in case we are not working with the \class{memoir} class.
+% \begin{macrocode}
+}{%
+% \end{macrocode}
+% We start by defining the lengths registers that hold the real inner, outer and upper
+% margins, without the one inch shift and without taking into consideration the headings
+% and their spacings, that must be specified before calling this package.
+% \begin{macrocode}
+\newlength\innermargin
+\newlength\outermargin
+\newlength\uppermargin
+% \end{macrocode}
+% Then we define scratch length registers in order to maintain intermediate values.
+% \begin{macrocode}
+\dimendef\CLpageratio=1256% x=b/h
+\dimendef\CLsmallratio=1258% z=x*y
+\dimendef\CLlargeratio=1260% y=(1-x)/(1+x)
+% \end{macrocode}
+% Now we determine the actual values based on the page width and height; we work on dimensions, and we extract the decimal fractional value by stripping off the `pt' part of their measure; we keep the decimal fractionl values into service macros:
+% \begin{macrocode}
+\CLpageratio=\dimexpr \p@*\paperwidth/\paperheight\relax % x
+\CLlargeratio=\dimexpr \p@*(\p@-\CLpageratio)/(\p@+\CLpageratio)\relax % y
+\CLsmallratio=\dimexpr \CLpageratio*\CLlargeratio/\p@\relax % z
+%
+\edef\CL@pageratio{\strip@pt\CLpageratio}
+\edef\CL@smallratio{\strip@pt\CLsmallratio}
+\edef\CL@largeratio{\strip@pt\CLlargeratio}
+% \end{macrocode}
+% We compute the type block dimensions:
+% \begin{macrocode}
+\textheight\paperwidth% altezza griglia
+\textwidth=\CL@pageratio\textheight
+% \end{macrocode}
+% We then compute the real margins between the page sides and the type block:
+% \begin{macrocode}
+\innermargin=\CL@smallratio\paperwidth
+\outermargin=\CL@largeratio\paperwidth
+\uppermargin=\CL@smallratio\paperheight
+% \end{macrocode}
+% But the typesetting engine does not use the net margins, due to the historical
+% one inch shift of the original \TeX\ implementation and, for the upper margin,
+% due to the fact that by default this layout implies the headings and the footers
+% outside the type block. Since we have the real outer margin dimension, we compute
+% the actual default marginal note measure:
+% \begin{macrocode}
+\marginparwidth=\dimexpr0.8\outermargin-\marginparsep\relax
+\evensidemargin=\dimexpr\outermargin -1in\relax
+\oddsidemargin=\dimexpr\innermargin-1in\relax
+\topmargin=\dimexpr\uppermargin-1in-\headheight-\headsep\relax
+% \end{macrocode}
+% When using different classes from the \class{memoir} one, we adjust the type block
+% dimensions so that the type block contains an integer number of lines; we use the
+% normal size |\baslineskip| value and compute the number of lines contained in the
+% initial type block minus the first line stander height equal to |\topskip|; notice
+% that the integer value expression computed for counter 256 is a rounded value, not
+% a truncated value, therefore the actual type block height might get enlarged or
+% reduced a very little bit that will not be noticed with naked eye when one examines
+% a typeset page; eventually we recompute the |\textheight| taking into account the
+% height of the first line.
+% \begin{macrocode}
+\normalfont
+\count256=\numexpr(\textheight-\topskip)/\baselineskip\relax
+\textheight=\count256\baselineskip\relax
+\textheight=\dimexpr\textheight+\topskip\relax
+\normalbaselineskip\baselineskip
+% \end{macrocode}
+% and we eventually close the second action depending on the use of the \class{memoir}
+% class:
+% \begin{macrocode}
+}
+% \end{macrocode}
+%
+% Just for testing the number of characters in a line, the following macros are provided.
% A couple of scratch dimension registers will be used |dimen@| and |\abcwidth|; |\abcwidth|
% will hold the current lowercase alphabet length, and |\dimen@| will hold several values
% in succession. The scratch counter |\count254| will receive the final result to be
-% printed out. $\varepsilon$-\TeX\ arithmetics will be used throughout, but we know this
-% is possible, since we already tested it at the very beginning.
-%
-% Another service macro for the user's sake is |\charactersperpage|; this macro typesets the
-% number of characters per line, the numbers of lines per page, and eventually their product,
-% a good estimate of the number of characters per page. Many test editors have facilities for
-% counting a ``compuscript'' number o words and characters; with this further information the
-% user may easily estimate the number of pages of his/her document; of course s/he must make
-% a certain allowance for the front and back matter pages, so that s/he can evaluate the total
-% amount of signatures of the whole typeset document; of course, by typesetting it with
+% printed out. $\varepsilon$-\TeX\ arithmetics will be used throughout.
+%
+% Another service macro for the user's sake is |\charactersperpage|; this macro
+% typesets the average number of characters per line, the numbers of lines per
+% page, and eventually their product, a good estimate of the number of characters
+% per page.
+%
+% Many text editors have facilities for counting a ``compuscript'' number o words
+% and characters; with this further information the user may easily estimate the
+% number of pages of his/her document; of course s/he must allow a certain allowance
+% for the front and back matter pages, so that s/he can evaluate the total amount
+% of signatures of the whole typeset document; of course, by typesetting it with
% \prog{(pdf)latex} s/he knows exactly the number of pages of the final document, but the
% typographer wants to know a good estimate before the source \TeX\ files are finished.
% \begin{macrocode}
@@ -433,16 +527,16 @@ and the derived files canoniclayout.sty and canoniclayout.pdf.
\settowidth\abc@width{abcdefghijklmnopqrstuvwxyz}\dimen0=26\p@
\dimen0=\dimexpr \textwidth * \dimen0 / \abc@width \relax
\count254=\numexpr \dimen0 / \p@ \relax
-\count252=\numexpr \textheight / \onelineskip \relax
+\count252=\numexpr \textheight / \baselineskip \relax
\count250=\numexpr \count252 * \count254\relax
-\quote The number of characters in one text line with the current
- font is \the\count254;
+\begin{quote} The average number of characters in one text line
+ with the current font is \the\count254;
this text block contains \the\count252\ lines;
a rough estimate of the number of characters per page is
\the\count250.\par
- This can be used to evaluate the total number of pages of
- a document.
-\endquote}
+ This information may be useful to evaluate the total number
+ of pages in a document.
+\end{quote}}
%</package>
% \end{macrocode}
diff --git a/Master/texmf-dist/tex/latex/canoniclayout/canoniclayout.sty b/Master/texmf-dist/tex/latex/canoniclayout/canoniclayout.sty
index 19396c3f827..915dc3b0d5b 100644
--- a/Master/texmf-dist/tex/latex/canoniclayout/canoniclayout.sty
+++ b/Master/texmf-dist/tex/latex/canoniclayout/canoniclayout.sty
@@ -7,14 +7,14 @@
%% canoniclayout.dtx (with options: `package')
%% ______________________________________________________
%% The canoniclayout package for LaTeX
-%% Copyright (C) 2010 Claudio Beccari
+%% Copyright (C) 2010-2011 Claudio Beccari
%% All rights reserved
%%
%% License information appended
%%
\NeedsTeXFormat{LaTeX2e}[2009/01/01]
\ProvidesPackage{canoniclayout}%
- [2010/12/04 v.0.2 Canonic layout circumscribed to a circle]
+ [2011/11/05 v.0.3 Canonic layout circumscribed to a circle]
\expandafter\ifx\csname eTeXversion\endcsname\relax
\PackageWarning{canoniclayout}{%
@@ -29,6 +29,7 @@ The typesetting engine is not working in extended mode.\MessageBreak
This package is being skipped}
\expandaftter\endinput
\fi
+\@ifclassloaded{memoir}{% }% balancing brace
\dimen@=\dimexpr \p@ * \paperwidth / \paperheight\relax
\edef\CLshape{\strip@pt\dimen@}
\dimen@=\dimexpr \p@ * \p@ / \dimen@\relax
@@ -40,6 +41,34 @@ This package is being skipped}
\setmarginnotes{7pt}{\dimexpr \foremargin-3\marginparsep}{\onelineskip}
\checkandfixthelayout
+}{%
+\newlength\innermargin
+\newlength\outermargin
+\newlength\uppermargin
+\dimendef\CLpageratio=1256% x=b/h
+\dimendef\CLsmallratio=1258% z=x*y
+\dimendef\CLlargeratio=1260% y=(1-x)/(1+x)
+\CLpageratio=\dimexpr \p@*\paperwidth/\paperheight\relax % x
+\CLlargeratio=\dimexpr \p@*(\p@-\CLpageratio)/(\p@+\CLpageratio)\relax % y
+\CLsmallratio=\dimexpr \CLpageratio*\CLlargeratio/\p@\relax % z
+\edef\CL@pageratio{\strip@pt\CLpageratio}
+\edef\CL@smallratio{\strip@pt\CLsmallratio}
+\edef\CL@largeratio{\strip@pt\CLlargeratio}
+\textheight\paperwidth% altezza griglia
+\textwidth=\CL@pageratio\textheight
+\innermargin=\CL@smallratio\paperwidth
+\outermargin=\CL@largeratio\paperwidth
+\uppermargin=\CL@smallratio\paperheight
+\marginparwidth=\dimexpr0.8\outermargin-\marginparsep\relax
+\evensidemargin=\dimexpr\outermargin -1in\relax
+\oddsidemargin=\dimexpr\innermargin-1in\relax
+\topmargin=\dimexpr\uppermargin-1in-\headheight-\headsep\relax
+\normalfont
+\count256=\numexpr(\textheight-\topskip)/\baselineskip\relax
+\textheight=\count256\baselineskip\relax
+\textheight=\dimexpr\textheight+\topskip\relax
+\normalbaselineskip\baselineskip
+}
\newlength\abc@width
\newcommand*\currentfontletters{%
\settowidth\abc@width{abcdefghijklmnopqrstuvwxyz}\dimen0=26\p@
@@ -52,19 +81,19 @@ This package is being skipped}
\settowidth\abc@width{abcdefghijklmnopqrstuvwxyz}\dimen0=26\p@
\dimen0=\dimexpr \textwidth * \dimen0 / \abc@width \relax
\count254=\numexpr \dimen0 / \p@ \relax
-\count252=\numexpr \textheight / \onelineskip \relax
+\count252=\numexpr \textheight / \baselineskip \relax
\count250=\numexpr \count252 * \count254\relax
-\quote The number of characters in one text line with the current
- font is \the\count254;
+\begin{quote} The average number of characters in one text line
+ with the current font is \the\count254;
this text block contains \the\count252\ lines;
a rough estimate of the number of characters per page is
\the\count250.\par
- This can be used to evaluate the total number of pages of
- a document.
-\endquote}
+ This information may be useful to evaluate the total number
+ of pages in a document.
+\end{quote}}
-%% Copyright 2010 Claudio Beccari
+%% Copyright 2011 Claudio Beccari
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of