Hello, The following test-file produces an error: % engine=luatex \usemodule[chemic] \starttext \chemical{CO_2} \stoptext ERROR: Undefined control sequence. --- TeX said --- <argument> \s !chemical\c !x1 \setvalue #1->\expandafter \def \csname #1 \endcsname l.2067 \setvalue{\s!chemical\c!x1} {0} Cheers, Peter -- http://pmrb.free.fr/contact/
On Thu, Feb 21, 2008 at 11:23 PM, Peter Münster wrote:
Hello,
The following test-file produces an error:
% engine=luatex \usemodule[chemic] \starttext \chemical{CO_2} \stoptext
The issue probably needs to be solved, but I happily use Taco's macro for that purpose (works better in titles). See \molecule on http://wiki.contextgarden.net/Chemistry. Mojca
On Thu, Feb 21 2008, Mojca Miklavec wrote:
On Thu, Feb 21, 2008 at 11:23 PM, Peter Münster wrote:
The following test-file produces an error:
% engine=luatex \usemodule[chemic] \starttext \chemical{CO_2} \stoptext
The issue probably needs to be solved, but I happily use Taco's macro for that purpose (works better in titles). See \molecule on http://wiki.contextgarden.net/Chemistry.
Hello Mojca, did you try it? Here, I get this error: ! LuaTeX error ...TeX-live/texmf-context/tex/context/base/syst-con.lua:21: bad argument #1 to 'char' (invalid value). \rawcharacter ...verters.rawcharacter(\number #1)} <to be read again> ...awcharacter {\recurselevel } } \@@ar@@1 ...hchem \rawcharacter {\recurselevel }}} \redostepwiserecurse ->\expandrecursecontent \dodostepwiserecurse <to be read again> { <inserted text> 66 ... l.39 \molecule {HSO_4^{-}} ? Cheers, Peter -- http://pmrb.free.fr/contact/
On Fri, Feb 22, 2008 at 9:23 AM, Peter Münster wrote:
On Thu, Feb 21 2008, Mojca Miklavec wrote:
On Thu, Feb 21, 2008 at 11:23 PM, Peter Münster wrote:
The following test-file produces an error:
% engine=luatex \usemodule[chemic] \starttext \chemical{CO_2} \stoptext
The issue probably needs to be solved, but I happily use Taco's macro for that purpose (works better in titles). See \molecule on http://wiki.contextgarden.net/Chemistry.
Hello Mojca,
did you try it? Here, I get this error:
I didn't claim that it works in mkiv, I still mostly use mkii (except for non-trivial documents).
! LuaTeX error ...TeX-live/texmf-context/tex/context/base/syst-con.lua:21: bad argument #1 to 'char' (invalid value). \rawcharacter ...verters.rawcharacter(\number #1)}
<to be read again> ...awcharacter {\recurselevel } } \@@ar@@1 ...hchem \rawcharacter {\recurselevel }}}
\redostepwiserecurse ->\expandrecursecontent \dodostepwiserecurse <to be read again> { <inserted text> 66 ... l.39 \molecule {HSO_4^{-}} ?
Interesting - here it works, but \molecule{A_2} only produces lowered 2, while A is lost. ConTeXt ver: 2008.02.13 23:49 MKIV fmt: 2008.2.19 int: english/english This is LuaTeX, Version snapshot-0.22.0-2008021722 Mojca ---------- \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} \starttext \molecule{CO_2}\molecule{HSO_4^{-}} \stoptext
On Fri, Feb 22 2008, Mojca Miklavec wrote:
Interesting - here it works, but \molecule{A_2} only produces lowered 2, while A is lost.
ConTeXt ver: 2008.02.13 23:49 MKIV fmt: 2008.2.19 int: english/english This is LuaTeX, Version snapshot-0.22.0-2008021722
Ok, I admit that I'm not up to date: TeXExec | context source date: 2008.01.28 21:28 This is LuaTeX, Version snapshot-0.20.2-2008012412 Nevertheless, thanks for the hint to \molecule, it can always be useful with MKII. Cheers, Peter -- http://pmrb.free.fr/contact/
On Thu, Feb 21, 2008 at 11:23 PM, Peter Münster
Hello,
The following test-file produces an error:
% engine=luatex \usemodule[chemic] \starttext \chemical{CO_2} \stoptext
This is tooo long. \usemodule[chemic] is enough to produce the error with mkiv. Replace the following lines in m-chemic \ifx\beginpicture\undefined \let\normalgrid\grid \let\normalaxis\axis \input pictex.tex \relax \let\pictexgrid\grid \let\pictexaxis\axis \let\grid\normalgrid \let\axis\normalaxis \fi with \ifx\beginpicture\undefined \let\beginpicture\relax \fi and the module works. Wolfgang
On Fri, Feb 22 2008, Wolfgang Schuster wrote:
Replace the following lines in m-chemic
\ifx\beginpicture\undefined \let\normalgrid\grid \let\normalaxis\axis \input pictex.tex \relax \let\pictexgrid\grid \let\pictexaxis\axis \let\grid\normalgrid \let\axis\normalaxis \fi
with
\ifx\beginpicture\undefined \let\beginpicture\relax \fi
and the module works.
Thanks! I hope, there are no side-effects and the patch could be applied to the distribution! Cheers, Peter -- http://pmrb.free.fr/contact/
participants (3)
-
Mojca Miklavec
-
Peter Münster
-
Wolfgang Schuster