ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Wolfgang Schuster" <schuster.wolfgang@googlemail.com>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: description fails on \if
Date: Wed, 26 Mar 2008 08:32:20 +0100	[thread overview]
Message-ID: <115224fb0803260032s54798150y3a2b7fb6ca2d1d6e@mail.gmail.com> (raw)
In-Reply-To: <DA065679-32B1-4B50-BAE0-53020A1BE1D6@science.uva.nl>

On Tue, Mar 25, 2008 at 8:38 PM, Hans van der Meer <hansm@science.uva.nl> wrote:
> There is the following problem on code that did work around july 2007,
> but no longer under the current context version (2008-03-11).
>
> Define a description, I did:
> \definedescription[answerblock][%
>        \c!margin=\v!no,\c!location=\v!left,%
>        \c!headstyle=\@@exmintrostyle,\c!style=\@@exmstyle,%
>        \c!before=,\c!inbetween=,\c!after=,%
>        \c!hang=\@@exmhang,\c!width=\questionblockwidth,%
>        \c!text=\placeanswerstart]

Could you try to set "title=no".

> Typeset with this description inside the following macro:
> \def\shortanswer#1\par{%
>        \par % be sure to end paragraph here
>        \answerblock{}% % {} needed here in description call
>        \ifanswers #1\else\dotfill\strut\fi % <<<<<< crashing on this if
>        \par            %  final \par of description ... \par
>        }
> The above code crashes with: ! Incomplete \ifx; all text was ignored
> after ...
>
> After some detective work in which Wolfgang Schuster had a large share
> and has found the most elegant workaround, the addition of a \relax
> just after the description call prevents the error:
> \def\shortanswer#1\par{%
>        \par % be sure to end paragraph here
>        \answerblock{}% % {} needed here in description call
>        \relax          % <<<<<<<<<<<<<<<<<   \relax prevents crash on if
>        \ifanswers #1\else\dotfill\strut\fi
>        \par            %  final \par of description ... \par
>        }
>
> The way \relax stops the error reminds me of the \relax that one
> places after a number in order to separate that from the code following.
> I did compare core-des.tex, both the last version and the archived
> from 2007-04-17. But I must admit, I did not succeed finding a clue
> among the differences about what could have happened. The code is a
> bit too intricate to just jump in and pinpoint the culprit -- at least
> for me.
>
> Allthough Wolfgang's workaround saves the day, I feel this problem
> deserves solving inside ConTeXt, not outside it. Someday somewhere
> another person will stumble on the same problem -- a situation that
> can and should be avoided, in my view.
> Therefore I explain the problem here as fully as possible hoping
> someone knowledgeable with descriptions <<we might need to fall back
> to Taco or Hans>> will find the best remedy.

I would say the message comes from \dodoublegroupempty in \@@description.

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
___________________________________________________________________________________


  reply	other threads:[~2008-03-26  7:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 19:38 Hans van der Meer
2008-03-26  7:32 ` Wolfgang Schuster [this message]
2008-03-26 20:23   ` Hans van der Meer
2008-03-26 21:52     ` Hans Hagen
2008-03-27  7:37     ` Wolfgang Schuster
2008-03-26 21:51 ` Hans Hagen

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=115224fb0803260032s54798150y3a2b7fb6ca2d1d6e@mail.gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --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).