summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-24 21:43:54 +0000
committerKarl Berry <karl@freefriends.org>2020-05-24 21:43:54 +0000
commit9c3aef688332cfa27bf37002fbd1cee6ef5a2b66 (patch)
tree885da59915a75554c2b5224dd7f8f8ad8b99476d /Master/texmf-dist/tex
parent9fb5024f4e6f1b5492dff41a31f225d9ac75c32d (diff)
fontsize (23may20)
git-svn-id: svn://tug.org/texlive/trunk@55264 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/fontsize/fontsize.sty343
1 files changed, 325 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/latex/fontsize/fontsize.sty b/Master/texmf-dist/tex/latex/fontsize/fontsize.sty
index c153213776a..50fdc64eb39 100644
--- a/Master/texmf-dist/tex/latex/fontsize/fontsize.sty
+++ b/Master/texmf-dist/tex/latex/fontsize/fontsize.sty
@@ -6,25 +6,30 @@
%%
%% fontsize.dtx (with options: `package')
%%
-%% Copyright 2020 Ivan Valbusa
+%% The 'fontsize' package
+%% Copyright (C) 2009-2020 Ivan Valbusa
+%% <ivan dot valbusa at gmail dot com>
%%
-%% This program is provided under the terms of the
-%% LaTeX Project Public License distributed from CTAN
-%% archives in directory macros/latex/base/lppl.txt.
+%% All rights reserved.
%%
-%% Author: Ivan Valbusa
-%% Ivan dot Valbusa at gmail dot com
+%% 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 consists of all files listed in README
%%
%% This work has the LPPL maintenance status "author-maintained".
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{fontsize}
- [2020/02/20 v0.1 'fontsize' package. Set main font sizes (Ivan Valbusa)]
-
-
+ [2020/05/24 v0.2 'fontsize' package. Set main font sizes (Ivan Valbusa)]
\@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}}
\@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}}
-\providecommand*{\@fontsizefilebase}{custom}
+\DeclareOptionX{cloname}[custom]{\def\@fontsizefilebase{#1}}
\DeclareOptionX{fontsize}[10]{%
\expandafter\@defaultunits\expandafter\@tempdima#1 pt\relax\@nnil
\edef\@tempa{#1}%
@@ -34,16 +39,23 @@
\edef\@ptsize{\strip@pt\@tempdimb}%
\edef\@tempa{%
\noexpand\makeatletter
- \noexpand\InputIfFileExists{\@fontsizefilebase\@tempa.clo}{%
- \noexpand\PackageInfo{fontsize}{%
- File `\@fontsizefilebase\@tempa.clo' used to setup font sizes}%
- }{%
- \noexpand\changefontsize{#1}%
- }%
- \noexpand\catcode`\noexpand\@=\the\catcode`\@
+ \noexpand\InputIfFileExists{\@fontsizefilebase\@tempa.clo}{%
+ \noexpand\PackageInfo{fontsize}{%
+ File `\@fontsizefilebase\@tempa.clo' used to setup font sizes}%
+ }{%
+ \noexpand\InputIfFileExists{\@fontsizefilebase\@tempb pt.clo}{%
+ \noexpand\PackageInfo{fontsize}{%
+ File `\@fontsizefilebase\@tempb pt.clo' used instead of%
+ \noexpand\MessageBreak
+ file `\@fontsizefilebase\@tempa.clo' to setup font sizes}%
+ }{%
+ \noexpand\changefontsize{#1}%
+ }%
}%
+ }%
\expandafter\AtEndOfPackage\expandafter{\@tempa}%
}
+\ExecuteOptionsX{cloname,fontsize}
\ProcessOptionsX*\relax
\newcommand*\ctm@setlength[4]{%
\ifdim #2<\ifdim #2=\z@ \z@ \else \p@\fi
@@ -86,6 +98,8 @@
\edef\@tempb{\the\@tempdimc}%
\setlength{\@tempdimc}{\@tempdima}%
\def\@tempa##1##2##3##4##5\@nnil{\def##1{##2.##3##4}}%
+\setlength\parindent{\the\@tempdimb}
+\setlength\headheight{\dimexpr(\@tempdima+2.5pt)}
\expandafter\@tempa\expandafter\@tempb\@tempb\@nnil%
\ctm@setlength{\abovedisplayskip}%
{.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}%
@@ -127,7 +141,7 @@
\ctm@setlength{\belowdisplayshortskip}%
{.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}%
\setlength{\belowdisplayskip}{\abovedisplayskip}%
- \edef\footnotesize{%
+ \edef\footnotesize{%
\noexpand\@setfontsize\noexpand\footnotesize
{\the\@tempdima}{\the\@tempdimb}%
\abovedisplayskip \the\abovedisplayskip
@@ -305,6 +319,299 @@
\setlength{\@dblfpbot}{\@fptop}%
\ctm@setlength{\partopsep}{.2\@tempdimb}{.1\@tempdimb}{.1\@tempdimb}%
}
+\newcommand*{\generateclofile}[1]{%
+ \kernel@ifnextchar [{\@generatefontfile{#1}}{\@@generatefontfile{#1}}%
+}
+\newcommand*{\@generatefontfile}{}
+\def\@generatefontfile#1[#2]#3{%
+ \begingroup
+ \changefontsize[#2]{#3}%
+ \generate@fontfile{#1}{#3}%
+ \endgroup
+}
+\newcommand\@@generatefontfile[2]{%
+ \begingroup
+ \changefontsize{#2}%
+ \generate@fontfile{#1}{#2}%
+ \endgroup
+}
+\newcommand*{\@@@generatefontfile}[2][]{}
+\newcommand*{\@fontfile}{}
+\let\@fontfile\@mainaux
+\newcommand*{\generate@fontfile}[2]{%
+ \def\@ind{\space\space}%
+ \immediate\openout\@fontfile #1#2.clo
+ \immediate\write\@fontfile{\@percentchar^^J%
+ \@percentchar\space This is file `#1#2.clo', generated with^^J%
+ \@percentchar\space fontsize
+ \csname ver@fontsize.\@pkgextension\endcsname,^^J%
+ \@percentchar\space Copyright (c) Ivan Valbusa.^^J%
+ \@percentchar^^J%
+ \string\ProvidesFile{#1#2.clo}[%
+ \the\year/\ifnum\month<10 0\fi\the\month/\ifnum\day<10 0\fi\the\day%
+ \space generated font size class option (#2)]}%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\parindent}{\f@baselineskip}^^J%
+ \string\setlength{\string\headheight}{\dimexpr(\f@size+2.5pt)}^^J%
+ }%
+ \immediate\write\@fontfile{%
+ \string\def\string\normalsize{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\normalsize{\f@size}{\f@baselineskip}%
+ \@percentchar^^J%
+ \@ind\string\abovedisplayskip\space \the\abovedisplayskip^^J%
+ \@ind\string\abovedisplayshortskip\space \the\abovedisplayshortskip^^J%
+ \@ind\string\belowdisplayskip\space \the\belowdisplayskip^^J%
+ \@ind\string\belowdisplayshortskip\space \the\belowdisplayshortskip^^J%
+ \@ind\string\let\string\@listi\string\@listI^^J%
+ }\@percentchar%
+ }%
+ \begingroup\small\@listi
+ \immediate\write\@fontfile{%
+ \string\def\string\small{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\small{\f@size}{\f@baselineskip}%
+ \@percentchar^^J%
+ \@ind\string\abovedisplayskip\space \the\abovedisplayskip^^J%
+ \@ind\string\abovedisplayshortskip\space \the\abovedisplayshortskip^^J%
+ \@ind\string\belowdisplayskip\space \the\belowdisplayskip^^J%
+ \@ind\string\belowdisplayshortskip\space \the\belowdisplayshortskip^^J%
+ \@ind\string\def\string\@listi{\@percentchar^^J%
+ \@ind\@ind\string\leftmargin\string\leftmargini^^J%
+ \@ind\@ind\string\topsep \the\topsep^^J%
+ \@ind\@ind\string\parsep \the\parsep^^J%
+ \@ind\@ind\string\itemsep \string\parsep^^J%
+ \@ind}\@percentchar^^J%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\footnotesize\@listi
+ \immediate\write\@fontfile{%
+ \string\def\string\footnotesize{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\footnotesize{\f@size}{\f@baselineskip}%
+ \@percentchar^^J%
+ \@ind\string\abovedisplayskip\space \the\abovedisplayskip^^J%
+ \@ind\string\abovedisplayshortskip\space \the\abovedisplayshortskip^^J%
+ \@ind\string\belowdisplayskip\space \the\belowdisplayskip^^J%
+ \@ind\string\belowdisplayshortskip\space \the\belowdisplayshortskip^^J%
+ \@ind\string\def\string\@listi{\@percentchar^^J%
+ \@ind\@ind\string\leftmargin\string\leftmargini^^J%
+ \@ind\@ind\string\topsep \the\topsep^^J%
+ \@ind\@ind\string\parsep \the\parsep^^J%
+ \@ind\@ind\string\itemsep \string\parsep^^J%
+ \@ind}\@percentchar^^J%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\scriptsize
+ \immediate\write\@fontfile{%
+ \string\def\string\scriptsize{%
+ \string\@setfontsize\string\scriptsize{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\tiny
+ \immediate\write\@fontfile{%
+ \string\def\string\tiny{%
+ \string\@setfontsize\string\tiny{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\large
+ \immediate\write\@fontfile{%
+ \string\def\string\large{%
+ \string\@setfontsize\string\large{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\Large
+ \immediate\write\@fontfile{%
+ \string\def\string\Large{%
+ \string\@setfontsize\string\Large{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\LARGE
+ \immediate\write\@fontfile{%
+ \string\def\string\LARGE{%
+ \string\@setfontsize\string\LARGE{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\huge
+ \immediate\write\@fontfile{%
+ \string\def\string\huge{%
+ \string\@setfontsize\string\huge{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\Huge
+ \immediate\write\@fontfile{%
+ \string\def\string\Huge{%
+ \string\@setfontsize\string\Huge{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+ \immediate\write\@fontfile{\string\normalsize}%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\footnotesep}{\the\footnotesep}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\skip\string\footins}{\the\skip\footins}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\floatsep}{\the\floatsep}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\textfloatsep}{\the\textfloatsep}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\intextsep}{\the\intextsep}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\dblfloatsep}{\the\dblfloatsep}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\dbltextfloatsep}{\the\dbltextfloatsep}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\@fptop}{\the\@fptop}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\@fpsep}{\the\@fpsep}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\@fpbot}{\the\@fpbot}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\@dblfptop}{\the\@dblfptop}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\@dblfpsep}{\the\@dblfpsep}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\@dblfpbot}{\the\@dblfpbot}\@percentchar
+ }%
+ \immediate\write\@fontfile{%
+ \string\setlength{\string\partopsep}{\the\partopsep}\@percentchar
+ }%
+ \begingroup
+ \@listi
+ \immediate\write\@fontfile{%
+ \string\def\string\@listi{\@percentchar^^J%
+ \@ind\string\leftmargin\string\leftmargini^^J%
+ \@ind\string\topsep \the\topsep^^J%
+ \@ind\string\parsep \the\parsep^^J%
+ \@ind\string\itemsep \string\parsep^^J%
+ }\@percentchar
+ }%
+ \endgroup
+ \immediate\write\@fontfile{%
+ \string\let\string\@listI\string\@listi
+ }%
+ \begingroup
+ \@listii
+ \immediate\write\@fontfile{%
+ \string\def\string\@listii{\@percentchar^^J%
+ \@ind\string\leftmargin\string\leftmarginii^^J%
+ \@ind\string\labelwidth\string\leftmarginii^^J%
+ \@ind\string\advance\string\labelwidth-\string\labelsep^^J%
+ \@ind\string\topsep \the\topsep^^J%
+ \@ind\string\parsep \the\parsep^^J%
+ \@ind\string\itemsep \string\parsep^^J%
+ }\@percentchar
+ }%
+ \endgroup
+ \begingroup
+ \@listiii
+ \immediate\write\@fontfile{%
+ \string\def\string\@listiii{\@percentchar^^J%
+ \@ind\string\leftmargin\string\leftmarginiii^^J%
+ \@ind\string\labelwidth\string\leftmarginiii^^J%
+ \@ind\string\advance\string\labelwidth-\string\labelsep^^J%
+ \@ind\string\topsep \the\topsep^^J%
+ \@ind\string\parsep \the\parsep^^J%
+ \@ind\string\partopsep \the\partopsep^^J%
+ \@ind\string\itemsep \string\topsep^^J%
+ }\@percentchar
+ }%
+ \endgroup
+ \begingroup
+ \@listiv
+ \immediate\write\@fontfile{%
+ \string\def\string\@listiv{\@percentchar^^J%
+ \@ind\string\leftmargin\string\leftmarginiv^^J%
+ \@ind\string\labelwidth\string\leftmarginiv^^J%
+ \@ind\string\advance\string\labelwidth-\string\labelsep^^J%
+ }\@percentchar
+ }%
+ \endgroup
+ \begingroup
+ \@listv
+ \immediate\write\@fontfile{%
+ \string\def\string\@listv{\@percentchar^^J%
+ \@ind\string\leftmargin\string\leftmarginv^^J%
+ \@ind\string\labelwidth\string\leftmarginv^^J%
+ \@ind\string\advance\string\labelwidth-\string\labelsep^^J%
+ }\@percentchar
+ }%
+ \endgroup
+ \begingroup
+ \@listvi
+ \immediate\write\@fontfile{%
+ \string\def\string\@listvi{\@percentchar^^J%
+ \@ind\string\leftmargin\string\leftmarginvi^^J%
+ \@ind\string\labelwidth\string\leftmarginvi^^J%
+ \@ind\string\advance\string\labelwidth-\string\labelsep^^J%
+ }\@percentchar
+ }%
+ \endgroup
+ \immediate\write\@fontfile{%
+ \string\@ifundefined{@list@extra}{}{\@percentchar^^J%
+ \string\expandafter\string\ifnum\string\scr@v@is@ge{3.17}%
+ \string\par@updaterelative\string\fi^^J%
+ \@ind\string\l@addto@macro{\string\@listi}{\string\@list@extra}%
+ \@percentchar^^J%
+ \@ind\string\let\string\@listI=\string\@listi^^J%
+ \@ind\string\l@addto@macro{\string\@listii}{\string\@list@extra}%
+ \@percentchar^^J%
+ \@ind\string\l@addto@macro{\string\@listiii}{\string\@list@extra}%
+ \@percentchar^^J%
+ \@ind\string\l@addto@macro{\string\footnotesize}{\string\protect
+ \string\add@extra@listi{ftns}}\@percentchar^^J%
+ \@ind\string\l@addto@macro{\string\small}{\string\protect
+ \string\add@extra@listi{sml}}\@percentchar^^J%
+ }\@percentchar^^J%
+ \string\@listi^^J%
+ \string\endinput^^J%
+ \@percentchar^^J%
+ \@percentchar\space End of file `#1#2.clo'.
+ }
+ \immediate\closeout\@fontfile
+}
+\@onlypreamble\generateclofile
+\def\fs@extext{As any dedicated reader can clearly see, the Ideal of
+practical reason is a representation of, as far as I know, the
+things in themselves; as I have shown elsewhere, the phenomena
+should only be used as a canon for our understanding. The paralogisms
+of practical reason are what first give rise to the architectonic of
+practical reason.}
+\chardef\fsbslash=`\\
+\newcommand{\mysize}[1]{%
+ \bgroup\noindent\csname#1\endcsname
+ The \texttt{\fsbslash #1} size is: \textbf{\csname#1\endcsname\f@size\,pt}.\\
+ The \texttt{\fsbslash baselineskip} is \the\baselineskip\par\vskip2mm\egroup}
+\newcommand{\mysizeex}[1]{%
+ \paragraph*{\csname #1\endcsname \texttt{\fsbslash #1}
+ \textmd{\f@size pt on \the\baselineskip}\\}
+ \noindent\bgroup\raggedright\csname #1\endcsname\fs@extext\par\egroup}
+\newcommand{\printfontsize}[2][]{%
+ \section*{Settings with \texttt{\fsbslash changefontsize[#1]\{#2\}}}%
+ \changefontsize[#1]{#2}
+ \mysize{tiny}\mysize{scriptsize}\mysize{footnotesize}
+ \mysize{small}\mysize{normalsize}\mysize{large}\mysize{Large}
+ \mysize{LARGE}\mysize{huge}\mysize{Huge}
+ \mysizeex{tiny}\mysizeex{scriptsize}\mysizeex{footnotesize}
+ \mysizeex{small}\mysizeex{normalsize}\mysizeex{large}
+ \mysizeex{Large}\mysizeex{LARGE}\mysizeex{huge}\mysizeex{Huge}}
\endinput
%%
%% End of file `fontsize.sty'.