summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-23 22:22:33 +0000
committerKarl Berry <karl@freefriends.org>2011-09-23 22:22:33 +0000
commit7b64a1aead3e4e89f3d17737813d522ca8ec66d2 (patch)
tree4525682485730e6db7a15e451f1397145d75623b
parentd532726dc875c573a3be147427a7d7f57b11249c (diff)
relsize 4.0 (23sep11)
git-svn-id: svn://tug.org/texlive/trunk@24074 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/relsize/README33
-rw-r--r--Master/texmf-dist/doc/latex/relsize/relsize-doc.pdfbin300839 -> 317217 bytes
-rw-r--r--Master/texmf-dist/doc/latex/relsize/relsize-doc.tex260
-rw-r--r--Master/texmf-dist/tex/latex/relsize/relsize.sty301
4 files changed, 316 insertions, 278 deletions
diff --git a/Master/texmf-dist/doc/latex/relsize/README b/Master/texmf-dist/doc/latex/relsize/README
new file mode 100644
index 00000000000..722c09eab22
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/relsize/README
@@ -0,0 +1,33 @@
+relsize.sty 4.0 Sept 21, 2011
+This software is contributed to the public domain.
+
+LaTex2e version by Donald Arseneau <asnd@triumf.ca> and
+Matt Swift <swift at bu.edu>.
+Original LaTex2.09 smaller.sty author: Bernie Cosell
+
+
+Setting the font size relative to the current size.
+
+commands are:
+ \relsize{n} where n gives the number of steps ("mag-step" = factor of 1.2)
+ to change the size by; n = 3 changes from \normalsize to
+ \LARGE size. Negative n selects smaller fonts. n is an
+ integer (or half-integer).
+
+ \smaller == \relsize{-1}, \smaller[n] == \relsize{-n}
+ \larger == \relsize{1}, \larger[n] == \relsize{n}
+
+ \textsmaller{text}, \textlarger{text} - versions that take an argument
+
+ \relscale{f} like \relsize, but instead of scale-steps,
+ the parameter is a scale factor, such as .75
+ \textscale{f}{text}
+
+ The font-size command nearest the requested size will be used, and if
+ the size error is more than \RSpercentTolerance, then the size will
+ be adjusted more precisely using \fontsize. (The default empty
+ \RSpercentTolerance signals automatic handling, choosing the tolerance
+ based on the font declarations.)
+
+ \mathsmaller{A}, \mathlarger{B} - math versions
+ (The math versions are entirely different from the text versions.)
diff --git a/Master/texmf-dist/doc/latex/relsize/relsize-doc.pdf b/Master/texmf-dist/doc/latex/relsize/relsize-doc.pdf
index c1e31e3a5a8..b40a13c4ef5 100644
--- a/Master/texmf-dist/doc/latex/relsize/relsize-doc.pdf
+++ b/Master/texmf-dist/doc/latex/relsize/relsize-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/relsize/relsize-doc.tex b/Master/texmf-dist/doc/latex/relsize/relsize-doc.tex
index 853325d0915..5475609a5ba 100644
--- a/Master/texmf-dist/doc/latex/relsize/relsize-doc.tex
+++ b/Master/texmf-dist/doc/latex/relsize/relsize-doc.tex
@@ -1,6 +1,6 @@
-\documentclass[pagesize=auto]{scrartcl}
+\documentclass[12pt,pagesize=auto]{scrartcl}
-\usepackage{fixltx2e}
+%\usepackage{fixltx2e} my copy of fixltx2e breaks \thanks numbering!
\usepackage{etex}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
@@ -8,9 +8,11 @@
\usepackage{amstext}
\usepackage{booktabs}
\usepackage{microtype}
-\usepackage{hyperref}
+% This documentation scrupulously avoide \usepackage{relsize}
+% It also avoids hyperref mailto:
+%\usepackage{hyperref}
-\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}}
+\newcommand*{\mail}[1]{\texttt{#1}}
\newcommand*{\pkg}[1]{\textsf{#1}}
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}}
\makeatletter
@@ -19,148 +21,190 @@
\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle}
\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}}
+\hyphenpenalty=500
+
\addtokomafont{title}{\rmfamily}
-\title{The \pkg{relsize} package\thanks{This manual corresponds to \pkg{relsize.sty}~v3.1, dated~July 4, 2003.}}
+\title{The \pkg{relsize} package\thanks
+ {This manual corresponds to \pkg{relsize.sty}~v4.0, dated~Sept 21, 2011.}}
\author{%
by Donald Arseneau\thanks{\mail{asnd@triumf.ca}, Vancouver, Canada}%
- \and origianally based on \pkg{smaller.sty} by Bernie Cosell\thanks{\mail{cosell@WILMA.BBN.COM}},%
- \and and combined with the version by Matt Swift\thanks{\mail{swift@bu.edu}}.%
+ \and originally based on \pkg{smaller.sty} by Bernie Cosell
+% \thanks{\mail{cosell@WILMA.BBN.COM}},%
+ \and and combined with code by Matt Swift
+%\thanks{\mail{swift@bu.edu}}.%
}
-\date{July 4, 2003}
+\date{Sept 21, 2011}
\begin{document}
\maketitle
+\sloppy
+\linespread{1.05}\selectfont
+
\noindent
It is frequently the case that something should be typeset somewhat larger
or smaller than the surrounding text, whatever that size happens to be.
Specifying such sizing commands explicitly makes it difficult to modify the
font sizes of a document at a later time, and makes it hard to write macros
-that work at arbitrary sizes. \pkg{Relsize.sty} defines several commands for \LaTeX\ %
-to set font sizes relative to the current size.
+that work at arbitrary sizes. To fill this need, \pkg{relsize.sty} defines
+several commands for \LaTeX\ to set font sizes relative to the current size.
+
+\begin{center}
+ \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lll@{}}
+ \toprule
+ Command & Function \\
+ \cmidrule(r){1-1} \cmidrule(lr){2-2}
+ \verb|\relsize{|$i$\verb|}| & Change font size by $i$ steps.\\
+ \verb|\larger[|$i$\verb|]| & Increase size by (optional) $i$ steps (default 1).\\
+ \verb|\smaller[|$i$\verb|]| & Reduce font size by $i$ steps (default~1).\\
+ \verb|\relscale{|$f$\verb|}| & Change font size by scale factor $f$.\\
+ \verb|\textlarger[|$i$\verb|]|\marg{text} & Text size enlarged by (optional) $i$ steps.\\
+ \verb|\textsmaller[|$i$\verb|]|\marg{text} & Text size reduced by (optional) $i$ steps.\\
+ \verb|\textscale{|$f$\verb|}|\marg{text} & Text size scaled by factor $f$.\\
+ \bottomrule
+ \end{tabular*}
+\end{center}
To refresh your memory, the font sizing commands in \LaTeX\ are, in order:
-\cmd{\tiny}, \cmd{\scriptsize}, \cmd{\footnotesize}, \cmd{\small}, \cmd{\normalsize}, \cmd{\large}, \cmd{\Large},
-\cmd{\LARGE}, \cmd{\huge}, \cmd{\Huge} (package \pkg{moresize} adds \cmd{\ssmall} and \cmd{\HUGE}). The main
-new command provided by \pkg{relsize.sty} is \cmd{\relsize}, which takes one (positive
-or negative) number as its argument; the number specifies how many ``steps''
-by which to change the font size, where each step is a scaling factor of~%
-1.2, corresponding to the usual difference between the size commands. For
-example, if \verb|{\relsize{-2} smaller}| appears in normal sized text, the word
-``smaller'' is printed in script size type. If the same command appears in a
-\cmd{\Large} section title, then ``smaller'' is printed in normal size.
-
-\begin{sloppypar}
- There are also the commands \cmd{\larger} and \cmd{\smaller}, which normally change the
- font size by one step in the obvious direction; \cmd{\larger} is an abbreviation
- for \verb|\relsize{+1}|, and \cmd{\smaller} is an abbreviation for \verb|\relsize{-1}|. For
- example, \verb+{\large... \larger{WOW!}}+ prints ``WOW'' in \cmd{\Large} type. You can
- also specify bigger steps as an optional argument for \cmd{\larger} and \cmd{\smaller}:
- \verb+\larger[3]+ is equivalent to \verb+\relsize{3}+; \verb+\smaller[2]+ is \verb+\relsize{-2}+.
- Both \cmd{\larger} and \cmd{\smaller} accept negative arguments, but please don't make
- things so obscure! If you want to change size by several steps it is
- much better to give an increment than to string several \cmd{\larger} commands
- together; i.\,e.\@, \verb+\relsize{3}+ or \verb+\larger[3]+, but not \verb+\larger\larger\larger+.
-\end{sloppypar}
-
-All of the \cmd{\relsize}, \cmd{\larger}, and \cmd{\smaller} commands are ``switches'' just
-like the regular sizing commands. That is, they change the size for all
-following text until the scope is ended by a closing brace. There are
-alternate versions called \cmd{\textlarger} and \cmd{\textsmaller} that take some text
-as an argument and apply the size change to only that text:
-\verb+\textlarger{big}+.
+\cmd{\tiny}, \cmd{\scriptsize}, \cmd{\footnotesize}, \cmd{\small},
+\cmd{\normalsize}, \cmd{\large}, \cmd{\Large}, \cmd{\LARGE}, \cmd{\huge},
+\cmd{\Huge} (package \pkg{moresize} adds \cmd{\ssmall} and \cmd{\HUGE}).
+The main new command provided by \pkg{relsize.sty} is \cmd{\relsize},
+which takes one (positive or negative) number as its argument; the number
+specifies how many ``steps'' by which to change the font size, where each
+step is a scaling factor of~1.2, corresponding to the usual difference
+between the size commands. For example, if \verb|{\relsize{-2} smaller}|
+appears in normal sized text, the word ``smaller'' is printed in script
+size type. If the same command appears in a \cmd{\Large} section title,
+then ``smaller'' is printed in normal size.
+
+There are also the commands \cmd{\larger} and \cmd{\smaller}, which normally
+change the font size by one step in the obvious direction; \cmd{\larger} is
+an abbreviation for \verb|\relsize{+1}|, and \cmd{\smaller} is an
+abbreviation for \verb|\relsize{-1}|. For example,
+\verb+{\large... \larger{WOW!}}+ prints {\large ``WOW!''} in \cmd{\Large}
+type. You can also specify bigger steps as an optional argument for
+\cmd{\larger} and \cmd{\smaller}: \verb+\larger[3]+ is equivalent to
+\verb+\relsize{3}+ and \verb+\smaller[2]+ is \verb+\relsize{-2}+. (Both
+\cmd{\larger} and \cmd{\smaller} accept negative arguments, but please
+don't make things so obscure!) If you want to change size by several steps
+it is much better to give an increment than to string several \cmd{\larger}
+commands together; i.e., \verb+\relsize{3}+ or \verb+\larger[3]+, but
+not \verb+\larger\larger\larger+. Half-steps are possible, as in
+\verb+\relsize{-0.5}+ to change from 10\,pt \cmd{\normalsize} to 9\,pt
+\cmd{\small}, but other numbers are rounded to the nearest half-integer.
+
+All of the \cmd{\relsize}, \cmd{\larger}, and \cmd{\smaller} commands
+are ``switches'' just like the regular sizing commands. That is, they
+change the size for all following text until the scope is ended by a
+closing brace (or tabular cell, or environment\,\dots). There are
+alternate versions called \cmd{\textlarger} and \cmd{\textsmaller}
+that take some text as an argument and apply the size change to only
+that text: \verb+\textlarger{big}+.
Using the number of ``magnification steps'' to indicate font size can
be confusing to some people, and limiting in certain uses. There are
-commands with syntax \cmd{\text\-scale}\marg{factor}\marg{text} and \cmd{\relscale}\marg{factor} to
-select the size based on a scale factor, like \verb+{0.75}+.
+commands with syntax \cmd{\text\-scale}\marg{factor}\marg{text} and
+\cmd{\relscale}\marg{factor} to select the size based on a scale factor,
+like \verb+\relscale{0.75}+.
If the size requested is too small or too large, a warning is given, and
-the size will only change as far as appropriate, typically \cmd{\tiny} or \cmd{\Huge}.
-These limits are controlled by the commands \cmd{\RSsmallest} and \cmd{\RSlargest}, which
-get set automatically when \pkg{relsize.sty} is loaded, but you can redefine them
-to other length values: \verb+\renewcommand\RSlargest{50pt}+.
-
-Fine point: The combination \cmd{\relsize}\marg{n}\cmd{\relsize}\texttt{\{}$-\text{\meta{n}}$\texttt{\}} is not guaranteed to
-restore the current font size! That is because the increment \meta{n} may be
-enough to overflow the range of sizes. Say you are in \cmd{\huge} text already,
-and you do \verb+\relsize{4}+. There is nothing bigger than \cmd{\Huge} so that is the
-size you get. Then an ensuing \verb+\relsize{-4}+ will take four steps smaller
-and change the size to \cmd{\large}. You should use grouping to undo relative
-size changes because it is unsafe to counteract one change with an ``equal''
-change in the opposite direction.
-
-Typically, the font-size commands do not select fonts at regular size
-intervals. \cmd{\relsize} (and the others) will select, and execute, the command
-for the size closest to the desired size. Then, if the relative difference
-from the target size is more than \cmd{\RSpercentTolerance} a further font-size
-selection is made. By~default, \cmd{\RSpercentTolerance} is an empty macro, which
-causes automatic selection: ``30'' (30\,\%) when the current ``fontshape'' definition
-is composed of only discrete sizes, and ``5'' when the fontshape definition
-covers ranges of sizes. The higher setting for discrete fonts ensures
-only the pre-defined sizes get used. (By~default \LaTeX\ uses Computer
-Modern fonts at discrete sizes; you get full coverage of sizes by using
-\verb+\usepackage{type1cm}+\@.) For special uses, or when the font shape definitions
-are not parsed properly, you can redefine the percent tolerance:
-\verb+\renewcommand\RSpercentTolerance{10}+.
-
-\enlargethispage{-5\baselineskip}
+the size will only change as far as appropriate, typically \cmd{\tiny} or
+\cmd{\Huge}. These limits are controlled by the commands \cmd{\RSsmallest}
+and \cmd{\RSlargest}, which get set automatically when \pkg{relsize.sty}
+is loaded, but you can redefine them to other length values:
+\verb+\renewcommand\RSlargest{50pt}+ (do not use \cmd{\setlength}).
+
+\begin{small}
+
+Fine point: The combination
+\verb|\relsize{|$n$\verb|}\relsize{|$-n$\verb|}|
+is not guaranteed to
+restore the current font size! That is because the increment $n$ may be
+enough to overflow the range of sizes, depending on \cmd{\RSsmallest},
+\cmd{\RSlargest}, and \cmd{\RSpercentTolerance} (below). You should use
+grouping to undo relative size changes because it is unsafe to counteract
+one change with an ``equal'' change in the opposite direction. Or just use
+the commands that take the text as arguments, like \verb+\textsmaller{this}+.
+\end{small}
+
+Typically, the font-size commands do not select fonts at precise regular
+size ratios (and some commands give half-intervals). \cmd{\relsize}
+and the others will select, and execute, the command for the size
+closest to the desired size. Then, if the relative difference
+from the target size is more than \cmd{\RSpercentTolerance} a further
+font-size selection is made. By~default, \cmd{\RSpercentTolerance}
+is an empty macro, which causes automatic selection: ``30'' (30\,\%)
+when the current ``fontshape'' definition is composed of only discrete
+sizes, and ``5'' when the fontshape definition covers ranges of sizes.
+The higher setting for discrete fonts ensures only the pre-defined sizes
+get used. (By~default \LaTeX\ uses Computer Modern fonts at discrete sizes;
+you get full coverage of sizes by using \verb+\usepackage{type1cm}+ or
+various other font package.) For special uses, or when the font shape
+definitions are not parsed properly, you can redefine the percent tolerance:
+\verb+\renewcommand\RSpercentTolerance{10}+. Define it as ``0'' (zero)
+to ensure the scaling is exactly as specified, regardless of the
+document's standard font sizes.
+
+\smallskip
+
+\noindent\centerline{$ - {~} \times {} \mathbin{\vcenter{\hbox{\Large $\times$}}} {} \times {~} - $}
+
+\smallskip
+\noindent
All of the commands described above are text commands; they cannot be used
in math mode. There are special \cmd{\mathsmaller} and \cmd{\mathlarger} commands
provided, but these do not use the same sizes that the text versions use.
Instead, they step between the usual math ``styles'' which you can explicitly
set using the commands \cmd{\displaystyle}, \cmd{\textstyle}, \cmd{\scriptstyle}, and
-\cmd{\scriptscriptstyle} [see Lamport, \LaTeX/Manual (1st~ed, p.\,54); GMS The \LaTeX\ %
-Companion, p.\,255]\@. However, the \cmd{\mathlarger} command will also increase the
+\cmd{\scriptscriptstyle}%
+%[see Lamport, \LaTeX/Manual (1st~ed, p.\,54); GMS The \LaTeX\ Companion, p.\,255]
+\@. However, the \cmd{\mathlarger} command will also increase the
size beyond regular \cmd{\displaystyle} by selecting a larger regular font size
(using \cmd{\larger})\@. (Yes, this is a kludge, and doesn't work very well, but
it can still be useful.) If you want to use this to create big integral
signs, then you must also load the package \pkg{exscale} so that math symbols
can change size. The sizes selected are:
-%
-\begin{flushleft}
+
+\medskip
+\begin{center}
\small
- \begin{tabular}{@{}lll@{}}
+ \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lll@{}}
\toprule
- Current style & \cmd{\mathsmaller} gives & \cmd{\mathlarger} gives \\
- \cmidrule(r){1-1} \cmidrule(lr){2-2} \cmidrule(l){3-3}
- \cmd{\displaystyle} & \cmd{\textstyle} (almost same) & \cmd{\displaystyle} in a \cmd{\larger} font \\
- \cmd{\textstyle} & \cmd{\scriptstyle} & \cmd{\displaystyle} (almost same) \\
- \cmd{\scriptstyle} & \cmd{\scriptscriptstyle} & \cmd{\textstyle} \\
- \cmd{\scriptscriptstyle} & \cmd{\scriptscriptstyle} (same) & \cmd{\scriptstyle} \\
+ Current style & \cmd{\mathsmaller} gives & \cmd{\mathlarger} gives \\
+ \cmidrule(r){1-1} \cmidrule(lr){2-2} \cmidrule(l){3-3}
+ \cmd{\displaystyle} & \cmd{\textstyle} (similar)& \cmd{\displaystyle} in \cmd{\larger} font \\
+ \cmd{\textstyle} & \cmd{\scriptstyle} & \cmd{\displaystyle} (similar) \\
+ \cmd{\scriptstyle} & \cmd{\scriptscriptstyle} & \cmd{\textstyle} \\
+ \cmd{\scriptscriptstyle} & \cmd{\scriptscriptstyle} & \cmd{\scriptstyle} \\
\bottomrule
- \end{tabular}
-\end{flushleft}
-%
-For example, try \verb+$\frac{\mathlarger{E}}{E}$+. Note that, for most symbols,
-\cmd{\display\-style} and \cmd{\textstyle} are the same size, so \verb+$N \mathlarger{N}$+
-gives two identical $N$'s, but \cmd{\sum} and \cmd{\int} do get bigger in display style:
-\verb+$\int\mathlarger{\int}$+, and fractions are treated differently too:
-\verb+$\frac{1}{2} \mathlarger{\frac{1}{2}}$+. As you might have guessed,
-\cmd{\mathlarger} and \cmd{\mathsmaller} should only be used in math mode.
-
-These commands will attempt to attach superscripts and subscripts to the
-symbol as if the symbol were used alone: \verb+$\mathlarger{\int}_{0}^{\infty}$+
-but math accents and the math spacing behave as if the symbol is enclosed
-in braces (which it is). Comparing
-%
-\begin{flushleft}
- \footnotesize
-\begin{verbatim}
-\[
-| \times | {\times} | \mathlarger{\times} | \mathbin{\mathlarger{\times}} |
-\]
-\end{verbatim}
-\end{flushleft}
-%
-shows that operators must be explicitly declared to use the right operator
-type (\cmd{\mathrel}, \cmd{\mathbin}, \cmd{\mathop}) to get the correct spacing.
+ \end{tabular*}
+\end{center}
+
+\noindent For example, try \verb+$\frac{\mathlarger{E}}{E}$+~= $\frac{\textstyle E}{E}$.
+Note that, for most symbols,
+\cmd{\display\-style} and \cmd{\text\-style} give the same size, so
+\verb+$N,\mathlarger{N}$+~= $N\displaystyle N$, showing two identical $N$'s,
+but \cmd{\sum} and \cmd{\int} do get bigger in display style,
+and fractions are treated differently too: \\
+\verb+$\int\frac{1}{2}dN - \mathlarger{\int\frac{1}{2}dN}$+~~=~
+$\int\frac{1}{2}dN - \displaystyle{\int\frac{1}{2}dN}$.\\[3pt]
+As you might have guessed, \cmd{\mathlarger} and \cmd{\mathsmaller}
+should only be used in math mode.
+
+These commands will attempt to attach any superscripts and subscripts
+directly to the symbol within the braces, rather than how they would attach
+to a math sub-formula. On the other hand, math accents and the math
+spacing do behave as if the symbol is enclosed in braces (which it is).
+Operators should be explicitly declared to use the right operator
+type (\cmd{\mathrel}, \cmd{\mathbin}, \cmd{\mathop}) to get the correct
+spacing, e.g., \verb+\mathrel{\mathsmaller{=}}+.
Due to their oddities, the math larger/smaller commands should not be
-trusted blindly, and they will not be useful in every instance.
+trusted very far, and they will not be useful in every instance.
\end{document}
diff --git a/Master/texmf-dist/tex/latex/relsize/relsize.sty b/Master/texmf-dist/tex/latex/relsize/relsize.sty
index febbf0ac7a8..1962f610916 100644
--- a/Master/texmf-dist/tex/latex/relsize/relsize.sty
+++ b/Master/texmf-dist/tex/latex/relsize/relsize.sty
@@ -1,113 +1,40 @@
-% relsize.sty 3.1 July 4, 2003
+% relsize.sty 4.0 Sept 21, 2011
% This software is contributed to the public domain.
-
+%
% LaTex2e version by Donald Arseneau <asnd@triumf.ca> and
% Matt Swift <swift@bu.edu>.
-% Original LaTex2.09 smaller.sty author: Bernie Cosell <cosell@WILMA.BBN.COM>
+% Original LaTex2.09 smaller.sty author: Bernie Cosell <cosell at WILMA.BBN.COM>
%
% Setting the font size relative to the current size
%
% commands are:
% \relsize{n} where n gives the number of steps ("mag-step" = factor of 1.2)
% to change the size by; n = 3 changes from \normalsize to
-% \LARGE size. Negative n selects smaller fonts.
-% \smaller == \relsize{-1}
-% \larger == \relsize{1}
+% \LARGE size. Negative n selects smaller fonts. n is an
+% integer (or half-integer).
+%
+% \smaller == \relsize{-1}, \smaller[n] == \relsize{-n}
+% \larger == \relsize{1}, \larger[n] == \relsize{n}
+%
% \textsmaller{text}, \textlarger{text} - versions that take an argument
%
-% \relscale{f} is equivalent to \relsize, but instead of scale-steps,
-% the parameter is a scale factor, such as .75
+% \relscale{f} like \relsize, but instead of scale-steps,
+% the parameter is a scale factor, such as .75
% \textscale{f}{text}
%
% The font-size command nearest the requested size will be used, and if
% the size error is more than \RSpercentTolerance, then the size will
-% be adjusted more precisely. (The default empty \RSpercentTolerance
-% signals automatic handling, choosing the tolerance based on the
-% font declarations.)
+% be adjusted more precisely using \fontsize. (The default empty
+% \RSpercentTolerance signals automatic handling, choosing the tolerance
+% based on the font declarations.)
%
% \mathsmaller{A}, \mathlarger{B} - math versions
% (The math versions are entirely different from the text versions.)
%
-% There are more instructions at the end of this file (after \endinput).
-
-\ProvidesPackage{relsize}[2003/07/04 ver 3.1]
-
-% The next two aren't the real initializations! The real ones are done
-% in \@tempb below. The user can change them afterwards.
-
-\def\RSsmallest{999pt}
-\def\RSlargest{1pt}
-
-% First, right now, we assemble a list of the font sizes
-
-\def\rs@size{\noexpand\rs@size\noexpand}
-\def\rs@fontsizes{}
-\def\@tempa#1{\ifx\@undefined#1\else
- \expandafter\@tempb#1\delimiter{#1}\fi}
-\def\@absVal#1{\ifnum#1<\z@-\fi#1}
-% parse definition of font-size command (like \large)
-% #1 = \@setfontsize #2 = the command (\large) #3 = size #4 = rest
-\def\@tempb#1#2#3#4\delimiter#5{%
- \@tempdimb\z@
- \ifx\@setfontsize#1\relax\ifx#5#2\@firstofone\relax
- \afterassignment\strip@prefix \@tempdimb #3pt>%
- \fi\fi
- \ifdim\@tempdimb=\z@
- \def\rs@fontsizes{}%
- \let\@tempa\@gobble
- \else
- \edef\rs@fontsizes{\rs@fontsizes\rs@size#2{\the\@tempdimb}}%
- \ifdim\@tempdimb<\RSsmallest \edef\RSsmallest{\the\@tempdimb}\fi
- \ifdim\@tempdimb>\RSlargest \edef\RSlargest{\the\@tempdimb}\fi
- \fi}
+% More comments at the end of this file, and full documentation in
+% relsize-doc.pdf
-% examine each (expected) pre-defined font size
-\@tempa\normalsize
-\@tempa\small
-\@tempa\footnotesize
-\@tempa\large
-\@tempa\Large
-\@tempa\LARGE
-\@tempa\scriptsize
-\@tempa\tiny
-\@tempa\huge
-\@tempa\Huge
-\@tempa\HUGE % moresize.sty
-\@tempa\ssmall
-
-\ifx\rs@fontsizes\@empty % ----------------------------------------------
-
-\PackageWarning{relsize}{Failed to get list of font sizes.\MessageBreak
- Falling back to old definition.}
-
-\DeclareRobustCommand\relsize[1]{%
-\ifmmode \@nomath\relsize\else
- \begingroup
- \@tempcnta % assign number representing current font size
- \ifx\@currsize\normalsize 4\else % funny order is to have most ...
- \ifx\@currsize\small 3\else % ...likely sizes checked first
- \ifx\@currsize\footnotesize 2\else
- \ifx\@currsize\large 5\else
- \ifx\@currsize\Large 6\else
- \ifx\@currsize\LARGE 7\else
- \ifx\@currsize\scriptsize 1\else
- \ifx\@currsize\tiny 0\else
- \ifx\@currsize\huge 8\else
- \ifx\@currsize\Huge 9\else
- 4\rs@unknown@warning % unknown state: \normalsize as starting point
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
-% Change the number by the given increment:
- \advance\@tempcnta#1\relax
-% watch out for size underflow:
- \ifnum\@tempcnta<\z@ \rs@size@warning{small}{\string\tiny}\@tempcnta\z@ \fi
- \expandafter\endgroup
- \ifcase\@tempcnta % set new size based on altered number
- \tiny \or \scriptsize \or \footnotesize \or \small \or \normalsize \or
- \large \or \Large \or \LARGE \or \huge \or \Huge \else
- \rs@size@warning{large}{\string\Huge}\Huge
-\fi\fi}
-
-\else % ----------------------------------------------
+\ProvidesPackage{relsize}[2011/09/21 ver 4.0]
\DeclareRobustCommand\relsize[1]{%
\ifmmode \@nomath\relsize\else
@@ -126,7 +53,7 @@
\@whilenum {\@tempcnta>\z@}\do {%
\advance\@tempcnta\m@ne
\@tempdimb\@tempa\@tempdimb}%
- % \message{ target size \the\@tempdimb. }%
+ % \message{ target size \the\@tempdimb. }%
\rs@scaleToB
\fi}
@@ -142,6 +69,7 @@
% Change font size to \@tempdimb. Follows from \relsize or \relscale
\def\rs@scaleToB{%
+ %\message{Change font size from \f@size\space to \the\@tempdimb. }%
% perform automatic tolerance adjustment, if requested
\ifx\RSpercentTolerance\@empty \rs@autoTol \fi
% apply limits
@@ -149,25 +77,29 @@
\rs@size@warning{small}{\RSsmallest}\fi
\ifdim\@tempdimb>\RSlargest \@tempdimb=\RSlargest
\rs@size@warning{large}{\RSlargest}\fi
- % look up that size in list of pre-defined sizes. Puts error of
+ % Look up that size in list of pre-defined sizes. Put error of
% closest match in \@tempdima
- \let\@tempa\relax \@tempdima\maxdimen
+ \def\@tempa{\relax}\@tempdima-\@m\p@
\let\rs@size\rs@lookup \rs@fontsizes
- % \message{ Look up best as \expandafter\string\@tempa\space
- % (off by \the\@tempdima}%
+ %\message{Look up best as \expandafter\string\@tempa, off by \the\@tempdima}%
% See how close match was (abs difference -> \@tempdima)
\ifdim\@tempdima<\z@ \@tempdima-\@tempdima\fi
% ... percentage error in \@tempdima (as a count)
- \@tempdima 100\@tempdima \divide\@tempdima\@tempdimb
- % if error is beyond tolerance, append \fontsize adjustment
- % \message{ or \number\@tempdima \expandafter\@gobble\string\%). }%
+ % (messiness to prevent numeric overflows)
+ \ifdim\@tempdima<160\p@ \@tempdima 100\@tempdima
+ \ifdim\@tempdimb>\p@ \divide\@tempdima\@tempdimb \fi
+ %\message{or \number\@tempdima \@percentchar. }%
+ \fi
+ % if error is beyond tolerance, append \fontsize adjustment.
\ifnum\@tempdima>\RSpercentTolerance
- % \message{ adjust size to \strip@pt\@tempdimb. }%
- \@tempdima1.2\@tempdimb % baselineskip
+ %\message{Adjust size to \strip@pt\@tempdimb. }%
+ \@tempdima1.2\@tempdimb % baselineskip (could be improved)
\edef\@tempa{\expandafter\noexpand\@tempa \noexpand\fontsize
{\strip@pt\@tempdimb}{\strip@pt\@tempdima}\noexpand\selectfont}\fi
% Now execute size-change command \@tempa
- \expandafter\endgroup\@tempa}
+ \expandafter\endgroup\@tempa
+ %\message{Font size is now \f@size. }%
+}
% For each defined font size, compare its actual size to the desired
% size (\@tempdimb) and the error of the best previous match (\@tempdima).
@@ -183,14 +115,10 @@
\endgroup
\fi}
-\fi % ----------------------------------------------
-
% Tolerance for size mis-match (%). The empty definition triggers
% automatic selection: 5 for scalable fonts, 30 otherwise.
-\def\RSpercentTolerance{}
-
\def\rs@autoTol{%
\expandafter\expandafter\expandafter\rs@autoTOL
\expandafter\meaning
@@ -210,17 +138,84 @@
\newcommand\rs@size@warning[2]{\PackageWarning{relsize}{%
Size requested is too #1.\MessageBreak Using #2 instead}}
-\newcommand\rs@unknown@warning{\PackageWarning{relsize}{Current font size
- is unknown! (Why?!?)\MessageBreak Assuming \string\normalsize}}
-
% derived commands
\DeclareRobustCommand\larger[1][\@ne]{\relsize{+#1}}
\DeclareRobustCommand\smaller[1][\@ne]{\relsize{-#1}}
-\DeclareRobustCommand\textlarger[2][\@ne]{{\relsize{+#1}#2}}
-\DeclareRobustCommand\textsmaller[2][\@ne]{{\relsize{-#1}#2}}
+\DeclareRobustCommand\textlarger[2][\@ne]{\leavevmode{\relsize{+#1}#2}}
+\DeclareRobustCommand\textsmaller[2][\@ne]{\leavevmode{\relsize{-#1}#2}}
+
+
+% Some initializations.
+
+% Default empty definition triggers auto-tolerance.
+% Beware that \providecommand makes \long macro that fails to trigger.
+
+\def\RSpercentTolerance{}
+
+% The next two aren't the real initializations! The real ones are done
+% in \@tempb below. The user can change them afterwards.
+
+\def\RSsmallest{999pt}
+\def\RSlargest{1pt}
-% math commands (completely different)
+% Right now we assemble a list of the font sizes
+
+\def\rs@size{\noexpand\rs@size\noexpand}
+\def\rs@fontsizes{}
+\def\@tempa#1{\ifx\@undefined#1\else
+ \expandafter\@tempb#1\@empty\relax\relax\delimiter{#1}\fi}
+\def\@absVal#1{\ifnum#1<\z@-\fi#1}
+% parse definition of font-size command (like \large)
+% #1 = \@setfontsize #2 = the command (\large) #3 = size #4 = rest
+\def\@tempb#1#2#3#4\delimiter#5{%
+ \let\protect\@unexpandable@protect
+ \message{Examine \string#5 starts \string#1 size may be \string#3. }%
+ \ifcase0\ifx\protect#1\@firstofone\relax\ifx\@empty#31\fi\fi % normal
+ \@tempdimb\z@
+ \ifx\@setfontsize#1\relax\ifx#5#2\@firstofone\relax
+ \afterassignment\strip@prefix \@tempdimb #3pt>%
+ \fi\fi
+ \ifdim\@tempdimb=\z@ % Failed to parse size
+ \def\RSpercentTolerance{3}% Both a setting and a flag
+ \else
+ \edef\rs@fontsizes{\rs@fontsizes\rs@size#2{\the\@tempdimb}}%
+ \ifdim\@tempdimb<\RSsmallest \edef\RSsmallest{\the\@tempdimb}\fi
+ \ifdim\@tempdimb>\RSlargest \edef\RSlargest{\the\@tempdimb}\fi
+ \fi
+ \or % self-protected: recurse
+ \expandafter\@tempb#2\@empty\relax\relax\delimiter{#5}%
+ \fi
+ \let\protect\@typeset@protect}
+
+% examine each (expected) pre-defined font size
+\@tempa\normalsize
+\@tempa\small
+\@tempa\footnotesize
+\@tempa\large
+\@tempa\Large
+\@tempa\LARGE
+\@tempa\scriptsize
+\@tempa\tiny
+\@tempa\huge
+\@tempa\Huge
+\@tempa\HUGE % moresize.sty
+\@tempa\ssmall
+
+\ifx\RSpercentTolerance\@empty \else
+
+ \PackageWarningNoLine{relsize}
+ {Failed to get list of defined font sizes.\MessageBreak
+ Size scaling will attempt arbitrary sizes.}
+
+ \def\RSsmallest{\p@}%
+ \def\RSlargest{100pt}%
+ \ifx\rs@fontsizes\@empty \def\RSpercentTolerance{0}\fi
+
+\fi
+
+%
+% Math commands (completely different)
\DeclareRobustCommand\mathsmaller[1]{\bgroup
\let\rs@makechoice\rs@makesmallerchoice
@@ -233,7 +228,9 @@
\futurelet\@tempa\rs@collect@decor
}
-% math so far is in \rs@mathatom; next tok is \@tempa; continuation is \@tempb
+% Collect the tokens that 'decorate' the atom, to apply them directly on the
+% symbol, not after the closing brace.
+% Math so far is in \rs@mathatom; next tok is \@tempa; continuation is \@tempb
% Don't nest \ifs because token may be \if or \fi or \or...
\def\rs@collect@decor{%
\let\@tempb\rs@makechoice
@@ -272,10 +269,10 @@
\endinput
==========================================================
-R E L S I Z E . S T Y ver 3.1 July 4, 2003
+R E L S I Z E . S T Y ver 4.0 Sept 21, 2011
by Donald Arseneau, asnd@triumf.ca, Vancouver, Canada
-origianally based on smaller.sty by Bernie Cosell, cosell@WILMA.BBN.COM,
+originally based on smaller.sty by Bernie Cosell, cosell@WILMA.BBN.COM,
and combined with the version by Matt Swift, swift@bu.edu.
@@ -286,39 +283,19 @@ font sizes of a document at a later time, and makes it hard to write macros
that work at arbitrary sizes. Relsize.sty defines several commands for LaTeX
to set font sizes relative to the current size.
-To refresh your memory, the font sizing commands in LaTeX are, in order:
-\tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large,
-\LARGE, \huge, \Huge (package moresize adds \ssmall and \HUGE). The main
-new command provided by relsize.sty is \relsize, which takes one (positive
-or negative) number as its argument; the number specifies how many "steps"
-by which to change the font size, where each step is a scaling factor of
-1.2, corresponding to the usual difference between the size commands. For
-example, if "{\relsize{-2} smaller}" appears in normal sized text, the word
-"smaller" is printed in script size type. If the same command appears in a
-\Large section title, then "smaller" is printed in normal size.
-
-There are also the commands \larger and \smaller, which normally change the
-font size by one step in the obvious direction; \larger is an abbreviation
-for \relsize{+1}, and \smaller is an abbreviation for \relsize{-1}. For
-example, {\large... \larger{WOW!}} prints "WOW" in \Large type. You can
-also specify bigger steps as an optional argument for \larger and \smaller:
-\larger[3] is equivalent to \relsize{3}; \smaller[2] is \relsize{-2}.
-Both \larger and \smaller accept negative arguments, but please don't make
-things so obscure! If you want to change size by several steps it is
-much better to give an increment than to string several \larger commands
-together; i.e., \relsize{3} or \larger[3], but not \larger\larger\larger.
-
-All of the \relsize, \larger, and \smaller commands are "switches" just
-like the regular sizing commands. That is, they change the size for all
-following text until the scope is ended by a closing brace. There are
-alternate versions called \textlarger and \textsmaller that take some text
-as an argument and apply the size change to only that text:
-\textlarger{big}.
-
-Using the number of "magnification steps" to indicate font size can
-be confusing to some people, and limiting in certain uses. There are
-commands with syntax \textscale{factor}{text} and \relscale{factor} to
-select the size based on a scale factor, like {0.75}.
+For i being an integer (or half-integer) magstep increment (like 2),
+and optional arg [i] defaulting to i=1,
+And f being a scale factor (like 0.75)
+And text being the text argument
+
+\relsize{i} ungrouped size change by i steps
+\larger[i] ungrouped size change by (optional) i steps
+\smaller[i] ungrouped size change by (optional) -i steps
+\relscale{f} ungrouped size change by scale factor f
+\textlarger[i]{text} "text" size enlarged by i steps
+\textsmaller[i]{text} "text" size reduced by i steps
+\textscale{f}{text} "text" sized scaled by factor f
+
If the size requested is too small or too large, a warning is given, and
the size will only change as far as appropriate, typically \tiny or \Huge.
@@ -327,13 +304,7 @@ get set automatically when relsize.sty is loaded, but you can redefine them
to other length values: \renewcommand\RSlargest{50pt}.
Fine point: The combination \relsize{n}\relsize{-n} is not guaranteed to
-restore the current font size! That is because the increment "n" may be
-enough to overflow the range of sizes. Say you are in \huge text already,
-and you do \relsize{4}. There is nothing bigger than \Huge so that is the
-size you get. Then an ensuing \relsize{-4} will take four steps smaller
-and change the size to \large. You should use grouping to undo relative
-size changes because it is unsafe to counteract one change with an "equal"
-change in the opposite direction.
+restore the current font size!
Typically, the font-size commands do not select fonts at regular size
intervals. \relsize (and the others) will select, and execute, the command
@@ -345,8 +316,9 @@ is composed of only discrete sizes, and "5" when the fontshape definition
covers ranges of sizes. The higher setting for discrete fonts ensures
only the pre-defined sizes get used. (By default LaTeX uses Computer
Modern fonts at discrete sizes; you get full coverage of sizes by using
-\usepackage{type1cm}.) For special uses, or when the font shape definitions
-are not parsed properly, you can redefine the percent tolerance:
+\usepackage{type1cm} or various other font packages.) For special uses,
+or when the font shape definitions are not parsed properly, you can redefine
+the percent tolerance:
\renewcommand\RSpercentTolerance{10}.
All of the commands described above are text commands; they cannot be used
@@ -369,21 +341,10 @@ Current style \mathsmaller gives \mathlarger gives
\scriptstyle \scriptscriptstyle \textstyle
\scriptscriptstyle \scriptscriptstyle (same) \scriptstyle
-For example, try $\frac{\mathlarger{E}}{E}$. Note that, for most symbols,
-\displaystyle and \textstyle are the same size, so $N \mathlarger{N}$
-gives two identical N's, but \sum and \int do get bigger in display style:
-$\int\mathlarger{\int}$, and fractions are treated differently too:
-$\frac{1}{2} \mathlarger{\frac{1}{2}}$. As you might have guessed,
-\mathlarger and \mathsmaller should only be used in math mode.
-
These commands will attempt to attach superscripts and subscripts to the
-symbol as if the symbol were used alone: $\mathlarger{\int}_{0}^{\infty}$
-but math accents and the math spacing behave as if the symbol is enclosed
-in braces (which it is). Comparing
-\[
-| \times | {\times} | \mathlarger{\times} | \mathbin{\mathlarger{\times}} |
-\]
-shows that operators must be explicitly declared to use the right operator
+symbol as if the symbol were used alone, but math accents and the math
+spacing behave as if the symbol is enclosed in braces (which it is).
+Operators should be explicitly declared to use the right operator
type (\mathrel, \mathbin, \mathop) to get the correct spacing.
Due to their oddities, the math larger/smaller commands should not be