[NTG-context] Re: Mikael’s missing math manual

2024-03-18 Thread Aditya Mahajan
On Mon, 18 Mar 2024, Mikael Sundqvist wrote:

> > One participant tested some math alignment examples from an older paper
> > by Aditya and found them working in her current LMTX installation but
> > not in COW – I know it runs an older version, but Aditya’s article was
> > even older…
> 
> There have been many changes along the way, and maybe at some time
> some things were not really working, but later fixed.

In any case, it will be good to have examples of something that breaks. 
Usually, it is due to minor change in the syntax and easily fixable. 

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


[NTG-context] Re: PDF, runner, and TikZ patches

2024-03-14 Thread Aditya Mahajan
On Thu, 14 Mar 2024, Jim wrote:

> Max (et al),
> 
> were you hoping the ConTeXt distribution would ship its own
> pgfutil-context.def, or were you hoping that someone could convince Henri
> to put the RGB change in?

We can patch some of the definitions of pgfutil-context.def in m-tikz if really 
needed, but it would be preferable to first check if tikz maintainers are 
willing to merge them upstream. 

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


[NTG-context] Re: has the statistical charts module a new home?

2024-03-11 Thread Aditya Mahajan
On Mon, 11 Mar 2024, Henning Hraban Ramm wrote:

> Hi Tomáš et al.,
> 
> the site https://akela.mendelu.cz/~thala/statcharts/ and actually the whole
> server disappeared.
> 
> Is there a new download location for the charts module?

There is a version on internet archive:

https://web.archive.org/web/20230603222611/https://akela.mendelu.cz/~thala/statcharts/

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


[NTG-context] Re: Strange error at lxml-mms.lmt:749

2024-02-25 Thread Aditya Mahajan
On Sun, 25 Feb 2024, Andres Conrado Montoya wrote:

> Another remark: It seems this behavior is consistent: if I comment out the
> last equation before the one I told you before, again the next formula
> works fine,

Would it be possible to create a reproducible example?

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


[NTG-context] Re: An announcement of my new book.

2024-02-15 Thread Aditya Mahajan
On Thu, 15 Feb 2024, Mikael Sundqvist wrote:

> Hi,
> 
> This small example from BachoTeX 2023 could perhaps be useful for
> someone: https://github.com/mpsmath/stepbystep

For tutorials, I had played around with using a git repo as a tutorial:

https://github.com/adityam/context-slides-example/commits

The following page is generated automatically from the git commit log:
https://adityam.github.io/context-blog/post/presentation-40-commits-redux/

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


[NTG-context] Re: \starttable questions

2024-01-26 Thread Aditya Mahajan
On Thu, 25 Jan 2024, Jim wrote:

> The nice thing about your setup above is that it is nice and structured.
> But if a table calls for some row, column or cell to be treated
> differently, I guess I am in for some more reading.

You can do: \setupTABLE[2][3] to select the formatting for row 3 and column 2 
(or the other way around ... always forget). In the worst case, you can always 
do 

...
\NC .. \NC[options] ... \NC \NR


Each cell is just a \framed[...]; so all options for \framed[...] work for 
Natural Tables. 

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


[NTG-context] Re: \starttable questions

2024-01-25 Thread Aditya Mahajan
On Thu, 25 Jan 2024, Jim wrote:

> On Thu, Jan 25, 2024 at 17:30 (+0100), Aditya Mahajan wrote:
> 
> > I haven't looked at starttable in well over a decade, but I did document 
> > some of it:
> 
> > https://www.tug.org/TUGboat/Articles/tb28-3/tb90mahajan.pdf
> > https://www.tug.org/TUGboat/Articles/tb29-1/tb91mahajan.pdf
> 
> Aditya,
> 
> thanks for those links.  Would you mind if I added them to the "See also"
> section of the \starttable wiki page (notwithstanding someone's claim at the
> top of the page saying they are obsolete)?

Of course that's okay. It's a wiki1

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


[NTG-context] Re: \starttable questions

2024-01-25 Thread Aditya Mahajan
On Thu, 25 Jan 2024, Jim wrote:

> In a recent answer on this list, Mikael helped someone by pointing out the
> \HF[...] command.  The \HF command is not listed in the \starttable wiki page.
> 
> Q2: Is \HF[] documented anywhere?  If so, can someone point me to that/those
> document(s)?
> 
> 
> 
> Perhaps an answer to Q2 will answer this one too, but in case it doesn't...
> 
> When using Wichura's \BeginTable ... \EndTable macros, I occasionally
> use the \\+nm feature to add n points above the current line and/or m
> points below the current line.
> 
> Q3: Does ConTexT's \starttable ... \endtable have this feature?
> If so, how does one access this feature?

I haven't looked at starttable in well over a decade, but I did document some 
of it:

https://www.tug.org/TUGboat/Articles/tb28-3/tb90mahajan.pdf
https://www.tug.org/TUGboat/Articles/tb29-1/tb91mahajan.pdf

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


[NTG-context] Re: Caching Metafun images and VIM Syntax highlighted code

2024-01-24 Thread Aditya Mahajan
On Wed, 24 Jan 2024, Shiv Shankar Dayal wrote:

> Perhaps Aditya Mahajan can tell me how can I cache code snippets. Invoking
> VIM will have heavy penalty on highlighting the code otherwise.

Have you tried the vim module:

https://github.com/adityam/filter/blob/dev/vim-README.md

Caching is enabled out of the box, so you don't need to configure anything.

> Other than that, how can I cache Metafun images so that they are not
> recomputed on every processing of file.

There used to a command for caching metafun images in MkII, but I don't know if 
that is really needed in LMTX. In most cases, metapost processing does not have 
a significant processing delay. 

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


[NTG-context] Re: Why LuaMetaTex is so slow?

2024-01-18 Thread Aditya Mahajan
On Fri, 19 Jan 2024, Hans Hagen via ntg-context wrote:

> On 1/19/2024 12:34 AM, Aditya Mahajan wrote:
> > On Thu, 18 Jan 2024, Hans Hagen wrote:
> > 
> >> Of course we'll never be as fast as (pure) plain tex (no layers added) or
> >> latex (which often is advocated as faster than context).
> > 
> > I was curious, so did a quick experiment: typeset \input knuth 500 times.
> > Here are the results:
> > 
> > pdflatex: 547 pages/sec
> > lualatex: 308 pages/sec
> 
> opentype or type 1 ?

type 1. I did not change anything in the defaults. I'll try to figure out how 
to load opentype fonts in latex, and test lualatex. 

> > MKIV: 130 pages/sec
> > LMTX: 147 pages/sec
> 
> that is weird as lmtx is always faster here (we loose some 15% on the backend
> compared to luatex, maybe even more, but we gain back quite a bit elsewhere
> for various reasons)

LMTX is faster for me as well.

> > Interestingly, pdflatex, lualatex, and MkIV all generated pdf with 1112
> > pages, while LMTX generated a pdf with 1250 pages. Both MkIV and LMTX take
> > the same time to run (8.5 sec) but LMTX generates more pages so it is
> > faster.
> 
> puzzling
> 
> > Of course, this is a meaningless experiment from a practical point of view
> > as a 1000 page document will be more complex than just text.
> % engine=pdftex  1.2
> % engine=luatmetatex 1.6
> % engine=luatex  1.8
> % engine=xetex   2.4
> 
> \starttext
> 
> \dorecurse{500} {
> \input knuth \par
> }
> 
> \stoptext
> 
> 125 pages, so how does your test file look

5000 recursions (not 500, sorry about that). 


\starttext

\dorecurse{5000}{\ReadFile{knuth}}

\stoptext

I'll send you the PDFs offlist. 

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


[NTG-context] Re: Why LuaMetaTex is so slow?

2024-01-18 Thread Aditya Mahajan
On Thu, 18 Jan 2024, Hans Hagen wrote:

> Of course we'll never be as fast as (pure) plain tex (no layers added) or
> latex (which often is advocated as faster than context).

I was curious, so did a quick experiment: typeset \input knuth 500 times. Here 
are the results:

pdflatex: 547 pages/sec
lualatex: 308 pages/sec

MKIV: 130 pages/sec
LMTX: 147 pages/sec

Interestingly, pdflatex, lualatex, and MkIV all generated pdf with 1112 pages, 
while LMTX generated a pdf with 1250 pages. Both MkIV and LMTX take the same 
time to run (8.5 sec) but LMTX generates more pages so it is faster. 

Of course, this is a meaningless experiment from a practical point of view as a 
1000 page document will be more complex than just text.

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


[NTG-context] Re: Linebreak in formual

2024-01-15 Thread Aditya Mahajan
On Mon, 15 Jan 2024, Mikael Sundqvist wrote:

> Hi,
> 
> you can try something like
> 
> \sum_{\mstack{k=0, k\equiv p + 1 (\mtext{mod }2)}}^{p -1}
> 
> but it will not be too pretty with such a large sub-index to the sum.

There is also 

\sum_{\startsubstack \NC a \NR \NC b \NR \stopsubstack}

which imitates the \substack command from latex. 

OT but it is better to use one of \mod, \pmod, \bmod, rather than explicit 
\mtext{mod }. 

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


[NTG-context] Re: Looking for itemize help

2024-01-15 Thread Aditya Mahajan
On Mon, 15 Jan 2024, Jim wrote:

> Thoughts?


\startitemize[nowhite, after]
  . . .
\stopitemize

See: https://adityam.github.io/context-blog/post/spacing-in-itemize/

Aditya

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


[NTG-context] Re: Do we have a geometry library for Metafun?

2024-01-12 Thread Aditya Mahajan
On Fri, 12 Jan 2024, Shiv Shankar Dayal wrote:

> Do we have a geometry library for common operations like finding tangents,
> perpendiculars, circumcircle, orthocenters and such?

No library that I know of, but drawing tangents (and therefore, perpendiculars) 
is straight-forward:

   https://tex.stackexchange.com/a/108060/323

Circumcircle, orthocenter, etc... are you thinking of triangles or general 
polynomails?

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


[NTG-context] Re: Question to a formular

2024-01-05 Thread Aditya Mahajan
On Fri, 5 Jan 2024, Ursula Hermann wrote:

> Dear list,
> 
> 
> I have this formular, but no idea , how to write it in Context. This is a 
> formular  with  factorial.
> 
> 
> 0! := 1
> (n + 1)! := (n + 1) n!
> 
> Can someone help me please?

\starttext
\startformula \startalign
  \NC 0! \NC \colonequals 1 \NR
  \NC (n+1)! \NC \colonequals (n+1) n! \NR
\stopalign \stopformula
\stoptext

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


[NTG-context] Re: Status of Asymptote

2023-12-30 Thread Aditya Mahajan
On Sun, 31 Dec 2023, Shiv Shankar Dayal wrote:

> It would be nice to either support Metapost 3D or Asymptote. Right now I
> generate images separately and embed them in PDF using externalfigure command 
> which works but I have to maintain all the graphics separately.

It is possible to obtain simple integration for asymptote using the filter 
module:

  https://github.com/adityam/filter

Using that you could define an asymptote environment so that:

\startbuffer[asymptote-preamble]

\stopbuffer

\starttext

\startasymptote
% Asymptote figure
\stopasymptote

\stoptext

saves the content of the asymptote-preamble and the figure in a separate file, 
runs asymptote to generate a PDF figure and includes the figure. The results 
are cached so the asymptote is re-run only if the content of the figure 
environment changes. 

A drawback of this approach is that the labels are generated by asymptote. That 
means that the font, colors, and any macros needed for the figures need to be 
redefined at both context and asymptote end. 

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


[NTG-context] Re: increase vertical between underbrace and equation

2023-12-18 Thread Aditya Mahajan
On Mon, 18 Dec 2023, Aditya Mahajan wrote:

> On Mon, 18 Dec 2023, Dean Hung wrote:
> 
> > The documentation on underbrace (and overbrace, underbracket, etc...) in
> > the ContextGarden wiki seems to be very limited, and I was not able to find
> > any user-supplied arguments for increasing this vertical distance.
> > 
> > There are various solutions available for LaTex, and they require external
> > packages (e.g., BigStrut, vphantom) that redefine the strut height.
> > 
> > I hope I'm missing something simple... Any help would be greatly
> > appreciated!
> 
> Hey, this is context. We don't need any packages for simple stuff:
> 
> \startformula
> \underbrace[mindepth=1cm]{x+y+z}_{\mathrm{my text here}}
> \stopformula

Actually, realized that you want more distance in the other direction. One 
option is to use \vrule.

\underbrace{x+y+z}_{\vrule width 0pt height 1cm\relax\mathrm{my text here}}

You probably also want \text{...} instead of \mathrm{...}.

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


[NTG-context] Re: increase vertical between underbrace and equation

2023-12-18 Thread Aditya Mahajan
On Mon, 18 Dec 2023, Dean Hung wrote:

> Hi ConText friends,
> 
> I am trying to increase the vertical distance between the underbrace and
> the part of the equation above the underbrace.
> 
> \startformula
> \underbrace{x+y+z}_{\blank[1cm]\mathrm{my text here}}
> \stopformula
> 
> I've tried using \blank and \vspace, but to no avail.  For example:
> 
> \underbrace{x+y+z}_{\blank[1cm]\mathrm{my text here}}
> ...does not work.
> 
> The documentation on underbrace (and overbrace, underbracket, etc...) in
> the ContextGarden wiki seems to be very limited, and I was not able to find
> any user-supplied arguments for increasing this vertical distance.
> 
> There are various solutions available for LaTex, and they require external
> packages (e.g., BigStrut, vphantom) that redefine the strut height.
> 
> I hope I'm missing something simple... Any help would be greatly
> appreciated!

Hey, this is context. We don't need any packages for simple stuff:

\startformula
\underbrace[mindepth=1cm]{x+y+z}_{\mathrm{my text here}}
\stopformula


Aditya



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


[NTG-context] Re: error with definestartstop and startmode

2023-12-18 Thread Aditya Mahajan
On Sun, 17 Dec 2023, Wolfgang Schuster wrote:

