## not permitted in the presence of &.
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
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
Thank you. But isn't \donknuthmode suppose to keep the
compatibility with standard tex?
Eythan
Wolfgang Schuster
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 ___________________________________________________________________________________
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
participants (2)
-
eythanweg@gmail.com
-
Wolfgang Schuster