There seems something very much amiss with \halign in later ConTeXt versions. This typesets fine in PlainTeX and is an example taken from a textbook. \tabskip=1em\halign{% \hfil\it#\hfil&\hfil#\hfil&\hfil#\crA&B&C&D\cr} Also in contextversion 2012.05.30 (from a TeXlive distribution). But it fails at least in ConTeXt ver: 2013.03.20 10:34 MKIV and in ConTeXt ver: 2013.04.16 12:08 MKIV beta with the following error ! Only one # is allowed per tab. system > tex > error on line 5 in file fixedwidth.tex: Only one # is allowed per tab ... 1 \starttext 2 contextversion=\contextversion\par 3 \tabskip=1em 4 \halign{% 5 >> \hfil\it#\hfil&\hfil#\hfil&\hfil#\cr 6 A&B&C&D\cr} 7 \stoptext l.5 \hfil\it#\hfil&\hfil# \hfil&\hfil#\cr Why? How primitive it may be, I would like to use \halign now and then. Hans van der Meer
Am 18.04.2013 um 14:55 schrieb "Meer, H. van der"
There seems something very much amiss with \halign in later ConTeXt versions.
This typesets fine in PlainTeX and is an example taken from a textbook.
\tabskip=1em\halign{% \hfil\it#\hfil&\hfil#\hfil&\hfil#\crA&B&C&D\cr}
Also in contextversion 2012.05.30 (from a TeXlive distribution).
But it fails at least in ConTeXt ver: 2013.03.20 10:34 MKIV and in ConTeXt ver: 2013.04.16 12:08 MKIV beta with the following error
! Only one # is allowed per tab. system > tex > error on line 5 in file fixedwidth.tex: Only one # is allowed per tab ...
1 \starttext 2 contextversion=\contextversion\par 3 \tabskip=1em 4 \halign{% 5 >> \hfil\it#\hfil&\hfil#\hfil&\hfil#\cr 6 A&B&C&D\cr} 7 \stoptext l.5 \hfil\it#\hfil&\hfil# \hfil&\hfil#\cr
Why? How primitive it may be, I would like to use \halign now and then.
The error message is misleading because the problem is & and not #. One of the changes for MkIV was to make _, ^ and & normal characters in the document (the first two still works for math). For code writing this doesn’t matter because & has it’s normal meaning when you use \unprotect … \protect but it can’t be used in the document. Wolfgang
I see, it is either the nuisance of having to type \& etc. in the text, or the nuisance of having to wrap everything like \halign in \unprotect..\protect and then resorting to \& again.
At least there is nothing amiss with \halign itself, which is reassuring. However, I do not feel secure with these little deviations from the orginal TeX.
Hans van der Meer
On 18 Apr 2013, at 3:03 PM, Wolfgang Schuster
On 4/18/2013 3:16 PM, Meer, H. van der wrote:
I see, it is either the nuisance of having to type \& etc. in the text, or the nuisance of having to wrap everything like \halign in \unprotect..\protect and then resorting to \& again. At least there is nothing amiss with \halign itself, which is reassuring. However, I do not feel secure with these little deviations from the orginal TeX.
orinal tex permits to set the catcodes so you need to define 'original tex' anyhow, you can use \aligntab and \alignhash which wee introduced in luatex for this purpose which reminds me that one of these days on the context dev list we should discuss this one \catcode`€=\mathshiftcatcode \starttext €e=mc^2€ \stoptext for typesetting math with continental style presets. 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 -----------------------------------------------------------------
which reminds me that one of these days on the context dev list we should discuss this one
\catcode`€=\mathshiftcatcode
\starttext €e=mc^2€ \stoptext
for typesetting math with continental style presets.
And maybe make it default whenever one wishes to use comma as a decimal separator :) Aditya
There seems to be more to it:
This works:
\unprotect\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr
A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}\protect
But these generate a missing } after the \halign:
\unprotect\framed{\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr
A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}}\protect
\framed{\unprotect\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr
A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}\protect}
Is such a construction (now) impossible?
Hans van der Meer
On 18 Apr 2013, at 3:03 PM, Wolfgang Schuster
Am 18.04.2013 um 15:26 schrieb "Meer, H. van der"
There seems to be more to it:
This works: \unprotect\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}\protect
But these generate a missing } after the \halign: \unprotect\framed{\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}}\protect
\framed{\unprotect\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}\protect}
Is such a construction (now) impossible?
\framed[align=normal,strut=no]{…} Wolfgang
Why does the [align=middle] makess such a difference?
Hans van der Meer
On 18 Apr 2013, at 3:34 PM, Wolfgang Schuster
Am 18.04.2013 um 15:26 schrieb "Meer, H. van der"
: There seems to be more to it:
This works: \unprotect\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}\protect
But these generate a missing } after the \halign: \unprotect\framed{\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}}\protect
\framed{\unprotect\halign{\hfil\it#\hfil&\hfil#\hfil&\hfil#\hfil\cr A&B&C&D\cr A&BB&CCCC&DDDDDDDD\cr}\protect}
Is such a construction (now) impossible?
\framed[align=normal,strut=no]{…}
Wolfgang
Sifting through my TeX-mailbox, I came along this post of Wolfgang Schuster and decided to try all variations given to the align parameter on \framed.
Curious in which cases the \hbox and in which the \vbox is chosen, not unimportant of course.
I did this by typesetting \hbox{abc}\hbox{xyz} inside a framed. For \hbox want expects abcxyz as output and for \vbox abc and below it xyz. As can be seen in the first two examples.
To my surprise none of the \framed[align=..] options exhibits \vbox character!
Thus my question: has the behaviour of \framed[align=..] changed in the mean time? Three years is of course an eternity when seen in the perspective of the speed with which ConTeXt is evolving 😃. Or is there another reason why the \vbox effect is not shown in any of the examples?
I am enclosing a minmal example and its output. Just curious.
Hans van der Meer
On 18 Apr 2013, at 15:46, Wolfgang Schuster
Meer, Hans van der mailto:H.vanderMeer@uva.nl 16. Mai 2016 um 15:50 Sifting through my TeX-mailbox, I came along this post of Wolfgang Schuster and decided to try all variations given to the align parameter on \framed. Curious in which cases the \hbox and in which the \vbox is chosen, not unimportant of course. I did this by typesetting \hbox{abc}\hbox{xyz} inside a framed. For \hbox want expects abcxyz as output and for \vbox abc and below it xyz. As can be seen in the first two examples. To my surprise none of the \framed[align=..] options exhibits \vbox character!
Thus my question: has the behaviour of \framed[align=..] changed in the mean time? Three years is of course an eternity when seen in the perspective of the speed with which ConTeXt is evolving 😃. Or is there another reason why the \vbox effect is not shown in any of the examples? \framed adds a \strut at the begin and end of the content.
\starttext \vbox{\hbox{First}\hbox{Second}} \vbox{\strut\hbox{First}\hbox{Second}} \framed[align=flushleft]{\hbox{First}\hbox{Second}} \framed[align=flushleft,strut=no,autostrut=no]{\hbox{First}\hbox{Second}} \stoptext Wolfgang
Thanks.
I redid the examples with the autostrut parameter set to respectively yes and no. In the former case I see all have an hbox and in the latter case all have a vbox. So it seems not the align, but the strut being the one determining the box variant.
Hans van der Meer
On 16 May 2016, at 16:03, Wolfgang Schuster
Meer, Hans van der mailto:H.vanderMeer@uva.nl 16. Mai 2016 um 16:31 Thanks.
I redid the examples with the autostrut parameter set to respectively yes and no. In the former case I see all have an hbox and in the latter case all have a vbox. So it seems not the align, but the strut being the one determining the box variant. No, the align settings determines the box type. The \strut at the begin forces horizontal mode which results in both \hbox’es in the same line.
\starttext \ifvmode Vertical \else Horizontal \fi mode \strut \ifvmode Vertical \else Horizontal \fi mode \stoptext Wolfgang
On 16 May 2016, at 16:41, Wolfgang Schuster
Meer, Hans van der mailto:H.vanderMeer@uva.nl 16. Mai 2016 um 17:18 Ok. But when using "strut=no,autostrut=no" I see for all values of align the abc/xyz below each other and none having abcxyz. Doesn't that suggest that all boxes are vbox and that the strut merely forces horizontal mode? Otherwise I do not understand what happens. Yes, when you set a value for the width key you always get a \vbox.
Wolfgang
participants (5)
-
Aditya Mahajan
-
Hans Hagen
-
Meer, H. van der
-
Meer, Hans van der
-
Wolfgang Schuster