diff options
author | Karl Berry <karl@freefriends.org> | 2017-09-02 21:42:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-09-02 21:42:29 +0000 |
commit | 5ec14a45caec6cf280a15720b306cbfd85f45dca (patch) | |
tree | 599614fa84b6442189832260f28479abcde4c1e0 /Master/texmf-dist/tex | |
parent | dadcd91ebbd36582ed905c008bcf90b8f3a6c551 (diff) |
ifxptex (2sep17)
git-svn-id: svn://tug.org/texlive/trunk@45195 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/ifxptex/ifxptex.sty | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/ifxptex/ifxptex.sty b/Master/texmf-dist/tex/generic/ifxptex/ifxptex.sty new file mode 100644 index 00000000000..7342533f262 --- /dev/null +++ b/Master/texmf-dist/tex/generic/ifxptex/ifxptex.sty @@ -0,0 +1,109 @@ + + +% ifxptex.sty +% Copyright 2017 Yue ZHANG +% License: Knuth License (https://ctan.org/license/knuth) + +\csname ENDINPUTIFXPTEXDOTSTY\endcsname + +\let\ENDINPUTIFXPTEXDOTSTY=\endinput + +\begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname ProvidesPackage\endcsname\relax + \else + \ProvidesPackage{ifxptex}[2017/09/02 v0.1a Detect pTeX and its derivatives]% + \fi + +\edef\IFXPTEXDOTSTYRESTORECATCODE{\catcode`\noexpand\@=\the\catcode`\@\relax} + +\catcode`\@=11\relax + +\def\ifxptex@ifprimitive#1{% + \begingroup + \edef\ifxptex@temp@meaning{\meaning#1}% + \edef\ifxptex@temp@string{\string#1}% + \expandafter + \endgroup + \ifx\ifxptex@temp@meaning\ifxptex@temp@string} + +\newif\ifxptex +\newif\ifxeptex +\newif\ifxuptex +\newif\ifxeuptex +\newif\ifxaptex + +\ifxptex@ifprimitive \tate \xptextrue \fi +\ifxptex@ifprimitive \epTeXinputencoding \xeptextrue \fi +\ifxptex@ifprimitive \ucs \xuptextrue \fi +\ifxptex@ifprimitive \ngbanner \xaptextrue \fi + +\newif\ifxpTeX +\newif\ifxepTeX +\newif\ifxupTeX +\newif\ifxeupTeX +\newif\ifxApTeX + +\ifxptex + \ifxaptex + \xApTeXtrue + \else + \ifxuptex + \ifxeptex + \xeupTeXtrue\xeuptextrue + \else + \xupTeXtrue + \fi + \else + \ifxeptex + \xepTeXtrue + \else + \xpTeXtrue + \fi + \fi + \fi +\fi + +\newif\ifxuniuptex +\newif\ifxunieuptex + +\newif\ifxUniupTeX +\newif\ifxUnieupTeX + +\ifxuptex \ifnum\ucs"3000="3000\relax \xuniuptextrue \fi \fi +\ifxeuptex \ifnum\ucs"3000="3000\relax \xunieuptextrue \fi \fi + +\ifxupTeX \ifnum\ucs"3000="3000\relax \xUniupTeXtrue \fi \fi +\ifxeupTeX \ifnum\ucs"3000="3000\relax \xUnieupTeXtrue \fi \fi + +\def\ifxptex@newrequiretex@error#1{% can be easily redefined + \errmessage{#1 is required}} + +\def\ifxptex@newrequiretex#1#2{% + \expandafter\def\csname RequireX#1\endcsname{% + \relax + \csname ifx#1\endcsname + \else + \ifxptex@newrequiretex@error{#2}% + \fi}} + +\ifxptex@newrequiretex{ptex}{pTeX / e-pTeX / upTeX / e-upTeX / ApTeX} +\ifxptex@newrequiretex{eptex}{e-pTeX / e-upTeX} +\ifxptex@newrequiretex{uptex}{upTeX / e-upTeX / ApTeX} +\ifxptex@newrequiretex{euptex}{e-upTeX} +\ifxptex@newrequiretex{aptex}{ApTeX} + +\ifxptex@newrequiretex{pTeX}{pTeX} +\ifxptex@newrequiretex{epTeX}{e-pTeX} +\ifxptex@newrequiretex{upTeX}{upTeX} +\ifxptex@newrequiretex{eupTeX}{e-upTeX} +\ifxptex@newrequiretex{ApTeX}{ApTeX} + +\ifxptex@newrequiretex{uniuptex}{Unicode upTeX / Unicode e-upTeX / ApTeX} +\ifxptex@newrequiretex{unieuptex}{Unicode e-upTeX} + +\ifxptex@newrequiretex{UniupTeX}{Unicode upTeX} +\ifxptex@newrequiretex{UnieupTeX}{Unicode e-upTeX} + +\IFXPTEXDOTSTYRESTORECATCODE + +\endinput |