Re: [NTG-context] Weird error when using \startformula inside lua

2021-09-12 Thread Sylvain Hubert via ntg-context
The problem also concerns \starttyping:

\starttext
.
\startluacode
context([[
\starttyping
\stoptyping
]])
\stopluacode
\stoptext

tex error   > runaway error: end of file encountered
mtx-context | fatal error: return code: 256

%

\starttext
.
\startluacode
context([[
\starttyping

foobar
\stoptyping
]])
\stopluacode
\stoptext

tex error   > tex error on line 5 in file ./test.tex:

lua error:

registered function call [1041]:
...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:534: invalid
value (nil) at index 3 in table for '
concat'
stack traceback:
[C]: in function 'table.concat'
...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:534: in
upvalue 'pickup'
...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:677: in
function <...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:668>
(...tail calls...)


Sylvain

On Sat, 11 Sept 2021 at 05:12, Aditya Mahajan via ntg-context <
ntg-context@ntg.nl> wrote:

> I sometimes define lua functions for showing out worked out calculations.
> The following minimal example shows that
>
>   context([[\startformula ... \stopformula]])
>
> fails in LMTX with an error message:
>
> tex error   > tex error on line 3 in file ./test.tex: Undefined
> control sequence \undefined
>
> MWE:
>
> \startluacode
>   thirddata = thirddata or {}
>
>   local comment = [[
> This is a famous formula
> \startformula
>   a^2 + b^2 = c^2
> \stopformula
>   ]]
>
>   function thirddata.explanation()
>   context(comment)
>   end
>
> \stopluacode
>
> \starttext
> \ctxlua{thirddata.explanation()}
> \stoptext
>
> The actual use case is more complicated (where I use templates, so I don't
> want to convert everything to context.startformula() etc.). The example
> compiles with MkIV but not LMTX.
>
> Any idea what is going on?
>
> Thanks,
> Aditya
>
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Weird error when using \startformula inside lua

2021-09-11 Thread Aditya Mahajan via ntg-context
On Sat, 11 Sep 2021, Hans Hagen wrote:

