ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Error after latest update
@ 2024-08-06 15:54 Shiv Shankar Dayal
  2024-08-06 16:27 ` [NTG-context] " Mikael Sundqvist
  0 siblings, 1 reply; 9+ messages in thread
From: Shiv Shankar Dayal @ 2024-08-06 15:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I have defined a determinant environment like below:

\definemathmatrix[determinant]
                  [matrix:bars]
                  [simplecommand=thedeterminant]

and I create a determinant like below:

\startformula \startdeterminant\NC a_{11} \NC a_{12} \NC a_{13} \NC
\cdots \NC a_{1n}\NR
 \NC a_{21} \NC a_{22} \NC a_{23} \NC \cdots \NC a_{2n}\NR
 \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR
 \multispan{9}{\dotfill}\NR
 \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn}
\NR\stopdeterminant

This was working before today but I updated ConTeXt and it has stopped
working. The error it gives me now is:

tex error       > tex error on line 277 in file determinants.tex: You
can't use '\Ustopmath' in restricted horizontal mode

How can I get it working again?

-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Error after latest update
  2024-08-06 15:54 [NTG-context] Error after latest update Shiv Shankar Dayal
@ 2024-08-06 16:27 ` Mikael Sundqvist
  2024-08-06 16:32   ` Shiv Shankar Dayal
  2024-08-06 17:18   ` Wolfgang Schuster
  0 siblings, 2 replies; 9+ messages in thread
From: Mikael Sundqvist @ 2024-08-06 16:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

On Tue, Aug 6, 2024 at 5:57 PM Shiv Shankar Dayal
<shivshankar.dayal@gmail.com> wrote:
>
> I have defined a determinant environment like below:
>
> \definemathmatrix[determinant]
>                   [matrix:bars]
>                   [simplecommand=thedeterminant]
>
> and I create a determinant like below:
>
> \startformula \startdeterminant\NC a_{11} \NC a_{12} \NC a_{13} \NC
> \cdots \NC a_{1n}\NR
>  \NC a_{21} \NC a_{22} \NC a_{23} \NC \cdots \NC a_{2n}\NR
>  \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR
>  \multispan{9}{\dotfill}\NR
>  \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn}
> \NR\stopdeterminant
>
> This was working before today but I updated ConTeXt and it has stopped
> working. The error it gives me now is:
>
> tex error       > tex error on line 277 in file determinants.tex: You
> can't use '\Ustopmath' in restricted horizontal mode
>
> How can I get it working again?
>
> --
> Respect,
> Shiv Shankar Dayal

I never seen \multispan before. But this seems to work:

\definemathmatrix
  [determinant]
  [matrix:bars]
  [simplecommand=thedeterminant]

\starttext

\startformula
  \startdeterminant
    \NC a_{11} \NC a_{12} \NC a_{13} \NC \cdots \NC a_{1n}\NR
    \NC a_{21} \NC a_{22} \NC a_{23} \NC  \cdots \NC a_{2n}\NR
    \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR
    \HF\NR
%     \multispan{9}{\dotfill}\NR
    \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn}\NR
  \stopdeterminant
\stopformula

\stoptext

I hope it gives you what you want.

/Mikael
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Error after latest update
  2024-08-06 16:27 ` [NTG-context] " Mikael Sundqvist
@ 2024-08-06 16:32   ` Shiv Shankar Dayal
  2024-08-06 17:16     ` Aditya Mahajan
  2024-08-06 17:18   ` Wolfgang Schuster
  1 sibling, 1 reply; 9+ messages in thread
From: Shiv Shankar Dayal @ 2024-08-06 16:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I do not remember where it came from, probably AMS Math or something like that.

Many thanks. It works but I am curious as to why the working code broke.

On Tue, Aug 6, 2024 at 9:58 PM Mikael Sundqvist <mickep@gmail.com> wrote:
>
> Hi,
>
> On Tue, Aug 6, 2024 at 5:57 PM Shiv Shankar Dayal
> <shivshankar.dayal@gmail.com> wrote:
> >
> > I have defined a determinant environment like below:
> >
> > \definemathmatrix[determinant]
> >                   [matrix:bars]
> >                   [simplecommand=thedeterminant]
> >
> > and I create a determinant like below:
> >
> > \startformula \startdeterminant\NC a_{11} \NC a_{12} \NC a_{13} \NC
> > \cdots \NC a_{1n}\NR
> >  \NC a_{21} \NC a_{22} \NC a_{23} \NC \cdots \NC a_{2n}\NR
> >  \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR
> >  \multispan{9}{\dotfill}\NR
> >  \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn}
> > \NR\stopdeterminant
> >
> > This was working before today but I updated ConTeXt and it has stopped
> > working. The error it gives me now is:
> >
> > tex error       > tex error on line 277 in file determinants.tex: You
> > can't use '\Ustopmath' in restricted horizontal mode
> >
> > How can I get it working again?
> >
> > --
> > Respect,
> > Shiv Shankar Dayal
>
> I never seen \multispan before. But this seems to work:
>
> \definemathmatrix
>   [determinant]
>   [matrix:bars]
>   [simplecommand=thedeterminant]
>
> \starttext
>
> \startformula
>   \startdeterminant
>     \NC a_{11} \NC a_{12} \NC a_{13} \NC \cdots \NC a_{1n}\NR
>     \NC a_{21} \NC a_{22} \NC a_{23} \NC  \cdots \NC a_{2n}\NR
>     \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR
>     \HF\NR
> %     \multispan{9}{\dotfill}\NR
>     \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn}\NR
>   \stopdeterminant
> \stopformula
>
> \stoptext
>
> I hope it gives you what you want.
>
> /Mikael
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________



