ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ## not permitted in the presence of &.
@ 2012-07-14 15:20 Eythan Weg
  2012-07-14 15:39 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Eythan Weg @ 2012-07-14 15:20 UTC (permalink / raw)
  To: ntg-context


Hi,

I run into trouble with  mkiv   (ConTeXt  ver: 
2012.05.30 11:26 MKIV  fmt: 2012.7.7  int:
english/english).

A small example:
\starttext
\def\c#1#2{\halign{##\hfil&##\cr\bf#1&\quad#2\cr}}
\c{11}{this}
\stoptext 

gives and  error: 

! Only one # is allowed per tab.

This runs error-free  under mkii (pdftex, xetex), plain tex
(luatex, xetex), latex (luatex) etc.

Would someone comment? 

Thank you,
Eythan 



___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ## not permitted in the presence of &.
  2012-07-14 15:20 ## not permitted in the presence of & Eythan Weg
@ 2012-07-14 15:39 ` Wolfgang Schuster
  2012-07-14 21:50   ` Eythan Weg
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2012-07-14 15:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.07.2012 um 17:20 schrieb Eythan Weg:

> Hi,
> 
> I run into trouble with  mkiv   (ConTeXt  ver: 
> 2012.05.30 11:26 MKIV  fmt: 2012.7.7  int:
> english/english).
> 
> A small example:
> \starttext
> \def\c#1#2{\halign{##\hfil&##\cr\bf#1&\quad#2\cr}}
> \c{11}{this}
> \stoptext 
> 
> gives and  error: 
> 
> ! Only one # is allowed per tab.
> 
> This runs error-free  under mkii (pdftex, xetex), plain tex
> (luatex, xetex), latex (luatex) etc.
> 
> Would someone comment? 

The error message is not very helpful in this case because the & is the problem.

In MkIV we made a while ago _, ^ and & normal characters in the text and you
don’t have to write \_ (or \textunderscore) etc. to use them. A side effect of this
was that \halign can’t be used anymore in a document (which isn’t recommended
anyway because ConTeXt has other high level table interfaces), when you now
want to use \halign to create a command put it in a \unprotect … \protect block
or use the \aligntab (it’s a LuaTeX primitive with the same meaning as &).

\unprotect

\def\one#1#2{\halign{##\hfil&##\cr\bf#1&\quad#2\cr}}

\protect

\def\two#1#2{\halign{##\hfil\aligntab##\cr\bf#1\aligntab\quad#2\cr}}

\starttext

\one{underscore}{_}

\two{ampersand}{&}

\stoptext

BTW: \c is already defined as a accent macro.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ## not permitted in the presence of &.
  2012-07-14 15:39 ` Wolfgang Schuster
@ 2012-07-14 21:50   ` Eythan Weg
  2012-07-16 16:22     ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Eythan Weg @ 2012-07-14 21:50 UTC (permalink / raw)
  To: ntg-context





Thank you.  But isn't  \donknuthmode suppose to keep the
compatibility with standard  tex?  

Eythan 



Wolfgang Schuster <schuster.wolfgang@gmail.com>
Sat, 14 Jul 2012 17:39:12 +0200

   Am 14.07.2012 um 17:20 schrieb Eythan Weg:
   
   > Hi,
   > 
   > I run into trouble with  mkiv   (ConTeXt  ver: 
   > 2012.05.30 11:26 MKIV  fmt: 2012.7.7  int:
   > english/english).
   > 
   > A small example:
   > \starttext
   > \def\c#1#2{\halign{##\hfil&##\cr\bf#1&\quad#2\cr}}
   > \c{11}{this}
   > \stoptext 
   > 
   > gives and  error: 
   > 
   > ! Only one # is allowed per tab.
   > 
   > This runs error-free  under mkii (pdftex, xetex), plain tex
   > (luatex, xetex), latex (luatex) etc.
   > 
   > Would someone comment? 
   
   The error message is not very helpful in this case because the & is the problem.
   
   In MkIV we made a while ago _, ^ and & normal characters in the text and you
   don’t have to write \_ (or \textunderscore) etc. to use them. A side effect of this
   was that \halign can’t be used anymore in a document (which isn’t recommended
   anyway because ConTeXt has other high level table interfaces), when you now
   want to use \halign to create a command put it in a \unprotect … \protect block
   or use the \aligntab (it’s a LuaTeX primitive with the same meaning as &).
   
   \unprotect
   
   \def\one#1#2{\halign{##\hfil&##\cr\bf#1&\quad#2\cr}}
   
   \protect
   
   \def\two#1#2{\halign{##\hfil\aligntab##\cr\bf#1\aligntab\quad#2\cr}}
   
   \starttext
   
   \one{underscore}{_}
   
   \two{ampersand}{&}
   
   \stoptext
   
   BTW: \c is already defined as a accent macro.
   
   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  : http://foundry.supelec.fr/projects/contextrev/
   wiki     : http://contextgarden.net
   ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ## not permitted in the presence of &.
  2012-07-14 21:50   ` Eythan Weg
@ 2012-07-16 16:22     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2012-07-16 16:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 14.07.2012 um 23:50 schrieb Eythan Weg:

> Thank you.  But isn't  \donknuthmode suppose to keep the
> compatibility with standard  tex?  

Only MkII keeps the traditional behavior for _, ^ and &, in MkIV
there is no way to go back but as I have show’n you there is \aligntab
which can be used instead of & and after \unprotect you can also
use & as column separator.

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-16 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-14 15:20 ## not permitted in the presence of & Eythan Weg
2012-07-14 15:39 ` Wolfgang Schuster
2012-07-14 21:50   ` Eythan Weg
2012-07-16 16:22     ` Wolfgang Schuster

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).