[dev-context] Catcodes in bib module

Aditya Mahajan adityam at umich.edu
Mon Oct 18 00:32:55 CEST 2010


On Mon, 18 Oct 2010, Hans Hagen wrote:

> On 17-10-2010 11:38, Aditya Mahajan wrote:
>> Hi,
>> 
>> Try this example:
>> 
>> \newcatcodetable\arbitcatcodes
>> 
>> \startcatcodetable\arbitcatcodes
>> \catcode`\@=0
>> \stopcatcodetable
>> 
>> \setcatcodetable\arbitcatcodes
>> 
>> @starttext
>> Hello
>> @stoptext
>> 
>> This results in the entire bxml-apa.mkiv being typeset! The file
>> bxml-apa is called by
>> 
>> \def\dodoloadbibtexpublicationalternative#1%
>> {\doonlyonce{#1}
>> {\readsysfile{bxml-#1.mkiv}
>> {\showmessage\m!publications{6}{bxml-#1}}
>> {\showmessage\m!publications{1}{bxml-#1}}}}
>> 
>> in bibl-bib.mkiv
>> 
>> I don't know if this should be considered a bug or not.
>
> does wrapping in
>
> \startreadingfile
>
> \stopreadingfile

Partially. Adding

\def\dodoloadbibtexpublicationalternative#1%
   {\doonlyonce{#1}
      {\startreadingfile\readsysfile{bxml-#1.mkiv}\stopreadingfile
         {\showmessage\m!publications{6}{bxml-#1}}
         {\showmessage\m!publications{1}{bxml-#1}}}}

before the test file gives an error on the next command:

! LuaTeX error <main ctx instance>:1: ')' expected near '\'.

system          > error on line 15 in file backend.tex: LuaTeX error  ...

  5     \stopcatcodetable
  6
  7     \def\dodoloadbibtexpublicationalternative#1%
  8       {\doonlyonce{#1}
  9          {\startreadingfile\readsysfile{bxml-#1.mkiv}\stopreadingfile
10             {\showmessage\m!publications{6}{bxml-#1}}
11             {\showmessage\m!publications{1}{bxml-#1}}}}
12
13     \setcatcodetable\arbitcatcodes
14
15 >>  @starttext
16     Hello
17     @stoptext


\normalshowmessage ...showmessage("#1","#2","#3")}

<argument> ...ns{6}{bxml-apa}} {\showmessage \m !p

ublications{1}{bxml-apa}}
\firstofoneargument #1->#1


But adding this at the beginning of the file works.

\let\normaldoloadbibtexpublicationalternative\doloadbibtexpublicationalternative
\let\doloadbibtexpublicationalternative\relax

\appendtoks
\pushcatcodetable
\setcatcodetable\ctxcatcodes
   \normaldoloadbibtexpublicationalternative
\popcatcodetable
\to \everystarttext % was everyjob, will change anyway

Aditya


More information about the dev-context mailing list