forked from PharmTeX/class
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PharmTeX.ini
87 lines (83 loc) · 3.22 KB
/
PharmTeX.ini
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
%%% PharmTeX Class ini file, part of the PharmTeX platform.
%%% Created from this post by Heiko Oberdiek: https://tex.stackexchange.com/questions/131207/own-cls-to-fmt-conversion.
%%% Copyright (C) 2023 Christian Hove Claussen ([email protected]).
%%% This program is free software: You can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program (see file named LICENSE). If not, see <https://www.gnu.org/licenses/>.
% Check for e-TeX
\expandafter\ifx\csname eTeXversion\endcsname\relax
\begingroup
\catcode`\{=1
\catcode`\}=2
\catcode`\^=7
\newlinechar=10 %
\def\space{ }
\def\MessageBreak{^^J\space\space}
\errmessage{%
The eTeX extension is missing.\MessageBreak
It can be enabled by option `-etex`\MessageBreak
or starting the first filename with a star `*'.\MessageBreak
The format generation is aborted%
}
\endgroup
\csname fi\endcsname % end \ifx
\csname @@end\endcsname % for the case a LaTeX format is already loaded
\end % end job
\fi
% Load class
\NeedsTeXFormat{LaTeX2e}
\documentclass{PharmTeX}\relax
% Now we have to redefine \documentclass to get valid user documents.
\makeatletter
\renewcommand*{\documentclass}[2][]{%
\def\reserved@a{#2}%
\ifx\reserved@a\PharmTeX@name
\def\reserved@a{#1}%
\ifx\reserved@a\@empty
% \else % warning not needed, since PharmTeX checks for new options and recompiles .fmt file if needed
% \ClassWarningNoLine{PharmTeX}{%
% This format has already loaded the class\MessageBreak
% and does not support global options.\MessageBreak
% The following options are ignored:\MessageBreak
% \@spaces[#1]%
% }%
\fi
\expandafter\PharmTeX@datecheck
\else
\ClassError{PharmTeX}{%
This format has already loaded the class `PharmTeX'\MessageBreak
and cannot be used with other classes.\MessageBreak
LaTeX run is aborted%
}\@ehd
\expandafter\@@end % abort job.
\fi
}
\newcommand*{\PharmTeX@name}{PharmTeX}
\newcommand*{\PharmTeX@datecheck}[1][]{%
\@ifclasslater{PharmTeX}{#1}{%
}{%
\@latex@warning@no@line{%
You have requested,\on@line,
version\MessageBreak
`#1' of class\space\PharmTeX@name,\MessageBreak
but only version\MessageBreak
`\csname ver@\[email protected]\endcsname'\MessageBreak
is available in this format%
}%
}%
}
% Format identification
\begingroup
\edef\x{%
\noexpand\typeout{%
Class \PharmTeX@name\space \@nameuse{ver@\[email protected]}.%
}%
\noexpand\typeout{%
Format created at \the\year/\two@digits\month/\two@digits\day
\space by class author.%
}%
}%
\expandafter\endgroup
\expandafter\everyjob\expandafter{\the\expandafter\everyjob\x}
\makeatother
% Generate format
\dump
\endinput