[NTG-context] Fwd: escaping \ in Lua

2023-09-05 Thread Hans Hagen via ntg-context





 Forwarded Message 
Subject: Re: [NTG-context] escaping \ in Lua
Date: Tue, 5 Sep 2023 21:00:21 +0200
From: Hans Hagen 
To: Pablo Rodriguez 

On 9/5/2023 6:43 PM, Pablo Rodriguez wrote:

Dear list,

I have the following source:

   \setupinteraction[state=start, display=new]
   \enabledirectives[references.border=darkgreen]
   \starttext
   \startTEXpage[offset=1dk]
   \attachment[method=hidden, file=a(b).pdf]
   \stopTEXpage
   \stoptext

The name in EmbeddedFiles is "a\(b\).pdf".

Sorry for the obscure question, but how can I access this with
"\goto{link to external}[a(b).pdf]"?

I guess there may be some Lua magic, but I cannot write a proper
":gsub("%(", "%\%("))".

Many thanks for your help,

\goto{link to external}[file(a(b).pdf)]


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

maillist : ntg-context@ntg.nl / 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] escaping \ in Lua

2023-09-05 Thread Pablo Rodriguez
Dear list,

I have the following source:

  \setupinteraction[state=start, display=new]
  \enabledirectives[references.border=darkgreen]
  \starttext
  \startTEXpage[offset=1dk]
  \attachment[method=hidden, file=a(b).pdf]
  \stopTEXpage
  \stoptext

The name in EmbeddedFiles is "a\(b\).pdf".

Sorry for the obscure question, but how can I access this with
"\goto{link to external}[a(b).pdf]"?

I guess there may be some Lua magic, but I cannot write a proper
":gsub("%(", "%\%("))".

Many thanks for your help,

Pablo
___
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: out of order sectionsblocks

2023-09-05 Thread Hans Hagen via ntg-context

On 9/5/2023 4:06 AM, Rik Kabel wrote:

The following example generates a log file which begins with the line

    structure   > lists > out of order sectionsblocks, maybe use
    \setsectionblock

My larger document has over a hundred of these at the beginning.

    \setupnote [endnote] [location=none]
    \starttext
      \startbodymatter
       \startchapter[title={Body}]
        \startparagraph
         \input knuthmath
         \startendnote
         \input knuth-gpt
         \stopendnote
        \stopparagraph
       \stopchapter
      \stopbodymatter
      \startbackmatter
       \startchapter[title={Notes}]
        \placenotes [endnote]
       \stopchapter
      \stopbackmatter
    \stoptext

Can the message be suppressed? Is there a better way to set up the 
document to have endnotes for text in other-than-backmatter 
sectionblocks appear in the backmatter sectionblock?


i'll bring the mewssage under tracker control and assume that you will 
answer all questions wrt side effects (in this case probably harmless 
but who knows when there is a real messed up block order cq. multiple 
same blocks used)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

maillist : ntg-context@ntg.nl / 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 Fabrice L
Dear Aditya,

> Le 5 sept. 2023 à 04:21, Aditya Mahajan  a écrit :
> 
> 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.
> 

This is working, thanks ! I tested some features of the calendar, and 
everything seems in order. I will continue today to work on this (a course 
syllabus).

> Aditya

Thanks again, you are a life saver ! 
Fabrice.


___
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] (no subject)

2023-09-05 Thread Ursula Hermann
Dear List,

After compiling the following example, which is from February 2021:
\setuppapersize[A8,landscape]
\setuplayout[leftmargin=2.5cm,
 leftmargindistance=0.2cm,
 backspace=2.9cm,
 width=4cm]
\showframe
\starttext
\margintext{\hairline\\{Me}}\dontleavehmode\hairline
\startformula
a^n + b^n = c^n.
\stopformula
\stoptext





I get:
Command Line:   context.exe --synctex=-1 "blackrule1.tex"
Startup Folder: \\ub.univie.ac.at\U_Dom\Users G-L\Hermann\Documents\Texlive


resolvers   | formats | executing runner 'run luametatex format': 
luametatex --jobname="./blackrule1.tex" --socket --shell-escape 
--fmt=C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
 
--lua=C:/Users/Hermann/Downloads/context-mswin/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
  --c:currentrun=1 --c:fulljobname="./blackrule1.tex" 
--c:input="./blackrule1.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:synctex="-1" 
--c:texmfbinpath="C:/Users/Hermann/Downloads/context-mswin/tex/texmf-mswin/bin"
"\\ub.univie.ac.at\U_Dom\Users G-L\Hermann\Documents\Texlive"
CMD.EXE wurde mit dem oben angegebenen Pfad als aktuellem Verzeichnis gestartet.
UNC-Pfade werden nicht untersttzt.
Stattdessen wird das Windows-Verzeichnis als aktuelles Verzeichnis gesetzt.
system  >
system  > ConTeXt  ver: 2023.09.03 19:03 LMTX  fmt: 2023.9.4  int: 
english/english
system  >
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'C:/Users/Hermann/Downloads/context-mswin/tex/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 
'C:/Users/Hermann/Downloads/context-mswin/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './blackrule1', input './blackrule1.tex', 
result './blackrule1'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
system  > synctex functionality is enabled, expect 5-10 pct runtime 
overhead!
runtime error : input file './blackrule1.tex' is not found, quitting
mtx-context | fatal error: return code: 1


_

ConTeXt Compilation Report (Pages: 0)

Errors: 0   Warnings: 0   Bad Boxes: 0
___
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
___