> Peter Münster schrieb am 17.12.2023 um 10:09:
> > On Sat, Dec 16 2023, Hans Hagen via ntg-context wrote:
> >
> >> \usemodule[abbreviations-logos]
> >> \defineblock [H] [before=\startcolor[blue],after=\stopcolor]
> >> \keepblocks[H]
> > Thanks for this solution.
> >
> > Is there also something for inline-mode? Example:
> >
> > test \beginH TEST\endH test
> 
> You can create different versions of your environment and let context choose
> one whether the mode is enabled or disabled.
> 
> %\enablemode[H]
> 
> \startmode [H]
>   \definestartstop [H] [color=blue]
> \stopmode
> 
> \startnotmode [H]
>   \define\startH{\ignoreupto\stopH}
> \stopnotmode
> 
> \starttext
> 
> xxx \startH yyy \stopH zzz
> 
> \stoptext

I do something similar:

\definebuffer[H]

\startmode[H]
  \definestartstop[H][color=blue]
\stopmode

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


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Aditya Mahajan
On Sat, 9 Dec 2023, Wolfgang Schuster wrote:

> \starttext
> 
> \startlines
> \type{\frac{1}{3}}: \m{\frac{1}{3}}
> \type{\xfrac{1}{3}}: \m{\xfrac{1}{3}}
> \type{\xxfrac{1}{3}}: \m{\xxfrac{1}{3}}
> \type{\tfrac{1}{3}}: \m{\tfrac{1}{3}}
> \type{\sfrac{1}{3}}: \m{\sfrac{1}{3}}
> \type{\frac{1}{3}}: \m{\frac{1}{3}}
> \type{\dfrac{1}{3}}: \m{\dfrac{1}{3}}
> \type{\cfrac{1}{3}}: \m{\cfrac{1}{3}}
> \type{\vfrac{1}{3}}: \m{\vfrac{1}{3}}
> \type{\hfrac{1}{3}}: \m{\hfrac{1}{3}}
> \stoplines
> 
> \stoptext

Or, for inline math, $\sqrt{1/3}$. 

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


[NTG-context] Re: multipage metapost output from ConTeXt

2023-11-27 Thread Aditya Mahajan
On Mon, 27 Nov 2023, Fabrice L wrote:

> Hi,
> 
> It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage 
> multiple times. Here is an example which build an animation of a particle 
> moving according to a Brownian motion. 

A very similar option is to pass a variable to a metapost drawing. This is what 
I use:

https://adityam.github.io/context-blog/post/metapost-animation/

It only works when viewed in acrobat, you can just comment out the animation 
part and wrap it in \startTEXpage .. \stopTEXpage to get multi-page animation.

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


[NTG-context] Re: externalfigure crashed

2023-11-22 Thread Aditya Mahajan
On Wed, 22 Nov 2023, Wolfgang Schuster wrote:

> Hans van der Meer schrieb am 22.11.2023 um 21:22:
> > The problem persists. Here the new logfile.
> 
> 1. What is the version of your Luametatex binary?
> 
>     luametatex --version
>     This is LuaMetaTeX, Version 2.10.11

For me, it is the same:

This is LuaMetaTeX, Version 2.10.11

> 
> 2. What do you get in your log-file with the following example!
> 
>     \starttext
>     \show\expandeddetokenize
>     \stoptext
> 
> On my system I can find the following line:
> 
>     > \expandeddetokenize=primitive \expandeddetokenize

\expandeddetokenize=undefined

Not sure why this is the case!

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


[NTG-context] Re: externalfigure crashed

2023-11-22 Thread Aditya Mahajan
On Wed, 22 Nov 2023, Wolfgang Schuster wrote:

> Hans van der Meer via ntg-context schrieb am 22.11.2023 um 20:55:
> > When \externalfigure could not find the file it used to graciously place a
> > rectangle kindly telling the user that the file has not been found.
> > But now, however, it seems the default in this case is a crash. Very
> > annoying in comparison with the earlier behaviour.
> > I might make a mistake, but the MWE is as simple as can be.
> 
> Can you update your ConTeXt installation and check if the error remains,
> I tries to your example on my machine (Windows 11) and wasn't able
> to reproduce the problem.

I get the same error on linux. I am using 2023.09.26 which appears to be the 
latest version available for linux.

The issue is that \expandeddetokenize used in the definition of 
grph_include_replacement is not defined.

A simple \def\expandeddetokenize{\relax} fixes the error, but clearly that is 
not a proper solution.

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


[NTG-context] Re: It works after a few changes but ..

2023-11-17 Thread Aditya Mahajan
On Fri, 17 Nov 2023, Ursula Hermann wrote:

> Dear List,
> After a few changes i have here an example:
> It works, but what I wanted to know is why are there
> 
> round brackets after writing \starttheroem if i compile it.
> Should be without round brackets.

Are you looking for something like this?

\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.5em,
alternative=serried,
  ]

\starttext
  \starttheorem 
The square on the hypotenuse is equal to the sum of the squares on the
other two sides. Ach is das schön, dass du da bist
  \stoptheorem
\stoptext

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


[NTG-context] Re: ConTeXt support for Nova text editor (MacOS)

2023-11-11 Thread Aditya Mahajan
On Sat, 11 Nov 2023, Paul Mazaitis wrote:

I don't use MacOS, but ...

