ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \chemical and MKIV
@ 2008-02-21 22:23 Peter Münster
  2008-02-21 22:54 ` Mojca Miklavec
  2008-02-22 10:57 ` Wolfgang Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Münster @ 2008-02-21 22:23 UTC (permalink / raw)
  To: ConTeXt list

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/

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \chemical and MKIV
  2008-02-21 22:23 \chemical and MKIV Peter Münster
@ 2008-02-21 22:54 ` Mojca Miklavec
  2008-02-22  8:23   ` Peter Münster
  2008-02-22 10:57 ` Wolfgang Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: Mojca Miklavec @ 2008-02-21 22:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \chemical and MKIV
  2008-02-21 22:54 ` Mojca Miklavec
@ 2008-02-22  8:23   ` Peter Münster
  2008-02-22 18:07     ` Mojca Miklavec
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Münster @ 2008-02-22  8:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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/

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \chemical and MKIV
  2008-02-21 22:23 \chemical and MKIV Peter Münster
  2008-02-21 22:54 ` Mojca Miklavec
@ 2008-02-22 10:57 ` Wolfgang Schuster
  2008-02-22 20:07   ` Peter Münster
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2008-02-22 10:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Feb 21, 2008 at 11:23 PM, Peter Münster <pmlists@free.fr> wrote:
> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \chemical and MKIV
  2008-02-22  8:23   ` Peter Münster
@ 2008-02-22 18:07     ` Mojca Miklavec
  2008-02-22 18:41       ` Peter Münster
  0 siblings, 1 reply; 7+ messages in thread
From: Mojca Miklavec @ 2008-02-22 18:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \chemical and MKIV
  2008-02-22 18:07     ` Mojca Miklavec
@ 2008-02-22 18:41       ` Peter Münster
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Münster @ 2008-02-22 18:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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/

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \chemical and MKIV
  2008-02-22 10:57 ` Wolfgang Schuster
@ 2008-02-22 20:07   ` Peter Münster
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Münster @ 2008-02-22 20:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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/

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-02-22 20:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-21 22:23 \chemical and MKIV Peter Münster
2008-02-21 22:54 ` Mojca Miklavec
2008-02-22  8:23   ` Peter Münster
2008-02-22 18:07     ` Mojca Miklavec
2008-02-22 18:41       ` Peter Münster
2008-02-22 10:57 ` Wolfgang Schuster
2008-02-22 20:07   ` Peter Münster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).