On 4-8-2012 20:59, Aditya Mahajan wrote:
Hi Aditya,

I usually use \ after abbreviations to avoid bad interword spaces. For
example, Prof.\ ABC. However, when using this in footnotes, if there is a
linebreak after the \, I get an error:

! Undefined control sequence.

1 >>  \starttext
2     Someone\footnote{Prof.\
3     ABC}
4     \stoptext
5

Ok, the next is only for those who want to spend some time on the internals ...

\starttext

\def\TestA#1%
  {\writestatus{Test A}{#1}%
   \ctxlua{str = "#1" print(str) context(str) io.savedata("temp.tmp",str)}}

\def\TestB#1%
  {\writestatus{Test B}{#1}%
\ctxlua{str = "\detokenize{#1}" print(str) context(str) io.savedata("temp.tmp",str)}}

\def\TestC#1%
  {\writestatus{Test C}{#1}%
   \edef\temp{#1}%
\ctxlua{str = "\detokenize\expandafter{\temp}" print(str) context(str) io.savedata("temp.tmp",str)}%
   \typefile{temp.tmp}}

\TestA{Test\
A}

\TestB{Test\
B}

\TestC{Test\
C}

Test\
D

\section{Test\
E}

Test F\footnote{Note\
F}

\stoptext

I patched the helpers.title macro to deal with it but it's still something to look into as one might wonder why the newline end up there (Taco might know).

(The 'context' function takes care of newlines so this is why it don't get noticed in other cases. Here a more low level sprint (<catcodeid>, str) was used.

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to