> (As an aside, this extension uses an updated version of the ConTeXt 
> tree-sitter parser [https://github.com/pmazaitis/tree-sitter-context] that 
> can now recognize (most) environments and use them to parse out the document 
> hierarchy.)

Last time I checked tree-sitter on neovim, there were no good tree-sitters for 
context. I'd be interested in testing this out. 

Does the parser detect nested metapost and luatex environments?

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


[NTG-context] Re: Example is not working

2023-11-03 Thread Aditya Mahajan
On Fri, 3 Nov 2023, Ursula Hermann wrote:

> Dear List,
> i hope somone can help me.

\starttext ... \stoptext is missing!

> This litte example is from the wiki, i wanted to try \placeformula

\starttext
> \placeformula[formula:aformula]
> \startformula
> y=x^2
> \stopformula
> \placeformula
> \startformula
> \int_0^1 x^2 dx
> \stopformula
\stoptext


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


[NTG-context] Re: typearea

2023-11-01 Thread Aditya Mahajan
On Sun, 29 Oct 2023, Henning Hraban Ramm wrote:

> Am 29.10.23 um 11:37 schrieb Thomas Meyer:
> > Hi,
> > I'm new to ConTeXt and try to use the module typearea
> > (https://modules.contextgarden.net/cgi-bin/module.cgi/action=find/name=typearea).
> > But the example doesn't work:
> 
> The module is from 2008, i.e. MkII. You can’t expect it to work with
> MkIV/LMTX.

Perhaps one option can be to ask module authors to rename mkii only modules to 
t-*.mkii, so that they are not loaded in mkiv/lmtx. 

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


[NTG-context] Re: Combining python and lua

2023-10-25 Thread Aditya Mahajan
On Wed, 25 Oct 2023, Alexandre Christe wrote:

> Dear list,
> 
> I’d like to know the best approach to make this a bit more usable. I’m trying 
> to typeset a table with sin/cos/tan values. I’d like to be able to convert 
> the angles in degrees into radians (with math notation) and to compute the 
> trigonometric function leading to sin(pi/4) = 1/2, or cos(pi/6) = sqrt(3)/2 
> and display it in math mode.
> 
> Here’s my current MWE, where I fail to convert the angles in radians 

there is math.sind, cosd, etc. for computing sin for angle in degrees. The 
implementation is l-math.lua is:

local pipi = 2*math.pi/360

function math.sind(d) return sin(d*pipi) end
function math.cosd(d) return cos(d*pipi) end
function math.tand(d) return tan(d*pipi) end

> and fail to display the result in symbolic form.

Context doesn't do symbolic math. You can try checking if one of the symbolic 
math libraries in lua provides all the features that you want.

> One possible way would be to use Python and the t-filter module, like this

This can work as follows. Take the array of angles, and convert them to the 
desired format in python and write them to a temp file. Read that temp file in 
lua and typeset it as you want.

Another option is an old proof of concept by Luigi: 
https://github.com/bastibe/lunatic-python which allowed two-way communication 
between python and luatex. Not sure if it still works.

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


[NTG-context] Re: numbered itemize list item label alignment

2023-10-15 Thread Aditya Mahajan
On Sun, 15 Oct 2023, Wolfgang Schuster wrote:

> Csikos Bela schrieb am 15.10.2023 um 15:51:
> > Hello:
> >
> > I would like to make a long numbered itemize list, where the numbers
> > increase up to three digits.
> > I would like the numbered labels aligned to the right and the widest
> > label's left side located at the left margin.
> > I tried the below code but the 3 digit labels' left sides go into the left
> > margin. How can I fix it?
> >
> > Code:
> >
> > \showframe
> > \starttext
> > \startitemize[n,broad][itemalign=flushright]
> > \dorecurse{250}{\item }
> > \stopitemize
> > \stoptext
> 
> You can use the width-key to set a value for the number, below is a example
> for method
> to calculate the width based on the number of items but I would use fixed
> value
> (e.g. width=2em) to let all items (independent of the entries) start on the
> same position.

I normally use the `fit` key with an appropriate value of `distance`. For 
example:

\showframe[text][text]

\starttext

\startitemize[n,fit,broad][distance=0.25em,itemalign=flushright]
\dorecurse{1}{\startitem xxx\stopitem}
\stopitemize

\page

\startitemize[n,fit,broad][distance=0.25em,itemalign=flushright]
\dorecurse{11}{\startitem xxx\stopitem}
\stopitemize

\page

\startitemize[n,fit,broad][distance=0.25em,itemalign=flushright]
\dorecurse{111}{\startitem xxx\stopitem}
\stopitemize

\stoptext

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


[NTG-context] Re: bibliography questions

2023-10-03 Thread Aditya Mahajan
On Tue, 3 Oct 2023, Henning Hraban Ramm wrote:

> For my ConTeXt book, I thought it would make sense, and I would jump through
> some hoops just to use the system, but
> – most sources that I want to list are never quoted (method=dataset)
> – I would need to define my own rendering, e.g. don’t like the handling of
> names
> – I need additional fields (custom rendering again)
> – if I refer to sources, I want a URL or file path in a footnote (custom cite 
> wrapper macro)

When I have to write your own rendering, I find it more convenient to use 
XML/JSON (or even a lua table) as a starting format.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] formula alignment for mathalign

2023-09-28 Thread Aditya Mahajan
Hi,

The `align` parameter of `\setupformulas` is ignored in mathalign. Consider the 
following MWE:

\setupformulas[align=flushleft,leftmargin=2em]

\starttext
\startformula 
  A = B
\stopformula

vs

\startformula \startalign
  \NC A \NC B \NR
  \NC A \NC B \NR
\stopalign \stopformula
\stoptext

The first display formula is flush left, but the aligned formula is centered on 
the page. This appears to be a regression compared to MkIV, where the above 
example works correctly.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: stackrel in context?

2023-09-21 Thread Aditya Mahajan
On Thu, 21 Sep 2023, Mikael Sundqvist wrote:

> Nice with offset=auto. It is not clear to me what the intent/meaning
> is of the original example, but one can also try the 23DC (can extend
> as \overparent):

https://tex.stackexchange.com/questions/128625/how-to-put-smallsmile-or-smallfrown-on-top-of-a-letter

I guess, some book/paper somewhere introduced it as an accent, and now others 
follow the same style.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: stackrel in context?

2023-09-21 Thread Aditya Mahajan
On Thu, 21 Sep 2023, Hans Hagen wrote:

> a teaser for Aditya:
> 
> \definemathstackers[toprel][top][mathclass=\mathrelationcode]
> \definemathstackers[topbin][top][mathclass=\mathbinarycode]
> 
> \definemathextensible[toprel][frownedupon]["2322]
> \definemathextensible[topbin][frowned]["2322]
> 
> \starttext
> $x \frownedupon{4} y + \frowned{!} z = 10$
> \stoptext

Interesting, but I think that the OP wanted to use \frown as an accent, 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: stackrel in context?

2023-09-21 Thread Aditya Mahajan
On Thu, 21 Sep 2023, Xavier B. wrote:

> Hi,
> 
> I want to write:
> 
> $0,00\stackrel{\smallfrown}{4}$
> 
> like latex 
> [https://tex.stackexchange.com/questions/39225/differences-between-stackrel-and-stackbin]
> 
> but context LMTX does not recognize stackrel
> 
> What can I do?

\stackrel is defined in context (with almost the same definition as latex). You 
get an error because \smallfrown is not defined. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Different behavior of \clf_lastypos vs \clf_lastxpos

2023-09-16 Thread Aditya Mahajan
Hi,

I am trying to debug an unexpected behavior with tikz reported on tex.se: 
https://tex.stackexchange.com/q/696136/323

The attached file shows what is going wrong (without using tikz). For some 
reason, there is an extra \relax written to file after 
`\the\numexp\clf_lastypos\relax` (there is no such relax after 
`\the\numexpr\clf_lastxpos\relax`). The test.pgf file is:

  \macro {A}{23930350}{43358454.0\relax }
  \macro {B}{39564274.0\relax }{14083538}

Any ideas on why is the extra \relax written after lastypos and how to fix that?

Aditya


t1.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Tikz calendar problem.

2023-09-05 Thread Aditya Mahajan
On Mon, 4 Sep 2023, Fabrice L wrote:

> Dear list,
> 
> I have a problem with tikzCalendar on a recent installation. This minimal 
> example :
> 
> 8< 
> 
> \usemodule[tikz]
> \usetikzlibrary[calendar]
>  
> \starttext
> This should works:
> \blank
> \tikz  \calendar[dates=2000-01-01 to 2000-01-31,week list];
> \blank
> but this does not !
> \stoptext
> 
> 8< 
> 
> should work, but does not. The problem seems to be here:
> 
> open source > level 2, order 61, name 'tikzlibrarycalendar.code.tex'
> modules > 'pgfcalendar' is not found
> close source> level 2, order 61, name ‘tikzlibrarycalendar.code.tex'
> 
> The file « tikzlibrarycalendar.code.tex » is read, but the file « pgfcalendar 
> » seems missing. I have reinstall a new standalone version of ConTeXt, with 
> all the modules (with the new script from ConTeXt Garden), but nothing works. 

Here is what is going on:

`tikzlibrarycalendar.code.tex` contains the line:

  \pgfutil@usemodule{pgfcalendar}

In `generic/pgf/utilities/pgfutil-context.def`, \pgfutil@usemodule is defined 
as:

  \def\pgfutil@usemodule#1{\usemodule[#1]}

which is supposed to load the file `plain/pgf/utilities/pgfcalendar.tex` which 
just a wrapper to load `pgfcalendar.code.tex`:


\edef\pgfcalendaratcode{\the\catcode`\@}
\catcode`\@=11

\input pgfrcs.tex
\input pgfcalendar.code.tex

\catcode`\@=\pgfcalendaratcode

\endinput

Now, the reason that this is not working is that the new module installer for 
tikz removes all the files from `tex/plain`. It appears that tikz is at fault 
here. If the file `pgfcalendar.tex` is supposed to used by both plain and 
context, then it should be in `tex/generic` directory rather than `tex/plain` 
directory. 

However, moving the file to `tex/generic` will not fix the issue directly 
loading the above `pgfcalendar.code.tex` in context is surely going to fail 
because of the manual catcode changes that are being done by pgfcalendar. 

So, I propose that we add a file `m-tikz-pgfcalendar.tex` as a wrapper around 
`pgfcalendar.code.tex` and in `m-tikz.mk(xl|iv)` add


  \definefilesynonym [pgfcalendar]  [tikz-pgfcalendar]


I am attaching `m-tikz-calendar` which causes the original example to compile 
(provided one adds the definefilesynonym before calling 
\usetikzlibrary[calendar]). Can you please test if other features of 
pgfcalendar are working with this file.

Aditya



m-tikz-calendar.tex
Description: m-tikz-pgfcalendar.tex
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: An error which is not in .log file

2023-08-16 Thread Aditya Mahajan
On Wed, 16 Aug 2023, Wolfgang Schuster wrote:

> 3. \starttikzpicure doesn't allow arguments which results in font error
> messages (char ... missing). This is an error in the ConTeXt version of the
> \starttikzpicture command and should be fixed.

Looking at m-tikz.mkxl, \starttikzpicture should allow optional arguments. The 
following works correctly for me with ver 2023.07.18:

\usemodule[tikz]
\usetikzlibrary[patterns]
\starttext
\starttikzpicture[scale=0.75]
% recipient
\draw (0,0) -- (0,10) -- (2,10) -- (2,0) -- cycle;

% aigua
\filldraw[pattern=north east lines, pattern color=orange] (0,0) -- 
(0,4) -- (2,4) -- (2,0) -- cycle;
\draw (1,2) node[fill=white] {aigua};

% oli
\filldraw[pattern=dots, pattern color=blue] (0,4) -- (0,6.5) -- (2,6.5) 
-- (2,4) -- cycle;
\draw (1,5.25) node[fill=white] {oli};

% ròtuls
\draw (2,2) node[anchor=west] {$2/5$};
\draw (2,5.25) node[anchor=west] {$1/4$};
\stoptikzpicture
\stoptext

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Very strange error:

2023-08-15 Thread Aditya Mahajan
On Mon, 14 Aug 2023, Xavier B. wrote:
> > Can you show the text (and commands) which appears on line 540 (plus a 
> > few lines before/after line 540) of your document.
> > 
> I attach the dev.log and dev-error.log. Is it enough?

You should show a *complete* context source document that generates the error. 
See 

https://tex.meta.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-working-example-mwe-what-is-that

(Most of the advice here is latex specific, but the idea is the same for 
context).

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Link from a PDF to a reference of an embedded PDF

2023-07-24 Thread Aditya Mahajan
On Mon, 24 Jul 2023, Gerion Entrup wrote:

> Hi Pablo,
> 
> > not sure I’m getting your point right.
> 
> Thank you for the detailed answer.
> But I fear, I have not expressed myself precise enough.
> The solution that you described does not directly fit to my setting.
> I'll try to rephrase. Maybe it gets more clear then. I think, named
> destinations could be a important part in the solution.
> 
> I'm do not know the structure of PDFs exactly, therefore some of my
> terms might be wrong. I'll name the two things from now on the following
> way:
> - a destination: This is a defined position within a PDF document; so
>   some position that a PDF viewer is able to jump to. In ConTeXt, you
>   can set such a position most of the time with the "reference" keyword.
>   In LaTeX, you use \label.
> - a reference: This is a link that you can click on and cause the
>   PDF viewer to jump/scroll to the linked destination. In ConTeXt, you
>   can use \in to create a reference. In LaTeX, you use \ref.
> 
> The situation is that I have a PDF-document (inner.pdf) that defines
> several destinations and I want to embed that document with
> \externalfigure into another PDF-document (outer.pdf). My question is:
> Is it possible to create references within the source code of outer.pdf
> that correctly set a link to a destination that is defined in inner.pdf?
> Asked in another way: Is is possible that \externalfigure can extract
> the (maybe named) destinations of inner.pdf and translate them in such a
> way, that I can use \in within the outer document to link to them.

According to https://wiki.contextgarden.net/Command/setupexternalfigure

\externalfigure[][interaction=reference]

should keep all the references (you can also try interaction=all). Not sure how 
the references get mapped internally, so that they may be linked. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: About Pgfplot.-

2023-07-22 Thread Aditya Mahajan
On Sat, 22 Jul 2023, Freddy Omar López Quintero wrote:

> I’m trying to reproduce the example in https://wiki.contextgarden.net/Pgfplot 
> and I’m getting this error:

That example is a little hard to test because you need to download a bunch of 
data files to test it, but pgfplots is working in the latest version.

> I’m on macOS 13.4.1 and this is the version of context I’m running:
> 
> > context --version 
> mtx-context | ConTeXt Process Management 1.04
> mtx-context |
> mtx-context | main context file: 
> /usr/local/texlive/2023/texmf-dist/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2023.03.10 12:15
> mtx-context | main context file: 
> /usr/local/texlive/2023/texmf-dist/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2023.03.10 12:15

Tikz (and related modules) needed to be adapted for LMTX, and this was done 
around April or May. So you will need to upgrade. 

If texlive does not include the latest version, then you would need to manually 
install context lmtx: https://wiki.contextgarden.net/Installation

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: context-on-web broken

2023-07-07 Thread Aditya Mahajan
On Mon, 26 Jun 2023, Hans Hagen via ntg-context wrote:

> On 6/26/2023 7:53 PM, Aditya Mahajan via ntg-context wrote:
> > On Mon, 26 Jun 2023, Miguel Diaz via ntg-context wrote:
> > 
> >> indeed it is a simple simulation of overleaf (for latex).
> > 
> > FWIW, context works on overleaf as well!
> > 
> > Simply create a `latexmkrc` file with the following content:
> > 
> > ```
> > $pdflatex="context --synctex=1 --result=output %S; cp output.log
> > /compile/output.log;cp output.pdf /compile/output.pdf";
> > $recorder=0;
> > $pdf_mode=1;
> I found back this link:
> 
> https://davidcarlisle.github.io/latexcgi/testc
> 
> 
> % !TEX mtxrun --script context
> 
> \starttext
> 
> \dorecurse{500}{\samplefile{tufte}\par}
> 
> \stoptext
> 
> Runs 113 pages in 1.13 sec so quite ok for a remote un I guess.
> 
> I'm not sure how up to date it is.

2023.05.05 18:36, so very recent.

https://texlive.net/run?%25!TEX%20mtxrun%20--script%20context%0A%0A%5Cstarttext%0A%5Ccontextversion%0A%5Cstoptext%0A

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Arch linux package for context lmtx

2023-07-05 Thread Aditya Mahajan
Hi,

I maintained a AUR (Arch User Repository) package for context lmtx which was 
called luametatex. 

Arch recently introduced an official extra package for luametatex (the binary) 
called ... well ... luametatex, which means that my package has a name conflict 
with the official package and hence was deleted. 

Arch also now provides an official texlive-context package for context. I 
assume that it syncs with texlive. At present, texlive-context includes ConTeXt 
2023.03.10. 

So, I think that the AUR package is still useful. It is essentially just a 
wrapper around the official install scripts and provides the latest release of 
context lmtx (and user modules). So, I am renaming my old `luametatex` package 
and am re-releasing it as `context-lmtx-bin`. 

To use it: 

git clone https://aur.archlinux.org/context-lmtx-bin.git
cd context-lmtx-bin
makepkg
sudo pacman -U context-lmtx-bin-.pkg.tar.zst

This will install context lmtx in /opt/context-lmtx. This is in parallel with 
any system installed context. I also keep the old .tar.zst files around. That 
makes it easy to revert back to a previous version in case there is something 
that doesn't work as expected in the latest release. 

Note that by default the following third user modules are installed:

'filter' 'visualcounter' 'vim' 'tikz' 'typescripts'

This is obviously a biased list corresponding to what packages I use. To 
install other packages, simply open the PKGBUILD file and change the _module 
variable defined as:

_modules=('filter' 'visualcounter' 'vim' 'tikz' 'typescripts')

You can change it to 

_modules=('--all')

to install all modules.

When using the package for the first time, run

source /opt/context-lmtx/setuptex
mtxrun --generate

For any future runs, simply use 

source /opt/context-lmtx/setuptex

once in your shell. This adds /opt/context-lmtx/texmf-linux-{32,64}/bin to the 
PATH variable, so the binaries provided by context-lmtx are found before the 
system binaries. 

The setuptex file provides a `resettex` function which removes the above path 
from the PATH variable.

The setuptex file also sets a variable CONTEXDIST to 'lmtx'. This can be used 
to set the value of PS1 variable (or similar) of your shell prompt to add a 
visual reminder of which context installation you are using. 

Let me know if there are any issues with this install.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: MP setup for a progress bar

2023-07-05 Thread Aditya Mahajan
On Tue, 4 Jul 2023, Henning Hraban Ramm wrote:

> Thanks to Taco, Robbert and Jules for their work!
> 
> 
> I used the downtime to setup a presentation style with a progress bar in the
> footer. But I get the same (first page) graphics on all pages, and the footer
> background appears under the text area as well as under the margins.

Also see:

https://github.com/adityam/visualcounter

There is a simple progress bar and the documentation shows how to create your 
own 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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] context-on-web broken

2023-06-26 Thread Aditya Mahajan via ntg-context
On Mon, 26 Jun 2023, Miguel Diaz via ntg-context wrote:

> indeed it is a simple simulation of overleaf (for latex). 

FWIW, context works on overleaf as well!

Simply create a `latexmkrc` file with the following content:

```
$pdflatex="context --synctex=1 --result=output %S; cp output.log 
/compile/output.log;cp output.pdf /compile/output.pdf";
$recorder=0;
$pdf_mode=1;
```

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] TiKz with LMTX

2023-06-09 Thread Aditya Mahajan via ntg-context
On Fri, 9 Jun 2023, Hans Hagen via ntg-context wrote:

> On 6/9/2023 5:57 AM, Aditya Mahajan via ntg-context wrote:
> > On Thu, 8 Jun 2023, Jigé via ntg-context wrote:
> > 
> >>   Thanks a lot Aditya.
> >>
> >> The very simple TikZ example with the cross works.
> >> The more complex example with the trigonometric circle from the pgf
> >> manual,
> >> quoted in https://wiki.contextgarden.net/TikZ , does not compile
> >> unless you also comment out
> >>   or find(n,"pdftex")
> >> in line 181 of the mtx-install-modules.lua file
> >> before doing mtxrun --script install-modules --install tikz
> >> but I could guess that from a:
> >>   Driver file ``pgfsys-pdftex.def'' not found..
> >> message
> > 
> > Ah so tikz uses both drivers.
> > 
> > @Hans, so the validate function should be:
> > 
> > local function validate(n)
> >  return not (
> > find(n,"latex")
> >   -- or find(n,"lualatex")
> >  or find(n,"plain")
> >  or find(n,"optex")
> >   -- or find(n,"luatex")
> >   -- or find(n,"pdftex")
> >  )
> > end
> so an alternative is to ignore deleting those two files
> 
> what is in lualatex that we need? can hardly be something generic

pgf/tikz doesn't have anything with lualatex in the name. The only files that 
match luatex/pdftex are these def files. 

> (it being pretty big makes me wonder if we should have texmf-tikz for it as i
> don't want to polute the modules tree too much - it gets hard to check other
> modules for instance when i want to see if some change has impact)

If it makes things easier to manage, we can definitely do that. We already have 
7 trees, one more isn't going to make any difference :-)

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] TiKz with LMTX

2023-06-08 Thread Aditya Mahajan via ntg-context
On Thu, 8 Jun 2023, Jigé via ntg-context wrote:

>  Thanks a lot Aditya.
> 
> The very simple TikZ example with the cross works.
> The more complex example with the trigonometric circle from the pgf manual,
> quoted in https://wiki.contextgarden.net/TikZ , does not compile
> unless you also comment out
>  or find(n,"pdftex")
> in line 181 of the mtx-install-modules.lua file
> before doing mtxrun --script install-modules --install tikz
> but I could guess that from a:
>  Driver file ``pgfsys-pdftex.def'' not found..
> message

Ah so tikz uses both drivers. 

@Hans, so the validate function should be:

local function validate(n)
return not (
   find(n,"latex")
 -- or find(n,"lualatex")
or find(n,"plain")
or find(n,"optex")
 -- or find(n,"luatex")
 -- or find(n,"pdftex")
)
end


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] TiKz with LMTX

2023-06-05 Thread Aditya Mahajan via ntg-context
On Mon, 5 Jun 2023, Aditya Mahajan via ntg-context wrote:

> On Sun, 4 Jun 2023, Jigé via ntg-context wrote:
> 
> 
> > $ mkdir ~/.local/share/context
> > $ cd ~/.local/share/context
> > $ wget https://lmtx.pragma-ade.com/install-lmtx/context-linux-64.zip
> > $ unzip context-linux-64.zip
> > $ sh install.sh
> > $ rm context-linux-64.zip
> > $ cd ~/.local/share/context/tex
> > $ mtxrun --script install-modules --list
> > $ mtxrun --script install-modules --install tikz
> > (And for good measure, I later did `mtxrun --script install-modules 
> > --install all`)
> > 
> > $ cd my-working-directory
> > $ vi some-sample-context-file.tex
> > $ export PATH=/home/myname/.local/share/context/tex/texmf-linux-64/bin:$PATH
> > $ context some-sample-context-file.tex
> > 
> > Did I miss anything? It works just fine.
> 
> On a new machine and pgfsys-luatex.def is missing for me as well. I'll try to 
> check what is going on. 

This was a bit crazy to track down. Here is the fix: 

In line 180 of mtx-install-modules.lua, comment the line

or find(n,"luatex")

Otherwise, the file 

tex/generic/pgf/systemlayer/pgfsys-luatex.def

is not extracted from the tikz.zip! 

I don't know why OP and I (both on archlinux) were the only ones who had 
pgfsys-luatex.def missing. Everyone should have been affected by this. 

Aditya


PS: Also on line 103, it may be a good idea to change the curl call to 

curl --ssl --location

mirros.ctan.org will also do a HTTP 302 redirect and without the --location 
flag, curl will not follow the redirect. ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] TiKz with LMTX