> On 9/11/2021 5:11 AM, Aditya Mahajan via ntg-context wrote:
> > I sometimes define lua functions for showing out worked out calculations.
> > The following minimal example shows that
> > 
> >context([[\startformula ... \stopformula]])
> > 
> > fails in LMTX with an error message:
> > 
> > tex error   > tex error on line 3 in file ./test.tex: Undefined control
> > sequence \undefined
> > 
> > MWE:
> > 
> > \startluacode
> >thirddata = thirddata or {}
> > 
> >local comment = [[
> >  This is a famous formula
> >  \startformula
> >a^2 + b^2 = c^2
> >  \stopformula
> >]]
> > 
> >function thirddata.explanation()
> >context(comment)
> >end
> > 
> > \stopluacode
> > 
> > \starttext
> > \ctxlua{thirddata.explanation()}
> > \stoptext
> > 
> > The actual use case is more complicated (where I use templates, so I don't
> > want to convert everything to context.startformula() etc.). The example
> > compiles with MkIV but not LMTX.
> > 
> > Any idea what is going on?
> \enabletrackers[context*]
> 
> shows that we have an unprotected \startformula so we need this in
> strc-mat.mkxl:
> 
> \permanent\protected\defcsname\e!start\v!formula\endcsname{\strc_formulas_start_formula{}}
> \permanent\protected\defcsname\e!stop
> \v!formula\endcsname{\strc_formulas_stop_formula}
> 
> \permanent\tolerant\protected\def\defineformulaalternative[#1]#*[#2]#*[#3]%
>   {\frozen\instance\protected\defcsname\e!start#1\v!formula\endcsname{#2}%
>\frozen\instance\protected\defcsname\e!stop #1\v!formula\endcsname{#3}}
> 
> (the \protected probably got lost when i added overload protection etc)

Thanks! This fixes the error in my main document as well.

Aditya
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Weird error when using \startformula inside lua

2021-09-11 Thread Hans Hagen via ntg-context

On 9/11/2021 5:11 AM, Aditya Mahajan via ntg-context wrote:

I sometimes define lua functions for showing out worked out calculations. The 
following minimal example shows that

   context([[\startformula ... \stopformula]])

fails in LMTX with an error message:

tex error   > tex error on line 3 in file ./test.tex: Undefined control 
sequence \undefined

MWE:

\startluacode
   thirddata = thirddata or {}

   local comment = [[
 This is a famous formula
 \startformula
   a^2 + b^2 = c^2
 \stopformula
   ]]

   function thirddata.explanation()
   context(comment)
   end

\stopluacode

\starttext
\ctxlua{thirddata.explanation()}
\stoptext

The actual use case is more complicated (where I use templates, so I don't want 
to convert everything to context.startformula() etc.). The example compiles 
with MkIV but not LMTX.

Any idea what is going on?

\enabletrackers[context*]

shows that we have an unprotected \startformula so we need this in 
strc-mat.mkxl:


\permanent\protected\defcsname\e!start\v!formula\endcsname{\strc_formulas_start_formula{}}
\permanent\protected\defcsname\e!stop 
\v!formula\endcsname{\strc_formulas_stop_formula}


\permanent\tolerant\protected\def\defineformulaalternative[#1]#*[#2]#*[#3]%
  {\frozen\instance\protected\defcsname\e!start#1\v!formula\endcsname{#2}%
   \frozen\instance\protected\defcsname\e!stop #1\v!formula\endcsname{#3}}

(the \protected probably got lost when i added overload protection etc)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Weird error when using \startformula inside lua

2021-09-10 Thread Aditya Mahajan via ntg-context
I sometimes define lua functions for showing out worked out calculations. The 
following minimal example shows that 

  context([[\startformula ... \stopformula]]) 

fails in LMTX with an error message:

tex error   > tex error on line 3 in file ./test.tex: Undefined control 
sequence \undefined 

MWE:

\startluacode
  thirddata = thirddata or {}

  local comment = [[
This is a famous formula
\startformula
  a^2 + b^2 = c^2
\stopformula
  ]]

  function thirddata.explanation()
  context(comment)
  end

\stopluacode

\starttext
\ctxlua{thirddata.explanation()}
\stoptext

The actual use case is more complicated (where I use templates, so I don't want 
to convert everything to context.startformula() etc.). The example compiles 
with MkIV but not LMTX.

Any idea what is going on?

Thanks,
Aditya

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Weird error

2014-09-10 Thread Aditya Mahajan

Hi,

There was a question on TeX.SX about an error message
http://tex.stackexchange.com/questions/200474/setuppagenumberinglocation-causes-problem-in-context

The following MWE shows the same error

\setupfootertexts[\namedheadnumber{chapter}]
\setuppagenumbering[location=,alternative=doublesided]

\starttext

\completecontent

\chapter{Creating device driver}

\section{How to create the}

Chapter text

\stoptext

which gives

lua errorerror on line 8 in file /tmp/test.tex:

...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: attempt 
to index field 'numbers' (a nil value)

stack traceback:
...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: 
in function 'getsectionnumber'

[\directlua]:1: in main chunk

The error is weird because it only appears when all parts of the minimal 
example are present. If I comment either or `location=,` or 
`alternative=doublesided` or `\completecontent` or `\section{...}`, the 
error goes away!


Any thoughts?

Aditya
___
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
___


Re: [NTG-context] Weird error

2014-09-10 Thread Wolfgang Schuster

Am 10.09.2014 um 18:37 schrieb Aditya Mahajan adit...@umich.edu:

 Hi,
 
 There was a question on TeX.SX about an error message
 http://tex.stackexchange.com/questions/200474/setuppagenumberinglocation-causes-problem-in-context
 
 The following MWE shows the same error
 
 \setupfootertexts[\namedheadnumber{chapter}]
 \setuppagenumbering[location=,alternative=doublesided]
 
 \starttext
 
 \completecontent
 
 \chapter{Creating device driver}
 
 \section{How to create the}
 
 Chapter text
 
 \stoptext
 
 which gives
 
 lua errorerror on line 8 in file /tmp/test.tex:
 
 ...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: attempt to 
 index field 'numbers' (a nil value)
 stack traceback:
...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: in 
 function 'getsectionnumber'
[\directlua]:1: in main chunk
 
 The error is weird because it only appears when all parts of the minimal 
 example are present. If I comment either or `location=,` or 
 `alternative=doublesided` or `\completecontent` or `\section{...}`, the error 
 goes away!
 
 Any thoughts?


The error arises only when there is no aux file. A alternative to 
\namedheadnumber{XXX} is \getmarking[XXXnumber].

\setupfootertexts[{\getmarking[chapternumber]}]

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
___


Re: [NTG-context] Weird error

2014-09-10 Thread Aditya Mahajan

On Wed, 10 Sep 2014, Wolfgang Schuster wrote:



Am 10.09.2014 um 18:37 schrieb Aditya Mahajan adit...@umich.edu:


Hi,

There was a question on TeX.SX about an error message
http://tex.stackexchange.com/questions/200474/setuppagenumberinglocation-causes-problem-in-context

The following MWE shows the same error

\setupfootertexts[\namedheadnumber{chapter}]
\setuppagenumbering[location=,alternative=doublesided]

\starttext

\completecontent

\chapter{Creating device driver}

\section{How to create the}

Chapter text

\stoptext

which gives

lua errorerror on line 8 in file /tmp/test.tex:

...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: attempt to 
index field 'numbers' (a nil value)
stack traceback:
   ...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: in 
function 'getsectionnumber'
   [\directlua]:1: in main chunk

The error is weird because it only appears when all parts of the minimal 
example are present. If I comment either or `location=,` or 
`alternative=doublesided` or `\completecontent` or `\section{...}`, the error 
goes away!

Any thoughts?



The error arises only when there is no aux file. A alternative to 
\namedheadnumber{XXX} is \getmarking[XXXnumber].

   \setupfootertexts[{\getmarking[chapternumber]}]


Thanks!

Aditya
___
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
___


[NTG-context] weird error: no return code

2010-03-25 Thread Philipp A.
 hi, the following document

\usemodule[tikz]
\starttext
\stoptext

yields the following error:

*
* ConTeXt output:
* cd /home/flyingsheep/Dokumente/LaTeX/ConTeXt/oma
* context --nonstopmode 'a4.tex'
*
This is LuaTeX, Version beta-0.50.0-2010010505
 \write18 enabled.
(/home/flyingsheep/Dokumente/LaTeX/ConTeXt/oma/a4.tex

ConTeXt  ver: 2010.03.20 22:59 MKIV  fmt: 2010.3.25  int: english/english

system  : cont-new loaded
(/usr/local/share/texmf/tex/context/base/cont-new.tex
systems : beware: some patches loaded from cont-new.tex
(/usr/local/share/texmf/tex/context/base/cont-new.mkiv))
system  : cont-fil loaded
(/usr/local/share/texmf/tex/context/base/cont-fil.tex
loading : ConTeXt File Synonyms
)
system  : cont-sys.rme loaded
(/etc/texmf/tex/context/user/cont-sys.rme
(/usr/local/share/texmf/tex/context/base/type-def.mkiv)
(/usr/local/share/texmf/tex/context/base/type-lua.tex)
(/usr/local/share/texmf/tex/context/base/type-siz.tex
(/usr/local/share/texmf/tex/context/base/type-siz.mkiv))
(/usr/local/share/texmf/tex/context/base/type-otf.tex
(/usr/local/share/texmf/tex/context/base/type-otf.mkiv)))
system  : a4.top loaded
(a4.top
)
fonts   : preloading latin modern fonts
bodyfont: 12pt rm is loaded
language: language en is active
(/usr/share/texmf/tex/context/pgf/frontendlayer/t-tikz.tex
(/usr/share/texmf/tex/context/pgf/basiclayer/t-pgf.tex
(/usr/share/texmf/tex/context/pgf/basiclayer/t-pgfcor.tex
(/usr/share/texmf/tex/context/pgf/systemlayer/t-pgfsys.tex
(/usr/share/texmf/tex/context/pgf/utilities/t-pgfrcs.tex
(/usr/share/texmf/tex/context/pgf/utilities/t-pgfmod.tex)
(/usr/share/texmf/tex/generic/pgf/utilities/pgfutil-common.tex)
(/usr/share/texmf/tex/generic/pgf/utilities/pgfutil-context.def)
(/usr/share/texmf/tex/generic/pgf/utilities/pgfrcs.code.tex))
(/usr/share/texmf/tex/generic/pgf/systemlayer/pgfsys.code.tex
(/usr/share/texmf/tex/generic/pgf/utilities/pgfkeys.code.tex)
(/usr/share/texmf/tex/generic/pgf/systemlayer/pgf.cfg)
(/usr/share/texmf/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
(/usr/share/texmf/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def))
(a4.pgf)) (/usr/share/texmf/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex)
(/usr/share/texmf/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex))
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcore.code.tex
(/usr/share/texmf/tex/generic/pgf/math/pgfmath.code.tex
(/usr/share/texmf/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/share/texmf/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/share/texmf/tex/generic/pgf/math/pgfmathparser.code.tex)
(/usr/share/texmf/tex/generic/pgf/math/pgfmathoperations.code.tex
(/usr/share/texmf/tex/generic/pgf/math/pgfmathtrig.code.tex)
(/usr/share/texmf/tex/generic/pgf/math/pgfmathrnd.code.tex))
(/usr/share/texmf/tex/generic/pgf/math/pgfmathbase.code.tex)))
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorequick.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex)
(/usr/share/texmf/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex)))
(/usr/share/texmf/tex/generic/pgf/modules/pgfmoduleshapes.code.tex)
(/usr/share/texmf/tex/generic/pgf/modules/pgfmoduleplot.code.tex))
(/usr/share/texmf/tex/context/pgf/utilities/t-pgffor.tex
(/usr/share/texmf/tex/context/pgf/utilities/t-pgfrcs.tex)
(/usr/share/texmf/tex/generic/pgf/utilities/pgffor.code.tex))
(/usr/share/texmf/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
(/usr/share/texmf/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex)
(/usr/share/texmf/tex/generic/pgf/modules/pgfmodulematrix.code.tex)
(/usr/share/texmf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.texMTXrun
| run 1: luatex
--fmt=/home/flyingsheep/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en
--lua=/home/flyingsheep/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en.lui
--backend=pdf ./a4.tex
MTXrun | fatal error: no return code, message: luatex: execution interrupted

I am using TexLive 2009 full and therefore mkIV

Can somebody help me?

Re: [NTG-context] weird error: no return code

2010-03-25 Thread Taco Hoekwater

Philipp A. wrote:

MTXrun | fatal error: no return code, message: luatex: execution interrupted

I am using TexLive 2009 full and therefore mkIV

Can somebody help me?


This is a hard crash. You appear to be running the latest context
and luatex 0.50 (not the ones on texlive) so you could try updating
luatex again.

The easiest would be to fetch a new binary from the context minimals,
but it looks like the minimals are not quite up to speed with the luatex
releases yet, so you may have to build 0.52.0 from source:

http://foundry.supelec.fr/gf/project/luatex/frs/

Best wishes,
Taco


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