-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Error after latest update
  2024-08-06 16:32   ` Shiv Shankar Dayal
@ 2024-08-06 17:16     ` Aditya Mahajan
  0 siblings, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2024-08-06 17:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

On Tue, 6 Aug 2024, Shiv Shankar Dayal wrote:

> Hi,
> 
> I do not remember where it came from, probably AMS Math or something like that.

It comes from plain:

❯ pdftex
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/Arch Linux) (preloaded format=pdftex)
 restricted \write18 enabled.
**\relax
entering extended mode

*\show\multispan
> \multispan=macro:
#1->\omit \mscount #1\relax \loop \ifnum \mscount >\@ne \sp@n \repeat .
<*> \show\multispan

Aditya

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Error after latest update
  2024-08-06 16:27 ` [NTG-context] " Mikael Sundqvist
  2024-08-06 16:32   ` Shiv Shankar Dayal
@ 2024-08-06 17:18   ` Wolfgang Schuster
  2024-08-06 17:30     ` Shiv Shankar Dayal
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2024-08-06 17:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Mikael Sundqvist

Mikael Sundqvist schrieb am 06.08.2024 um 18:27:
> Hi,
>
> On Tue, Aug 6, 2024 at 5:57 PM Shiv Shankar Dayal
> <shivshankar.dayal@gmail.com> wrote:
>> I have defined a determinant environment like below:
>>
>> \definemathmatrix[determinant]
>>                    [matrix:bars]
>>                    [simplecommand=thedeterminant]
>>
>> and I create a determinant like below:
>>
>> \startformula \startdeterminant\NC a_{11} \NC a_{12} \NC a_{13} \NC
>> \cdots \NC a_{1n}\NR
>>   \NC a_{21} \NC a_{22} \NC a_{23} \NC \cdots \NC a_{2n}\NR
>>   \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR
>>   \multispan{9}{\dotfill}\NR
>>   \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn}
>> \NR\stopdeterminant
>>
>> This was working before today but I updated ConTeXt and it has stopped
>> working. The error it gives me now is:
>>
>> tex error       > tex error on line 277 in file determinants.tex: You
>> can't use '\Ustopmath' in restricted horizontal mode
>>
>> How can I get it working again?
>>
>> --
>> Respect,
>> Shiv Shankar Dayal
> I never seen \multispan before. But this seems to work:

\multispan is a plain TeX command to create cells which span multiple 
columns
and makes only sense when you create tables with the \halign primitive 
because
tables in context use hidden cells for padding on the left and right etc.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Error after latest update
  2024-08-06 17:18   ` Wolfgang Schuster
@ 2024-08-06 17:30     ` Shiv Shankar Dayal
  2024-08-06 19:10       ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Shiv Shankar Dayal @ 2024-08-06 17:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mikael Sundqvist

Hi,

I still do not know why it stopped working after the latest update.