2023-06-05 Thread Aditya Mahajan via ntg-context
On Sun, 4 Jun 2023, Jigé via ntg-context wrote:


> $ mkdir ~/.local/share/context
> $ cd ~/.local/share/context
> $ wget https://lmtx.pragma-ade.com/install-lmtx/context-linux-64.zip
> $ unzip context-linux-64.zip
> $ sh install.sh
> $ rm context-linux-64.zip
> $ cd ~/.local/share/context/tex
> $ mtxrun --script install-modules --list
> $ mtxrun --script install-modules --install tikz
> (And for good measure, I later did `mtxrun --script install-modules --install 
> all`)
> 
> $ cd my-working-directory
> $ vi some-sample-context-file.tex
> $ export PATH=/home/myname/.local/share/context/tex/texmf-linux-64/bin:$PATH
> $ context some-sample-context-file.tex
> 
> Did I miss anything? It works just fine.

On a new machine and pgfsys-luatex.def is missing for me as well. I'll try to 
check what is going on. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Moving up a Figure

2023-06-05 Thread Aditya Mahajan via ntg-context
On Mon, 5 Jun 2023, Alan Braslau via ntg-context wrote:

> On 05/06/23 05/06/23, 00:08, Mikael Sundqvist via ntg-context wrote:
> > On Mon, Jun 5, 2023 at 4:03 AM Jeroen via ntg-context
> >   wrote:
> >> Not fully, it indeed moves up the figure but a little too much. Is there a
> >> more granular method?
> > Not that I know of, but maybe {right,halfline} will do?
> 
> Maybe try "location={right,-1*hang},"

For finer control, you can use `\movesidefloat`:

\movesidefloat[x=-..., y=...]
\startplacefigure
  [..]
\stopplacefigure

Aditya

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Super slow installation

2023-05-30 Thread Aditya Mahajan via ntg-context
On Tue, 30 May 2023, Thangalin via ntg-context wrote:

> FWIW, I'm seeing the same slow down issue from three different machines:
> 
>1. My personal computer in Vancouver BC.
>2. A work computer on Vancouver Island (Victoria BC)
>3. Microsoft ADO servers (presumably in Seattle WA).
> 
> Is it possible there's a slow pipe from North America to Europe?

Could be. For me (Montreal, Canada) it took more than a minute:

❯ wget http://lmtx.pragma-ade.com/install-lmtx//texmf.zip
--2023-05-30 13:38:26--  http://lmtx.pragma-ade.com/install-lmtx//texmf.zip
Resolving lmtx.pragma-ade.com (lmtx.pragma-ade.com)... 213.125.29.165
Connecting to lmtx.pragma-ade.com (lmtx.pragma-ade.com)|213.125.29.165|:80... 
connected.
HTTP request sent, awaiting response... 200 OK
Length: 53293716 (51M) [application/zip]
Saving to: ‘texmf.zip’

texmf.zip   100%[==>]  50.82M   637KB/sin 72s

2023-05-30 13:39:38 (721 KB/s) - ‘texmf.zip’ saved [53293716/53293716]

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] module installer: unknown script 'install-modules.lua' or 'mtx-install-modules.lua'

2023-05-24 Thread Aditya Mahajan via ntg-context
On Wed, 24 May 2023, Denis Maier via ntg-context wrote:

> I've just tested with a couple of other scripts...
> 
> Doesn't matter which one I try to call:
> Mtxrun --script XYZ
> 
> will always results in the equivalent error message, e.g.:
> mtxrun  | unknown script 'interface.lua' or 'mtx-interface.lua'
> 
> I have 
> ..\context\tex\texmf-win64\bin
> ..\context\bin
> In my path.
> 
> Do I need to add something else to the Path?

I would remove context/bin from the PATH.

Try running mtxrun --generate to regenerate the files database.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Inline framed verbatim text

2023-05-19 Thread Aditya Mahajan via ntg-context
On Fri, 19 May 2023, Jeroen via ntg-context wrote:

> Many thanks. Is there a proper way to add some space (a couple of pt or em)
> to the left and the right of the text itself so the frame does not get so
> close to the text?

\framed[loffset=0.2ex, roffset=0.2ex]{...}

Also see: https://wiki.contextgarden.net/Command/setupframed

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] upload

2023-05-05 Thread Aditya Mahajan via ntg-context
On Fri, 5 May 2023, Hans Hagen via ntg-context wrote:

> Hi,
> 
> I uploaded a version that provides
> 
>   mtxrun --script install-tikz
> 
> that when run in the tex root (.../tex) will fetch some tikz stuff from ctan
> and puts is in texmf-modules. After installing it wipes the files that make no
> sense (or can interfere or might be harmful) but I didn't check that
> extensively. Finally it remakes the file dastabase. I don't know if more needs
> to be installed. It assumes curl to be present (as library or binary). It's a
> rather stupid script but (I guess) good enough for what it is supposed to do.

Works fine at my end. I also adapted the arch AUR package to use the 
install-tikz option (earlier I was installing these packages by wget as part of 
the installation process). 

> I can add more (like other modules) in which case it will be renamed.

Would it make sense to add a similar script to install context modules from 
modules.contextgarden.net? 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz + lmtx

2023-05-04 Thread Aditya Mahajan via ntg-context
On Thu, 4 May 2023, Hans Hagen via ntg-context wrote:

> On 4/28/2023 6:08 AM, Aditya Mahajan via ntg-context wrote:
> > Hi all,
> > 
> > For a few months now, all features of tikz have not been working with LMTX.
> > After help from Hans and a bit of trial and error, I think that figured out
> > what was going wrong with the catcodes in m-tikz: Since the texcatcodes are
> > different from what tikz expects, the catcodes have to be set inside
> > \starttikzpicture (in addition to before the loading of tikz files, which
> > was already being done).
> > 
> > I am attaching the working m-tikz.mkxl file.
> > 
> > I have tested this on my course notes, which make extensive use of simple
> > tikz block diagrams and pgfplots graphs. Perhaps others who were having
> > issues with tikz could test if this fixes everything and, if so, we can add
> > this to the distribution.
> So, what is needed from tikz?
> 
> "graphics/pgf/base/pgf.tds.zip",
> "graphics/pgf/contrib/pgfplots.tds.zip",
> "graphics/pgf/contrib/circuitikz.tds.zip",
> 
> Is there more that should be installed as reasonable basic set? 

I believe that these are the most popular ones. 

> I made a script that does fetch/installs it (and also wipes latex / plain
> /useless stuff afterwards including some shell etc scripts as we don't want
> those either - security risk etc -).

Does that mean that these will be now included as part of the lmtx install?

> Not being a tikz user I have no preferences but we can add some test files to
> the test suite if needed.

It may be good to add some basic files (e.g., the ones that I sent to you 
off-list) so that we may know if these packages break again.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Units for volts and Ohms

2023-05-02 Thread Aditya Mahajan via ntg-context
Hi,

As I was testing circuitikz, I realized that the following don't work:

\unit{1V}
\unit{100 kΩ}

In phys-dim.lmt, we need to change line 467:

v  = "volt",

to

V  = "volt",

and perhaps add (not sure if lua allows utf variable names)

Ω  = "ohm",

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz + lmtx

2023-05-01 Thread Aditya Mahajan via ntg-context
On Fri, 28 Apr 2023, Aditya Mahajan via ntg-context wrote:

> On Fri, 28 Apr 2023, Ulrike Fischer via ntg-context wrote:
> 
> > Am Fri, 28 Apr 2023 01:01:23 -0400 (EDT) schrieb Aditya Mahajan via
> > ntg-context:
> > 
> > > Circuitikz still doesn't work. Even loading the module fails. 
> > 
> > It works for me on texlive 2023 with your new module file. 
> 
> Thanks for testing. I'll double check what was going wrong with my circuitikz 
> tests.

A 5 year old circuitikz module in $TEXMFHOME, which was interfering! Everything 
appears to be working now at my end as well.

@Hans, could we add the m-tikz.mkxl file that I sent to the distribution. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz + lmtx

2023-04-28 Thread Aditya Mahajan via ntg-context
On Fri, 28 Apr 2023, Floris van Manen via ntg-context wrote:

> 
> 
> On 28/04/2023 16:25, Aditya Mahajan via ntg-context wrote:
> > These are already part of the distribution. Just one caveat: you need to use
> > 
> > \usemodule[tikz]
> > \usemodule[pgfplots]
> 
> 
> when running the example from contextgarden:
> https://wiki.contextgarden.net/Pgfplot
> 
> \setupcolors[state=start]
> \usemodule[tikz]
> \usemodule[pgfplots]
> \starttext
> \starttikzpicture
> \startaxis[
> xmin=0,xmax=300,
> title=http://cryogenics.nist.gov/,
> xlabel=$T$ (K),
> ylabel=$(L-L_{293})/L_{293}$,
> legend style={at={(0.95,0.05)},anchor=south east},
> width=16cm ]
> \addplot[mark=none,color=red] plot file {sapphire.dat};
> \addlegendentry{sapphire}
> \addplot[mark=none,color=green] plot file {Be.dat};
> \addlegendentry{Be}
> \addplot[mark=none,color=blue] plot file {BeCu.dat};
> \addlegendentry{BeCu}
> \addplot[mark=none,color=cyan] plot file {SS304.dat};
> \addlegendentry{SS304}
> \addplot[mark=none,color=magenta] plot file {Al6061-T6.dat};
> \addlegendentry{Al6061-T6}
> \addplot[mark=none,color=orange] plot file {nylon.dat};
> \addlegendentry{nylon}
> \stopaxis
> \stoptikzpicture
> \stoptext

Is it possible to create a standalone test that does not depend on a bunch of 
datafiles that need to be downloaded?

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz + lmtx

2023-04-28 Thread Aditya Mahajan via ntg-context
On Fri, 28 Apr 2023, Ulrike Fischer via ntg-context wrote:

> Am Fri, 28 Apr 2023 01:01:23 -0400 (EDT) schrieb Aditya Mahajan via
> ntg-context:
> 
> > Circuitikz still doesn't work. Even loading the module fails. 
> 
> It works for me on texlive 2023 with your new module file. 

Thanks for testing. I'll double check what was going wrong with my circuitikz 
tests.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz + lmtx

2023-04-28 Thread Aditya Mahajan via ntg-context
On Fri, 28 Apr 2023, Gavin wrote:

> Hi fellow Tik-Z users,
> 
> Tik-Z, including circuitikz, is working for me after adding two files from 
> Hans to a slightly older version of ConTeXt (ver: 2023.02.07 19:06 LMTX  fmt: 
> 2023.3.14). I do not know if these files are of any use with the current 
> versions, but I am quoting a list email from January (including the files) 
> just in case it helps anyone with the present problems.
> 
> Gavin

These are already part of the distribution. Just one caveat: you need to use

\usemodule[tikz]
\usemodule[pgfplots]

Directly loading 

\usemodule[pgfplots]

will not work as the t-pgfplots module explicitly loads t-tikz, which does not 
work with LMTX.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz + lmtx

2023-04-27 Thread Aditya Mahajan via ntg-context
On Fri, 28 Apr 2023, Aditya Mahajan via ntg-context wrote:

> Hi all,
> 
> For a few months now, all features of tikz have not been working with LMTX. 
> After help from Hans and a bit of trial and error, I think that figured out 
> what was going wrong with the catcodes in m-tikz: Since the texcatcodes are 
> different from what tikz expects, the catcodes have to be set inside 
> \starttikzpicture (in addition to before the loading of tikz files, which was 
> already being done). 
> 
> I am attaching the working m-tikz.mkxl file. 
> 
> I have tested this on my course notes, which make extensive use of simple 
> tikz block diagrams and pgfplots graphs. Perhaps others who were having 
> issues with tikz could test if this fixes everything and, if so, we can add 
> this to the distribution.

Circuitikz still doesn't work. Even loading the module fails. Not sure why this 
is happening:

\usemodule[circuitikz]

gives:


tex error   > tex error on line 77 in file 
/opt/luametatex/texmf-context/tex/context/modules/mkxl/m-circuitikz.mkxl: 
Package pgfkeys Error: I do not know the key '/tikz/resistor', to which you 
passed 'american', and I am going to ignore it. Perhaps you misspelled it

 \pgfkeys@error

which is a bit strange as the key should have been '/tikz/circuitikz/resistor' 
rather than 'tikz/resistor'.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] tikz + lmtx

2023-04-27 Thread Aditya Mahajan via ntg-context
Hi all,

For a few months now, all features of tikz have not been working with LMTX. 
After help from Hans and a bit of trial and error, I think that figured out 
what was going wrong with the catcodes in m-tikz: Since the texcatcodes are 
different from what tikz expects, the catcodes have to be set inside 
\starttikzpicture (in addition to before the loading of tikz files, which was 
already being done). 

I am attaching the working m-tikz.mkxl file. 

I have tested this on my course notes, which make extensive use of simple tikz 
block diagrams and pgfplots graphs. Perhaps others who were having issues with 
tikz could test if this fixes everything and, if so, we can add this to the 
distribution.

