[NTG-context] \quad confusion

Henri Menke henrimenke at gmail.com
Thu Dec 27 11:12:04 CET 2018


On 12/27/18 11:08 PM, Henri Menke wrote:
> On 12/27/18 10:43 PM, Floris van Manen wrote:
>> When trying to typeset, luatex kept complaining about incorrect parameters for ‘minus’.
>> There is no \minus command in the source however.
>> So it turns out that the combination of using \quad with ‘plus’, 'minus', and some more make the error appear.
>> If i rewrite minus by {minus} the error does not show up either.
> 
> That's because the skips in spac-hor.mkiv are defined like this
> 
>     \unexpanded\def\enskip{\hskip.5\emwidth}
>     \unexpanded\def\quad  {\hskip  \emwidth}
>     \unexpanded\def\qquad {\hskip 2\emwidth}
> 
> The syntax for the \hskip primitive is
> 
>     \hskip<glue>
> 
> and the definition of <glue> is
> 
>     <dimen>plus<dimen>minus<dimen>
> 
> So “\quad minuskel” will expand to “\hskip\emwidth minuskel”.  You see
> what's going to happen?  The “minus” will be interpreted as part of the
> glue definition but no <dimen> is following it, so you get an error.  To
> fix the bug, the definitions in spac-hor.mkiv have to changed
> 
>     \unexpanded\def\enskip{\hskip.5\emwidth\relax}
>     \unexpanded\def\quad  {\hskip  \emwidth\relax}
>     \unexpanded\def\qquad {\hskip 2\emwidth\relax}
> 
> As a temporary workaround you can also just copy them into your document.

There is even a comment in the TeXbook about this exact issue.

\danger Horizontal glue is created in the same way, but with ^|\hskip|
instead of\/ ^|\vskip|. For example, plain \TeX\ defines ^|\enskip| as an
abbreviation for the command `|\hskip.5em\relax|'; this skips
horizontally by
one ``^{en},'' i.e., by exactly half of an em in the current font. There
is no
stretching or shrinking in an |\enskip|. The control sequence ^|\relax|
after `|.5em|' prevents \TeX\ from thinking that a ^{keyword}
is present, in case the text following |\enskip| just happens to begin
with `|plus|' or `|minus|'.

> 
>> 
>> 
>> \starttext
>> \quad minuskel
>> \stoptext
>> 
>> 
>> Where do i go wrong?
>> 
>> Thanks.
>> Floris
>> 
>> 
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> 
>> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
>> 
> 



More information about the ntg-context mailing list