blob: ff1ca4d2ac3b7fff7487e5edaa2df97d5ce5b993 (
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
|
%
% ifuptex.sty (for both LaTeX2e & plain TeX)
%
%%%% Avoid multiple loading and check if LaTeX2e is used.
\ifx\iuMode\undefined\else \expandafter\endinput \fi
\ifx\RequirePackage\undefined % not LaTeX2e
\edef\iuRestoreAt{\catcode64=\the\catcode64}
\catcode64=11 \let\iuMode=p
\else % LaTeX2e
\let\iuRestoreAt\relax \let\iuMode=l
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ifuptex}[2008/03/14 v0.2 upTeX checker]
\fi
%%%% \ifupTeX, \ifnativeupTeX
\def\iu@true#1{\expandafter\let\csname#1\endcsname\iftrue}
\def\iu@false#1{\expandafter\let\csname#1\endcsname\iffalse}
\edef\reserved@a{\string\kchar}\edef\reserved@b{\meaning\kchar}
\ifx\reserved@a\reserved@b \iu@true{ifupTeX}
\ifnum\ucs"3000="3000 \iu@true{ifnativeupTeX}
\else \iu@false{ifnativeupTeX} \fi
\else \iu@false{ifupTeX}\iu@false{ifnativeupTeX}
\fi
%%%% \iu@noupTeX
\if l\iuMode % LaTeX2e
\def\iu@noupTeX#1{\PackageError{\@currname}%
{This \@cls@pkg\space requires #1}%
{I stop loading here.}\expandafter\endinput}
\else % not LaTeX2e
\def\iu@noupTeX#1{\errorcontextlines=-1
\errhelp{You should quit right now.}%
\errmessage{This document requires #1!}}
\fi
%% \RequireupTeX, \RequireNativeupTeX
\def\RequireupTeX{%
\ifupTeX\else \iu@noupTeX{upTeX}\fi}
\def\RequirenativeupTeX{%
\ifnativeupTeX\else \iu@noupTeX{native upTeX}\fi}
%%%% all done
\let\iu@true\relax\let\iu@false\relax
\iuRestoreAt\let\iuRestoreAt\relax
\endinput
%% EOF
|