blob: 915dc3b0d5b3a69d12d29eb1098ee2aee2cdd535 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
%%
%% This is file `canoniclayout.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% canoniclayout.dtx (with options: `package')
%% ______________________________________________________
%% The canoniclayout package for LaTeX
%% Copyright (C) 2010-2011 Claudio Beccari
%% All rights reserved
%%
%% License information appended
%%
\NeedsTeXFormat{LaTeX2e}[2009/01/01]
\ProvidesPackage{canoniclayout}%
[2011/11/05 v.0.3 Canonic layout circumscribed to a circle]
\expandafter\ifx\csname eTeXversion\endcsname\relax
\PackageWarning{canoniclayout}{%
The typesetting engine is not suited\Messagebreak
for working in extended mode.\Messagebreak}
This package is being skipped}
\expandafter\endinput
\fi
\ifnum\eTeXversion>\z@\else
\PackageWarning{canoniclayout}{%
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
\edef\CLinvshape{\strip@pt\dimen@}
\textheight=\paperwidth
\settypeblocksize{\textheight}{*}{\CLshape}
\setlrmargins{*}{*}{\CLinvshape}
\setulmargins{*}{*}{\CLinvshape}
\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@
\dimen0=\dimexpr \textwidth * \dimen0 / \abc@width \relax
\count254=\numexpr \dimen0 / \p@ \relax
\par The number of characters in one text line with the current font is
\the\count254.\par}
\newcommand*\charactersperpage{%
\settowidth\abc@width{abcdefghijklmnopqrstuvwxyz}\dimen0=26\p@
\dimen0=\dimexpr \textwidth * \dimen0 / \abc@width \relax
\count254=\numexpr \dimen0 / \p@ \relax
\count252=\numexpr \textheight / \baselineskip \relax
\count250=\numexpr \count252 * \count254\relax
\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 information may be useful to evaluate the total number
of pages in a document.
\end{quote}}
%% Copyright 2011 Claudio Beccari
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%%
%% This work is "author-maintained"
%%
%% This work consists of this file canoniclayout.dtx, a README file
%% and the derived files canoniclayout.sty and canoniclayout.pdf.
%%
%%
%% End of file `canoniclayout.sty'.
|