Open main menu

Changes

984 bytes removed ,  08:58, 1 October 2023
move old links to the bottom, mark code as old & broken
In MkII this was called PPCHTeX, which works also with plain TeX and LaTeX.
There doesn’t seem to be any current documentation (all previous links were long dead), while chemistry support is still part of the distribution, but seems currently broken. * [http://www.mit.edu/afs/athena/contrib/tex(2023-contrib/Chem2/ppchtex/doc/fh10-ch-en.htm PPCHTeX FAQ] (199701: part of the math upgrade, please wait until it becomes stable)* [http://www.tug.org/TUGboat/Articles/tb17-1/tb50hage.pdf TUG Boat article on PPCHTeX] by Hans Hagen and A.F. Otten 1996
Some other links about chemistry in ConTeXt:
== Simple Formulae in Text Mode ==
An alternative to using the chemistry module or mathmode for typesetting simple formulae are the three ConTeXt commands {{cmd|high}}, {{cmd|low}} , {{cmd|lohi}}, and {{cmd|lohihimilo}}. This might be useful if you want to typset the formula with the same font as the surrounding text (in titles or slanted fonts, although that might not be desired in all situations).
<context source="yes">
</context>
Taco's Taco’s macros implement this approach [http://archive.contextgarden.net/thread/20060702.084423.a201a280.en.html]:
'''This is broken code from 2006!''' <texcodecontext source="yes">
\newbox\chemlowbox
\def\chemlow#1%
{\expandafter\scantokens\expandafter
{\detokenize{#1\finishchem}}\egroup}
</texcode>
<texcode>
\bs Bold slanted molecules: \molecule{HSO_4^-} and \molecule{SF_6}
</texcode>
 
<context>
\newbox\chemlowbox
\def\chemlow#1%
{\setbox\chemlowbox\hbox{{\switchtobodyfont[small]#1}}}
 
\def\chemhigh#1%
{\ifvoid\chemlowbox \high{{\switchtobodyfont[small]#1}}%
\else \/\lohi{\box\chemlowbox}{{\switchtobodyfont[small]#1}}\fi }
 
\def\finishchem%
{\ifvoid\chemlowbox \else
\iffluor \fluorfalse \kern-.1em \fi\low{\box\chemlowbox}\fi}
 
% for "kerning" after F
\newif\iffluor
 
\unexpanded\def\molecule%
{\bgroup
\catcode`\_=\active \uccode`\~=`\_ \uppercase{\let~\chemlow}%
\catcode`\^=\active \uccode`\~=`\^ \uppercase{\let~\chemhigh}%
\dostepwiserecurse {65}{90}{1}
{\catcode \recurselevel = \active
\uccode`\~=\recurselevel
\uppercase{\edef~{\noexpand\finishchem
\rawcharacter{\recurselevel}}}}%
\uccode `\~=`\F \uppercase{\def~{\finishchem F\fluortrue}}%
\catcode`\-=\active \uccode`\~=`\- \uppercase{\def~{--}}%
\loggingall
\domolecule }%
 
\def\domolecule#1%
{\expandafter\scantokens\expandafter
{\detokenize{#1\finishchem}}\egroup}
 
{\bsx Bold slanted molecules: \molecule{HSO_4^-} and \molecule{SF_6}}
 
</context>
\setupchemical[style=\bs]
</texcode>
 
== Old Links ==
 
* [http://www.mit.edu/afs/athena/contrib/tex-contrib/Chem2/ppchtex/doc/fh-ch-en.htm PPCHTeX FAQ] (1997)
* [http://www.tug.org/TUGboat/Articles/tb17-1/tb50hage.pdf TUG Boat article on PPCHTeX] by Hans Hagen and A.F. Otten 1996
 
[[Category:Sciences]]