Aditya%D \module
%D   [   file=m-tikz,
%Dversion=2021.07.12,
%D  title=\CONTEXT\ Extra Modules,
%D   subtitle=TIKZ support,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D A fixed variant of the t-tikz module distributed with tikz. For practical 
reasons
%D per 2021 we split the module for \MKIV\ and \LMTX. (Maybe some day I'll 
optimize
%D TIKZ a bit.)
%D
%D All these t-* modules in the tikz distribution make no sense as we can just 
load
%D them here which is way cleaner. There is also some mkii filename mapping 
going on
%D that is not needed on todays systems (windows has no 8.3 limitation and on 
unix
%D tds finally adopted a case insensitive approach.)

%D Just in case someone does a hard input ...

\ifdefined\pgfdefined\endinput \fi
\ifdefined\pgfcoredefined\endinput \fi

%D ... but normally we end up here:

\startmodule[tikz]

\ifdefined\pdflastxpos \else
\unprotect

\frozen\overloaded\protected\def\pdflastxpos{\numexpr\clf_lastxpos\relax}

\frozen\overloaded\protected\def\pdflastypos{\numexpr\clf_lastypos\relax}
\protect
\fi

\newcatcodetable \tikzcatcodes

\startcatcodetable \tikzcatcodes
\catcode\tabasciicode \spacecatcode
\catcode\endoflineasciicode   \endoflinecatcode
\catcode\formfeedasciicode\endoflinecatcode
\catcode\spaceasciicode   \spacecatcode
\catcode\endoffileasciicode   \ignorecatcode
\catcode\circumflexasciicode  \superscriptcatcode
\catcode\underscoreasciicode  \subscriptcatcode
\catcode\ampersandasciicode   \alignmentcatcode
\catcode\backslashasciicode   \escapecatcode
\catcode\leftbraceasciicode   \begingroupcatcode
\catcode\rightbraceasciicode  \endgroupcatcode
\catcode\dollarasciicode  \mathshiftcatcode
\catcode\hashasciicode\parametercatcode
\catcode\commentasciicode \commentcatcode
\catcode\atsignasciicode  \lettercatcode
\catcode\exclamationmarkasciicode \othercatcode
\catcode\questionmarkasciicode\lettercatcode
\catcode\tildeasciicode   \activecatcode
\catcode\barasciicode \othercatcode
\stopcatcodetable

\permanent\protected\def\starttikzinput
  {\pushoverloadmode
   \pushcatcodetable
   \setcatcodetable\tikzcatcodes
   \pushmacro\meaning
   \let\meaning\meaningless
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzinput
  {\autoparagraphmode\plusone
   \popcatcodetable
   \popmacro\meaning
   \popoverloadmode}

\permanent\protected\def\tikzinputfile#1%
  {\starttikzinput
   \input{#1}\relax
   \stoptikzinput}

\permanent\protected\def\tikzerrormessage#1#2#3%
  {\writestatus{#1}{#2}}

% For now we need this but we need to educate the user to wrap settings in the
% wrappers. So some day the next line will go. I need to check what commands are
% possible outside a picture.

\overloadmode\zerocount

\newtoks\everytikzpicture

% \appendtoks
% \resetcharacterspacing
% \to \everytikzpicture

\permanent\protected\def\starttikzsettings
  {\pushoverloadmode
   \pushmacro\meaning
   \let\meaning\meaningless
   \autoparagraphmode\zerocount}

\permanent\protected\def\stoptikzsettings
  {\autoparagraphmode\plusone
   \popmacro\meaning
   \popoverloadmode}

\permanent\protected\def\starttikzpicture
  {\dontleavehmode
   \hcontainer\bgroup
   \setcatcodetable\tikzcatcodes
   \the\everytikzpicture
   \autoparagraphmode\zerocount
   \pushmacro\meaning
   \let\meaning\meaningless
 % \pushoverloadmode
   \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
   \tikzpicture}

\permanent\protected\def\stoptikzpicture
  {\endtikzpicture
 % \popoverloadmode
   \popmacro\meaning
   \egroup}

\let\pgfdefined\relax
\let\pgfcoredefined\relax

\tikzinputfile{pgfutil-common.tex}
\tikzinputfile{pgfutil-context.def}
\tikzinputfile{pgfrcs.code.tex}
\tikzinputfile{pgfsys.code.tex}
\tikzinputfile{pgfkeys.code.tex}
\tikzinputfile{pgfsyssoftpath.code.tex}
\tikzinputfile{pgfsysprotocol.code.tex}

Re: [NTG-context] update

2023-04-26 Thread Aditya Mahajan via ntg-context
On Wed, 26 Apr 2023, lynx--- via ntg-context wrote:

> Re: performing update(s) 
> 
> New to conTeXt, have not performed a specific update prior to this. 
> 
> My conTeXt installation is part of TeXlive-2023 (under Linux OS). Will
> the updates to ConTeXt be handled by tlmgr ? 

No. Usually, texlive updates context once a year. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Filter Module with Openscad

2023-04-26 Thread Aditya Mahajan via ntg-context
On Wed, 26 Apr 2023, Jeroen via ntg-context wrote:

> I am using OpenSCAD to create drawings with the filter module with the
> following MWE:
> 
> \usemodule[filter]
> \defineexternalfilter[openscad]
>   [filtercommand={/context/openscad/openscad -o \externalfilteroutputfile},
>output={\externalfilterbasefile.png},
>cache=force,
>readcommand=\ReadImage]
> \define[1]\ReadImage{\externalfigure[#1]}
> 
> \starttext
> \startopenscad
>   square(4,2);
> \stopopenscad
> \stoptext
> 
> This works fine. I now want to use the following options added to the
> command line: --view axes,edges,scales --viewall
> 
> When I create an Openscad file test.scad, I can run it fine with the
> following command line at a CLI window:
> 
> openscad.com test.scad -o test.png --view axes,edges,scales --viewall
> 
> When I add this to the filtercommand as following
> 
> [filtercommand={/context/openscad/openscad -o
> \externalfilteroutputfile --view axes,edges,scales --viewall}
> 
> I cannot get it to run. Is there anything I am missing?

My guess is that you need:

[filtercommand={/context/openscad/openscad -o \externalfilteroutputfile\space 
--view axes,edges,scales --viewall}

this is because any macro \something gobbles the space after that. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Idea for a shared repository.

2023-04-25 Thread Aditya Mahajan via ntg-context
On Tue, 25 Apr 2023, Pawel Urbanski via ntg-context wrote:

> What about creating a repository called: 'templates' or 'resources' - we can
> figure out the exact name later.

Why not use the wiki for such documents? For fonts, there is already a wiki 
page collecting typescripts:

https://wiki.contextgarden.net/Typescripts_examples

There are also a collection of templates which are already on the wiki:

https://wiki.contextgarden.net/Category:Sample_documents


> It is not about duplicating the Context garden site but to collect code in a
> place where we could gradually fix possible errors or introduce improvements.

This can be done on the wiki 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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \setupitemize[indentnext=auto] broken?

2023-04-18 Thread Aditya Mahajan via ntg-context
On Mon, 17 Apr 2023, Hans Hagen via ntg-context wrote:

> On 4/17/2023 7:06 AM, Aditya Mahajan via ntg-context wrote:
> > On Sun, 16 Apr 2023, Aditya Mahajan via ntg-context wrote:
> > 
> >> On Sat, 15 Apr 2023, Jim via ntg-context wrote:
> >>
> >>> %
> >>>
> >>> \setupindenting[medium,yes]
> >>> \setupitemize[indentnext=auto]
> >>>
> >>>\startitemize
> >>>  \item One
> >>>\stopitemize
> >>>
> >>>This paragraph should be indented - due to the blank line after
> >>>\type{\stopitemize}.
> >>>
> >>>\startitemize
> >>>  \item Two
> >>>\stopitemize
> >>>This paragraph should not be indented.
> >>>
> >>> %
> >> Works in mkiv but appears to be a bug in lmtx. I haven't debugged what is
> >> going wrong.
> > 
> > `indentnext=auto` doesn't appear to work for any environment.
> can you test with this patch

This works on with the 3-4 test examples that I had but ...

> \permanent\protected\protected\def\spac_indentation_check_next_indentation
^

Is that a typo (double \protected)? I tested with a single \protected and that 
also works.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \setupitemize[indentnext=auto] broken?

2023-04-16 Thread Aditya Mahajan via ntg-context
On Sun, 16 Apr 2023, Aditya Mahajan via ntg-context wrote:

> On Sat, 15 Apr 2023, Jim via ntg-context wrote:
> 
> > %
> > 
> > \setupindenting[medium,yes]
> > \setupitemize[indentnext=auto]
> > 
> >   \startitemize
> > \item One
> >   \stopitemize
> > 
> >   This paragraph should be indented - due to the blank line after 
> > \type{\stopitemize}.
> > 
> >   \startitemize
> > \item Two
> >   \stopitemize
> >   This paragraph should not be indented.
> > 
> > %
> Works in mkiv but appears to be a bug in lmtx. I haven't debugged what is 
> going wrong. 

`indentnext=auto` doesn't appear to work for any environment. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \setupitemize[indentnext=auto] broken?

2023-04-16 Thread Aditya Mahajan via ntg-context
On Sat, 15 Apr 2023, Jim via ntg-context wrote:

> In the wiki page https://wiki.contextgarden.net/Indentation there is the
> following example:
> 
> %
> 
> \setupindenting[medium,yes]
> \setupitemize[indentnext=auto]
> 
>   \startitemize
> \item One
>   \stopitemize
> 
>   This paragraph should be indented - due to the blank line after 
> \type{\stopitemize}.
> 
>   \startitemize
> \item Two
>   \stopitemize
>   This paragraph should not be indented.
> 
> %
> 
> Tragically, the paragraph which claims it should be indented is not, in
> both my test and the wiki page itself.
> 
> Is this a documentation bug, a ConTeXt bug, or something else yet?

Works in mkiv but appears to be a bug in lmtx. I haven't debugged what is going 
wrong. 

Aditya (who wrote bulk of that wiki page)

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Feynman Diagrams

2023-04-12 Thread Aditya Mahajan via ntg-context
On Wed, 12 Apr 2023, Gavin via ntg-context wrote:

> Hi Aditya,
> 
> > Have you tried using feynmp (the metapost macros) directly instead of the 
> > LaTeX wrapper? Can you create an example that works with metapost but fails 
> > in ConTeXt?
> 
> No, I’m not sure how to do that. I looked at the manual, and it has some 
> examples where new styles are written in MetaPost, but every diagram is drawn 
> with the LaTeX wrapper. I looked in the source files, and maybe feynmf.dtx 
> has everything to produce documentation for the MetaPost macros, but if so, 
> I’m not sure how to generate that documentation.
> 
> Can you point me to an example that works with metapost macros directly?

I have never used feynMP, so I am just copy-pasting an example from 

https://osksn2.hep.sci.osaka-u.ac.jp/~taku/osx/feynmp/fmfsamples.pdf

\documentclass{article}
\usepackage{feynmp}
\begin{document}
\unitlength = 1mm
\begin{fmffile}{simple}
\begin{fmfgraph}(40,25)
\fmfleft{i1,i2}
\fmfright{o1,o2}
\fmf{fermion}{i1,v1,o1}
\fmf{fermion}{i2,v2,o2}
\fmf{photon}{v1,v2}
\end{fmfgraph}
\end{fmffile}
\end{document}

This creates a file simple.mp in the same directory (kind of like the old mkii 
way of including MP in context):

% simple.mp -- do not edit, generated automatically by test1.tex
input feynmp
require_RCS_revision "1.30";
beginchar(1, 40*2.84526pt#, 25*2.84526pt#, 0);
"feynmf: 1";
LaTeX_unitlength:=2.84526pt;
subgraph (0, 0, w, h);
vinit;
pickup pencircle scaled thin;
vleft (__i1, __i2);
vright (__o1, __o2);
vconnect ("fermion", __i1, __v1, __o1);
vconnect ("fermion", __i2, __v2, __o2);
vconnect ("photon", __v1, __v2);
vfreeze;
vdraw;
endsubgraph;
endchar;
% the end.
end.
endinput;

So, I created a context file:

\startMPinclusions
input feynmp;
require_RCS_revision "1.30";
\stopMPinclusions

\starttext
\startMPpage
beginchar(1, 40*2.84526pt#, 25*2.84526pt#, 0);
"feynmf: 1";
LaTeX_unitlength:=2.84526pt;
subgraph (0, 0, w, h);
vinit;
pickup pencircle scaled thin;
vleft (__i1, __i2);
vright (__o1, __o2);
vconnect ("fermion", __i1, __v1, __o1);
vconnect ("fermion", __i2, __v2, __o2);
vconnect ("photon", __v1, __v2);
vfreeze;
vdraw;
endsubgraph;
endchar;
\stopMPpage
\stoptext

but compiling that fails with 

metapost> trace >
metapost> trace > loading metafun for lmtx, including the plain 1.004 
base definitions
metapost> trace >
metafun > log >
metafun > log > error: Isolated expression
metafun > log >
metapost> trace >  1
metapost> trace >  #
metafun > log >
metafun > log > I couldn't find an '=' or ':=' after the expression 
that is shown above this
error message, so I guess I'll just ignore it and carry on.
metafun > log >
metapost> trace >  bp# := bp;
metapost> trace >

My guess is that it could be something to do with bp# being used as a variable, 
but I am not 100% sure on that. 

In principle, it should be easier to adapt the feynmp.mp (attached) code to 
make it work with LMTX. The feynmp.sty package, simply provide a high level 
macro wrapper around this mp code, and it is relatively simply to do something 
similar in context; but the MP file isn't that different from the latex code 
anyways.

Aditya%%
%% This is file `feynmp.mp',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% feynmf.dtx  (with options: `base,mp')
%% 
%% Copyright (C) 1989, 1990, 1992-1995 by thorsten@physik.th-darmstadt.de
%% 
%% This file is NOT the source for feynmf, because almost all comments
%% have been stripped from it.  It is NOT the preferred form of feynmf
%% for making modifications to it.
%% 
%% Therefore you can NOT redistribute and/or modify THIS file.  You can
%% however redistribute the complete source (feynmf.dtx and feynmf.ins)
%% and/or modify it under the terms of the GNU General Public License as
%% published by  the Free Software Foundation; either version 2, or (at
%% your option) any later version.
%% 
%% As a special exception, you can redistribute parts of this file for
%% the electronic distribution of scientific papers, provided that you
%% include a short note pointing to the complete source.
%% 
%% Feynmf is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%% GNU General Public License for more details.
%% 
%% You should have received a copy of the GNU General Public License
%% along with this program; if not, write to the Free Software
%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%% 

%% \CheckSum{924}
%% \CharacterTable
%%  {Upper-case  

Re: [NTG-context] Feynman Diagrams

2023-04-12 Thread Aditya Mahajan via ntg-context
On Wed, 12 Apr 2023, Gavin via ntg-context wrote:

> Hi Hans, Alan, Mikael, and other Feynman fans,
> 
> I do think Alan's node module could do a good job with this.
> 
> >  It would be nice to have a not too complicated syntax, but maybe just have 
> > some of the
> > "shapes" of paths available. So, which ones are actually needed?
> 
> I think the needed shapes are:
>  - dashed or dotted paths already built into MetaPost
>  - paths that are wiggly, zig-zag or coiled
>  - optional arrows on the paths
>  - optional dots or blobs at the connecting points
> 
> This is plenty for someone doing Standard Model physics. Model builders doing 
> supersymmetric, walking-technicolor, bla-bla need more, of course, but I’d 
> let them program their own shapes.
> 
> The package feynMP already has all of these paths, as well as double-line 
> variants, coded in MetaPost. If I could use feynMP with ConTeXt, that’s what 
> I’d do. It produces very nice diagrams.

Have you tried using feynmp (the metapost macros) directly instead of the LaTeX 
wrapper? Can you create an example that works with metapost but fails in 
ConTeXt?

Aditya


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] /usr/bin/env texlua no such file or directory; ~/context/tex is not a valid TEXROOT path; no file plain.tex

2023-04-10 Thread Aditya Mahajan via ntg-context
On Mon, 10 Apr 2023, Carlos via ntg-context wrote:

> I'm just following some of the standalone installation instructions
> as per the wiki alongside  a TeX Live installation,  but there are a
> few things that don't add up or I can't seem to add them up :).
> 
> first, while I was trying to mtxrun --generate it returned
> 
> /usr/bin/env texlua no such file or directory
> 
> So I thought heck, perhaps by creating a symbolic link we'll call it
> a day, but that wasn't enough, nope.
> 
> This is is circa 21st century ladies and gentlemen!
> 
> so I thought, alright, since there seems ot be a a problem with texlua,
> let's also add it to path somehow.

Did you source the `setuptex` script, which sets the correct path.

> So with that out of the way, we'll move on to the next step and change
> to a directory and try to call out mtxrun --generate again
> 
> It returns:
> 
> mtxrun --generate resolvers   | resolving | variable 'SELFAUTOLOC'
> set to '/home/ce/context/bin' resolvers   | resolving | variable

This appears to be the wrong mtxrun binary. You should include the PATH 
variable listed as part of the installation. It should point to 
`/home/ce/context/texmf-linux-64/bin` or something similar.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz error upgrading to texlive version (artix)

2023-03-31 Thread Aditya Mahajan via ntg-context
On Fri, 31 Mar 2023, Hans Hagen via ntg-context wrote:

> On 3/30/2023 11:56 PM, Xavier B. via ntg-context wrote:
> > Thanks, Max, for finding the problem. It is related to two more bugs:
> > https://github.com/pgf-tikz/pgf/issues/990
> > and
> > https://github.com/pgf-tikz/pgf/issues/958
> > 
> > Perhaps Hans or other people could help tikz staff to do the pending and
> > definitive solution.
> > It's annoying to have to put workarrounds in production documents.
> > 
> > There is just a glad mkiv user ;-)
> \usemodule[tikz]
> 
> \starttext
>   Hello World.
> \stoptext
> 
> works ok here

Last time I tested, a simple \starttikzpicture \draw (0,0)--(1,0); 
\stoptikzpicture was failing. I'll try again with the latest version of LMTX + 
TikZ. 

Hans, are you using the latest version of tikz from ctan? Some of these issues 
are due to recent changes made in tikz. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] tikz error upgrading to texlive version (artix)

2023-03-30 Thread Aditya Mahajan via ntg-context
On Thu, 30 Mar 2023, Xavier B. via ntg-context wrote:

> Thanks, Max, for finding the problem. It is related to two more bugs:
> https://github.com/pgf-tikz/pgf/issues/990
> and 
> https://github.com/pgf-tikz/pgf/issues/958
> 
> Perhaps Hans or other people could help tikz staff to do the pending and 
> definitive solution.
> It's annoying to have to put workarrounds in production documents.
> 
> There is just a glad mkiv user ;-)

I reported that tikz is not working a few months ago, but after a few back and 
forth with Hans, could not get it to work. At that time, it appeared that I was 
the only have having issues, so I thought that I was making a mistake in how I 
was installing the package. 

I have reverted to using mkiv for my course notes, because I heavily use 
pgfplots and that is not working in LMTX. (I was also using some nice new 
features of metafun, and have had to resort to compiling them externally using 
LMTX via the filter module and compiling the main doc with MkIV).

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Description together with itemize, luametatex

2023-03-06 Thread Aditya Mahajan via ntg-context
On Mon, 6 Mar 2023, Gerion Entrup via ntg-context wrote:

> Hi,
> 
> I'm trying to use a description environment in conjunction with an
> itemize with the latest luametatex. Is this supposed to work?
> 
> Here is an MWE:
> ```
> \definedescription[desc][headstyle=bold]
> 
> \starttext
> Foo
> 
> \desc{Some title} Some text
>   \startitemize
>   \item Some item
>   \stopitemize
> 
> \stoptext

Use \startdesc ... \stopdesc

\definedescription[desc][headstyle=bold]

\starttext
Foo

\startdesc[title={Some title}]
  Some text
\startitemize
\item Some item
\stopitemize
\stopdesc

\stoptext

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Visual highlighted text with title, mix of enumeration and framedtext

2023-03-06 Thread Aditya Mahajan via ntg-context
On Mon, 6 Mar 2023, Henning Hraban Ramm via ntg-context wrote:

> Am 06.03.23 um 12:19 schrieb Gerion Entrup via ntg-context:
> > I want to typeset a "Good to know" section that is visually highlighted
> > and can spawn across multiple pages.
> > 
> > In LaTeX this would be possible with the mdframed package. See the
> > attached screenshot for an example how it might look like (it is copied
> > out of page 4: Definition: Inhomogeneous linear of the mdframed
> > documentation:
> > http://mirrors.ctan.org/macros/latex/contrib/mdframed/mdframed.pdf)
> > 
> > I have searched in the wiki and found \defineenumeration:
> > This is near of that what I need. However I explicitly does not need an
> > enumeration (so no number or counter). Also I am not sure if I can set a
> > background and so on.
> > 
> > The other possibility is \defineframedtext. For example this goes much
> > in the direction that I want:
> > \definecolor[gbackground][s=0.98]
> > \defineframedtext[gtk][frame=on,
> > offset=5pt,
> > background=color,
> > width=0.95\textwidth,
> > backgroundcolor=gbackground]
> > 
> > However, there does not seem a possibility to define a title and it
> > seems to not work on multiple pages.
> > 
> > Is there a mix of an enumeration and framedtext that can produce
> > something like in the attached picture?
> 
> If you don’t need an enumeration, then don’t use one.
> 
> Did you try text backgrounds?
> https://wiki.contextgarden.net/TextBackground

As an example, see this article that I had written years ago:

https://www.tug.org/pracjourn/2006-4/mahajan/

The solution environment there is similar to what you want. Most of the code 
there should still work with minor changes.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Aaligned numbers in a matrix?

2023-02-26 Thread Aditya Mahajan via ntg-context
On Mon, 27 Feb 2023, Bruce Horrocks via ntg-context wrote:

> I'm using the following MWE to produce a matrix:
> 
> \definemathmatrix[bmatrix]
>   [matrix:brackets]
>   [simplecommand=bmatrix]
> \starttext
> $ a \rightarrow
>   \bmatrix{1, 2, 3, 4; 
>2, 1, 4, 3;
>3,-4, 1,-2;
>4,-3, 2,-1} $
> \stoptext
> 
> The columns with negative numbers in are centred and I would rather have them 
> right-aligned so that the digits stack up above each other and the negative 
> signs stick out to the left, so to speak. Is there an easy way to achieve 
> this?

You can right align all columns, though I am not sure that this looks better, 
because column 2 and 3 now appear to be "too close".

\definemathmatrix[bmatrix]
  [matrix:brackets]
  [align=all:right,simplecommand=bmatrix]
\starttext
$ a \rightarrow
  \bmatrix{1, 2, 3, 4;
   2, 1, 4, 3;
   3,-4, 1,-2;
   4,-3, 2,-1} $
\stoptext

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Math issue

2023-02-16 Thread Aditya Mahajan via ntg-context
On Thu, 16 Feb 2023, Willi Egger via ntg-context wrote:

> Hi math gurus,
> 
> I should typeset a couple of simple math formulae. However I do not get the 
> desired result. I attach my output as pdf.
> 
> 1. Why is the \times 12 in the denominator although the fraction is grouped? 
> — I tried also the grouping with bracis, which gives the same result.
> 2. Why is the result after the equalsign in the denominator?
> 
> [...]

> Thank you for hinting me how to this correctly.

Have you tried using \frac{...}{...} instead of {... \over ...}

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] autospacing and colonequals (was Lucida-1.901 (2023-01-21) available)

2023-01-27 Thread Aditya Mahajan via ntg-context
On Fri, 27 Jan 2023, Hans Hagen via ntg-context wrote:

> On 1/27/2023 6:26 PM, Otared Kavian via ntg-context wrote:
> > Hi Hans,
> > 
> > Thank you for the hint: indeed
> > \setupmathematics[collapsing=2]
> > does exactly what I was looking for…
> > 
> > Now, like many others, I am just waiting for the 3145 pages document about
> > maths in ConTeXt :-)
> It will be 3147 because we need to demo

No, it has to be 31415 pages now (so that the number of pages eventually 
converges to pi)!

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] pgfplots module wrecks in latest

2023-01-24 Thread Aditya Mahajan via ntg-context
On Mon, 16 Jan 2023, Aditya Mahajan via ntg-context wrote:

> On Mon, 16 Jan 2023, Hans Hagen via ntg-context wrote:
> 
> > make sure to get rid of the t-tikz modules
> 
> Tested again. Downloaded the latest context and pgf.tds.zip from ctan. Unizip 
> pgf by using 'unzip -x "**/t-*.*" so that no t- modules from tikz are 
> unzipped but still get the following error on a simple hello world example:
> 
> \usemodule[tikz]
> 
> \starttext
> Hello
> \stoptext
> 
> gives the attached log.

FWIW, the above example also fails on 2023.01.24 (with latest tikz from CTAN), 
with the same error message as in the last log. Could someone else please 
confirm if that is the case to rule out a misconfiguration/bug in my local 
install. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] pgfplots module wrecks in latest

2023-01-17 Thread Aditya Mahajan via ntg-context
On Mon, 16 Jan 2023, Aditya Mahajan via ntg-context wrote:

> On Mon, 16 Jan 2023, Hans Hagen via ntg-context wrote:
> 
> > make sure to get rid of the t-tikz modules
> 
> Tested again. Downloaded the latest context and pgf.tds.zip from ctan. Unizip 
> pgf by using 'unzip -x "**/t-*.*" so that no t- modules from tikz are 
> unzipped but still get the following error on a simple hello world example:
> 
> \usemodule[tikz]
> 
> \starttext
> Hello
> \stoptext
> 
> gives the attached log.

In case anyone else needs a temp workaround until this is resolved:

\usemodule[filter]

\startbuffer[tikz-start]
\usemodule[tikz]
% Add font setup
% Add  tikz setup
\starttext
\startTEXpage
\starttikzpicture
\stopbuffer

\startbuffer[tikz-stop]
\stoptikzpicture
\stopTEXpage
\stoptext
\stopbuffer

\defineexternalfilter
[tikzpicture]
[
  filter=context --luatex --once,
  cache=yes,
  output=\externalfilterbasefile.pdf,
  readcommand=\IncludeTikzPicture,
  bufferbefore=tikz-start,
  bufferafter=tikz-stop,
]

\define[1]\IncludeTikzPicture{\externalfigure[#1]}


\starttext
Hello

\starttikzpicture
  \draw (0,0) -- (1,1);
\stoptikzpicture
\stoptext

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] pgfplots module wrecks in latest

2023-01-16 Thread Aditya Mahajan via ntg-context
On Mon, 16 Jan 2023, Hans Hagen via ntg-context wrote:

> make sure to get rid of the t-tikz modules

Tested again. Downloaded the latest context and pgf.tds.zip from ctan. Unizip 
pgf by using 'unzip -x "**/t-*.*" so that no t- modules from tikz are unzipped 
but still get the following error on a simple hello world example:

\usemodule[tikz]

\starttext
Hello
\stoptext

gives the attached log.

Does the latest pgf/tikz run at your end?

Adityajob > passes > version mismatch: 1.32 <> 1.33
system  > 
system  > ConTeXt  ver: 2023.01.15 14:04 LMTX  fmt: 2023.1.16  int: 
english/english
system  > 
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'/opt/luametatex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name 
'/opt/luametatex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './test', input './test.tex', result './test'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './test.tex'
modules > 'tikz' is loaded
open source > level 2, order 3, name 
'/opt/luametatex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl'
open source > level 3, order 4, name 'pgfutil-common.tex'
close source> level 3, order 4, name 'pgfutil-common.tex'
open source > level 3, order 5, name 'pgfutil-context.def'
close source> level 3, order 5, name 'pgfutil-context.def'
open source > level 3, order 6, name 'pgfrcs.code.tex'
open source > level 4, order 7, name 'pgf.revision.tex'
close source> level 4, order 7, name 'pgf.revision.tex'
close source> level 3, order 7, name 'pgfrcs.code.tex'
open source > level 3, order 8, name 'pgfsys.code.tex'
open source > level 4, order 9, name 'pgfkeys.code.tex'
open source > level 5, order 10, name 'pgfkeyslibraryfiltered.code.tex'
close source> level 5, order 10, name 'pgfkeyslibraryfiltered.code.tex'
close source> level 4, order 10, name 'pgfkeys.code.tex'
cld > stack > 
cld > stack > use : slot = context.functions.register(f)
cld > stack > and : context.functions.unregister(slot)
cld > stack > 
open source > level 4, order 11, name 'pgf.cfg'
close source> level 4, order 11, name 'pgf.cfg'
Driver file for pgf: pgfsys-luatex.def

open source > level 4, order 12, name 'pgfsys-luatex.def'
open source > level 5, order 13, name 'pgfsys-common-pdf.def'
close source> level 5, order 13, name 'pgfsys-common-pdf.def'
close source> level 4, order 13, name 'pgfsys-luatex.def'
open source > level 4, order 14, name 'test.pgf'
close source> level 4, order 14, name 'test.pgf'
close source> level 3, order 14, name 'pgfsys.code.tex'
open source > level 3, order 15, name 'pgfkeys.code.tex'
close source> level 3, order 15, name 'pgfkeys.code.tex'
open source > level 3, order 16, name 'pgfsyssoftpath.code.tex'
close source> level 3, order 16, name 'pgfsyssoftpath.code.tex'
open source > level 3, order 17, name 'pgfsysprotocol.code.tex'
close source> level 3, order 17, name 'pgfsysprotocol.code.tex'
open source > level 3, order 18, name 'pgfcore.code.tex'
open source > level 4, order 19, name 'pgfmath.code.tex'
open source > level 5, order 20, name 'pgfmathutil.code.tex'
close source> level 5, order 20, name 'pgfmathutil.code.tex'
open source > level 5, order 21, name 'pgfmathparser.code.tex'
close source> level 5, order 21, name 'pgfmathparser.code.tex'
open source > level 5, order 22, name 'pgfmathfunctions.code.tex'
close source> level 5, order 22, name 'pgfmathfunctions.code.tex'
open source > level 5, order 23, name 'pgfmathfunctions.basic.code.tex'
close source> level 5, order 23, name 'pgfmathfunctions.basic.code.tex'
open source > level 5, order 24, name 
'pgfmathfunctions.trigonometric.code.tex'
close source> level 5, order 24, name 
'pgfmathfunctions.trigonometric.code.tex'
open source > level 5, order 25, name 'pgfmathfunctions.random.code.tex'
close source> level 5, order 25, name 'pgfmathfunctions.random.code.tex'
open source > level 5, order 26, name 'pgfmathfunctions.comparison.code.tex'
close source> level 5, order 26, name 'pgfmathfunctions.comparison.code.tex'
open source > level 5, order 27, name 'pgfmathfunctions.base.code.tex'
close source> level 5, order 27, name 'pgfmathfunctions.base.code.tex'
open source > level 5, order 28, name 'pgfmathfunctions.round.code.tex'
close source> level 5, order 28, name 'pgfmathfunctions.round.code.tex'
open source > level 5, order 29, name 'pgfmathfunctions.misc.code.tex'
close source> level 5, order 29, name 'pgfmathfunctions.misc.code.tex'
open source > level 5, order 30, name 

Re: [NTG-context] pgfplots module wrecks in latest

2023-01-16 Thread Aditya Mahajan via ntg-context
On Mon, 16 Jan 2023, Henri Menke via ntg-context wrote:

> On Mon, 2023-01-16 at 11:56 -0500, Aditya Mahajan wrote:
> > 
> > On Mon, 16 Jan 2023, Hans Hagen via ntg-context wrote:
> > 
> > > just load tikz first so that the right loader helpers are there
> > > 
> > > \usemodule[tikz]
> > > \usemodule[pgfplots]
> > > 
> > > \starttext
> > > Hello
> > > \stoptext
> > > 
> > > seems to work here
> > 
> > I did a fresh install of context and downloaded the latest version of
> > pgf/tikz and pgfplots from ctan. Now, something is wrong with tikz:
> > 
> > \usemodule[tikz]
> > 
> > \starttext
> > Hello
> > \stoptext
> > 
> > gives the attached log file. Not sure what changed on the tikz end. 
> 
> That's most likely due to
> 
> https://github.com/pgf-tikz/pgf/issues/1062
> https://github.com/pgf-tikz/pgf/pull/1073
> 
> but this MWE
> 
> \catcode`\@=11
> 
> \begingroup
>   \lccode`\~=`\"
>   \lowercase{\endgroup
> \def\pgfmath@catcodes{%
>   \catcode`\==12 %
>   \catcode`\,=12 %
>   \catcode`\|=12 %
>   \catcode`\&=12 %
>   \let~\pgfmath@char@quote
> }}%
> 
> {\pgfmath@catcodes "}
> 
> \bye
> 
> works in Knuth TeX, so it's likely not our fault.

I haven't looked pgf core in a while, but does it make sense to just redefine 
all the catcode jugglery in pgf as a catcodetable in m-tikz.mkxl?

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] pgfplots module wrecks in latest

2023-01-16 Thread Aditya Mahajan via ntg-context

On Mon, 16 Jan 2023, Hans Hagen via ntg-context wrote:

> just load tikz first so that the right loader helpers are there
> 
> \usemodule[tikz]
> \usemodule[pgfplots]
> 
> \starttext
> Hello
> \stoptext
> 
> seems to work here

I did a fresh install of context and downloaded the latest version of pgf/tikz 
and pgfplots from ctan. Now, something is wrong with tikz:

\usemodule[tikz]

\starttext
Hello
\stoptext

gives the attached log file. Not sure what changed on the tikz end. 

Thanks,
Aditya

system  > 
system  > ConTeXt  ver: 2023.01.15 14:04 LMTX  fmt: 2023.1.16  int: 
english/english
system  > 
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'/opt/luametatex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name 
'/opt/luametatex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './test', input './test.tex', result './test'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './test.tex'
modules > 'tikz' is loaded
open source > level 2, order 3, name 
'/opt/luametatex/texmf-context/tex/context/modules/mkxl/m-tikz.mkxl'
open source > level 3, order 4, name 'pgfutil-common.tex'
close source> level 3, order 4, name 'pgfutil-common.tex'
open source > level 3, order 5, name 'pgfutil-context.def'
close source> level 3, order 5, name 'pgfutil-context.def'
open source > level 3, order 6, name 'pgfrcs.code.tex'
open source > level 4, order 7, name 'pgf.revision.tex'
close source> level 4, order 7, name 'pgf.revision.tex'
close source> level 3, order 7, name 'pgfrcs.code.tex'
open source > level 3, order 8, name 'pgfsys.code.tex'
open source > level 4, order 9, name 'pgfkeys.code.tex'
open source > level 5, order 10, name 'pgfkeyslibraryfiltered.code.tex'
close source> level 5, order 10, name 'pgfkeyslibraryfiltered.code.tex'
close source> level 4, order 10, name 'pgfkeys.code.tex'
cld > stack > 
cld > stack > use : slot = context.functions.register(f)
cld > stack > and : context.functions.unregister(slot)
cld > stack > 
open source > level 4, order 11, name 'pgf.cfg'
close source> level 4, order 11, name 'pgf.cfg'
Driver file for pgf: pgfsys-luatex.def

open source > level 4, order 12, name 'pgfsys-luatex.def'
open source > level 5, order 13, name 'pgfsys-common-pdf.def'
close source> level 5, order 13, name 'pgfsys-common-pdf.def'
close source> level 4, order 13, name 'pgfsys-luatex.def'
open source > level 4, order 14, name 'test.pgf'
close source> level 4, order 14, name 'test.pgf'
close source> level 3, order 14, name 'pgfsys.code.tex'
open source > level 3, order 15, name 'pgfkeys.code.tex'
close source> level 3, order 15, name 'pgfkeys.code.tex'
open source > level 3, order 16, name 'pgfsyssoftpath.code.tex'
close source> level 3, order 16, name 'pgfsyssoftpath.code.tex'
open source > level 3, order 17, name 'pgfsysprotocol.code.tex'
close source> level 3, order 17, name 'pgfsysprotocol.code.tex'
open source > level 3, order 18, name 'pgfcore.code.tex'
open source > level 4, order 19, name 'pgfmath.code.tex'
open source > level 5, order 20, name 'pgfmathutil.code.tex'
close source> level 5, order 20, name 'pgfmathutil.code.tex'
open source > level 5, order 21, name 'pgfmathparser.code.tex'
close source> level 5, order 21, name 'pgfmathparser.code.tex'
open source > level 5, order 22, name 'pgfmathfunctions.code.tex'
close source> level 5, order 22, name 'pgfmathfunctions.code.tex'
open source > level 5, order 23, name 'pgfmathfunctions.basic.code.tex'
close source> level 5, order 23, name 'pgfmathfunctions.basic.code.tex'
open source > level 5, order 24, name 
'pgfmathfunctions.trigonometric.code.tex'
close source> level 5, order 24, name 
'pgfmathfunctions.trigonometric.code.tex'
open source > level 5, order 25, name 'pgfmathfunctions.random.code.tex'
close source> level 5, order 25, name 'pgfmathfunctions.random.code.tex'
open source > level 5, order 26, name 'pgfmathfunctions.comparison.code.tex'
close source> level 5, order 26, name 'pgfmathfunctions.comparison.code.tex'
open source > level 5, order 27, name 'pgfmathfunctions.base.code.tex'
close source> level 5, order 27, name 'pgfmathfunctions.base.code.tex'
open source > level 5, order 28, name 'pgfmathfunctions.round.code.tex'
close source> level 5, order 28, name 'pgfmathfunctions.round.code.tex'
open source > level 5, order 29, name 'pgfmathfunctions.misc.code.tex'
close source> level 5, order 29, name 'pgfmathfunctions.misc.code.tex'
open source > level 5, order 30, name 

Re: [NTG-context] pgfplots module wrecks in latest

2023-01-15 Thread Aditya Mahajan via ntg-context
On Fri, 30 Dec 2022, Hans Hagen via ntg-context wrote:

> On 12/30/2022 12:40 AM, Gavin via ntg-context wrote:
> > Hi List,
> > 
> > The TikZ related module “pgfplots” is causing a fatal error in the latest
> > ConTeXt. Here is a MWE:
> > 
> > 
> > \usemodule[tikz]
> > \usemodule[pgfplots]% PGFPlots module for graphs
> > 
> > \starttext
> > 
> > \starttikzpicture
> > \draw (0, 0) circle (3cm);
> > \stoptikzpicture
> > 
> > \stoptext
> > 
> > 
> > Without loading the pgfplots module, this draws a circle. With the
> > \usemodule[pgfplots] line, this has the error below before doing anything.
> > 
> > I don’t know when this started happening, because I don’t use pgfplots
> > often, but it was probably in the last couple months.
> > 
> > Thanks for all the great updates!
> these extra modules have bad loaders ... i'll send you better ones to test

pgfplots still appears to be broken in LMTX:

\usemodule[pgfplots]

\starttext
Hello
\stoptext

gives

tex error   > tex error on line 521 in file pgfplots.code.tex: Use of 
\pgfplots@command@to@string@@ doesn't match its definition




m
acro:colormap

\pgfplots@colormap@catcodemagic
 \pgfplots@command@to@string
#1#2->\expandafter \pgfplots@command@to@string@@ \meaning #1
\pgfplots@EOI {#2}


\pgfplots@command@to@string\pgfplots@colormap@catcodemagic\pgfplots@colormap@catcodemagic



@Hans, could you please send me the new loaders as well and I can test them. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Why does \doifsomething think there is content?

2023-01-15 Thread Aditya Mahajan via ntg-context
On Sun, 15 Jan 2023, Joel via ntg-context wrote:

> I am creating a book that presents readers with a list of recommended 
> materials.
> If materials are listed, then its displayed under the \subject{Materials} 
> heading in a simple itemized list.
> I'm using \doifsomething{} to check if any items are listed.

Try \doiftext which typesets the material and checks its width.

> The problem I'm having is, when fed a blank macro, `\define\needsoven{}` it 
> thinks there is content, so it displays the "Materials" heading, but an empty 
> list. I have a custom macro that determins "if oven is needed" independent of 
> these other items. So I need  `\define\needsoven{}` to be regarded as nothing.

\define\needsoven makes \needsoven non-expandable. You either need 
\defineexpandable\needsoven or use \doiftext

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Command line arguments on context project

2022-12-19 Thread Aditya Mahajan via ntg-context
On Sun, 18 Dec 2022, Alan Braslau via ntg-context wrote:

> On Fri, 16 Dec 2022 16:14:33 +
> Jethro Djan via ntg-context  wrote:
> 
> > 2. How do I get CoTeXt to recognise the ref.bib file when I run the
> > components not the product?
> > 
> > For context, I don’t want the references printed at the end of each
> > chapter but I would like the in-text citation to work (if that is
> > possible). If not, is it possible compile the whole product but only
> > output a certain page range?
> 
> You need to include the \usebtxdataset [ref.bib] in an environment file
> that gets read each run.
> 
> A limitation, or rather a design goal, of the bibliography subsystem is
> that citations will not work unless you render the bibliography list.

You can, of course, cheat:

\setbox\scratchbox\vbox{\placelistofpublications}

> Why is this? The reasoning is that it makes no sense to give list
> numbers or list labels (e.g. APA : authoryear) if there is no list, for
> these numbers or labels depend on the context (bibliography by chapter,
> by part, by volume, or by book, for example).

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] \externalfigure problem with displaying external images via https://live.contextgarden.net

2022-12-05 Thread Aditya Mahajan via ntg-context
On Mon, 5 Dec 2022, Jaroslav Hajtmar via ntg-context wrote:
> Does anyone know what the problem might be? Why online ConTeXt is not read my 
> PDF file and on other side read another PDF file? What does onlineConText not 
> like?
> I need to get my application for printing archive certificates working 
> again...

I am guessing it is a security setting to avoid DOS attack (imagine forcing the 
server to download a ridiculously large file, etc.).

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] annotated equations

2022-11-18 Thread Aditya Mahajan via ntg-context
On Thu, 17 Nov 2022, Henning Hraban Ramm via ntg-context wrote:

> Here’s an interesting example for annotated equations, done with LaTeX/TikZ:
> https://mastodon.social/@sibin/109349703357749846
> 
> I guess something similar is possible with node anchors in ConTeXt/MetaPost?

Yes, this is possible using node anchors and \hpos etc. The interface is 
slightly cumbersome, mainly because you have to make sure that anchors are 
unique. 

I sometimes use such constructs in my presentations, but not often enough to 
build a nice interface as the latex package provides. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Create the values of a sequence with Lua

2022-10-31 Thread Aditya Mahajan via ntg-context
On Mon, 31 Oct 2022, Fabrice Couvreur via ntg-context wrote:

> Hi,
> The idea is to fill the array with the sequence defined by
> p(0) = 0.3 and p(n + 1) = 0.3 + 0.7*p(n)
> The problem is that I don't really master Lua but I will learn when I have
> some time!
> Thanks for your help.
> Fabrice

You just need to adjust the order in which you are doing things...

\starttext
\startluacode
context.startxtable({"align={middle,lohi},width=2cm,bodyfont=9pt"})
local p = {}
p[0] = 0.3
for i= 0, 19 do
context.startxrow()
context.startxcell() context(i) context.stopxcell()
-- context.startxcell() context(i+1) context.stopxcell()
context.startxcell() context("%0.8f", p[i]) context.stopxcell()
context.stopxrow()
p[i+1] = 0.3 + 0.7*p[i]
end
context.stopxtable()
\stopluacode
\stoptext


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] What to do when ConTeXt not revealing the error details?

2022-10-30 Thread Aditya Mahajan via ntg-context

On Mon, 31 Oct 2022, Joel via ntg-context wrote:

>  I found what it was, a % in the text preventing a \stopitemize to close a 
> list. Thanks! --Joel

mtxrun concheck filename 

is very useful in such situations.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] new upload

2022-10-17 Thread Aditya Mahajan via ntg-context
On Mon, 17 Oct 2022, Hans Hagen via ntg-context wrote:

> On 10/17/2022 3:38 AM, Aditya Mahajan via ntg-context wrote:
> > On Sun, 16 Oct 2022, Mikael Sundqvist via ntg-context wrote:
> > 
> >> Hi,
> >>
> >> On Sun, Oct 16, 2022 at 6:07 PM Aditya Mahajan via ntg-context
> >>  wrote:
> >>>
> >>> On Fri, 14 Oct 2022, Hans Hagen via ntg-context wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> I uploaded a new version. Apart from a few fixes / extensions already
> >>>> mentioned here (or known to those who wanted it) the main changes are in
> >>>> the math goodie files (work in progress, we will clean them up later) as
> >>>> part of improving the rendering of math.
> >>>
> >>> Something is wrong with the placement of limits around an integral with
> NeoEuler:
> >>>
> >>> \usetypescriptfile[euler]
> >>>
> >>> \definetypeface[mainfont][rm][specserif][CharisSil][default]
> >>> \definetypeface[mainfont][mm][math] [eulernova][default]
> >>> \definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8,
> features=none]
> >>> \setupbodyfont[mainfont,10pt]
> >>>
> >>> \starttext
> >>> \startTEXpage[offset=1mm]
> >>>$\displaystyle \int_{0}^{1} f(x) dx$
> >>> \stopTEXpage
> >>> \stoptext
> >>>
> >>> gives the attached result.
> >>
> >> This is because the integral "sits wrong" in its boundingbox. Almost
> >> all fonts have the glyph centered around the math axis, but there are
> >> a few that doesn't. In euler-math.lfg, add the tweak
> >>
> >> {
> >> tweak = "fixoldschool",
> >> },
> > 
> > This fixes the issue with eulernova, but not with pagellaovereuler.
> pagellaovereuler uses euler-with-pagella-math as a goodie file, but that is
> missing from the distribution. (I simply copied euler-math.lfg for my use
> case).
> > 
> > With tweak=fixoldschool, \startcases doesn't work correctly (see attached):
> > 
> > \usetypescriptfile[euler]
> > 
> > \definetypeface[mainfont][rm][specserif][CharisSil][default]
> > \definetypeface[mainfont][mm][math] [eulernova][default]
> > \definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8,
> features=none]
> > \setupbodyfont[mainfont,10pt]
> > 
> > \starttext
> > \startTEXpage[offset=1mm]
> >\startformula
> >  \startcases
> >\NC A \NC B \NR
> >\NC C \NC D \NR
> >  \stopcases
> >\stopformula
> > \stopTEXpage
> > \stoptext
> 
> Looks like some older experimental value is wrong:
> 
> parameters = {
> -- DelimiterPercent=  901,
>  DelimiterShortfall  =  500,
>  },
> 
> (that whole lfg is a todo)

Thanks. This fixes the delimiters. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] new upload

2022-10-16 Thread Aditya Mahajan via ntg-context
On Sun, 16 Oct 2022, Mikael Sundqvist via ntg-context wrote:

> Hi,
> 
> On Sun, Oct 16, 2022 at 6:07 PM Aditya Mahajan via ntg-context
>  wrote:
> >
> > On Fri, 14 Oct 2022, Hans Hagen via ntg-context wrote:
> >
> > > Hi,
> > >
> > > I uploaded a new version. Apart from a few fixes / extensions already
> > > mentioned here (or known to those who wanted it) the main changes are in
> > > the math goodie files (work in progress, we will clean them up later) as
> > > part of improving the rendering of math.
> >
> > Something is wrong with the placement of limits around an integral with 
> > NeoEuler:
> >
> > \usetypescriptfile[euler]
> >
> > \definetypeface[mainfont][rm][specserif][CharisSil][default]
> > \definetypeface[mainfont][mm][math] [eulernova][default]
> > \definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8, 
> > features=none]
> > \setupbodyfont[mainfont,10pt]
> >
> > \starttext
> > \startTEXpage[offset=1mm]
> >   $\displaystyle \int_{0}^{1} f(x) dx$
> > \stopTEXpage
> > \stoptext
> >
> > gives the attached result.
> 
> This is because the integral "sits wrong" in its boundingbox. Almost
> all fonts have the glyph centered around the math axis, but there are
> a few that doesn't. In euler-math.lfg, add the tweak
> 
> {
> tweak = "fixoldschool",
> },

