summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/romannum/romannum.sty
blob: 53e788fa611fa67d5617c262f8b9f3fca4c40112 (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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
%%
%% This is file `romannum.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% romannum.dtx  (with options: `usc')
%% 
%% Author: Peter Wilson (CUA)
%%         now at: peter.r.wilson@boeing.com
%% 
%% Copyright 1999 Peter R. Wilson
%% 
%%  This program is provided under the terms of the
%%  LaTeX Project Public License distributed from CTAN
%%  archives in directory macros/latex/base/lppl.txt.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{romannum}[1999/05/08 v1.0 roman numerals]
\RequirePackage{stdclsdv}
\newif\ifrn@mYear \rn@mYearfalse
\newif\ifrn@mDay \rn@mDayfalse
\newif\ifrn@mday \rn@mdayfalse
\DeclareOption{Section}{%
  \ifSCDchapter
    \renewcommand{\thechapter}{\Roman{chapter}}
    \renewcommand{\thesection}{\thechapter.\Roman{section}}
  \else
    \renewcommand{\thesection}{\Roman{section}}
  \fi
  \renewcommand{\thesubsection}{\thesection.\Roman{subsection}}
  \renewcommand{\thesubsubsection}{\thesubsection.\Roman{subsubsection}}
  \renewcommand{\theparagraph}{\thesubsubsection.\Roman{paragraph}}
  \renewcommand{\thesubparagraph}{\theparagraph.\Roman{subparagraph}}
}
\DeclareOption{section}{%
  \ifSCDchapter
    \renewcommand{\thechapter}{\roman{chapter}}
    \renewcommand{\thesection}{\thechapter.\roman{section}}
  \else
    \renewcommand{\thesection}{\roman{section}}
  \fi
  \renewcommand{\thesubsection}{\thesection.\roman{subsection}}
  \renewcommand{\thesubsubsection}{\thesubsection.\roman{subsubsection}}
  \renewcommand{\theparagraph}{\thesubsubsection.\roman{paragraph}}
  \renewcommand{\thesubparagraph}{\theparagraph.\roman{subparagraph}}
}
\DeclareOption{Equation}{%
  \ifSCDchapter
    \renewcommand{\theequation}%
      {\ifnum \c@chapter>\z@ \thechapter.\fi \Roman{equation}}
  \else
    \renewcommand{\theequation}{\Roman{equation}}
  \fi
}
\DeclareOption{equation}{%
  \ifSCDchapter
    \renewcommand{\theequation}%
      {\ifnum \c@chapter>\z@ \thechapter.\fi \roman{equation}}
  \else
    \renewcommand{\theequation}{\roman{equation}}
  \fi
}
\DeclareOption{Caption}{%
  \ifSCDchapter
    \renewcommand{\thefigure}%
      {\ifnum \c@chapter>\z@ \thechapter.\fi \Roman{figure}}
    \renewcommand{\thetable}%
      {\ifnum \c@chapter>\z@ \thechapter.\fi \Roman{table}}
  \else
    \renewcommand{\thefigure}{\Roman{figure}}
    \renewcommand{\thetable}{\Roman{table}}
  \fi
}
\DeclareOption{caption}{%
  \ifSCDchapter
    \renewcommand{\thefigure}%
      {\ifnum \c@chapter>\z@ \thechapter.\fi \roman{figure}}
    \renewcommand{\thetable}%
      {\ifnum \c@chapter>\z@ \thechapter.\fi \roman{table}}
  \else
    \renewcommand{\thefigure}{\roman{figure}}
    \renewcommand{\thetable}{\roman{table}}
  \fi
}
\DeclareOption{Footnote}{%
  \renewcommand{\thefootnote}{\Roman{footnote}}
}
\DeclareOption{footnote}{%
  \renewcommand{\thefootnote}{\roman{footnote}}
}
\DeclareOption{Enumerate}{%
  \renewcommand{\theenumi}{\Roman{enumi}}
  \renewcommand{\theenumiii}{\roman{enumiii}}
}
\DeclareOption{enumerate}{%
  \renewcommand{\theenumi}{\roman{enumi}}
  \renewcommand{\theenumiii}{\Roman{enumiii}}
}
\DeclareOption{Year}{\rn@mYeartrue}
\DeclareOption{Day}{\rn@mDaytrue\rn@mYeartrue\rn@mdayfalse}
\DeclareOption{day}{\rn@mDayfalse\rn@mYeartrue\rn@mdaytrue}
\DeclareOption{Most}{%
  \ExecuteOptions{Section,Equation,Caption,Footnote,Enumerate}
}
\DeclareOption{most}{%
  \ExecuteOptions{section,equation,caption,footnote,enumerate}
}
\ProcessOptions\relax
\ifrn@mYear
  \newcommand{\thern@myear}{\@Roman\year}
  \ifrn@mDay
    \newcommand{\thern@mday}{\@Roman\day}
  \else
    \ifrn@mday
      \newcommand{\thern@mday}{\@roman\day}
    \else
      \newcommand{\thern@mday}{\@arabic\day}
    \fi
  \fi
  \edef\today{\ifcase\month\or
    January\or February\or March\or April\or May\or June\or
    July\or August\or September\or October\or November\or December\fi
    \space\thern@mday, \thern@myear}
\fi
\newcommand{\romannum}[1]{%
  \ifnum#1<1
    \ifnum#1=0
      o%
    \else
      -\romannumeral -#1%
    \fi
  \else
    \romannumeral #1%
  \fi}
\DeclareRobustCommand{\Romannum}[1]{\MakeUppercase{\romannum{#1}}}
\AtBeginDocument{\pagenumbering{roman}}
\endinput
%%
%% End of file `romannum.sty'.