On Tue, Aug 6, 2024 at 10:54 PM Wolfgang Schuster
<wolfgang.schuster.lists@gmail.com> wrote:
>
> Mikael Sundqvist schrieb am 06.08.2024 um 18:27:
> > Hi,
> >
> > On Tue, Aug 6, 2024 at 5:57 PM Shiv Shankar Dayal
> > <shivshankar.dayal@gmail.com> wrote:
> >> I have defined a determinant environment like below:
> >>
> >> \definemathmatrix[determinant]
> >>                    [matrix:bars]
> >>                    [simplecommand=thedeterminant]
> >>
> >> and I create a determinant like below:
> >>
> >> \startformula \startdeterminant\NC a_{11} \NC a_{12} \NC a_{13} \NC
> >> \cdots \NC a_{1n}\NR
> >>   \NC a_{21} \NC a_{22} \NC a_{23} \NC \cdots \NC a_{2n}\NR
> >>   \NC a_{31} \NC a_{32} \NC a_{33} \NC \cdots \NC a_{3n}\NR
> >>   \multispan{9}{\dotfill}\NR
> >>   \NC a_{n1} \NC a_{n2} \NC a_{n3} \NC \cdots \NC a_{nn}
> >> \NR\stopdeterminant
> >>
> >> This was working before today but I updated ConTeXt and it has stopped
> >> working. The error it gives me now is:
> >>
> >> tex error       > tex error on line 277 in file determinants.tex: You
> >> can't use '\Ustopmath' in restricted horizontal mode
> >>
> >> How can I get it working again?
> >>
> >> --
> >> Respect,
> >> Shiv Shankar Dayal
> > I never seen \multispan before. But this seems to work:
>
> \multispan is a plain TeX command to create cells which span multiple
> columns
> and makes only sense when you create tables with the \halign primitive
> because
> tables in context use hidden cells for padding on the left and right etc.
>
> Wolfgang
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________



-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Error after latest update
  2024-08-06 17:30     ` Shiv Shankar Dayal
@ 2024-08-06 19:10       ` Wolfgang Schuster
  2024-08-06 19:17         ` Shiv Shankar Dayal
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2024-08-06 19:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Shiv Shankar Dayal; +Cc: Mikael Sundqvist

Shiv Shankar Dayal schrieb am 06.08.2024 um 19:30:
> Hi,
>
> I still do not know why it stopped working after the latest update.

Which version was your last one you used?

Just because it worked without an error message before doesn't mean your 
input is the right  way.
Especially when you have to pass 9 as argument to \multispan even though 
you have only 5 columns
should be alarming.

The reason for the error here is that Context creates a template for 
each matrix cell which enables
and disable math mode at the begin of each cell but when you use 
\multispan the template is ignored
and you have to provide your own settings. The problem no is that no 
math mode is entered at
the begin of your new marge cell but Context always adds a end of math 
mode trigger when it reaches
the \NR command at the end of the row.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Error after latest update
  2024-08-06 19:10       ` Wolfgang Schuster
@ 2024-08-06 19:17         ` Shiv Shankar Dayal
  2024-08-06 19:32           ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Shiv Shankar Dayal @ 2024-08-06 19:17 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users, Mikael Sundqvist

LuaMetaTeX 2.11.03 20240517 + ConTeXt LMTX 2024.05.17 16:32

On Wed, Aug 7, 2024 at 12:40 AM Wolfgang Schuster
<wolfgang.schuster.lists@gmail.com> wrote:
>
> Shiv Shankar Dayal schrieb am 06.08.2024 um 19:30:
> > Hi,
> >
> > I still do not know why it stopped working after the latest update.
>
> Which version was your last one you used?
>
> Just because it worked without an error message before doesn't mean your
> input is the right  way.
> Especially when you have to pass 9 as argument to \multispan even though
> you have only 5 columns
> should be alarming.
>
> The reason for the error here is that Context creates a template for
> each matrix cell which enables
> and disable math mode at the begin of each cell but when you use
> \multispan the template is ignored
> and you have to provide your own settings. The problem no is that no
> math mode is entered at
> the begin of your new marge cell but Context always adds a end of math
> mode trigger when it reaches
> the \NR command at the end of the row.
>
> Wolfgang
>


-- 
Respect,
Shiv Shankar Dayal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: Error after latest update
  2024-08-06 19:17         ` Shiv Shankar Dayal
@ 2024-08-06 19:32           ` Wolfgang Schuster
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2024-08-06 19:32 UTC (permalink / raw)
  To: Shiv Shankar Dayal; +Cc: mailing list for ConTeXt users, Mikael Sundqvist

Shiv Shankar Dayal schrieb am 06.08.2024 um 21:17:
> LuaMetaTeX 2.11.03 20240517 + ConTeXt LMTX 2024.05.17 16:32

I had a copy of this older version and the cell handling was different 
back then.

Still the correct way to add filler symbols in a matrix is the \HF 
command which
has two optional commands where you can a) set the number of columns which
should be filled and b) the filler alternative to be used for the symbol.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-08-06 19:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-06 15:54 [NTG-context] Error after latest update Shiv Shankar Dayal
2024-08-06 16:27 ` [NTG-context] " Mikael Sundqvist
2024-08-06 16:32   ` Shiv Shankar Dayal
2024-08-06 17:16     ` Aditya Mahajan
2024-08-06 17:18   ` Wolfgang Schuster
2024-08-06 17:30     ` Shiv Shankar Dayal
2024-08-06 19:10       ` Wolfgang Schuster
2024-08-06 19:17         ` Shiv Shankar Dayal
2024-08-06 19:32           ` 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).