This fixes the issue with eulernova, but not with pagellaovereuler. 
pagellaovereuler uses euler-with-pagella-math as a goodie file, but that is 
missing from the distribution. (I simply copied euler-math.lfg for my use 
case). 

With tweak=fixoldschool, \startcases doesn't work correctly (see attached):

\usetypescriptfile[euler]

\definetypeface[mainfont][rm][specserif][CharisSil][default]
\definetypeface[mainfont][mm][math] [eulernova][default]
\definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8, 
features=none]
\setupbodyfont[mainfont,10pt]

\starttext
\startTEXpage[offset=1mm]
  \startformula
\startcases
  \NC A \NC B \NR
  \NC C \NC D \NR
\stopcases
  \stopformula
\stopTEXpage
\stoptext


Aditya

test.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] new upload

2022-10-16 Thread Aditya Mahajan via ntg-context
On Fri, 14 Oct 2022, Hans Hagen via ntg-context wrote:

> Hi,
> 
> I uploaded a new version. Apart from a few fixes / extensions already 
> mentioned here (or known to those who wanted it) the main changes are in 
> the math goodie files (work in progress, we will clean them up later) as 
> part of improving the rendering of math.

Something is wrong with the placement of limits around an integral with 
NeoEuler:

\usetypescriptfile[euler]

