summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gmutils/gmrelsize.sty
blob: 9ee550c47548140ca7e30927f556f9832bbd6e7b (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
%% 
%% \iffalse ^^A we skip the debug setting
\IfFileExists{\string~/bin/gen_and_xela}{\errorcontextlines=1000 }{}
%% \fi
%% ^^A $Id: TheUltimateMaster.gmd,v 0.352 2011/10/12 15:19:42 natror Exp natror $
%% This is file “gmrelsize.sty” generated with the DocStrip utility.
%% 
%%
%% The original source files were:
%%
%% gmutils/gmutils.gmd  (with options: `relsize')
%%
%% 
%% Copyright ©  
%% by Grzegorz ‘Natror’ Murzynowski
%% natror (at) gmail (dot) com
%% 
%% This program is subject to the LaTeX Project Public License.
%% See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
%% for the details of that license.
%%
%% LPPL status: "author-maintained".
%%
%% 
%% 
%% For documentation please refer to the file(s)
%% gmutils.{gmd,pdf}.
%% 
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{gmrelsize}
    [2010/04/09 v0.996 chosen macros from the relsize package and mine (GM)]


%%
%%
%%     ^^A\typeout{\unexpanded{#4}}%%
\protected\def\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
     \advance\@tempcnta#1\relax
      \ifnum\@tempcnta<\z@ \rs@size@warning{small}{\string\tiny}\@tempcnta\z@ \fi
      \@xa\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}% end of |\relsize|.

\providecommand*\rs@size@warning[2]{\PackageWarning{gmutils (relsize)}{%
    Size requested is too #1.\MessageBreak Using #2 instead}%
}%

\providecommand*\rs@unknown@warning{\PackageWarning{gmutils (relsize)}{Current font size
 is unknown! (Why?!?)\MessageBreak Assuming \string\normalsize}}

\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}}
\protected\def\largerr{\relsize{+2}}
\protected\def\smallerr{\relsize{-2}}


\endinput
%%
%% End of file `gmrelsize.sty'.