ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Lars Huttar <lars_huttar@sil.org>
Subject: Re: (XeTeX) trouble debugging a "Missing number" error
Date: Wed, 05 Dec 2012 14:10:12 +0100	[thread overview]
Message-ID: <50BF47B4.2000909@wxs.nl> (raw)
In-Reply-To: <50BF1FCE.2000605@sil.org>

On 12/5/2012 11:19 AM, Lars Huttar wrote:
> Hi all,
>
> I'm working with some code that was developed by someone else.
> The document I'm typesetting is now giving the following error:
>
> ! Missing number, treated as zero.
> <to be read again>
>                     \otr:1:27
> \OTRSETdoifcellelse ...er #1:\number #2\endcsname
>                                                    \@EA
> \secondoftwoarguments...
>
> \@@ar@@1 ...ellelse {\mofcolumns }\columnlastcell
>                                                    {\global \advance
> \columnl...
>
> \redoloop ->\expandrecursecontent
>                                    \endofloop
> <to be read again>
>                     {
> <inserted text>
>                  28
> ....
> l.12 \startabblist
>                    {
> ?
>
> I haven't been able to figure out what's wrong or how to fix it.
>
> I had just made changes to refactor the definitions of fonts. (I
> confirmed that these changes really are a necessary cause of the error:
> when I back out just these changes, the error goes away.)
>
>>From the above error message I understand the error was detected during
> the expansion of \startabblist. Here's the definition of abblist:
>
> % Abbreviations
> \definestartstop
>    [abblist]
>    [before={\setupbackgrounds[text][background=verticalline]
> \starttextbackground[text]
> \setuptab[headstyle={\switchtobodyfont[SansB,\SansBsize]},width=20mm,location=left]
> \startcolumnset[abbcolumn] \startalignment[flushleft,nothyphenated]},
>     after={\stopalignment \stopcolumnset \stoptextbackground
> \setupbackgrounds[text][background=off]}]

you can try

\unexpanded\def\StartAbbList
   {\setupbackgrounds[text][background=verticalline]
    \starttextbackground[text]
 
\setuptab[headstyle={\switchtobodyfont[SansB,\SansBsize]},width=20mm,location=left]
    \startcolumnset[abbcolumn]
    \startalignment[flushleft,nothyphenated]}

\unexpanded\def\StopAbbList
   {\stopalignment
    \stopcolumnset
    \stoptextbackground
    \setupbackgrounds[text][background=off]}

\definestartstop
   [abblist]
   [before=\StartAbbList,
    after=\StopAbbList]

in such case best make a small example, for instance how is abblist used?

>>From that, one might guess that the font SansB or the font dimension
> \SansBsize were the problem. But those definitions haven't changed
> (though I would like to confirm that empirically with a run-time trace
> message).
>
> Here are the font settings changes that did occur:
>
> E16fonts.tex:
> changed this block:
>    \definefont[SerifXLI][name:GentiumBookBasic-Italic at 10pt]
>    \definefont[SerifXXL][name:GentiumBookBasic at 12pt]
>    \definefont[SerifXXLB][name:GentiumBookBasic-Bold at 12pt]
>
> to use size dimensions defined elsewhere:
> \definefont[SerifXLI][name:GentiumBookBasic-Italic at \XLfontsize]
> \definefont[SerifXXL][name:GentiumBookBasic at \XXLfontsize]
> \definefont[SerifXXLB][name:GentiumBookBasic-Bold at \XXLfontsize]
>
> E16settings.tex: I added these definitions:
> \define\XLfontsize{14pt}
> \define\XXLfontsize{16pt}
>
> There are modes involved, so things are a bit more complicated, but I
> believe that is the only effective difference.

and how about:

\def\XLfontsize{14pt}
\def\XXLfontsize{16pt}

> I also created a log file, which I'll attach.
> There is also a version with \tracingmacros=1, but it's 600K, so I'll
> put it at
> http://www.huttar.net/tmp/country-report-country_id-15-tracing.log
>
> Thanks for taking a look. Please let me know what further information I
> need to provide.
> I can provide the .tex files themselves upon request.
>
> I would especially like to know better techniques for debugging -- how I
> can induce TeX/ConTeXt to tell me more about what's going on. I realize
> that as a macro language, this is inherently difficult with TeX.

yes, it's not always easy ... best is to make small tests (while 
developing styles) and test those snippets ... due to tex's expansion 
there can always be nasty interferences in complex setups

> We are heavily invested in XeTeX, so switching to LuaTeX in the near
> term is not an option.

a pitty as it runs smoother (and context mkiv has some more features)

(i never used xetex in production and as in context it used the mkii 
macros there are not updates, so in principle old runs should still run)

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	other threads:[~2012-12-05 13:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05 10:19 Lars Huttar
2012-12-05 13:10 ` Hans Hagen [this message]
     [not found] <mailman.95.1354702805.2096.ntg-context@ntg.nl>
2012-12-05 15:46 ` Lars Huttar
2012-12-05 16:22   ` Wolfgang Schuster
     [not found] <mailman.104.1354736814.2096.ntg-context@ntg.nl>
2012-12-07 16:05 ` Lars Huttar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50BF47B4.2000909@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=lars_huttar@sil.org \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).