From: Hans Hagen <pragma@wxs.nl>
Subject: Re: \mathpunctuationtrue and latest beta
Date: Wed, 14 Jul 2004 15:38:58 +0200 [thread overview]
Message-ID: <40F53772.6050302@wxs.nl> (raw)
In-Reply-To: <Pine.LNX.4.58.0407101210110.8959@gaston.free.fr>
Peter Münster wrote:
>Hello,
>for some reasons I need something like this:
>
>\mathpunctuationtrue
>\def\MyMacro#1{\stoptable\par#1}
>\starttext
>\starttable[|c|]
>\NC1\NC\AR
>\MyMacro{Peter, Olivier} % problem with comma
>\stoptext
>
>But with the latest beta version, this works no more. Could you help please?
>Greetings, Peter
>
>
actually this is a combined problem:
(1) in table there is a math switch (the following patch removes that one)
and
(2) you feed #1 to the macro while still in table mode and therefore in
the math mode (outer box) and so the , is active etc etc, a solution for
that is (for the unpatched table macro) to do a two step macro
\unprotect
\def\!ttBeginTableA[#1]{%
\if #1u% % "unboxed" table
\ifmmode
\def\!ttEndTable{% % user had better be in display math mode
\relax}% % and have only one table at the outer level
\else % user had better be in vertical mode
\bgroup
\def\!ttEndTable{%
\egroup}%
\fi
\else
%\hbox\bgroup $
%\def\!ttEndTable{%
% \egroup % for the \vtop, \vbox, or \vcenter, yet to come
% $% for math mode
% \egroup}% for the \hbox
%\if #1t%
% \vtop
%\else
% \if #1b%
% \vbox
% \else
% \vcenter % math mode was essential for this
% \fi
%\fi
%
\hbox\bgroup
\def\!ttEndTable{\egroup\egroup}%
\if#1t%
\vtop
\else\if#1b%
\vbox
\else
\def\!ttEndTable{\egroup$\egroup}%
%$\vcenter
\scratchtoks\everymath\everymath\emptytoks$\everymath\scratchtoks\vcenter
\fi\fi
%
\bgroup % for the \vtop, \vbox, or \vcenter
\fi
\advance\!taRecursionLevel 1 % RecursionLevel governs initialization
\let\!ttRightGlue=\relax % This may be changed by \JustCenter, etc
\everycr={}
\ifnum \!taRecursionLevel=1
\!ttInitializeTable
\fi}
\protect
\mathpunctuationtrue
\def\MyMacro{\stoptable\doMyMacro}
\def\doMyMacro#1{\par#1}
test, test
\starttext
{\starttable[|c|]
\NC1,,10\NC\AR
\MyMacro{Peter, Olivier}
}
\stoptext
-----------------------------------------------------------------
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
-----------------------------------------------------------------
prev parent reply other threads:[~2004-07-14 13:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-10 10:14 Peter Münster
2004-07-14 13:38 ` Hans Hagen [this message]
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=40F53772.6050302@wxs.nl \
--to=pragma@wxs.nl \
--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).