ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \to broken in figure captions
@ 2006-04-26 18:28 Sanjoy Mahajan
  2006-04-26 20:00 ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Sanjoy Mahajan @ 2006-04-26 18:28 UTC (permalink / raw)


In inline math, \to works fine (produces a right arrow), but in a figure
caption all hell breaks loose.

The culprit may be this redefinition of \to in enco-ini.tex:

  $ find texmf -name '*.tex' |xargs egrep -n '\\((e|g|)def|let)\\to\b'
  texmf/tex/context/base/core-pos.tex:642:  %\edef\to  {\POSprefix#1}%
  texmf/tex/context/base/enco-ini.tex:1565:  {\appendtoks\let\to\everylowercase
  texmf/tex/context/base/enco-ini.tex:1570:  {\appendtoks\let\to\everyuppercase

[context : ver: 2006.04.17 23:14]

This test file:

\starttext
\placefigure[abc]{ABC $n\to1$.}{} \input tufte
\stoptext

produces lots of errors beginning with

ERROR: Missing control sequence inserted.

--- TeX said ---
<inserted text> 
                \inaccessible 
<to be read again> 
                   1
\convertargument #1\to #2->\dodoglobal \edef #2
                                               {\detokenize {#1}}
<argument> ABC $n\to 1
                      $.
\docompletefloat ... \doglobal \convertargument #6
                                                  \to \asciititle \ifnofloat...
<argument> ...abc}{figure}{ABC $n\to 1$.}\nextbox 
                                                  \else \docompletefloat {fi...
...
l.2 \placefigure[abc]{ABC $n\to1$.}{}
                                      \input tufte

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

* Re: \to broken in figure captions
  2006-04-26 18:28 \to broken in figure captions Sanjoy Mahajan
@ 2006-04-26 20:00 ` Aditya Mahajan
  2006-04-26 21:39   ` Sanjoy Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2006-04-26 20:00 UTC (permalink / raw)


On Wed, 26 Apr 2006, Sanjoy Mahajan wrote:

> In inline math, \to works fine (produces a right arrow), but in a figure
> caption all hell breaks loose.
>
> The culprit may be this redefinition of \to in enco-ini.tex:
>
>  $ find texmf -name '*.tex' |xargs egrep -n '\\((e|g|)def|let)\\to\b'
>  texmf/tex/context/base/core-pos.tex:642:  %\edef\to  {\POSprefix#1}%
>  texmf/tex/context/base/enco-ini.tex:1565:  {\appendtoks\let\to\everylowercase
>  texmf/tex/context/base/enco-ini.tex:1570:  {\appendtoks\let\to\everyuppercase
>
> [context : ver: 2006.04.17 23:14]
>
> This test file:
>
> \starttext
> \placefigure[abc]{ABC $n\to1$.}{} \input tufte
> \stoptext
>
> produces lots of errors beginning with
> [snip]

Replacing $...$ with \mathematics{...} works without errors.

Aditya

-- 
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008

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

* Re: \to broken in figure captions
  2006-04-26 20:00 ` Aditya Mahajan
@ 2006-04-26 21:39   ` Sanjoy Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Sanjoy Mahajan @ 2006-04-26 21:39 UTC (permalink / raw)


From:    Aditya Mahajan <adityam@umich.edu>
> Replacing $...$ with \mathematics{...} works without errors.

Good suggestion -- also works here.  

Shouldn't $...$ be equivalent to \mathematics{...}?

$$...$$ is deprecated relative to \startformula...\stopformula, so I
wrote a Python script to convert the plain TeX form to the
ConTexT-preferred form.  However, I like $...$: It's compact and
reading the source file is almost as easy as reading the printed file.
With \mathematics scattered throughout the paragraphs it wouldn't be
so easy, plus I'd have to convince Emacs to fontify the argument of
\mathematics, whereas it already does that for $...$.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
         --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.

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

* Re: \to broken in figure captions
  2006-04-27 14:35 ` Hans Hagen
@ 2006-05-23 17:28   ` Sanjoy Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Sanjoy Mahajan @ 2006-05-23 17:28 UTC (permalink / raw)


From:    Hans Hagen <pragma@wxs.nl>, Thu, 27 Apr 2006 16:35:47 +0200
> Sanjoy Mahajan wrote:
> > A workaround:
> >
> > \starttext
> > \def\myto{\to}
> > \placefigure[abc]{ABC $n\myto1$.}{} \input tufte
> > \stoptext
> >   
> i need to change the \convertargument#1\to#2 macro so for the
> moment, use this solution or add {} as in

Not sure if that change was intended to be part of the new releases
and got lost in the post-Bachotex craziness, so this email is just a
reminder about it.  Meanwhile I'm using the workaround with no
problems.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
         --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.

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

* Re: \to broken in figure captions
  2006-04-26 18:33 Sanjoy Mahajan
@ 2006-04-27 14:35 ` Hans Hagen
  2006-05-23 17:28   ` Sanjoy Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2006-04-27 14:35 UTC (permalink / raw)


Sanjoy Mahajan wrote:
> A workaround:
>
> \starttext
> \def\myto{\to}
> \placefigure[abc]{ABC $n\myto1$.}{} \input tufte
> \stoptext
>   
i need to change the \convertargument#1\to#2 macro so for the moment, use this solution or add {} as in 

\placefigure[abc]{{ABC $n\to1$.}}{} \input tufte


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* \to broken in figure captions
@ 2006-04-26 18:33 Sanjoy Mahajan
  2006-04-27 14:35 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Sanjoy Mahajan @ 2006-04-26 18:33 UTC (permalink / raw)


A workaround:

\starttext
\def\myto{\to}
\placefigure[abc]{ABC $n\myto1$.}{} \input tufte
\stoptext

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

end of thread, other threads:[~2006-05-23 17:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 18:28 \to broken in figure captions Sanjoy Mahajan
2006-04-26 20:00 ` Aditya Mahajan
2006-04-26 21:39   ` Sanjoy Mahajan
2006-04-26 18:33 Sanjoy Mahajan
2006-04-27 14:35 ` Hans Hagen
2006-05-23 17:28   ` Sanjoy Mahajan

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).