Changes

Jump to navigation Jump to search
648 bytes removed ,  19:40, 1 October 2023
add link to publications manual
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. * (2023-10-01: part of the math upgrade, please wait until it becomes stable.) There are a few working examples in the [[httpmanual://www.mit.edu/afs/athena/contrib/texmkiv-contrib/Chem2/ppchtex/doc/fh-ch-enpublications.htm PPCHTeX FAQpdf|publications] ] manual (1997chapter 10.2)* , i.e. in the file [httphttps://wwwsource.tugcontextgarden.orgnet/TUGboatdoc/context/sources/general/Articlesmanuals/tb17-1publications/tb50hageC6H6O.bib C6H6O.pdf TUG Boat article on PPCHTeXbib] by Hans Hagen and A.F. Otten 1996
Some other links about chemistry in ConTeXt:
* [[manual:mkiv-publications.pdf|publications]] manual – use the bibliography database for chemicals
* [[Chromatograms]] macro
* [[manual:xchemml-p.pdf|ChemML]] ([[manual:xchemml-s.pdf|screen]]), [[MathML]] extension for chemistry.
== Using {{cmd|chemical}} ==
== 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]]

Navigation menu