\definetypeface[mainfont][rm][specserif][CharisSil][default]
\definetypeface[mainfont][mm][math] [eulernova][default]
\definetypeface[mainfont][tt][mono] [dejavu][default] [rscale=0.8, 
features=none]
\setupbodyfont[mainfont,10pt]

\starttext
\startTEXpage[offset=1mm]
  $\displaystyle \int_{0}^{1} f(x) dx$
\stopTEXpage
\stoptext

gives the attached result.

Thanks,
Aditya

test.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] LMTX generates PDFs with non-working fonts on real printers

2022-10-11 Thread Aditya Mahajan via ntg-context
On Tue, 11 Oct 2022, Leah Neukirchen via ntg-context wrote:

> Hans Hagen via ntg-context  writes:

> > Once we're confident that we can catch it Leah (who does the low level
> > introspective testing with viewers, printers and tools) likely will
> > report on it and there will be a test file for users to test if what
> > we do is okay before we apply the safeguard.
> 
> There's a write up now on the issue:
> https://leahneukirchen.org/blog/archive/2022/10/50-blank-pages-or-black-box-debugging-of-pdf-rendering-in-printers.html

Wow, that was quite a ride. Kudos on getting to the bottom of this!

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Math alignment question

2022-09-23 Thread Aditya Mahajan via ntg-context
On Thu, 22 Sep 2022, Jeong Dal via ntg-context wrote:

