summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/ppchtex.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/ppchtex.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/ppchtex.mkiv62
1 files changed, 22 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/context/base/ppchtex.mkiv b/Master/texmf-dist/tex/context/base/ppchtex.mkiv
index e81551eeab2..1162c1fcf6a 100644
--- a/Master/texmf-dist/tex/context/base/ppchtex.mkiv
+++ b/Master/texmf-dist/tex/context/base/ppchtex.mkiv
@@ -97,13 +97,15 @@
\doifundefined{fiverm} % In the more recent LaTeX versions
{\font\fiverm=cmr5 } % \fiverm is no longer (pre)defined.
+\newconstant\chemicaldrawingmode
+
\doifdefinedelse{beginpicture} % PiCTeX
{\doifdefinedelse{startMPdrawing}
- {\chardef\chemicaldrawingmode=2 } % MetaPost
- {\chardef\chemicaldrawingmode=0 }} % raw
+ {\chemicaldrawingmode\plustwo } % MetaPost
+ {\chemicaldrawingmode\zerocount}} % raw
{\doifdefinedelse{psaxes}
- {\chardef\chemicaldrawingmode=1 } % PSTricks
- {\chardef\chemicaldrawingmode=3 }} % unknown
+ {\chemicaldrawingmode\plusone } % PSTricks
+ {\chemicaldrawingmode\plusthree}} % unknown
\ifcase\chemicaldrawingmode
\writestatus{ppchtex}{using PiCTeX}
@@ -283,22 +285,10 @@
% regels iets verder uit elkaar gezet. Jammer. Italic fonts
% hebben grotere cijfers en vallen min of meer uit de boot.
-\newif\ifloweredsubscripts
-
-% Due to some upward incompatibality of LaTeX to LaTeX2.09
-% and/or LaTeX2e we had to force \@@dochemicalstyle. Otherwise
-% some weird \nullfont error comes up.
-
-\def\beginlatexmathmodehack
- {\ifmmode
- \let\endlatexmathmodehack=\relax
- \else
- \def\endlatexmathmodehack{$}$\@@dochemicalstyle\empty
- \fi}
+\newif\ifloweredsubscripts % this will be redone in the mkiv ways
\def\setsubscripts
- {\beginlatexmathmodehack
- \def\dosetsubscript##1##2##3%
+ {\def\dosetsubscript##1##2##3%
{\dimen0=##3\fontexheight##2%
\setxvalue{@@\string##1\string##2}{\the##1##2\relax}%
##1##2=\dimen0\relax}%
@@ -309,12 +299,10 @@
%dodosetsubscript\mathsupnormal {?}%
\dodosetsubscript\mathsubnormal {.7}%
\dodosetsubscript\mathsubcombined{.7}%
- \global\loweredsubscriptstrue
- \endlatexmathmodehack}
+ \global\loweredsubscriptstrue}
\def\resetsubscripts
{\ifloweredsubscripts
- \beginlatexmathmodehack
\def\doresetsubscript##1##2%
{\dimen0=\getvalue{@@\string##1\string##2}\relax
##1##2=\dimen0}%
@@ -326,7 +314,6 @@
\dodoresetsubscript\mathsubnormal
\dodoresetsubscript\mathsubcombined
\global\loweredsubscriptsfalse
- \endlatexmathmodehack
\fi}
\ifx\Umathchar\undefined \else
@@ -390,11 +377,8 @@
\def\dowithchemical%
{}
-\doifdefinedelse{@@iastate}
- {\def\localgotochemical#1#2{\naarbox{#2}[#1]}%
- \def\localthisischemical#1{\pagereference[#1]}}
- {\def\localgotochemical#1{}%
- \def\localthisischemical#1{}}
+\def\localgotochemical#1#2{\gotobox{#2}[#1]}
+\def\localthisischemical#1{\pagereference[#1]}
% eind van experiment
@@ -719,8 +703,8 @@
\ignorespaces}
\def\dostartchemical%
- {\catcode`\^=\@@superscript% t.b.v. \enableduplication
- \catcode`\_=\@@subscript % t.b.v. de zekerheid
+ {\catcode`\^=\superscriptcatcode% t.b.v. \enableduplication
+ \catcode`\_=\subscriptcatcode % t.b.v. de zekerheid
\begingroup
\inchemicaltrue
\def\toptext##1{\gdef\thetoptext{##1}\ignorespaces}\toptext{}%
@@ -1096,7 +1080,7 @@
\dosetsubscripts
\setbox2=\hbox{\@@dochemicalcolor
$\@@dochemicalstyle{\@@localchemicalformat \chemicaltext}$}%
- \setbox4=\hbox{$\@@dochemicalstyle{\@@localchemicalformat C_2^2}$}%
+ \setbox4=\hbox{$\@@dochemicalstyle{\@@localchemicalformat C\normalsubscript2\normapsuperscript2}$}%
\setbox6=\hbox{$\@@dochemicalstyle{\@@localchemicalformat O}$}% or C
\doresetsubscripts
\doifnot\@@chemicallocation\v!intext
@@ -1204,7 +1188,7 @@
% #3: x-coordinaat eindpunt
% #4: y-coordinaat eindpunt
-\chardef\chemicallinetype=0
+\newconstant\chemicallinetype
\def\doplotchemicalline
{\!!counte=\!!countc \advance\!!counte by -\!!counta
@@ -1407,7 +1391,7 @@
\getvalue{\s!chemicallinesegment#2#1}}
\def\doprocesschemicallinesegment#1#2#3#4#5%
- {\chardef\chemicallinetype=#1
+ {\chemicallinetype#1\relax
\def\chemicallineposition{#2}%
\def\doprocess[##1##2##3##4##5]%
{\doifelse{##1}{?}
@@ -1778,8 +1762,8 @@
\innerchemicalfalse
\fi
\bgroup
- \catcode`\^=\@@superscript % t.b.v. \enableduplication
- \catcode`\_=\@@subscript % t.b.v. de zekerheid
+ \catcode`\^=\superscriptcatcode % t.b.v. \enableduplication
+ \catcode`\_=\subscriptcatcode % t.b.v. de zekerheid
\ifmmode
\ifinnerchemical
\def\next{\dotriplegroupempty\dosimplechemicalA}%
@@ -2006,7 +1990,7 @@
{\@@dochemicalcolor
$\@@dochemicalstyle{\scriptscriptstyle\hskip-.15em#2}$}%
\wd0=0pt
- \big#1_{\hskip.1em\box0}%
+ \big#1\normapsubscript{\hskip.1em\box0}%
\egroup}
\def\disablechemicalspecials%
@@ -2204,13 +2188,11 @@
\doresetsubscripts}%
\mathop{\box0}%
\ifthirdargument
- \doifnot{#2}{}
- {^{\@@dochemicalstyle{\strut#2}}}%
- \doifnot{#3}{}
- {_{\@@dochemicalstyle{\strut#3}}}%
+ \doifnot{#2}{}{\normapsuperscript{\@@dochemicalstyle{\strut#2}}}%
+ \doifnot{#3}{}{\normapsubscript {\@@dochemicalstyle{\strut#3}}}%
\else
\doifnot{#2}{}
- {_{\@@dochemicalstyle{\strut#2}}}%
+ {\normapsubscript{\@@dochemicalstyle{\strut#2}}}%
\fi
\egroup
\chemicalspace}