> Dear Mikael and Hans,
> 
> Recently, you introdued the new command “\alignhere, \breakhere, \skiphere” 
> which works fine.
> 
> Since I usually use the following code that is adopted from My 
> Way(Mathalign.pdf), I’d like to know that there is a way to use “\alignhere, 
> \breakhere, \skiphere”  for the case below?
> 
> \startformula\startalign
> \NC A \NC = 3 \NR
> \NC B \NC = 5 \NR
> \stopalign\stopformula

The way I see it is that the current implementation is that it is way to break 
a _single_ long equation to multiple lines. For multiple equations, you still 
need to use the \startalign method.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Merging two lua tables

2022-08-29 Thread Aditya Mahajan via ntg-context
On Mon, 29 Aug 2022, Hans Hagen via ntg-context wrote:

> On 8/29/2022 2:20 PM, Aditya Mahajan via ntg-context wrote:
> > Hi,
> > 
> > How do I merge two lua tables? I believe that table.merge or table.merged
> should do the trick, but I cannot figure out how to use them.
> > 
> > ```
> > local t1 = { 1, 2 }
> > local t2 = { 8, 9 }
> > 
> > local m1 = {}
> > table.merge(m1,t1, t2)
> > table.print(m1)
> > 
> > local m2 = table.merged(t1, t2)
> > table.print(m2)
> > ```
> > 
> > Processing the file with context filename shows that both m1 and m2 are {8,
> 9}. What am I missing.
> table.imerge(m1,t1, t2)

Ah, thanks!

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Merging two lua tables

2022-08-29 Thread Aditya Mahajan via ntg-context
On Mon, 29 Aug 2022, Aditya Mahajan via ntg-context wrote:

> Hi,
> 
> How do I merge two lua tables? I believe that table.merge or table.merged 
> should do the trick, but I cannot figure out how to use them. 
> 
> ``` 
> local t1 = { 1, 2 }
> local t2 = { 8, 9 }
> 
> local m1 = {}
> table.merge(m1,t1, t2)
> table.print(m1)
> 
> local m2 = table.merged(t1, t2)
> table.print(m2)
> ```
> 
> Processing the file with context filename shows that both m1 and m2 are {8, 
> 9}. What am I missing. 

Looking at the code, I see what is happening. table.merge(d) assume that the 
tables are key-value tables so the keys of the first table are silently 
overwritten by the send. I guess, I'll have to write my own function to merge 
"array" tables. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Merging two lua tables

2022-08-29 Thread Aditya Mahajan via ntg-context
Hi,

How do I merge two lua tables? I believe that table.merge or table.merged 
should do the trick, but I cannot figure out how to use them. 

``` 
local t1 = { 1, 2 }
local t2 = { 8, 9 }

local m1 = {}
table.merge(m1,t1, t2)
table.print(m1)

local m2 = table.merged(t1, t2)
table.print(m2)
```

Processing the file with context filename shows that both m1 and m2 are {8, 9}. 
What am I missing. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] How can I make a Gentoo Linux package for ConTeXt LMTX?

2022-08-23 Thread Aditya Mahajan via ntg-context
On Mon, 22 Aug 2022, amano.kenji via ntg-context wrote:

> Wuh. That's a bit complex.

If you are packaging any flavor of TeX, you need to understand TDS (TeX 
Directory Structure): 

https://tug.org/tds/

ConTeXt distributions are TDS compatible, but simplify certain aspects. 
Essentially, context LMTX is distributed as a collection of TDS trees (texmf, 
texmf-context, texmf-linux, etc.) which separate the files according to their 
role. The purpose of texmfcnf.lua is to tell the binary about the location of 
the different trees. 

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Clipping multiple PDFs

2022-08-23 Thread Aditya Mahajan via ntg-context
On Tue, 23 Aug 2022, Pablo Rodriguez via ntg-context wrote:

> On 8/23/22 17:27, Aditya Mahajan via ntg-context wrote:
> > [...]
> > For a more low-level interface to finding the number of pages, see:
> >
> > https://adityam.github.io/context-blog/post/include-multi-page-pdf/
> 
> Hi Aditya,
> 
> I wonder whether your final definition should be rewritten as:
> 
>  \unexpanded\def\includePDF[#1]%
> {\getfiguredimensions[#1]
>  \dorecurse{\noffigurepages}
> {\startTEXpage
> \externalfigure[#1][page=\recurselevel]
>  \stopTEXpage}}
> 
> At least, otherwise it will only work with "talk.pdf".
> 
> Or am I missing something?

Thanks. That was a typo and is now fixed.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Clipping multiple PDFs

2022-08-23 Thread Aditya Mahajan via ntg-context
On Mon, 22 Aug 2022, Jethro Djan via ntg-context wrote:

> 
> Thanks for the solution Pablo. It works well.
> 
> I wanted to add more pdfs (which also has many pages) and found it was easier 
> for me to reason in the lua side of things. This is what I have at the moment:
> 
> \starttext
> \startluacode
>   local function doc(fil)
> return fil..[[.pdf]]
>   end
> 
>   local function disppdf(fname)
> n = 1 
> repeat 
>   context.externalfigure({fname},{
> page = n,
> width = "200mm",
> scale = "950"
>   })
>   n = n + 1
> until n == context(context.noffigurepages)
>   end
> 
>   local pdffiles = {"ass1", "ass2", "ass3", "ass4", "ass5", "ass6", "ass7", 
> "ass8"}
>   for index=1,#pdffiles do 
> local f = doc(pdffiles[index])
> context.getfiguredimensions({f})
> disppdf(pdffiles[index])
>   end
> \stopluacode
> \stoptext
> 
> I didn’t know how to get an array (or indexed table or whatever you call it) 
> in ConTeXt/Tex. My problem is now with context(context.noffigurepages). It 
> doesn’t produce an integer so n is being compared to nil. Am I calling it 
> wrong? All I want to do is call \noffigurepages from the lua side. Is there 
> something I am missing?

For a more low-level interface to finding the number of pages, see:

https://adityam.github.io/context-blog/post/include-multi-page-pdf/

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


  1   2   3   4   5   6   7   8   9   10   >