[NTG-context] Re: outlinetext broken?

2024-05-11 Thread Jairo A. del Rio
As for the current ConTeXt, the example above still produces the wrong
output. Can anyone reproduce this case? Thank you in advance.

Jairo

El sáb, 4 may 2024 a la(s) 7:23 p.m., Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:

> Hi, list
>
> \startMPpage
> draw outlinetext.d("\mathematics{\sqrt{2}-1}")(withcolor black withpen
>   currentpen) scaled 1;
> \stopMPpage
>
> fails (radicals are not drawn at all). As for context --version,
>
> mtx-context | ConTeXt Process Management 1.06
> mtx-context |
> mtx-context     | main context file:
> /usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2024.04.01 08:59
> mtx-context | main context file:
> /usr/local/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2024.04.01 08:59
>
> Maybe it's only me, but I tried with several fonts and the outcome is
> similar.
>
> Best regards,
> Jairo
>


ema.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://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: Hbox error with itemized list on second page

2024-05-08 Thread Ross Schulman
Hi everyone. Just raising this question again. Is anyone able to help me figure 
out why this is happening and how I can fix it more permanently? Thank you all 
very much!

Ross

On Mon, May 6, 2024, at 7:33 PM, Ross Schulman wrote:
> So, unfortunately while using `\testpage` helped in the version of the resume 
> I was working on at the time, I've encountered the error again now that some 
> different content is making the page break at a different point, and setting 
> `\testpage` as high as 6 is not fixing the problem. Is there something else I 
> can/should try?
> 
> Thanks very much,
> Ross
> 
> On Tue, Apr 30, 2024, at 12:20 PM, Ross Schulman wrote:
>> Thank you. Adding that did the trick!
>> 
>> Best,
>> Ross Schulman
>> 
>> On Tue, Apr 30, 2024, at 11:47 AM, Wolfgang Schuster wrote:
>>> Ross Schulman schrieb am 30.04.2024 um 15:01:
>>> > Hello,
>>> > I'm attempting to format a resume in Context building off of a template 
>>> > I found online. I'm having an odd error with some bullets on the second 
>>> > page, however. I'm guessing it has something to do with my \definelayout 
>>> > for the second (and subsequent) pages, but I can't figure it out for 
>>> > sure. What is happening is that whichever bullets are at the top of the 
>>> > second page are being wrapped as if they were appearing on the first 
>>> > page, which has a different layout structure.
>>> > 
>>> > I've pasted a sanitized version of the tex file below. Any assistance 
>>> > would be greatly appreciated!
>>> > 
>>> > Thanks,
>>> > Ross Schulman
>>> > 
>>> > 
>>> > [...]
>>> > 
>>> > Lorem Manager
>>> > \startitemize[packed]
>>> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>> > \stopitemize
>>> 
>>> You can use the \testpage command to force a page break before the TeX 
>>> mechanism to start a new page kicks in.
>>> 
>>> \startitemize[inbetween={\testpage[2]\blank}]
>>>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>> \stopitemize
>>> 
>>> Wolfgang
>>> ___
>>> If your question is of interest to others as well, please add an entry to 
>>> the Wiki!
>>> 
>>> maillist : ntg-context@ntg.nl / 
>>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>>> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
>>> archive  : https://github.com/contextgarden/context
>>> wiki : https://wiki.contextgarden.net
>>> ___
>>> 
>> 
>> ___
>> 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
>> ___
>> 
> 
> ___
> 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
> ___
> 
___
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: weird \inlinetypebuffer interaction

2024-05-07 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 07.05.2024 um 19:40:

On 5/6/24 22:45, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 06.05.2024 um 20:06:

Dear list,

I have the following sample:

\definefontfamily[mainface][tt][TeX Gyre Termes]

Apply the none feature when you set the monospace font, i.e.

\definefontfamily[...][tt][...][features=none]

Many thanks for your reply, Wolfgang.

This solves the issue, but I have two questions.

Why is this only required for \inlinetypebuffer and not for \typebuffer?

Which is the exact font feature that does the hyphen ligatures?

I’m interested in not disabling hz and hanging.


\typebuffer disables automatic \endash and \emdash with the 
\nohyphencollapsing command

but the command isn't used for \typeinlinebuffer.

\starttext

\type{--} = --

\nohyphencollapsing

\type{--} = --

\dohyphencollapsing

\type{--} = --

\stoptext

Wolfgang

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

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


[NTG-context] Re: weird \inlinetypebuffer interaction

2024-05-07 Thread Pablo Rodriguez via ntg-context
On 5/6/24 22:45, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 06.05.2024 um 20:06:
>> Dear list,
>>
>> I have the following sample:
>>
>>    \definefontfamily[mainface][tt][TeX Gyre Termes]
>
> Apply the none feature when you set the monospace font, i.e.
>
> \definefontfamily[...][tt][...][features=none]

Many thanks for your reply, Wolfgang.

This solves the issue, but I have two questions.

Why is this only required for \inlinetypebuffer and not for \typebuffer?

Which is the exact font feature that does the hyphen ligatures?

I’m interested in not disabling hz and hanging.

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://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: Hbox error with itemized list on second page

2024-05-06 Thread Ross Schulman
So, unfortunately while using `\testpage` helped in the version of the resume I 
was working on at the time, I've encountered the error again now that some 
different content is making the page break at a different point, and setting 
`\testpage` as high as 6 is not fixing the problem. Is there something else I 
can/should try?

Thanks very much,
Ross

On Tue, Apr 30, 2024, at 12:20 PM, Ross Schulman wrote:
> Thank you. Adding that did the trick!
> 
> Best,
> Ross Schulman
> 
> On Tue, Apr 30, 2024, at 11:47 AM, Wolfgang Schuster wrote:
>> Ross Schulman schrieb am 30.04.2024 um 15:01:
>> > Hello,
>> > I'm attempting to format a resume in Context building off of a template 
>> > I found online. I'm having an odd error with some bullets on the second 
>> > page, however. I'm guessing it has something to do with my \definelayout 
>> > for the second (and subsequent) pages, but I can't figure it out for 
>> > sure. What is happening is that whichever bullets are at the top of the 
>> > second page are being wrapped as if they were appearing on the first 
>> > page, which has a different layout structure.
>> > 
>> > I've pasted a sanitized version of the tex file below. Any assistance 
>> > would be greatly appreciated!
>> > 
>> > Thanks,
>> > Ross Schulman
>> > 
>> > 
>> > [...]
>> > 
>> > Lorem Manager
>> > \startitemize[packed]
>> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>> > \stopitemize
>> 
>> You can use the \testpage command to force a page break before the TeX 
>> mechanism to start a new page kicks in.
>> 
>> \startitemize[inbetween={\testpage[2]\blank}]
>>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>> \stopitemize
>> 
>> Wolfgang
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / 
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
>> archive  : https://github.com/contextgarden/context
>> wiki : https://wiki.contextgarden.net
>> ___
>> 
> 
> ___
> 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
> ___
> 
___
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: weird \inlinetypebuffer interaction

2024-05-06 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 06.05.2024 um 20:06:

Dear list,

I have the following sample:

   \definefontfamily[mainface][tt][TeX Gyre Termes]


Apply the none feature when you set the monospace font, i.e.

\definefontfamily[...][tt][...][features=none]

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

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


[NTG-context] weird \inlinetypebuffer interaction

2024-05-06 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \definefontfamily[mainface][tt][TeX Gyre Termes]
  \setupbodyfont[mainface]
  \starttext
  \startbuffer
  context --purgeall
  \stopbuffer
  inline \typeinlinebuffer

  block:
  \typebuffer
  \stoptext

As long as there is no defined font family for mono, \typeinlinebuffer
doesn’t convert -- into an en-dash (the same way as \typebuffer behaves).

But as in the sample above, when a font is defined for mono (at least
with \definefontfamily), \typeinlinebuffer converts -- into en-dashes
(different from \typebuffer).

Sorry, but how could I fix this \typeinlinebuffer?

This is important for me, since two hyphens is one of the most common
ways to marks options when invoking programs (which I try to explain to
others).

BTW, \sciteinlinebuffer seems have the same problem (in the scite module).

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://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] outlinetext broken?

2024-05-04 Thread Jairo A. del Rio
Hi, list

\startMPpage
draw outlinetext.d("\mathematics{\sqrt{2}-1}")(withcolor black withpen
  currentpen) scaled 1;
\stopMPpage

fails (radicals are not drawn at all). As for context --version,

mtx-context | ConTeXt Process Management 1.06
mtx-context |
mtx-context | main context file:
/usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2024.04.01 08:59
mtx-context | main context file:
/usr/local/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
mtx-context | current version: 2024.04.01 08:59

Maybe it's only me, but I tried with several fonts and the outcome is
similar.

Best regards,
Jairo


ema.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://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: Hbox error with itemized list on second page

2024-04-30 Thread Ross Schulman
Thank you. Adding that did the trick!

Best,
Ross Schulman

On Tue, Apr 30, 2024, at 11:47 AM, Wolfgang Schuster wrote:
> Ross Schulman schrieb am 30.04.2024 um 15:01:
> > Hello,
> > I'm attempting to format a resume in Context building off of a template 
> > I found online. I'm having an odd error with some bullets on the second 
> > page, however. I'm guessing it has something to do with my \definelayout 
> > for the second (and subsequent) pages, but I can't figure it out for 
> > sure. What is happening is that whichever bullets are at the top of the 
> > second page are being wrapped as if they were appearing on the first 
> > page, which has a different layout structure.
> > 
> > I've pasted a sanitized version of the tex file below. Any assistance 
> > would be greatly appreciated!
> > 
> > Thanks,
> > Ross Schulman
> > 
> > 
> > [...]
> > 
> > Lorem Manager
> > \startitemize[packed]
> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
> >\item \ipsum[alternative=words, n=10, inbetween=\space] \par
> > \stopitemize
> 
> You can use the \testpage command to force a page break before the TeX 
> mechanism to start a new page kicks in.
> 
> \startitemize[inbetween={\testpage[2]\blank}]
>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
>\item \ipsum[alternative=words, n=10, inbetween=\space] \par
> \stopitemize
> 
> Wolfgang
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
> 
___
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: Hbox error with itemized list on second page

2024-04-30 Thread Wolfgang Schuster

Ross Schulman schrieb am 30.04.2024 um 15:01:

Hello,
I'm attempting to format a resume in Context building off of a template 
I found online. I'm having an odd error with some bullets on the second 
page, however. I'm guessing it has something to do with my \definelayout 
for the second (and subsequent) pages, but I can't figure it out for 
sure. What is happening is that whichever bullets are at the top of the 
second page are being wrapped as if they were appearing on the first 
page, which has a different layout structure.


I've pasted a sanitized version of the tex file below. Any assistance 
would be greatly appreciated!


Thanks,
Ross Schulman


[...]

Lorem Manager
\startitemize[packed]
   \item \ipsum[alternative=words, n=10, inbetween=\space] \par
   \item \ipsum[alternative=words, n=10, inbetween=\space] \par
   \item \ipsum[alternative=words, n=10, inbetween=\space] \par
   \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize


You can use the \testpage command to force a page break before the TeX 
mechanism to start a new page kicks in.


\startitemize[inbetween={\testpage[2]\blank}]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

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

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


[NTG-context] Re: Font switching for titles and subtitle not working as expected ?

2024-04-30 Thread Wolfgang Schuster

denis.ma...@unibe.ch schrieb am 30.04.2024 um 14:22:


Hi,

I just jumbled upon this question on tex stackexchange : 
https://tex.stackexchange.com/questions/715799/context-switching-font-for-both-title-and-subject#715804


Using the style key as suggested in the accepted answer works, but 
I’ve had a look in to this, and I don’t understand why the original 
code does not work.


I’ve also tried to find a solution using textcommand instead of 
command, but that makes no difference. Only one setting will be 
accepted. As soon as both, titles and subjects, are changed only the 
first change will be accepted.


Is this a bug, or am I missing something?



When you load a typescript only in a local group (e.g. a section title) 
you should always load it

at the start of the document to avoid such side effects.

    \usebodyfont[chorus] % load the chorus typescript
    \setupbodyfont[modern] % set the default font for the document

Wolfgang

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

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


[NTG-context] Hbox error with itemized list on second page

2024-04-30 Thread Ross Schulman
Hello,
I'm attempting to format a resume in Context building off of a template I found 
online. I'm having an odd error with some bullets on the second page, however. 
I'm guessing it has something to do with my \definelayout for the second (and 
subsequent) pages, but I can't figure it out for sure. What is happening is 
that whichever bullets are at the top of the second page are being wrapped as 
if they were appearing on the first page, which has a different layout 
structure.

I've pasted a sanitized version of the tex file below. Any assistance would be 
greatly appreciated!

Thanks,
Ross Schulman


\usemodule[ipsum]
\setuppapersize[letter]
\setuppagenumbering[location=]
\definelayout[first]
  [% horizontal
   backspace=2.5in,
   leftmargin=1.75in,
   leftmargindistance=0.25in,
   width=5.5in,
   rightmargin=0in,
   % vertical
   topspace=0pt,
   header=1.2in,
   headerdistance=.1in,
   height=middle,
   footerdistance=0pt,
   footer=\lineheight,
   bottomspace=.5in]

\definelayout[rest]
  [% horizontal
leftmargin=0in,
width=6.5in,
rightmargin=0in,
% % vertical
topspace=0pt,
header=1in,
headerdistance=.1in,
height=middle,
footerdistance=0pt,
footer=\lineheight,
bottomspace=.3in]

\definelayout[1][first]
\definelayout[2][rest]

\setupmarginblock
  [location=left,
   width=\leftmarginwidth,
   align=flushright]

\usecolors[svg]

\definehead[contacts][title]
\setuphead
[contacts]
[
align=center,
page=no,
after={\thinrule\blank[big]}]

\definehead[topic][subject]
\setuphead
[topic]
[
after={\hairline}]

\defineitemgroup
  [timeline]
  [before=,
   inbetween=,
   width=6em]

\setuplines[before=,after=,command=\strut]

\definelayer[mybkgr][x=0mm,y=0mm,
  width=\paperwidth,height=\paperheight]

\setupbackgrounds[page][background={mybkgr}]

\starttext
\setlayerframed
  [mybkgr]
  []
  [background=color,
   framecolor=forestgreen,
   backgroundcolor=forestgreen,
   foregroundcolor=white,
   width=\paperwidth,
   height=\dimexpr\topspace+\headerheight\relax]
{\dontleavehmode{\tfd ROSS SCHULMAN}\blank[medium]
policy technologist
}

\startmarginblock
\topic{CONTACT}
\startlines
1234 Main St NW
Washington, DC 20011
\stoplines

\topic{LANGUAGES}
\startlines
English (Native Speaker)
Spanish (Conversational)
\stoplines

\topic{TECH}
\startlines
Rust
Javascript \letterampersand\space Typescript
Linux Administration
Google and Microsoft Office Suites
\stoplines
\stopmarginblock

\setupalign[flushleft]
\topic{EXPERIENCE}
\starttimeline
\sym{2021--Now}\color[forestgreen]{Lorem Ipsum Foundation}\hfill
\color[darkgrey]{\tfx San Francisco, CA (remote)}

Senior Fellow
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

\sym{2015--2021}\color[forestgreen]{Other Place About Lorem}\hfill
\color[darkgrey]{\tfx Washington, DC}

Senior Lorem Counsel
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

\sym{2014--2015}\color[forestgreen]{Lorems R Us}\hfill
\color[darkgrey]{\tfx Washington, DC}

Lorem Manager
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

\sym{2010--2014}\color[forestgreen]{Computer and Communications Industry 
Association}\hfill
\color[darkgrey]{\tfx Washington, DC}

Lorem Project Manager
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

\sym{2005--2007}\color[forestgreen]{Center for Lorem Ipsum}\hfill
\color[darkgrey]{\tfx Washington, DC}

Program Associate
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize
\stoptimeline
\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

[NTG-context] Font switching for titles and subtitle not working as expected ?

2024-04-30 Thread denis.maier
Hi,
I just jumbled upon this question on tex stackexchange : 
https://tex.stackexchange.com/questions/715799/context-switching-font-for-both-title-and-subject#715804
Using the style key as suggested in the accepted answer works, but I've had a 
look in to this, and I don't understand why the original code does not work.
I've also tried to find a solution using textcommand instead of command, but 
that makes no difference. Only one setting will be accepted. As soon as both, 
titles and subjects, are changed only the first change will be accepted.

Is this a bug, or am I missing something?

Best,
Denis


%
% Original MWE

\define[2]\mytitle{%
  \switchtobodyfont[chorus]%
  #2
}

\define[2]\mysubject{%
  \switchtobodyfont[chorus]%
  #2
}

\setuphead[title][command=\mytitle]
\setuphead[subject][command=\mysubject]

\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\stoptext
%

%
% Adapted MWE
%

\define[1]\mytitleformat{%
  \switchtobodyfont[chorus]%
  #1
}

%\setuphead[subject,title][textcommand=\mytitleformat]
%\setuphead[title][textcommand=\mytitleformat]
\setuphead[subject][textcommand=\mytitleformat] % this will adapt the format 
for subjects, as long as titles are not changed


\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\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: QR Code (Henning Hraban Ramm)

2024-04-29 Thread Benjamin Buchmuller
Hi Hraban,

Downgrading zint to 2.12.0 worked for me. Many thanks!

In case someone is experiencing similar issues, I ran:

brew remove zint
curl 
https://raw.githubusercontent.com/Homebrew/homebrew-core/962d789d26c9d8f760affe272689f21388f7d3e2/Formula/z/zint.rb
 > zint.rb
brew install zint.rb
zint --version (should be 2.12.0)

[follow the instructions to symlink zint to 
tex/texmf-osx-64/bin/lib/luametatex/zint]

mtxrun --generate


___
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: unprotecting when defining in Lua

2024-04-29 Thread Pablo Rodriguez via ntg-context
On 4/29/24 19:32, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 18:21:
>> Is \protected the same as \unexpanded?
>
> Yes they are the same (\protected is the primitive and \unexpanded is a
> copy) but this wasn't always the case.
>
> Original TeX didn't provide a mechanism to create protected commands
> and creators of macro packages had to create their own mechanism for
> this, the ConTeXt solution was \unexpanded. With the etex extensions
> the \protected primitive was added and \unexpanded uses the new
> primitive when you used a engine which supported it.

Many thanks for your fast reply and your explanation, Wolfgang.

Pablo

___
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: unprotecting when defining in Lua

2024-04-29 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 18:21:

On 4/29/24 18:04, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22:

[...]
Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.

You can't create unprotected command with interfaces.definecommand
but this not a problem because you can just use interfaces.implement
to create your command which is then unprotected by default. Using
implement instead of definecommand doesn't matter because
definecommand is just a wrapper for the implement function with the
option to create a environment.

Many thanks for your fast reply, Wolfgang.

I’m reading it now in cld-mkiv.pdf.

Is \protected the same as \unexpanded?


Yes they are the same (\protected is the primitive and \unexpanded is a 
copy) but this wasn't always the case.


Original TeX didn't provide a mechanism to create protected commands and 
creators of macro packages
had to create their own mechanism for this, the ConTeXt solution was 
\unexpanded. With the etex extensions
the \protected primitive was added and \unexpanded uses the new 
primitive when you used a engine

which supported it.

Wolfgang

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

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


[NTG-context] Re: unprotecting when defining in Lua

2024-04-29 Thread Pablo Rodriguez via ntg-context
On 4/29/24 18:04, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22:
>> [...]
>> Which is the right way to use "interfaces.definecommand" to get a simple
>> command as in standard TeX?
>>
>> I mean, no a non \permanent or non \protected command.
>
> You can't create unprotected command with interfaces.definecommand
> but this not a problem because you can just use interfaces.implement
> to create your command which is then unprotected by default. Using
> implement instead of definecommand doesn't matter because
> definecommand is just a wrapper for the implement function with the
> option to create a environment.

Many thanks for your fast reply, Wolfgang.

I’m reading it now in cld-mkiv.pdf.

Is \protected the same as \unexpanded?

Many thanks for your help again,

Pablo
___
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: unprotecting when defining in Lua

2024-04-29 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22:

Dear list,

I have the following sample:

   \starttext
   \startluacode
 function document.test(str)
   context(str)
 end

 interfaces.definecommand {
   name = "testing",
   protected = false,
   macro = document.test,
 }
   \stopluacode

   \meaningfull\testing

   \def\test#1{#1}

   \meaningfull\test
   \stoptext

Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.


You can't create unprotected command with interfaces.definecommand but 
this not a problem
because you can just use interfaces.implement to create your command 
which is then unprotected
by default. Using implement instead of definecommand doesn't matter 
because definecommand
is just a wrapper for the implement function with the option to create a 
environment.


Wolfgang

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

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


[NTG-context] unprotecting when defining in Lua

2024-04-29 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \startluacode
function document.test(str)
  context(str)
end

interfaces.definecommand {
  name = "testing",
  protected = false,
  macro = document.test,
}
  \stopluacode

  \meaningfull\testing

  \def\test#1{#1}

  \meaningfull\test
  \stoptext

Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.

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://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: QR Code

2024-04-29 Thread Henning Hraban Ramm

Hi Ben,

I’m not sure if this is your issue, but the zint library’s API used to 
change with every version, so that ConTeXt supports only the “latest” 
few, and probably that’s still 2.10 to 2.12.


I still have 2.12 via MacPorts on MacOS 10.15, and it works.
Can you try an older zint version?

And just for information, MkIV used to call the zint binary, while LMTX 
uses the library to create the structures and converts them via MP into 
PDF objects (no additional files).


Hraban

Am 29.04.24 um 05:03 schrieb Benjamin Buchmuller:

Catching up on an earlier thread by Ursula and Hraban,

I'm also experienceing problems with \usemodule[zint] while \usemodule[t-zint] 
works fine.

Running on macOS (ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.28).

The issue seems somewhat unrelated to ConTeXt on first glance (??) if this is 
helpful. My code stopped working after I updated the OS (to Sonoma) and my 
homebrew cellar (to zint 2.13.0) while keeping a ConTeXt version from 2022 
which compiled the barcodes perfectly fine before these updates. This being 
said, the newer ConTeXt version doesn't resolve the issue.

Observations:

1) Zint (and Inkscape) is in my PATH and correctly sym-linked as specified in the 
wiki (~/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so 
<http://libzint.so/>). However, the library was (still) not fount after mtxrun 
--generate

[This seems an odd, but unrelated problem]

2) So, I hardcoded libfile in libs-impzint.lmt to

local libfile = "/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib"

3) Running the wiki example:

   \usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm]
\barcode[alternative=qrcode, text={https://wiki.contextgarden.net},
width=3cm]
\barcode[alternative=maxicode, text={test}, width=3cm]
\stoptext

* With \usemodule[m-zint], I correctly get:

zint --barcode=qrcode  --output="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.eps" 
--input="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.tmp"
zint --barcode=maxicode  --output="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.eps" 
--input="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.tmp"

[Barcodes show up as expected]

* With \usemodule[zint], no success:

optional> using library 
'/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib'
zint> something went wrong: invalid result vector
zint> something went wrong: invalid result
zint> something went wrong: invalid result vector

Maybe this is helpful to pinpoint the issue?


___
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: QR Code

2024-04-28 Thread Benjamin Buchmuller
Catching up on an earlier thread by Ursula and Hraban,

I'm also experienceing problems with \usemodule[zint] while \usemodule[t-zint] 
works fine. 

Running on macOS (ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.28).

The issue seems somewhat unrelated to ConTeXt on first glance (??) if this is 
helpful. My code stopped working after I updated the OS (to Sonoma) and my 
homebrew cellar (to zint 2.13.0) while keeping a ConTeXt version from 2022 
which compiled the barcodes perfectly fine before these updates. This being 
said, the newer ConTeXt version doesn't resolve the issue.

Observations:

1) Zint (and Inkscape) is in my PATH and correctly sym-linked as specified in 
the wiki (~/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so 
<http://libzint.so/>). However, the library was (still) not fount after mtxrun 
--generate

[This seems an odd, but unrelated problem]

2) So, I hardcoded libfile in libs-impzint.lmt to

local libfile = "/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib"

3) Running the wiki example:

  \usemodule[m-zint]
   \starttext
   \barcode[alternative=isbnx, text=9783865419026, width=4cm]
   \barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, 
   width=3cm]
   \barcode[alternative=maxicode, text={test}, width=3cm]
   \stoptext

* With \usemodule[m-zint], I correctly get:

zint --barcode=qrcode  
--output="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.eps" 
--input="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.tmp"
zint --barcode=maxicode  
--output="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.eps" 
--input="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.tmp"

[Barcodes show up as expected]

* With \usemodule[zint], no success:

optional> using library 
'/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib'
zint> something went wrong: invalid result vector
zint> something went wrong: invalid result
zint> something went wrong: invalid result vector

Maybe this is helpful to pinpoint the issue?

Best


Ben
___
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 Difference Between \placefloat and \definefloat

2024-04-28 Thread Henning Hraban Ramm
Where’s the float type "sidebar" defined? AFAIK it’s not a default type. 
And it might interfere with the actual sidebar stuff from 
https://source.contextgarden.net/tex/context/base/mkxl/anch-bar.mkxl, 
see also https://wiki.contextgarden.net/Command/setupsidebar


Hraban

Am 28.04.24 um 19:54 schrieb urba...@ca.rr.com:
I swear I used to understand this stuff.  I plead old age.   Why do I 
get two different results from the float placements here:


\definefloat[mysidebar][mysidebars]
\setupfloat[mysidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]

\defineframedtext [sidebartext]
[width=.4\textwidth,bodyfont=small,corner=round,background=color,backgroundcolor=lightgray,align=flushleft]

\starttext
This is a bit of text
\placefloat[sidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]{}{
\startsidebartext
This is a short sidebar
\stopsidebartext
}
And something to follow.

A bit of text
\placemysidebar{}{
\startsidebartext
This is a short sidebar
\stopsidebartext
}
And something to follow.

\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: \par and \startlines

2024-04-27 Thread Henning Hraban Ramm

Am 26.04.24 um 18:24 schrieb Wolfgang Schuster:
BTW: ConTeXt has a module for poems which can be loaded with 
\usemodule[format].


Never heard of it. Version says “ancient” ;)

https://source.contextgarden.net/tex/context/modules/mkiv/m-format.mkiv

What’s the advantage of all this markup over simple "lines" (or even 
\par after each line)?


I’ll need to typeset a book of poetry soon, that will probably need a 
lot of different indentation/aligments…


Hraban

___
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: \par and \startlines

2024-04-26 Thread Pablo Rodriguez via ntg-context
On 4/26/24 19:52, Denis Maier via ntg-context wrote:
>> Wolfgang Schuster hat am 26.04.2024 19:29 CEST geschrieben:
>> The inbetween setting works because ConTeXt checks at the start of
>> each line whether it's empty (in this case the value is used) or not.
>>
>> When you add a \par you just end the current line/paragraph and it
>> doesn't matter how many \par's you use because TeX just ignores them.
>  
> I see. But there's no command that could be used to simulate an empty line?

Crappy code:

  \starttext
  a\dorecurse{25}{\par}b
  a\dorecurse{25}{\null\par}b
  \stoptext

Just to show it could be achieved,

Pablo
___
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: wrong spacing after command with optional arguments

2024-04-26 Thread Pablo Rodriguez via ntg-context
On 4/26/24 19:50, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 19:04:
>> I tried this approach (I hope it isn’t wrong):
>>
>>\starttext
>>\expanded\tolerant\def\MyCommand#_#,#_#,#_#,#_{%
>
> The \expanded modifier is wrong (I guess you meant \unexpanded) but
> which check for the number of arguments you use doesn't matter in a
> document.

You are right, I meant \unexpanded.

> The LMTX version of the \iffourthargument etc. checks is the
> \ifarguments commands where you use \or to set a case for the number of
> argument passed.

Many thanks for explaining this too.

>> But what are these "#_" (which don’t seem to come from TeX)?
>
> Hans added many additions to command parameters in Luametatex and #_
> means the argument to a commands has to be enclosed in braces while #1
> allows you to pass text without it.

I get it now.

> You can find a list with all new command parameters in lowlevel-macros.pdf.

An interesting reading for the weekend.

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://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: \par and \startlines

2024-04-26 Thread Denis Maier via ntg-context


 
 
  
    
   
   
   
Wolfgang Schuster  hat am 26.04.2024 19:29 CEST geschrieben:

   
 

   
 
Denis Maier schrieb am 26.04.2024 um 19:18:



  
 
 
 
  Wolfgang Schuster  hat am 26.04.2024 18:24 CEST geschrieben:
  
 
   
  
 
   
  Denis Maier via ntg-context schrieb am 26.04.2024 um 18:10: 
  
  
   
   
Pablo Rodriguez via ntg-context <ntg-context@ntg.nl> hat am 26.04.2024 17:25 CEST geschrieben:

   
 

   
 

   
On 4/26/24 15:33, denis.ma...@unibe.ch wrote:



 Hi,
 



 I’m trying to typeset a poem from XML, but I can’t figure out how to
 

 make the inbetween key working here.
 



 As the source is XML, I cannot just add an empty line to start a new
 

 group of lines inside \startlines…\stoplines. I guess, there must be a
 

 command to do that, but \par seems to have no effect here.
 



 How can this be done?
 

   
Hi Denis,

   
 

   
I must confess I don’t get which is your actual question.

   
 

   
\blank works here and you know that (since you included it in your code).

   
 

   
MkIV with \par works in your sample and LMTX with \par doesn’t.

   
 

   
I wonder whether this might be a bug in LMTX.

   
 

   
Just in case it might help,

   
  
    
   
  
   Thanks for your answer and sorry for not being clearer. I was just wondering why the \par seems to have no effect. (I first guessed that it might be related to XML, to but then realized it happens with context markup as well. Usually, you won't run into this because an empty line works, but with XML that's not am option.) As you've said, it looks like a bug then.
   
  
 The lines environment treats each line of the input as paragraph by adding \par at the end of it and adding another \par makes no difference here. 
 
 BTW: ConTeXt has a module for poems which can be loaded with \usemodule[format]. 
 
 Wolfgang 
 
 
 

 Ok. I'll have a look at this module. Just two questions:
 

 1. so did this behavior change? 
 

 2. What is inbetween referring to then? If each line is a paragraph, what's this group of paragraphs then? Can you manually switch to the next one?
 

   The inbetween setting works because ConTeXt checks at the start of each line whether it's empty (in this case the value is used) or not.
   
   When you add a \par you just end the current line/paragraph and it doesn't matter how many \par's you use because TeX just ignores them.
   
   Wolfgang
   
  
    
   
  
   I see. But there's no command that could be used to simulate an empty line?
   
  
   If not, me should I perhaps try to replicate the wrapper structure from the XML source in context? (I'll also look into the format module of course.) What do you think?
   
  
    
   
  
   Thank you so much for your help.
   
  
   Best,
   
  
   Denis 
  
 

___
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: wrong spacing after command with optional arguments

2024-04-26 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 19:04:

On 4/26/24 18:18, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 17:29:

What is wrong in my definition above?


There is nothing wrong, this is just a side effect of the scanner used
with the \do...groupempty commands. To have more control about this
behavior use the \tolerant modifier for \def to change it.


Many thanks for your reply, Wolfgang.

I tried this approach (I hope it isn’t wrong):

   \starttext
   \expanded\tolerant\def\MyCommand#_#,#_#,#_#,#_{%
 \doiftextelse{#4}%
   {#4}
   {\doiftextelse{#3}
 {#3}
 {#2}}}


The \expanded modifier is wrong (I guess you meant \unexpanded) but 
which check for the number of arguments you use doesn't matter in a 
document.


The LMTX version of the \iffourthargument etc. checks is the 
\ifarguments commands where you use \or to set a case for the number of 
argument passed.


\protected\tolerant\def\MyCommand#_#,#_#,#_#,#_%
  {\ifarguments
 % no arguments are passed
   \or
 #1% one argument is passed
   \or
 #2% two arguments are passed
   \or
 #3% three arguments are passed
   \or
 #4% four arguments are passed
   \fi}



   \MyCommand{}{second}{third}{fourth},\\
   \MyCommand{}{second}{third}{fourth} e,\\

   \MyCommand{}{second}{third},\\
   \MyCommand{}{second}{third} e,\\

   \MyCommand{}{second},\\
   \MyCommand{}{second} e,\\
   \stoptext

BTW, this is the first time I see #_ instead of #1.

There is no way to search for "#_" in the wiki.

Grepping the source, "#_" seems to be used for optional arguments
(mainly in syst-aux.mkxl).

But what are these "#_" (which don’t seem to come from TeX)?


Hans added many additions to command parameters in Luametatex and #_ 
means the argument to a commands has to be enclosed in braces while #1

allows you to pass text without it.

In the following example \CommandA take in the first case "a" as 
argument while CommandB ignores it and would only accept "{a}" with 
braces around it.


 begin example
 \def\CommandA#1{(#1)}
\tolerant\def\CommandB#_{(#1)}

\starttext

\CommandA abc\par
\CommandB abc\blank

\CommandA {ab}c\par
\CommandB {ab}c\blank

\stoptext
 end example

You can find a list with all new command parameters in lowlevel-macros.pdf.

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

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


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Wolfgang Schuster

Denis Maier schrieb am 26.04.2024 um 19:18:
Wolfgang Schuster  hat am 
26.04.2024 18:24 CEST geschrieben:

Denis Maier via ntg-context schrieb am 26.04.2024 um 18:10:
Pablo Rodriguez via ntg-context <mailto:ntg-context@ntg.nl>> hat am 26.04.2024 17:25 CEST geschrieben:
On 4/26/24 15:33, denis.ma...@unibe.ch 
<mailto:denis.ma...@unibe.ch> wrote:
Hi, 
I’m trying to typeset a poem from XML, but I can’t figure out how to
make the inbetween key working here. 
As the source is XML, I cannot just add an empty line to start a new
group of lines inside \startlines…\stoplines. I guess, there must 
be a
command to do that, but \par seems to have no effect here. 
How can this be done? 

Hi Denis,
I must confess I don’t get which is your actual question.
\blank works here and you know that (since you included it in your 
code).

MkIV with \par works in your sample and LMTX with \par doesn’t.
I wonder whether this might be a bug in LMTX.
Just in case it might help, 
Thanks for your answer and sorry for not being clearer. I was just 
wondering why the \par seems to have no effect. (I first guessed 
that it might be related to XML, to but then realized it happens 
with context markup as well. Usually, you won't run into this 
because an empty line works, but with XML that's not am option.) As 
you've said, it looks like a bug then. 


The lines environment treats each line of the input as paragraph by 
adding \par at the end of it and adding another \par makes no 
difference here.


BTW: ConTeXt has a module for poems which can be loaded with 
\usemodule[format].


Wolfgang


Ok. I'll have a look at this module. Just two questions:
1. so did this behavior change?
2. What is inbetween referring to then? If each line is a paragraph, 
what's this group of paragraphs then? Can you manually switch to the 
next one?


The inbetween setting works because ConTeXt checks at the start of each 
line whether it's empty (in this case the value is used) or not.


When you add a \par you just end the current line/paragraph and it 
doesn't matter how many \par's you use because TeX just ignores them.


Wolfgang

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

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


[NTG-context] Re: wrong spacing after command with optional arguments

2024-04-26 Thread Pablo Rodriguez via ntg-context
On 4/26/24 18:18, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 17:29:
>> What is wrong in my definition above?
>
> There is nothing wrong, this is just a side effect of the scanner used
> with the \do...groupempty commands. To have more control about this
> behavior use the \tolerant modifier for \def to change it.

Many thanks for your reply, Wolfgang.

I tried this approach (I hope it isn’t wrong):

  \starttext
  \expanded\tolerant\def\MyCommand#_#,#_#,#_#,#_{%
\doiftextelse{#4}%
  {#4}
  {\doiftextelse{#3}
{#3}
{#2}}}

  \MyCommand{}{second}{third}{fourth},\\
  \MyCommand{}{second}{third}{fourth} e,\\

  \MyCommand{}{second}{third},\\
  \MyCommand{}{second}{third} e,\\

  \MyCommand{}{second},\\
  \MyCommand{}{second} e,\\
  \stoptext

BTW, this is the first time I see #_ instead of #1.

There is no way to search for "#_" in the wiki.

Grepping the source, "#_" seems to be used for optional arguments
(mainly in syst-aux.mkxl).

But what are these "#_" (which don’t seem to come from TeX)?

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://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: Combine lua and btx setup, was: Re: Customize citation format of a bibliography (use the short form as reference format)

2024-04-25 Thread Gerion Entrup
I solved it, although it's kinda hacky. I'm pretty sure that
publications.citevariants.short is not meant to be called directly.

Do you know why `context.getdetail(dataset, tag, "author")` does not work in 
render_cite?
It always returns nil.


```
\setupinteraction[state=start]

\startbuffer[testdata]
@Book{knuth1,
author = {Donald E. Knuth},
    title = {TEX and METAFONT. New directions in typesetting},
year = {1979},
publisher = {Addison-Wesley},
}
@Article{someother,
author = {Some Person and Some Otherperson},
title = {Another title},
year = {1900},
}
\stopbuffer

% enable tracing
\enabletrackers[publications, publications.crossref, publications.details, 
publications.cite, publications.strings]

\usebtxdataset[main][testdata.buffer]
\usebtxdefinitions[aps]
\setupbtx[dataset=main]
\definebtxrendering[bibrendering][aps][dataset=main, numbering=short]
\setupbtxlist[aps][
  alternative=b,
  distance=.5em,
]

\definebtx[aps:cite:special][aps:cite]
\startluacode
function render_cite(dataset, tag, righttext)
local luadata = publications.datasets[dataset].luadata
local entry = luadata[tag]
local extrasign = ""
if entry.author:lower():find("knuth") then
extrasign = ">"
end
context("[" .. extrasign)
print(righttext)
publications.citevariants.short({dataset = dataset, reference = tag, 
variant = "short", righttext = righttext})
context("]")
end
\stopluacode

\startsetups btx:aps:cite:special
\btxcitereference
\ctxlua{render_cite([==[\currentbtxdataset]==], [==[\currentbtxtag]==], 
[==[\currentbtxrighttext]==])}
\stopsetups
\setupbtx[aps:cite][alternative=special]

\starttext

\def\comma{,}

Knuth developed \TeX~\cite[knuth1]
Several persons said something~\cite[someother].

\placelistofpublications[bibrendering]

\stoptext
```

Gerion

Am Dienstag, 23. April 2024, 16:03:50 MESZ schrieb Gerion Entrup:
> Here is a solution for the first part of my question. This is based on
> https://www.mail-archive.com/ntg-context@ntg.nl/msg101156.html
> and try and error based on publ-imp-aps.mkvi and publ-imp-apa.mkvi:
> 
> It display now the citation _and_ numbering labels in the short form:
> ```
> \setupinteraction[state=start]
> 
> \startbuffer[testdata]
> @Book{knuth1,
>   author = {Donald E. Knuth},
>   title = {TEX and METAFONT. New directions in typesetting},
>   year = {1979},
>   publisher = {Addison-Wesley},
> }
> @Article{someother,
>   author = {Some Person and Some Otherperson},
>   title = {Another title},
>   year = {1900},
> }
> \stopbuffer
> 
> % enable tracing
> \enabletrackers[publications, publications.crossref, publications.details, 
> publications.cite, publications.strings]
> 
> \usebtxdataset[main][testdata.buffer]
> \usebtxdefinitions[aps]
> \setupbtx[dataset=main]
> \definebtxrendering[bibrendering][aps][dataset=main, numbering=short]
> \setupbtxlist[aps][
>   alternative=b,
>   distance=.5em,
> ]
> \setupbtx[aps:cite][alternative=short]
> 
> \starttext
> 
> Knuth developed \TeX \cite[knuth1]
> Several persons said something \cite[someother].
> 
> \placelistofpublications[bibrendering]
> 
> \stoptext
> ```
> 
> The remaining part now is to mark publications of Knuth in a different way.
> I have tried this and failed. Here is my code so far:
> ```
> \startluacode
> function render_cite(short, author)
>   print(author)
>   if author:lower():find("knuth") then
>   context("[>" .. short .. "]")
>   else
>   context("[" .. short .. "]")
>   end
> end
> \stopluacode
> \definebtx[aps:cite:special][aps:cite]
> \startsetups btx:aps:cite:special
>   \btxcitereference
>   \ctxlua{render_cite([==[\btxflush{year}]==], [==[\btxflush{author}]==])}
> \stopsetups
> % use it with \cite[special][knuth1]
> ```
> This has several problems:
> - \btxflush{short} does not work as I expected that. How can I get the short 
> form?
> - \btxflush to pass arguments to lua does not work as intended. On the lua 
> side the
>variable "author" resolves to "\btxflushauthor{author}" and not to "D. E. 
> Knuth".
>How can I pass the data?
> 
> I use Lua only because I find it more convenient as a programming language. 
> If a
> plain tex solution is simpler, I'm happy to use that. 
> 
> 
> Another question that came up while studying the source code:
> What effect have \c!, \s!, and \v!? These commands exist a lot in the above
> cited files.
> 
> Gerion
> 
> 
> Am Mittwoch, 17. Ap

[NTG-context] Re: documentation: parameters of \setuplist

2024-04-24 Thread Henning Hraban Ramm

Am 24.04.24 um 01:00 schrieb Bruce Horrocks:

In the source there is a comment relating to location:

%D Regular list entries are bound to a specific location in order to get the 
right
%D pagenumber etc.\ associated. When pushing something inbetween (in mkiv) it 
ends
%D up directtly in the list. This is the default because otherwise users will 
wonder
%D why spacing might get messed up (due to an unseen but present node). It is
%D possible to force a location by explicitly setting \type {location} to \type
%D {here}.
%D
%D Another way to force a certain order is to set the \type {order} variable 
when
%D placing a list. The \type {command} option only pushes commands into the 
right
%D order, and \type {all} orders all entries (which might be too much). In this 
case
%D no specific location is needed with the inbetween method. Maybe additional
%D mechanisms show up some day. See \type {inbetween-001.tex} for an example.

I don't really understand what capability the comment is referring to let alone 
be able to create an example demonstrating the difference.


Thank you, so it looks like "location=here" is only used with 
\writebetweenlist to get the current page number.


Hraban
___
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: documentation: parameters of \setuplist

2024-04-24 Thread Bruce Horrocks


> On 23 Apr 2024, at 20:43, Henning Hraban Ramm  wrote:
> 
> Am 22.04.24 um 18:09 schrieb Henning Hraban Ramm:
>> I tried to complete https://wiki.contextgarden.net/Command/setuplist, but I 
>> don’t understand all parameters.
>> Can anyone explain these please:
>> * state (start stop): what does this en-/disable? collecting entries?
>> * label (yes no none Name): language dependent labels? as a prefix or what?
>> * location (none, here): disable placement? when makes this sense?
>> * symbol (one two three none default): where is this used?
> 
> One solved, still 4 to go… Please, anyone who used these?

In the source there is a comment relating to location:


%D Regular list entries are bound to a specific location in order to get the 
right
%D pagenumber etc.\ associated. When pushing something inbetween (in mkiv) it 
ends
%D up directtly in the list. This is the default because otherwise users will 
wonder
%D why spacing might get messed up (due to an unseen but present node). It is
%D possible to force a location by explicitly setting \type {location} to \type
%D {here}.
%D
%D Another way to force a certain order is to set the \type {order} variable 
when
%D placing a list. The \type {command} option only pushes commands into the 
right
%D order, and \type {all} orders all entries (which might be too much). In this 
case
%D no specific location is needed with the inbetween method. Maybe additional
%D mechanisms show up some day. See \type {inbetween-001.tex} for an example.

I don't really understand what capability the comment is referring to let alone 
be able to create an example demonstrating the difference.

—
Bruce Horrocks
Hampshire, UK

___
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] Combine lua and btx setup, was: Re: Customize citation format of a bibliography (use the short form as reference format)

2024-04-23 Thread Gerion Entrup
Here is a solution for the first part of my question. This is based on
https://www.mail-archive.com/ntg-context@ntg.nl/msg101156.html
and try and error based on publ-imp-aps.mkvi and publ-imp-apa.mkvi:

It display now the citation _and_ numbering labels in the short form:
```
\setupinteraction[state=start]

\startbuffer[testdata]
@Book{knuth1,
author = {Donald E. Knuth},
title = {TEX and METAFONT. New directions in typesetting},
year = {1979},
publisher = {Addison-Wesley},
}
@Article{someother,
author = {Some Person and Some Otherperson},
title = {Another title},
year = {1900},
}
\stopbuffer

% enable tracing
\enabletrackers[publications, publications.crossref, publications.details, 
publications.cite, publications.strings]

\usebtxdataset[main][testdata.buffer]
\usebtxdefinitions[aps]
\setupbtx[dataset=main]
\definebtxrendering[bibrendering][aps][dataset=main, numbering=short]
\setupbtxlist[aps][
  alternative=b,
  distance=.5em,
]
\setupbtx[aps:cite][alternative=short]

\starttext

Knuth developed \TeX \cite[knuth1]
Several persons said something \cite[someother].

\placelistofpublications[bibrendering]

\stoptext
```

The remaining part now is to mark publications of Knuth in a different way.
I have tried this and failed. Here is my code so far:
```
\startluacode
function render_cite(short, author)
print(author)
if author:lower():find("knuth") then
context("[>" .. short .. "]")
else
context("[" .. short .. "]")
end
end
\stopluacode
\definebtx[aps:cite:special][aps:cite]
\startsetups btx:aps:cite:special
\btxcitereference
\ctxlua{render_cite([==[\btxflush{year}]==], [==[\btxflush{author}]==])}
\stopsetups
% use it with \cite[special][knuth1]
```
This has several problems:
- \btxflush{short} does not work as I expected that. How can I get the short 
form?
- \btxflush to pass arguments to lua does not work as intended. On the lua side 
the
   variable "author" resolves to "\btxflushauthor{author}" and not to "D. E. 
Knuth".
   How can I pass the data?

I use Lua only because I find it more convenient as a programming language. If a
plain tex solution is simpler, I'm happy to use that. 


Another question that came up while studying the source code:
What effect have \c!, \s!, and \v!? These commands exist a lot in the above
cited files.

Gerion


Am Mittwoch, 17. April 2024, 15:44:12 MESZ schrieb Gerion Entrup:
> Hi,
> 
> > The APS style is an example of a number-based citation system. As you
> > are looking for a tag-based citation, it might be better to start with
> > something like the APA style.
> 
> I'm kind of satisfied with the publication-list layout of the APS style so I 
> chose
> this as a base. If it is simpler to start with the APA style, I can do that.
> 
> My hope is that it is possible to just change the "label" that is used for
> referencing and keep everything else as is.
> 
> > Is there some specification for your short tag-based citation style?
> 
> biblatex implements this with the "alphabetic" style. I'm not aware of
> a specification, though. Does the "short" form in ConTeXt exist for a
> specific reason? :)
> 
> Gerion
> 
> > On Tue, 16 Apr 2024 06:04:35 +0200
> > Gerion Entrup  wrote:
> > 
> > > Hi,
> > > 
> > > I'm trying to customize a cite format in a bibliography. Currently,
> > > I'm using the aps style which fits so far, except of the plain number
> > > as reference. In concrete, I want to change the following:
> > > - Use the first letter of the last name and the year as reference
> > > (this should be exactly the short form). It is more less also
> > > described here [1].
> > > - Highlight publications of a certain author with an extra char (e.g.
> > > '>')
> > > 
> > > Here is a minimal example (lets assume, every occurrence of Knuth
> > > should be highlighted): ```
> > > \setupinteraction[state=start]
> > > 
> > > \startbuffer[testdata]
> > > @Book{knuth1,
> > >   author = {Donald E. Knuth},
> > >   title = {TEX and METAFONT. New directions in typesetting},
> > >   year = {1979},
> > >   publisher = {Addison-Wesley},
> > > }
> > > @Article{someother,
> > >   author = {Some Person and Some Otherperson},
> > >   title = {Another title},
> > >   year = {1900},
> > > }
> > > \stopbuffer
> > > 
> > > % enable tracing
> > > \enabletrackers[publications, publications.crossref,
> > > publications.details, publications.cite, publications.strings]

[NTG-context] Re: Why don't footnotes appear in floats or figures?

2024-04-22 Thread Joel via ntg-context
 I've managed to get a minimum working example. If you check, you'll see the 
5th footnote inside a placefigure doesn't render anywhere:
\starttext

    \input knuth
    \placefigure{Caption\footnote{message 
A}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
B}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
C}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
D}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
E}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
F}}{\externalfigure[cow][width=\textwidth]}

\stoptext


Is this the correct way to be using the \startpostponing code (see example 
below)?
\starttext
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
A}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
B}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
C}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
D}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
E}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
F}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
\stoptext




On Monday, April 22, 2024 at 02:31:30 AM MDT, Hans Hagen via ntg-context 
 wrote:  
 
 On 4/22/2024 2:45 AM, Joel via ntg-context wrote:
> I'm three days out from sending my work to an editor, and found some 
> serious problem: many footnotes just aren't rendering.
> 
> I have a history text that uses ConTeXt-SBL for the citations, as such, 
> it has lots of footnotes. Sometimes the footnotes are just in the main 
> text, but sometimes also in figure captions, inside floats, inside 
> tables that are inside floats, inside tabulations inside floats, etc.
> 
> What I find alarming is it is frequently not rendering all of the 
> footnote messages at the bottom of the page. The actual footnote number 
> within the body is rendered, but no number is listed in at the bottom of 
> the page. So I might see a list of footnotes, for instance, on page 1, I 
> only get footnotes 1, 2, 3, 5, and 6, but 4 was mysteriously skipped.
> 
> 
> ---
> 1 message
> 2 message
> 3 message
> 5 message
> 6 message
> 
> After a lot of trial-and-error and checking logs and checking my BibTeX 
> files for errors, running everything through BibTex Tidy, etc., and 
> failures to make a minimum working example, I found a single pattern:
> 
> If the footnote marker appears on the SAME page as the footnote text, it 
> has no problem rendering the footnote. But, if ConTeXt decides to move a 
> float a page or two later on--as it frequently seems to do---such that 
> the footnote marker and footnote text at bottom of page should be on 
> DIFFERENT pages, the footnote message at the bottom of the page won't 
> render.
> 
> I've seen some 2+ year old mailing list posts suggesting ConTeXt might 
> have issues with footnotes; they appear to be similar to my issue--is 
> that still a problem? Is there a fix or workaround? Old fixes I could 
> finding in the mailing list don't seem to work with current versions of 
> ConTeXt anymore.
you need to consider the complications of such notes ...

- tex needs to take the notes into account when determining a page break
- it does so by the insert mechanism
- when floats can't be placed they also become inserts (top and bottom)
- when there are inserts in inserts th eproblem becomes more complex (so 
notes inside floats)
- in traditional tex deeply burried inserts disappearm less so in lmtx

There are things that are hard to get right. This works:

\startpostponing
    \startplacefigure[location=here,title={test \footnote{oeps 1}}]
        \blackrule[width=1tw]
        here
        \footnote{hello 1} and
        \footnote{hello 2} and
        \footnote{hello 3} done
    \stopplacefigure
\stoppostponing

\dorecurse{10}{\samplefile{tufte}\par}

Because here the inserts (notes) will migrate but even then one can get 
them out of order (unless we renumber, which then is sensitiev for 
oscillation).

I occasionally wonder if top floats could be done more directly but 
bottom notes still would have an out-of-sync problem




-
                                          Hans Hagen | PRAGMA ADE
              Ridd

[NTG-context] Re: Why don't footnotes appear in floats or figures?

2024-04-22 Thread Hans Hagen via ntg-context

On 4/22/2024 2:45 AM, Joel via ntg-context wrote:
I'm three days out from sending my work to an editor, and found some 
serious problem: many footnotes just aren't rendering.


I have a history text that uses ConTeXt-SBL for the citations, as such, 
it has lots of footnotes. Sometimes the footnotes are just in the main 
text, but sometimes also in figure captions, inside floats, inside 
tables that are inside floats, inside tabulations inside floats, etc.


What I find alarming is it is frequently not rendering all of the 
footnote messages at the bottom of the page. The actual footnote number 
within the body is rendered, but no number is listed in at the bottom of 
the page. So I might see a list of footnotes, for instance, on page 1, I 
only get footnotes 1, 2, 3, 5, and 6, but 4 was mysteriously skipped.



---
1 message
2 message
3 message
5 message
6 message

After a lot of trial-and-error and checking logs and checking my BibTeX 
files for errors, running everything through BibTex Tidy, etc., and 
failures to make a minimum working example, I found a single pattern:


If the footnote marker appears on the SAME page as the footnote text, it 
has no problem rendering the footnote. But, if ConTeXt decides to move a 
float a page or two later on--as it frequently seems to do---such that 
the footnote marker and footnote text at bottom of page should be on 
DIFFERENT pages, the footnote message at the bottom of the page won't 
render.


I've seen some 2+ year old mailing list posts suggesting ConTeXt might 
have issues with footnotes; they appear to be similar to my issue--is 
that still a problem? Is there a fix or workaround? Old fixes I could 
finding in the mailing list don't seem to work with current versions of 
ConTeXt anymore.

you need to consider the complications of such notes ...

- tex needs to take the notes into account when determining a page break
- it does so by the insert mechanism
- when floats can't be placed they also become inserts (top and bottom)
- when there are inserts in inserts th eproblem becomes more complex (so 
notes inside floats)

- in traditional tex deeply burried inserts disappearm less so in lmtx

There are things that are hard to get right. This works:

\startpostponing
\startplacefigure[location=here,title={test \footnote{oeps 1}}]
\blackrule[width=1tw]
here
\footnote{hello 1} and
\footnote{hello 2} and
\footnote{hello 3} done
\stopplacefigure
\stoppostponing

\dorecurse{10}{\samplefile{tufte}\par}

Because here the inserts (notes) will migrate but even then one can get 
them out of order (unless we renumber, which then is sensitiev for 
oscillation).


I occasionally wonder if top floats could be done more directly but 
bottom notes still would have an out-of-sync problem





-
  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://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: Customize citation format of a bibliography (use the short form as reference format)

2024-04-17 Thread Gerion Entrup
Hi,

> The APS style is an example of a number-based citation system. As you
> are looking for a tag-based citation, it might be better to start with
> something like the APA style.

I'm kind of satisfied with the publication-list layout of the APS style so I 
chose
this as a base. If it is simpler to start with the APA style, I can do that.

My hope is that it is possible to just change the "label" that is used for
referencing and keep everything else as is.

> Is there some specification for your short tag-based citation style?

biblatex implements this with the "alphabetic" style. I'm not aware of
a specification, though. Does the "short" form in ConTeXt exist for a
specific reason? :)

Gerion

> On Tue, 16 Apr 2024 06:04:35 +0200
> Gerion Entrup  wrote:
> 
> > Hi,
> > 
> > I'm trying to customize a cite format in a bibliography. Currently,
> > I'm using the aps style which fits so far, except of the plain number
> > as reference. In concrete, I want to change the following:
> > - Use the first letter of the last name and the year as reference
> > (this should be exactly the short form). It is more less also
> > described here [1].
> > - Highlight publications of a certain author with an extra char (e.g.
> > '>')
> > 
> > Here is a minimal example (lets assume, every occurrence of Knuth
> > should be highlighted): ```
> > \setupinteraction[state=start]
> > 
> > \startbuffer[testdata]
> > @Book{knuth1,
> > author = {Donald E. Knuth},
> > title = {TEX and METAFONT. New directions in typesetting},
> > year = {1979},
> > publisher = {Addison-Wesley},
> > }
> > @Article{someother,
> > author = {Some Person and Some Otherperson},
> > title = {Another title},
> > year = {1900},
> > }
> > \stopbuffer
> > 
> > % enable tracing
> > \enabletrackers[publications, publications.crossref,
> > publications.details, publications.cite, publications.strings]
> > 
> > \usebtxdataset[main][testdata.buffer]
> > \usebtxdefinitions[aps]
> > \setupbtx[dataset=main]
> > \definebtxrendering[bibrendering][aps][dataset=main]
> > 
> > % this seems to have no effect?
> > \setupbtx[alternative=short]
> > 
> > \starttext
> > 
> > Knuth developed \TeX \cite[knuth1].
> > Several persons said something \cite[someother].
> > 
> > \placelistofpublications[bibrendering]
> > 
> > \stoptext
> > ```
> > 
> > It should be rendered as:
> > ```
> > Knuth developed TeX [>Knu79].
> > Several persons said something [PO00].
> > 
> > [Knu79] D.E. Knuth, TEX and METAFONT. New directions in
> > typesetting (Addi­son-Wesley, 1979). [PO00] S. Person and S.
> > Otherperson, Another title, (1900). ```
> > 
> > How can I achieve that \cite[something] always renders in the short
> > form by default? How can I customize that references to Knuth contain
> > this extra '>'? How can I customize the APS style to also use the
> > short form in the list of publications instead of numbers?
> > 
> > Best
> > Gerion
> > 
> > [1]
> > https://tex.stackexchange.com/questions/295444/citation-style-with-first-letters-of-authors-lastname



signature.asc
Description: This is a digitally signed message part.
___
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: Customize citation format of a bibliography (use the short form as reference format)

2024-04-17 Thread Alan Braslau via ntg-context
Hello,

The APS style is an example of a number-based citation system. As you
are looking for a tag-based citation, it might be better to start with
something like the APA style.

Is there some specification for your short tag-based citation style?

Alan



On Tue, 16 Apr 2024 06:04:35 +0200
Gerion Entrup  wrote:

> Hi,
> 
> I'm trying to customize a cite format in a bibliography. Currently,
> I'm using the aps style which fits so far, except of the plain number
> as reference. In concrete, I want to change the following:
> - Use the first letter of the last name and the year as reference
> (this should be exactly the short form). It is more less also
> described here [1].
> - Highlight publications of a certain author with an extra char (e.g.
> '>')
> 
> Here is a minimal example (lets assume, every occurrence of Knuth
> should be highlighted): ```
> \setupinteraction[state=start]
> 
> \startbuffer[testdata]
> @Book{knuth1,
>   author = {Donald E. Knuth},
>   title = {TEX and METAFONT. New directions in typesetting},
>   year = {1979},
>   publisher = {Addison-Wesley},
> }
> @Article{someother,
>   author = {Some Person and Some Otherperson},
>   title = {Another title},
>   year = {1900},
> }
> \stopbuffer
> 
> % enable tracing
> \enabletrackers[publications, publications.crossref,
> publications.details, publications.cite, publications.strings]
> 
> \usebtxdataset[main][testdata.buffer]
> \usebtxdefinitions[aps]
> \setupbtx[dataset=main]
> \definebtxrendering[bibrendering][aps][dataset=main]
> 
> % this seems to have no effect?
> \setupbtx[alternative=short]
> 
> \starttext
> 
> Knuth developed \TeX \cite[knuth1].
> Several persons said something \cite[someother].
> 
> \placelistofpublications[bibrendering]
> 
> \stoptext
> ```
> 
> It should be rendered as:
> ```
> Knuth developed TeX [>Knu79].
> Several persons said something [PO00].
> 
> [Knu79]   D.E. Knuth, TEX and METAFONT. New directions in
> typesetting (Addi­son-Wesley, 1979). [PO00]   S. Person and S.
> Otherperson, Another title, (1900). ```
> 
> How can I achieve that \cite[something] always renders in the short
> form by default? How can I customize that references to Knuth contain
> this extra '>'? How can I customize the APS style to also use the
> short form in the list of publications instead of numbers?
> 
> Best
> Gerion
> 
> [1]
> https://tex.stackexchange.com/questions/295444/citation-style-with-first-letters-of-authors-lastname



-- 
Alan Braslau
816 West Mountain Avenue
Fort Collins, CO 80521 USA
mobile: (970) 237-0957

Conserve energy! ;-)
___
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: Wiki - test/proposal to further clarify documentation

2024-04-17 Thread Henning Hraban Ramm

Am 17.04.24 um 10:36 schrieb Hans Hagen:

On 4/17/2024 8:32 AM, Thomas A. Schmitz wrote:



On 16. Apr 2024, at 21:56, Peter Hopcroft via ntg-context 
 wrote:





On 17/04/2024, at 7:11 AM, Henning Hraban Ramm  wrote:

In my poster (still WIP) I wrote:
…


Excellent


No, I must admit I don’t like the first two paragraphs. The question 
is “what is ConTeXt,” and the answer is “we’re not LaTeX.” And why 
“infamous”?
I agree. It sounds the same as "we're not msword" or "we're not google 
docs". (In the end the only thing that latex and context have in common 
is that they use the tex language / ecosystem.)


In my experience, most people interested in ConTeXt know LaTeX, so it 
makes sense to compare.
And I actually just say “LaTeX is the most known command-based 
typesetting system” (that’s just true) to shortcut explaining what a 
cbts might be.


Your critique applies to JUH’s quote, though.

I used “infamous” as a funny way to say “not famous, but somewhat known” 
(and yes, I know Latin and what the words really mean).


Hraban
___
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: Wiki - test/proposal to further clarify documentation

2024-04-17 Thread Hans Hagen

On 4/17/2024 8:32 AM, Thomas A. Schmitz wrote:




On 16. Apr 2024, at 21:56, Peter Hopcroft via ntg-context  
wrote:




On 17/04/2024, at 7:11 AM, Henning Hraban Ramm  wrote:

In my poster (still WIP) I wrote:
…


Excellent


No, I must admit I don’t like the first two paragraphs. The question is “what 
is ConTeXt,” and the answer is “we’re not LaTeX.” And why “infamous”?
I agree. It sounds the same as "we're not msword" or "we're not google 
docs". (In the end the only thing that latex and context have in common 
is that they use the tex language / ecosystem.)


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://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: Wiki - test/proposal to further clarify documentation

2024-04-16 Thread Henning Hraban Ramm

Am 14.04.24 um 21:45 schrieb Peter Hopcroft via ntg-context:

It would be great if the main page actually said what Context does.


In my poster (still WIP) I wrote:

start
---

The “infamous” alternative to LaTeX

While most designers use graphical tools, there are still areas where 
code-based typesetting systems are fun, make sense or are even superior. 
While LaTeX is the most known of these, ConTeXt is used by a growing 
minority of ambitioned enthusiasts around the world.


The small but active and creative community of ConTeXt users and 
developers is always driving TeX development over new frontiers:

NTS, MetaFun, Oriental TeX, LuaTeX, mplib, LuaMetaTeX…
They’re also dubbed the incisors (AKA cutting edge) of the dinosaur of 
Open Source.


ConTeXt is aimed at creative users, known for advanced features like 
extensive font control and direct XML processing, with a deep 
integration of Lua and MetaPost.


---

ConTeXt was invented in the 1990s by Hans Hagen and Ton Otten of the 
Dutch company “Pragma Advanced Document Engineering” for typesetting 
schoolbooks. Taco Hoekwater refactored the TeX source code to create 
LuaTeX which was further developed into LuaMetaTeX by Hans Hagen (and 
lately Mikael Sundqvist for refined math typography).


---

“To be fair, switching to the ConTeXt way of thinking and doing things 
was not an overnight process […]. But once I got used to it, I could not 
imagine going back to LaTeX. I’ll go even further and say that, in my 
view, ConTeXt is the future of TeX.

(Prof. Idris Samawi Hamid, 2009)
Source: www.tug.org/interviews/hamid.html

---

“ConTeXt is LaTeX done right. It is simple, flexible and powerful.”
(J. U. Hasecke on Mastodon, 2022)

---

Is ConTeXt for me?

If you want …
* to design your own layout
* best quality math typesetting
* to use Lua functions e.g. for processing data
* deep integration of a graphics language (MetaPost)
* to process XML input
* no package conflicts
* to use OpenType features
* consistent setup commands
* to place stuff on layers
* visual debugging features
* to have a lean, but mighty TeX system
* to typeset much faster than with LaTeX
* high quality Arabic typography
… then ConTeXt is for you!

---
stop

___
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] Customize citation format of a bibliography (use the short form as reference format)

2024-04-15 Thread Gerion Entrup
Hi,

I'm trying to customize a cite format in a bibliography. Currently, I'm using 
the aps style which fits so far, except of the plain number as reference.
In concrete, I want to change the following:
- Use the first letter of the last name and the year as reference (this should 
be exactly the short form). It is more less also described here [1].
- Highlight publications of a certain author with an extra char (e.g. '>')

Here is a minimal example (lets assume, every occurrence of Knuth should be 
highlighted):
```
\setupinteraction[state=start]

\startbuffer[testdata]
@Book{knuth1,
author = {Donald E. Knuth},
title = {TEX and METAFONT. New directions in typesetting},
year = {1979},
publisher = {Addison-Wesley},
}
@Article{someother,
author = {Some Person and Some Otherperson},
title = {Another title},
year = {1900},
}
\stopbuffer

% enable tracing
\enabletrackers[publications, publications.crossref, publications.details, 
publications.cite, publications.strings]

\usebtxdataset[main][testdata.buffer]
\usebtxdefinitions[aps]
\setupbtx[dataset=main]
\definebtxrendering[bibrendering][aps][dataset=main]

% this seems to have no effect?
\setupbtx[alternative=short]

\starttext

Knuth developed \TeX \cite[knuth1].
Several persons said something \cite[someother].

\placelistofpublications[bibrendering]

\stoptext
```

It should be rendered as:
```
Knuth developed TeX [>Knu79].
Several persons said something [PO00].

[Knu79] D.E. Knuth, TEX and METAFONT. New directions in typesetting 
(Addi­son-Wesley, 1979).
[PO00]  S. Person and S. Otherperson, Another title, (1900).
```

How can I achieve that \cite[something] always renders in the short form by 
default?
How can I customize that references to Knuth contain this extra '>'?
How can I customize the APS style to also use the short form in the list of 
publications instead of numbers?

Best
Gerion

[1] 
https://tex.stackexchange.com/questions/295444/citation-style-with-first-letters-of-authors-lastname

signature.asc
Description: This is a digitally signed message part.
___
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: Most recent context doesn't like synctex?

2024-04-15 Thread Henning Hraban Ramm

I made it work with Pulsar and the pdfjs-viewer plugin:

The sourcecode of the plugin is broken but easily fixable: 
https://github.com/allefeld/atom-pdfjs-viewer/issues/15


Then pdf->tex works with synctex from TeX live, "--synctex=repeat" and a 
right click in the viewer.


Sigh, should I learn TypeScript to adopt the viewer plugin and enable my 
language-context-lmtx* plugin to run ConTeXt and SyncTeX? (I’ve already 
too many projects and not enough brain capacity.)


Hraban


*) https://codeberg.org/fiee/language-context-lmtx
___
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: Most recent context doesn't like synctex?

2024-04-15 Thread Jim
Hi Mikael (and other synctex users),

On Sat, Apr 13, 2024 at 22:28 (+0200), Mikael Sundqvist wrote:

> Hi,

> On Sat, Apr 13, 2024 at 7:54 PM Jim  wrote:

>> Thanks for the quick reply.

>> On Sat, Apr 13, 2024 at 09:18 (+0200), Hans Hagen wrote:

>>> On 4/13/2024 12:39 AM, Jim wrote:
>>>> Hi,

>>>> I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my
>>>> system.

>>>> Recently, the stand-alone ConTeXt distribution seems to not create a
>>>> synctex file any more.  Specifically,

>>>>  /usr/local/context/tex/texmf-linux-64/bin/context --once --texutil 
>>>> --synctex=1 --nonstop file.tex

>>>> does not create a .synctex file (and deletes it, if it is there), whereas
>>>> the TeXlive version

>>>>  /usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil 
>>>> --synctex=1 --nonstop nwg_newsletter_2024_04.tex

>>>> does create the .synctex file.


>>>> The ConTeXt distribution version *does* create the file if --nonstop is
>>>> *not* used.  Knowing that, I can work around this for now, although
>>>> emacs+auctex probably won't be happy without --nonstop.

>>>> I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on
>>>> that.

>>>> Is this a bug introduced by some recent change?

>>> it's more a feature

>> I guess one person's bug is another person's feature.  :-)

>>> - Mikael S and i spend some time with editor/viewer combinations on linux in
>>> order to find ways around the different synctex libs that they use

>>> - as a result we could make most work ok

>> Are these recent changes?  And should emacs+auctex+PDFview work now?

> What will work will depend on the viewers.  We noticed a few weeks ago
> that synctex (pdf -> editor) was not working in a few viewers (okular)
> while it was working in others.  After some debugging, our conclusion
> was that different versions of the library/application were used, or
> different approaches.  We found a way to generate the stuff in the pdf
> to make it work for the failing viewers we had.  Hans did then not
> replace this with the old approach, since then the previously working
> viewers might break.  He therefore added repeat as a key, so
> \setupsynctex[state=repeat] will use the new approach.

Thanks for that clarification.


>>> - we assume that synctex is set up in the document with

>>> \setupsynctex[state=start]
>>> \setupsynctex[state=repeat] % less efficient but gets around issue

>> I haven't been using either of those, since auctex does The Right Thing for
>> me.  Or, at least, it used to.

>>> - when context is run 'headless' (on a server) it's often done in
>>> batchmode because one knows that the style works and in that case synctex
>>> makes no sense so we disable it; this avoids the need to patch the style

>> I (think I) see what you are saying, but if one explicitly uses --synctex
>> on the command line, should that not over-ride the over-ride?  Or, put
>> another way, would the following not make sense:
>> if --synctex is used on the command line
>> create synctex file
>> else if --nonstop is used on the command line
>> do not create the synctex file
>> else if \setupsynctex[...] is used in the source file
>> create the synctex file
>> else
>> do not create the synctex file

>>> - the manual has been updates

> workflows-synctex.tex now suggests:

> "When your viewer doesn't return to the editor, you can try

> \starttyping
> \setupsynctex[state=repeat]
> \stoptyping

> or

> \starttyping
> context --synctex=repeat somefile.tex
> \stoptyping

> This will give a bit larger file that tries to fool the areas resolver in the
> library that the viewer uses."

Looking at two synctex files, it would seem that the state=repeat version
creates a synctex file that has syntax matching the "original" synctex
format.  And you are right, the file is bigger.

In any case, now that I know what is going on, I have convinced auctex to
play nicely with the new way of doing things, and so all is now good.


Question for anyone who made it down this far:
Is there a mailing list or other way that a ConTeXt user can find out about
non-backward-compatible changes like this?  I wasted a fair amount of time
tracking this problem down (*), and if there is some other mailing list I
should be subscribed to, I'd love to know about it.

(*) Unfortunately, this change to ConTeXt happened around the same time I
upgraded emacs from 27.2 to 29.3, and when things didn't work I upgraded
auctex from 13.

[NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

2024-04-14 Thread Martin Hasoň
Hi Denis,

I made a similar solution for docker image [minidocks/context](https://hub.docker.com/r/minidocks/context):
[https://github.com/minidocks/context/commit/9b3ccc1eb62e556cada29b5b761207a526bca52e](https://github.com/minidocks/context/commit/9b3ccc1eb62e556cada29b5b761207a526bca52e).

You can get inspired. Everything works as it should:

```
$ docker run --rm -it minidocks/context --luatex --version  
resolvers   | globbing | confusing filename, name: 'CHANGELOG.md', lower: 'changelog.md', already: 'ChangeLog.md'  
mtx-context | redirect luametatex -> luatex: luatex --luaonly --socket "/usr/share/tex/texmf/bin/mtxrun.lua" --script mtx-context --luatex --version --redirected  
resolvers   | globbing | confusing filename, name: 'CHANGELOG.md', lower: 'changelog.md', already: 'ChangeLog.md'  
mtx-context | ConTeXt Process Management 1.06  
mtx-context |  
mtx-context | main context file: /usr/share/tex/texmf-context/tex/context/base/mkiv/context.mkiv  
mtx-context | current version: 2024.04.01 08:59  
mtx-context | main context file: /usr/share/tex/texmf-context/tex/context/base/mkxl/context.mkxl  
mtx-context | current version: 2024.04.01 08:59
```

Best,

Martin Hasoň
___
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: Most recent context doesn't like synctex?

2024-04-13 Thread Mikael Sundqvist
Hi,

On Sat, Apr 13, 2024 at 7:54 PM Jim  wrote:
>
> Thanks for the quick reply.
>
> On Sat, Apr 13, 2024 at 09:18 (+0200), Hans Hagen wrote:
>
> > On 4/13/2024 12:39 AM, Jim wrote:
> >> Hi,
>
> >> I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my
> >> system.
>
> >> Recently, the stand-alone ConTeXt distribution seems to not create a
> >> synctex file any more.  Specifically,
>
> >>  /usr/local/context/tex/texmf-linux-64/bin/context --once --texutil 
> >> --synctex=1 --nonstop file.tex
>
> >> does not create a .synctex file (and deletes it, if it is there), whereas
> >> the TeXlive version
>
> >>  /usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil 
> >> --synctex=1 --nonstop nwg_newsletter_2024_04.tex
>
> >> does create the .synctex file.
>
>
> >> The ConTeXt distribution version *does* create the file if --nonstop is
> >> *not* used.  Knowing that, I can work around this for now, although
> >> emacs+auctex probably won't be happy without --nonstop.
>
> >> I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on
> >> that.
>
> >> Is this a bug introduced by some recent change?
>
> > it's more a feature
>
> I guess one person's bug is another person's feature.  :-)
>
> > - Mikael S and i spend some time with editor/viewer combinations on linux in
> > order to find ways around the different synctex libs that they use
>
> > - as a result we could make most work ok
>
> Are these recent changes?  And should emacs+auctex+PDFview work now?

What will work will depend on the viewers. We noticed a few weeks ago
that synctex (pdf -> editor) was not working in a few viewers (okular)
while it was working in others. After some debugging, our conclusion
was that different versions of the library/application were used, or
different approaches. We found a way to generate the stuff in the pdf
to make it work for the failing viewers we had. Hans did then not
replace this with the old approach, since then the previously working
viewers might break. He therefore added repeat as a key, so
\setupsynctex[state=repeat] will use the new approach.

>
> > - we assume that synctex is set up in the document with
>
> > \setupsynctex[state=start]
> > \setupsynctex[state=repeat] % less efficient but gets around issue
>
> I haven't been using either of those, since auctex does The Right Thing for
> me.  Or, at least, it used to.
>
> > - when context is run 'headless' (on a server) it's often done in
> > batchmode because one knows that the style works and in that case synctex
> > makes no sense so we disable it; this avoids the need to patch the style
>
> I (think I) see what you are saying, but if one explicitly uses --synctex
> on the command line, should that not over-ride the over-ride?  Or, put
> another way, would the following not make sense:
> if --synctex is used on the command line
> create synctex file
> else if --nonstop is used on the command line
> do not create the synctex file
> else if \setupsynctex[...] is used in the source file
> create the synctex file
> else
> do not create the synctex file
>
> > - the manual has been updates

workflows-synctex.tex now suggests:

"When your viewer doesn't return to the editor, you can try

\starttyping
\setupsynctex[state=repeat]
\stoptyping

or

\starttyping
context --synctex=repeat somefile.tex
\stoptyping

This will give a bit larger file that tries to fool the areas resolver in the
library that the viewer uses."

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

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


[NTG-context] Re: Most recent context doesn't like synctex?

2024-04-13 Thread Jim
Thanks for the quick reply.

On Sat, Apr 13, 2024 at 09:18 (+0200), Hans Hagen wrote:

> On 4/13/2024 12:39 AM, Jim wrote:
>> Hi,

>> I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my
>> system.

>> Recently, the stand-alone ConTeXt distribution seems to not create a
>> synctex file any more.  Specifically,

>>  /usr/local/context/tex/texmf-linux-64/bin/context --once --texutil 
>> --synctex=1 --nonstop file.tex

>> does not create a .synctex file (and deletes it, if it is there), whereas
>> the TeXlive version

>>  /usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil 
>> --synctex=1 --nonstop nwg_newsletter_2024_04.tex

>> does create the .synctex file.


>> The ConTeXt distribution version *does* create the file if --nonstop is
>> *not* used.  Knowing that, I can work around this for now, although
>> emacs+auctex probably won't be happy without --nonstop.

>> I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on
>> that.

>> Is this a bug introduced by some recent change?

> it's more a feature

I guess one person's bug is another person's feature.  :-)

> - Mikael S and i spend some time with editor/viewer combinations on linux in
> order to find ways around the different synctex libs that they use

> - as a result we could make most work ok

Are these recent changes?  And should emacs+auctex+PDFview work now?

> - we assume that synctex is set up in the document with

> \setupsynctex[state=start]
> \setupsynctex[state=repeat] % less efficient but gets around issue

I haven't been using either of those, since auctex does The Right Thing for
me.  Or, at least, it used to.

> - when context is run 'headless' (on a server) it's often done in
> batchmode because one knows that the style works and in that case synctex
> makes no sense so we disable it; this avoids the need to patch the style

I (think I) see what you are saying, but if one explicitly uses --synctex
on the command line, should that not over-ride the over-ride?  Or, put
another way, would the following not make sense:
if --synctex is used on the command line
create synctex file
else if --nonstop is used on the command line
do not create the synctex file
else if \setupsynctex[...] is used in the source file
create the synctex file
else
do not create the synctex file

> - the manual has been updates

Ummm... I hunted around for a while, but I did not find out which manual
was updated.  The synctex wiki page has not been updated, nor has the
"workflow support in context" manual.  Can you tell me which manual I
should go look at?

> - running context in nonstop mode makes little sense

Guessing wildly, I assume the auctex author(s) didn't want processes
sitting there waiting for input on errors, like plain TeX would normally
do.  But perhaps the addition of --nonstopmode for ConTeXt is incorrect
and/or redundant in April of 2024.

> (maybe, as power user, Mikael remembers more details)

Mikael?  Any thoughts to share?


Cheers.
Jim
___
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: Back in the 90s

2024-04-13 Thread Hans Hagen

On 4/13/2024 2:12 PM, Riviera Taylor wrote:

Hello,

I was reading about the history of ConTeXt in the Not So Short 
Introduction To ConTeXt and I have a historical question. I noticed that 
the PDF specification was published in 1993 yet ConTeXt was invented in 
1991. The book suggests that PDF output was handled by the PdfTeX engine 
in MKII in 2005. What sort of output did the software produce before 
PdfTeX was introduced? Was this the same as the output produced by the 
software before the publication of the PDF specification?
2005 is when we started with luatex which is a follow up on pdftex, and 
pdftex is more a mid 90's thing; we immediately adopted pdftex (which 
made some believe that context depended on pdftex which is not true)


anyway, we started with dvi which needs a postprocessor to go to some 
printer format like specific hp or more general postscript but also can 
drive viewers


we went from epson dot matrix printer -> early 300 dpi laser -> 600 dpi 
laser printer -> high speed oce 512 dpi printer (metric) -> high speed 
oce 600 dpi printer (+ crappy canon color laser printer) -> fast 
page-wide hp color inkjet office printer


in mkii all is controlled by backend drivers, that use so called 
specials to support color, hyperlinks, images so a workflow can have


- dvipsone : high quality postscript
- dviwindo : viewer with typeone support and hyperlinks
- acrobat  : postscript to pdf

and as all these external backends have their demands we could handle 
all these things in an abstract way (that way one could also drive 
printer properties like duplex or paper bins etc from a tex job)


that meant that when pdf came around we could almost immediately support 
most of the interactive features in a dvi -> ps -> acrobat workflow


when pdftex came around the intermediate step of postscript could be 
avoided which btw was also possible with dvipdfm(x) so we also supported 
that


so to summarize, it went from

tex -> dvi -> printer format
tex -> dvi -> postscript -> more generic printer format
tex -> dvi -> pdf -> print from acrobat
tex -> pdf -> print from pdf viewer

in the meantime we are pdf (as from that one can produce other formats)

Hans

(btw, the fact that we could easily support pdf was also a reason why at 
that time some adobe folk in nl used documents produced by context to 
show somewhat extrems usage of interactive features, thanks to the fact 
that tex can adapt to such new situations, also via the dvi route in 
this case with pdfmarks; at that time pdf usage - and features - was a 
bit more dualistic: ps replacement format versus storage and preview 
format, but that's a different story; but it still shows in how the 
standard evolved)


-
  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://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: Most recent context doesn't like synctex?

2024-04-13 Thread Hans Hagen

On 4/13/2024 12:39 AM, Jim wrote:

Hi,

I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my
system.

Recently, the stand-alone ConTeXt distribution seems to not create a
synctex file any more.  Specifically,

 /usr/local/context/tex/texmf-linux-64/bin/context --once --texutil 
--synctex=1 --nonstop file.tex

does not create a .synctex file (and deletes it, if it is there), whereas
the TeXlive version

 /usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil 
--synctex=1 --nonstop nwg_newsletter_2024_04.tex

does create the .synctex file.


The ConTeXt distribution version *does* create the file if --nonstop is
*not* used.  Knowing that, I can work around this for now, although
emacs+auctex probably won't be happy without --nonstop.

I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on
that.

Is this a bug introduced by some recent change?

it's more a feature

- Mikael S and i spend some time with editor/viewer combinations on 
linux in order to find ways around the different synctex libs that they use


- as a result we could make most work ok

- we assume that synctex is set up in the document with

\setupsynctex[state=start]
\setupsynctex[state=repeat] % less efficient but gets around issue

- when context is run 'headless' (on a server) it's often done in 
batchmode because one knows that the style works and in that case 
synctex makes no sense so we disable it; this avoids the need to patch 
the style


- the manual has been updates

- running context in nonstop mode makes little sense

(maybe, as power user, Mikael remembers more details)

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://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] Most recent context doesn't like synctex?

2024-04-12 Thread Jim
Hi,

I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my
system.

Recently, the stand-alone ConTeXt distribution seems to not create a
synctex file any more.  Specifically,

/usr/local/context/tex/texmf-linux-64/bin/context --once --texutil 
--synctex=1 --nonstop file.tex

does not create a .synctex file (and deletes it, if it is there), whereas
the TeXlive version

/usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil 
--synctex=1 --nonstop nwg_newsletter_2024_04.tex

does create the .synctex file.


The ConTeXt distribution version *does* create the file if --nonstop is
*not* used.  Knowing that, I can work around this for now, although
emacs+auctex probably won't be happy without --nonstop.

I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on
that.

Is this a bug introduced by some recent change?

Thanks.

Jim
___
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: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

2024-04-11 Thread Hans Hagen via ntg-context

On 4/11/2024 5:25 PM, Pablo Rodriguez via ntg-context wrote:

On 4/10/24 22:28, Denis Maier wrote:

[...]
   context --luatex --generate


Thanks, Pablo.
I've tried it, but it doesn't seem to work...


I get the same result on Win64 when I move the luatex binary from the
tex/texmf-win64/bin/ directory.

This may sound stupid, but could you check whether the bin directory
contain the required binary?

Sorry, "luatex --version" and even "whereis luatex" should give the same
result (but on Windows, it seems to be https://ss64.com/nt/where.html).

I hope it may help,

it searches for mtxrun.lua and contextl.lua in the same path so you need:

luametatex.exe
mtxrun.exe (can be link to luametatex.exe)
context.exe (can be link to luametatex.exe)
context.lua
mtxrun.lua

all in the same (bib) path

... always has been so ...

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://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: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

2024-04-11 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: Pablo Rodriguez via ntg-context 
> Gesendet: Donnerstag, 11. April 2024 17:26
> An: 'mailing list for ConTeXt users' 
> Cc: Pablo Rodriguez 
> Betreff: [NTG-context] Re: unknown script 'mtx-context.lua' or 'mtx-mtx-
> context.lua
> 
> On 4/10/24 22:28, Denis Maier wrote:
> >> [...]
> >>   context --luatex --generate
> >
> > Thanks, Pablo.
> > I've tried it, but it doesn't seem to work...
> 
> I get the same result on Win64 when I move the luatex binary from the
> tex/texmf-win64/bin/ directory.
> 
> This may sound stupid, but could you check whether the bin directory
contain
> the required binary?
> 
> Sorry, "luatex --version" and even "whereis luatex" should give the same
result
> (but on Windows, it seems to be https://ss64.com/nt/where.html).
> 
> I hope it may help,
> 
> Pablo

Ok. It wasn't there. I have now copied it from my Miktex installation, but
it still does not work. (Looks like some path issue. The luatex binary from
the miktex installation seems to take priority over the one now in the
ConTeXt installation. Looks like I'm getting somewhere...)

Thanks for your help,
Denis

___
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: unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua

2024-04-11 Thread Pablo Rodriguez via ntg-context
On 4/10/24 22:28, Denis Maier wrote:
>> [...]
>>   context --luatex --generate
>
> Thanks, Pablo.
> I've tried it, but it doesn't seem to work...

I get the same result on Win64 when I move the luatex binary from the
tex/texmf-win64/bin/ directory.

This may sound stupid, but could you check whether the bin directory
contain the required binary?

Sorry, "luatex --version" and even "whereis luatex" should give the same
result (but on Windows, it seems to be https://ss64.com/nt/where.html).

I hope it may 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://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] Fwd: [lug-leaders] BachoTeX 2024: Last minute

2024-04-09 Thread Taco Hoekwater

Hi all,

Please see the forwarded message from GUST below.

Best wishes,
Taco

> Begin forwarded message:
> 
> From: Jerzy Ludwichowski 
> Subject: [lug-leaders] BachoTeX 2024: Last minute
> Date: 9 April 2024 at 14:09:09 CEST
> To: tex...@tug.org, LUG boards 
> Reply-To: lug-boa...@ifi.uio.no
> 
> Dear TeXies,
> 
> we've extended the deadline for "early-bird"  BachoTeX 2024 registrations 
> until 11th of April.
> All the current details of the conference are available from the revamped(!) 
> page:
> 
> https://bachotex.gust.org.pl
> 
> Don't hesitate, come and share the joys of TeXing together: "Ideas are born 
> between heads"
> 
> --Jerzy Ludwichowski
> (for the Organizing Committee)

___
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: Very bizarre bug

2024-04-07 Thread Hans Hagen

On 4/7/2024 7:08 PM, Thomas A. Schmitz wrote:

Hi everybody,

this is bizarre, but hear me out: a file that I have has a mixture of 
xml, TeX and Lua. It compiles cleanly, no problem, on macos and linux. I 
also have a little raspberry pi on which I have installed lmtx. The file 
compiles, BUT: it has one additional page. The first page of the 
document is empty and has the word "on" in the upper left hand corner of 
the text area. I have checked several times, it always comes out like 
this. Everything else is exactly the same - context version, file and 
environment files (everything under git, so really identical). The "on" 
does not appear if I just make a "hello world" document on the raspi. So 
my question is: how can I begin to explore where this word creeps in? I 
suspect it's something in the linux-aarch64 tree or some test for this 
architecture that is the culprit, but what would be a good way to trace it?


can you make a format with line 25 of context.mkxl uncommented to see if 
you get a message (not production, just a test)


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://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] Very bizarre bug

2024-04-07 Thread Thomas A. Schmitz

Hi everybody,

this is bizarre, but hear me out: a file that I have has a mixture of 
xml, TeX and Lua. It compiles cleanly, no problem, on macos and linux. I 
also have a little raspberry pi on which I have installed lmtx. The file 
compiles, BUT: it has one additional page. The first page of the 
document is empty and has the word "on" in the upper left hand corner of 
the text area. I have checked several times, it always comes out like 
this. Everything else is exactly the same - context version, file and 
environment files (everything under git, so really identical). The "on" 
does not appear if I just make a "hello world" document on the raspi. So 
my question is: how can I begin to explore where this word creeps in? I 
suspect it's something in the linux-aarch64 tree or some test for this 
architecture that is the culprit, but what would be a good way to trace it?


All best

Thomas
___
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: incosistent output of --- dash

2024-04-06 Thread Pablo Rodriguez via ntg-context
On 4/6/24 11:43, madiazm.eo...@gmail.com wrote:
> Hi everyone,

Hi Miguel,

> […]
> Am I missing something on the use of this ligature?

I don’t think so.

In some cases you may not get the ligature for a good reason:

  \starttyping
  program --option=value file.ext
  \stoptyping

It would make no sense to get an en-dash there (but I guess you don’t
mean that).

But all OSes provide character maps to get single characters. And also
Unicodia works fine in Windows (https://mercury13.github.io/unicodia/,
just in case it might suit your needs).

Having a single character (emoji, dashes or whatever) is way more
readable than a character combination for a ligature or a TeX command.

This single-character approach also makes easier to copy and paste text
to other formats.

> (the question is just out of curiosity, since I plan to create a
> command that adds a hairspace after or before the dash, since I don't
> like it to stick to some letters like "o").
Just consider that you should add an horizontal box (or pair both space
and hyphen), otherwise you may get a line break between character and
hyphen (instead of the hair space):

  \starttext
  \startTEXpage[offset=2st]
  \hsize\zeropoint
  this —\hairspace or so\hairspace— that

  this \hbox{—\hairspace}or so\hbox{\hairspace—} that
  \stopTEXpage
  \stoptext

Just in case it might 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://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 \sc

2024-04-04 Thread Pablo Rodriguez via ntg-context
On 4/3/24 07:16, Peter Münster wrote:
> On Tue, Apr 02 2024, Andres Conrado Montoya wrote:
>
>> You shouldn't run context as root in any case.
>
> I don’t run context as root. But I need to erase the cache in
> /opt/context/tex/texmf-cache as root, because the user doesn’t have the
> permission to do that.

Sorry, Peter, but I have a suspicion from what you wrote.

>>   mtxrun --script cache --erase && mtxrun --generate
>
> Thanks. It did not work after doing it as root, but then I saw, that
> there is also a cache in the user home-directory, so I’ve done it as the
> user too, and now it works.

In principle, cache is only written to tex/texmf-cache.

But I guess, when that directory cannot be written by the user, cache is
written to $HOME/texmf.

This may be why you get two cache directories (instead of only
tex/texmf-cache).

Cheers,

Pablo
___
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 \sc

2024-04-02 Thread Peter Münster
On Tue, Apr 02 2024, Andres Conrado Montoya wrote:

> You shouldn't run context as root in any case.

I don’t run context as root. But I need to erase the cache in
/opt/context/tex/texmf-cache as root, because the user doesn’t have the
permission to do that.

-- 
   Peter
___
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 \sc

2024-04-02 Thread Pablo Rodriguez via ntg-context
On 4/2/24 21:23, Mikael Sundqvist wrote:
> On Tue, Apr 2, 2024 at 9:16 PM Peter Münster  wrote:
>> [...]
>> TIA for any hints,
>
> Hans wrote in his email:
> -- If you have troubles (crash) you need to wipe the cache due to a
> change in lua bytecode storage (no easy way to catch it).
>
> Did you do that? (One way is to remove tex/texmf-cache/*)

Another way is to run (since your test works fine on my laptop):

  mtxrun --script cache --erase && mtxrun --generate

The format file will be generated in the next compilation, so it will
take a bit longer.

Just in case it might 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://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 \sc

2024-04-02 Thread Mikael Sundqvist
Hi,

On Tue, Apr 2, 2024 at 9:16 PM Peter Münster  wrote:
>
> Hi,
>
> With ConTeXt version 2024.04.01, the \sc command produces an error:
>
> fonts   > preloading latin modern fonts (second stage)
> fonts   > 'fallback modern rm 12pt' is loaded
> pages   > flushing realpage 1, userpage 1, subpage 1
> close source> level 1, order 3, name './test.tex'
> backend         > xmp > using file 
> '/opt/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
> mtx-context | fatal error: return code: 1
>
> Test file:
>   \starttext
>   \sc test
>   \stoptext
>
> Is this a bug, or some misconfiguration of my installation?
>
> TIA for any hints,

Hans wrote in his email:
-- If you have troubles (crash) you need to wipe the cache due to a
change in lua bytecode storage (no easy way to catch it).

Did you do that? (One way is to remove tex/texmf-cache/*)

Your file works here.

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

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


[NTG-context] error with \sc

2024-04-02 Thread Peter Münster
Hi,

With ConTeXt version 2024.04.01, the \sc command produces an error:

fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern rm 12pt' is loaded
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 1, order 3, name './test.tex'
backend > xmp > using file 
'/opt/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
mtx-context | fatal error: return code: 1

Test file:
  \starttext
  \sc test
  \stoptext

Is this a bug, or some misconfiguration of my installation?

TIA for any hints,
-- 
   Peter
___
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] what about "textdisplay"?

2024-04-01 Thread Henning Hraban Ramm
A while ago, I was pointed (by Wolfgang or Hans, I guess) to 
\start/stoptextdisplay to enhance whitespace handling around images.


I wanted to document it, but can’t find it in the sources:

$ context --find=textdisplay
mtx-context | 
…/tex/texmf-context/doc/context/sources/general/manuals/ontarget/ontarget-profiles.tex

mtx-context |
mtx-context |   196  \starttextdisplay
…
mtx-context |   277  \stoptextdisplay
mtx-context |
mtx-context | 
…/tex/texmf-context/doc/context/sources/general/manuals/ontarget/ontarget-standardize.tex

mtx-context |
mtx-context |   888  \starttextdisplay
…
mtx-context |   941  \stoptextdisplay
mtx-context |

These two documents use it and compile flawlessly.

What’s on?

Hraban
___
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] context editor support / syntax highlighting for Pulsar

2024-04-01 Thread Henning Hraban Ramm

Hi Hans (et al.),

find attached a slightly extended version of the "interface" script that 
can also generate the list of commands in cson format for Pulsar/Atom.


It just creates a basic list of commands for syntax highlighting; for a 
complete plugin, "grammars" and "settings" are missing, see 
https://codeberg.org/fiee/language-context
(Yes, this approach is oldfashioned and a plugin could do a lot more, 
but I don’t speak TypeScript.)


The generated cson file is for "snippets", like in:
https://codeberg.org/fiee/language-context/src/branch/master/snippets/language-context.cson

There, I added information from the interface files and also from the 
wiki, if existing. I don’t know how to do that in the lua script.


---
function flushers.pulsar(collected)
for interface, whatever in next, collected do
local commands = whatever.commands
local environments = whatever.environments
local result, r = { }, 0
r = r + 1 ; result[r] = "'.text.tex.context':\n"
for i=1,#commands do
r = r + 1 ; result[r] = format("\t'\\%s':\n",commands[i])
r = r + 1 ; result[r] = format("\t\tprefix: 
'%s'\n",commands[i])

-- can we have some information?
--r = r + 1 ; result[r] = format("\t\tdescription: 'level: 
primitive; interface: i-tex.xml'",'')

-- no URL if command starts with "stop"
r = r + 1 ; result[r] = format("\t\tdescriptionMoreURL: 
'https://wiki.contextgarden.net/Command/%s'\n",commands[i])

end
io.savedata(format("language-context-%s.cson",interface), 
concat(result),"\n")

end
end
---

Also, the "en" interface is empty, everything is in "common", so the 
iteration over interfaces makes no sense here.



Actually, Atom/Pulsar could work with a tree sitter parser 
(https://github.com/pmazaitis/tree-sitter-context), but I don’t know how 
to use it.



[TextMate]
For TextMate and other editors that use TM bundles, it might make sense 
to update https://github.com/pgundlach/context.tmbundle
At least the list of commands could be automatically converted from the 
interface files, but it’s more involved than what mtx-interface does.



[Visual Studio Code / VSCodium]
BTW, is the ConTeXt language server for VS Code public anywhere? 
(Ramkumar KB promised…) Or is "mtxrun --script=vscode --lsfile" the same?


Hrabanif not modules then modules = { } end modules ['mtx-cache'] = {
version   = 1.001,
comment   = "companion to mtxrun.lua",
author= "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license   = "see context related readme files"
}

local concat, sort, insert = table.concat, table.sort, table.insert
local gsub, format, gmatch, find, upper = string.gsub, string.format, 
string.gmatch, string.find, string.upper
local utfchar, utfgsub = utf.char, utf.gsub
local sortedkeys, sortedhash, serialize = table.sortedkeys, table.sortedhash, 
table.serialize

local helpinfo = [[


 
  mtx-interface
  ConTeXt Interface Related Goodies
  0.14
 
 
  
   
generate context mkii interface 
files
   
   
equals   
   
   
generate scite interface
generate bbedit interface files
generate jedit interface files
generate pulsar/atom interface 
files
generate textpad interface files
generate vim interface files
create text files for commands and 
environments
report commands to the console
generate check file
report the meaning of commands
show the internal representation of 
commands
   
   
replace named characters by utf
preprocess mkvi files to tex files 
[force,suffix]
   
   
use given suffix for output files
force action even when in doubt
   
   
a pattern for meaning lookups
   
  
 

]]

local application = logs.application {
name = "mtx-interface",
banner   = "ConTeXt Interface Related Goodies 0.13",
helpinfo = helpinfo,
}

local report = application.report

scripts   = scripts   or { }
scripts.interface = scripts.interface or { }

local flushers  = { }
local userinterfaces= { 'en','cs','de','it','nl','ro','fr','pe' }
local messageinterfaces = { 'en','cs','de','it','nl','ro','fr','pe','no' }

local function collect(filename,class,data)
if data then
local result, r = { }, 0
for name, list in sortedhash(data) do
r = r + 1 ; result[r] = format("keywordclass.%s.%s=\\\n",class,name)
for i=1,#list do
if i%5 == 0 then
r = r + 1 ; result[r] = "\\\n"
end
r = r + 1 ; result[r] = format("%s ",list[i])
end
r = r + 1 ; result[r] = "\n\n"

[NTG-context] upload

2024-04-01 Thread Hans Hagen

Hi,

There is a new lmtx upload.

-- The svg inclusion via metapost has been upgraded and cleanup a bit, 
using some more recent metapost features. There are some new (not yet 
all documented metapost) features.


-- In the process, support for LCH colors has been added, which is 
documented in the (eg luametafun manual).


-- The math manual is not yet there because we were distracted by 
improving support for envelopes (penbased outlines) in metafun. This is 
still work in progress, some is present and discussed in the manual, and 
we'll come back to that sometime next month. Given the next item, we 
also might need to change some in the manual (different focus).


-- Because we have users who have to conform to the European 
Accessibility Act we have been wondering how to deal with that and at 
Mikaels place there are two demands: distinctive colors and tagging and 
especially math (somehow validators love to check that). Colors never 
were an issue as they can be controlled, and tagging math neither, 
especially because nothing was/is done with it anyway, but ... we are 
happy that we found a reasonable (more modern and future proof) way out.


As explained / shown in the attached document we're basically forced to 
choose a different approach with math (a pity as we worked hard to get 
the rendering right but the attached file works fine in the viewers that 
we tested).


-- We like to hear from users what other demands wrt accessibility there 
are. We're not interested in the (commercial) big money aspects (of pdf 
and tagging) nor in the politics behind it (changes over time). What are 
the demands, so that we can see how to make it work or just work around 
it (as it's kind of boring to cook uyp complex features	, esp compared 
to playing with metapost).


-- Furthermore .. the usual bits and pieces as discussed on the list and 
otherwise.


-- If you have troubles (crash) you need to wipe the cache due to a 
change in lua bytecode storage (no easy way to catch it).


Hans & Mikael

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

math-riddance.pdf
Description: Adobe PDF document
% language=us

% todo: no comma

\usemodule[scite]
\usemodule[article-basic]
\usemodule[abbreviations-logos]
\usemodule[math-goodriddance]

\setuplayout[tight]

\starttext

\subject{Good riddance}

We're done with math. After years of active development, Mikael and Hans have
decided to quit working on math, and concentrate on \METAPOST\ and handing over
to the next generation instead. We lost our user to the way more popular
alternative (frozen in stone standards). Also, we had it with suboptimal math
fonts, Unicode math not getting improved, MathML constantly being changed,
browsers dealing with math differently every few years, math archives getting
polluted with tons of useless tagged math.

There are other motivations, like the European union imposing strict rules with
respect to accessibility in educational content management systems, and Dutch
schools trying to get rid of math in favor of simple calculus, if at all. This 
is
why the next iteration of the engine will no longer have a math engine:
MathLessTeX. Of course, in the beginning \MLTX\ will be compatible with \LMTX,
because we owe that to the users and we need to prototype the new engine anyway.

In order to get an idea of how we will get rid of the disturbing formulas, you
can load the module:

\starttyping
\usemodule[math-goodriddance]
\stoptyping

Until becoming the default setting, the command \typ {\goodriddancemath} will
bring you into \MLTX\ mode while \typ {\badriddancemath} will bring you back to
the obsolete \LMTX\ mode. Like:

\startbuffer
\usemodule[math-goodriddance] \goodriddancemath

Who wants to solve the equation \m {x + 1 = 4} or deal with the function \m {x 
\mapsto
\root [3] {x}}, when we have AI around the corner to help us out with simple 
and silly
things like the Pythagorean theorem: \m {a^2 + b^2 = c^2}, or even with more 
advanced
math like geometric series: \m {\sum_{k = 0}^{+\infty} x^k = 1/(1 - x)}?

We will not support complicated nonsense stuff like:

\startplaceformula
\startformula
F__{1}{2}(a,b;b;z) = (1 - z)^{-a}
\stopformula
\stopplaceformula

When developing this Hans' Swedish improved a lot. {\language[sv] Den lilla del 
av
befolkningen som handlar på IKEA och tittar på fåniga krimserier förstår kanske 
detta:
\im {\sqrt {x + 1} = \sin(4 + y)}!}
\stopbuffer

\typebuffer[option=TEX]

Which gives us the beautifully typeset:

\startcolor[darkblue] \getbuffer \stopcolor

We hope that the highly respected Swedish Academy will consider our prose in
their upcoming evaluations. Our first submission to the leading \TEX\ journal 
was
how

[NTG-context] Re: ConTeXt on RPI400

2024-03-27 Thread hf
Hello Pablo,

Tried, the problem still remains.

I did not encouinter this problem on x64 PC. I will try to find another 
RPI4B computer to try.

Thank you.

Hong


2024年3月27日 02:58, "Pablo Rodriguez via ntg-context"  写到:

> On 3/26/24 18:43, Andres Conrado Montoya wrote:
> 
>> Can you try the following: Delete the `texmf-cache` folder
>> 
>> inside /home/hf/WORKSPACE/TOOLS/ConTeXt/tex/, and then run `mtxrun
>> 
>> --generate && context --make`?
> 
> In principle, the two following commands should be enough:
> 
> mtxrun --script cache --erase && mtxrun --generate
> 
> The format file generation will be run automatically by the next
> 
> compilation.
> 
> Just in case it may 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://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
> 
> ___
___
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: Headertext

2024-03-27 Thread Henning Hraban Ramm

Am 26.03.24 um 17:12 schrieb Wolfgang Schuster:

 begin example
\showframe

\definetext
   [chapterheader] % identifier
   [header]    % vertical position (header/footer)
% [text]  % horizontal position (text/margin)
   [This is a custom header for \tex{chapter}] % content

\setuphead[chapter][header=chapterheader]


Thank you, I added that to https://wiki.contextgarden.net/Command/definetext

Hraban

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

2024-03-27 Thread Thomas Meyer

Thank you, Wolfgang,

that's exactly what I wanted.

Greetings
Thomas

Am 26.03.24 um 17:12 schrieb Wolfgang Schuster:
When you use "header=high" you can't have a header because the block 
for it no longer exists, compare the results for "header=high" and 
"header=empty" in the following example.


 begin example
\showframe

\starttext

\setuphead[chapter][header=high]

\chapter{Lorem Ipsum}

\dorecurse{10}{\samplefile{lorem}}

\setuphead[chapter][header=empty]

\chapter{Lorem Ipsum}

\dorecurse{10}{\samplefile{lorem}}

\stoptext
 end example

As you have guessed \definetext is the way to create a custom header 
for the first page of your \chapter, the command has like 
\setupheadertexts a variable number of arguments.


The third argument with the horizontal position can only be used when 
you use two or four arguments to set texts on the left and right side 
but isn't in my example because a) the text position is the default 
and b) I pass only one argument for the content because I wan't the 
text in the middle.


 begin example
\showframe

\definetext
  [chapterheader] % identifier
  [header]    % vertical position (header/footer)
% [text]  % horizontal position (text/margin)
  [This is a custom header for \tex{chapter}] % content

\setuphead[chapter][header=chapterheader]

\starttext

\chapter{Lorem Ipsum}

\dorecurse{10}{\samplefile{lorem}}

\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: ConTeXt on RPI400

2024-03-26 Thread Pablo Rodriguez via ntg-context
On 3/26/24 18:43, Andres Conrado Montoya wrote:
> Can you try the following: Delete the `texmf-cache` folder
> inside /home/hf/WORKSPACE/TOOLS/ConTeXt/tex/, and then run `mtxrun
> --generate && context --make`? 

In principle, the two following commands should be enough:

  mtxrun --script cache --erase && mtxrun --generate

The format file generation will be run automatically by the next
compilation.

Just in case it may 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://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 on RPI400

2024-03-26 Thread Andres Conrado Montoya
Can you try the following: Delete the `texmf-cache` folder
inside /home/hf/WORKSPACE/TOOLS/ConTeXt/tex/, and then run `mtxrun
--generate && context --make`?
After running those two, try again, and let's see if that helps.

El mar, 26 mar 2024 a las 7:25,  escribió:

> Hello Andres,
>
>
> I have set up the shell environment variable in my `~/.zshrc`, here it is
> the output of `echo $PATH` under the shell:
>
> ```
>
> /home/hf/WORKSPACE/TOOLS/Emacs/bin:/home/hf/WORKSPACE/TOOLS/ConTeXt/tex/texmf-linux-aarch64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
> ```
>
> Here it is the output of `which context`:
>
> ```
> /home/hf/WORKSPACE/TOOLS/ConTeXt/tex/texmf-linux-aarch64/bin/context
> ```
>
> To use the full path of context on hello-world.tex generated the same
> error message.
>
> Thank you.
> Hong
>
>
> 2024年3月26日 10:47, "Andres Conrado Montoya"  >
> 写到:
>
> You can invoke it directly, with a complete path, and it will work even if
> it's not in your $PATH variable. In my personal installation I have context
> at `/home/andi/Apps/lmtx/tex/texmf-linux-64/bin`, so I can call it saying
> `/home/andi/Apps/lmtx/tex/texmf-linux-64/bin/context hello-world.tex` and
> it works fine.
>
> Is the `texmf-/bin` folder in your $PATH? or did you create a
> symlink to a known path folder? If the latter, that could be the cause of
> your problem. You need the bin folder of context in your path variable. Can
> you send the output of `echo $PATH`? Does it work if you invoke it with a
> full path?
>
> El lun, 25 mar 2024 a las 18:14,  escribió:
>
> Hello,
>
> I have installed ConTeXt on my Raspberry Pi 400 (aarch64), tried to
> typeset this simple file:
>
> ```
> \starttext
>
> First tex file to make, hello, world!
>
> \stoptext
> ```
>
> but the test failed:
>
>
> ```
> $context hello-world.tex
> mtxrun | forcing cache reload
> resolvers | resolving | configuration files already identified
> resolvers | resolving | skipping configuration file
> 'selfautoparent:/texmf-context/web2c/texmfcnf.lua' (no valid format)
> resolvers | resolving | no texmf paths are defined (using TEXMF)
> resolvers | resolving |
> mtxrun | the resolver databases are not present or outdated
> resolvers | resolving | using suffix based filetype 'lua'
> resolvers | resolving | remembering file 'mtx-context.lua' using hash
> 'lua::mtx-context.lua'
> resolvers | resolving | using suffix based filetype 'lua'
> resolvers | resolving | remembering file 'mtx-contexts.lua' using hash
> 'lua::mtx-contexts.lua'
> resolvers | resolving | remembered file 'mtx-context.lua'
> resolvers | resolving | using suffix based filetype 'lua'
> resolvers | resolving | remembering file 'mtx-t-mtx-context.lua' using
> hash 'lua::mtx-t-mtx-context.lua'
> resolvers | resolving | using suffix based filetype 'lua'
> resolvers | resolving | remembering file 'mtx-t-mtx-contexts.lua' using
> hash 'lua::mtx-t-mtx-contexts.lua'
> resolvers | resolving | remembered file 'mtx-t-mtx-context.lua'
> resolvers | resolving | remembered file 'mtx-context.lua'
> mtxrun | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'
> ```
>
> What's wrong with my installation?
>
> Best,
> Hong Feng
>
> ___
> 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
>
> ___
>
>
>
> --
> Andrés Conrado Montoya
> Andi Kú
> andresconr...@gmail.com
> http://sesentaycuatro.com
> http://messier87.com
> http://chiquitico.org
> 
> Los fines no justifican los medios, porque la medida verdadera de nuestro
> carácter está dada por los medios que estamos dispuestos a utilizar, no por
> los fines que proclamamos.
> 
>
> “You develop an instant global consciousness, a people orientation, an
> intense dissatisfaction with the state of the world, and a compulsion to do
> something about it. From out there on the moon, international politics look
> so petty. You want to grab a politician by the scruff of the neck and drag
> him a quarter of a million miles out and say, ‘Look at that, you son of a
> bitch.’” — Apollo 14 astronaut Edgar Mitchell
>
>
>
> _

[NTG-context] Re: Headertext

2024-03-26 Thread Wolfgang Schuster

Thomas Meyer schrieb am 26.03.2024 um 16:28:

Hi folks,

I know, with

\setuphead[chapter][header=high]

I can suppress the header text on the first page. But what can I do if I 
still want to have part of the header text on the first page?

Is there something I can do with \definetext and if so, how?


When you use "header=high" you can't have a header because the block for 
it no longer exists, compare the results for "header=high" and 
"header=empty" in the following example.


 begin example
\showframe

\starttext

\setuphead[chapter][header=high]

\chapter{Lorem Ipsum}

\dorecurse{10}{\samplefile{lorem}}

\setuphead[chapter][header=empty]

\chapter{Lorem Ipsum}

\dorecurse{10}{\samplefile{lorem}}

\stoptext
 end example

As you have guessed \definetext is the way to create a custom header for 
the first page of your \chapter, the command has like \setupheadertexts 
a variable number of arguments.


The third argument with the horizontal position can only be used when 
you use two or four arguments to set texts on the left and right side 
but isn't in my example because a) the text position is the default and 
b) I pass only one argument for the content because I wan't the text in 
the middle.


 begin example
\showframe

\definetext
  [chapterheader] % identifier
  [header]% vertical position (header/footer)
% [text]  % horizontal position (text/margin)
  [This is a custom header for \tex{chapter}] % content

\setuphead[chapter][header=chapterheader]

\starttext

\chapter{Lorem Ipsum}

\dorecurse{10}{\samplefile{lorem}}

\stoptext
 end example

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

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


[NTG-context] Re: ConTeXt on RPI400

2024-03-26 Thread hf
Hello Andres,
I have set up the shell environment variable in my `~/.zshrc`, here it is the 
output of `echo $PATH` under the shell:
```
/home/hf/WORKSPACE/TOOLS/Emacs/bin:/home/hf/WORKSPACE/TOOLS/ConTeXt/tex/texmf-linux-aarch64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
```
Here it is the output of `which context`:
```
/home/hf/WORKSPACE/TOOLS/ConTeXt/tex/texmf-linux-aarch64/bin/context
```
To use the full path of context on hello-world.tex generated the same error 
message.
Thank you.
Hong
2024年3月26日 10:47, "Andres Conrado Montoya" mailto:andresconr...@gmail.com?to=%22Andres%20Conrado%20Montoya%22%20%3Candresconrado%40gmail.com%3E)>
 写到:
You can invoke it directly, with a complete path, and it will work even if it's 
not in your $PATH variable. In my personal installation I have context at 
`/home/andi/Apps/lmtx/tex/texmf-linux-64/bin`, so I can call it saying 
`/home/andi/Apps/lmtx/tex/texmf-linux-64/bin/context hello-world.tex` and it 
works fine.
Is the `texmf-/bin` folder in your $PATH? or did you create a symlink to 
a known path folder? If the latter, that could be the cause of your problem. 
You need the bin folder of context in your path variable. Can you send the 
output of `echo $PATH`? Does it work if you invoke it with a full path?
El lun, 25 mar 2024 a las 18:14, mailto:h...@hongfeng.ch)> 
escribió:
Hello,
I have installed ConTeXt on my Raspberry Pi 400 (aarch64), tried to typeset 
this simple file:
```
\starttext
First tex file to make, hello, world!
\stoptext
```
but the test failed:
```
$context hello-world.tex
mtxrun | forcing cache reload
resolvers | resolving | configuration files already identified
resolvers | resolving | skipping configuration file 
'selfautoparent:/texmf-context/web2c/texmfcnf.lua' (no valid format)
resolvers | resolving | no texmf paths are defined (using TEXMF)
resolvers | resolving |
mtxrun | the resolver databases are not present or outdated
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-context.lua' using hash 
'lua::mtx-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-contexts.lua' using hash 
'lua::mtx-contexts.lua'
resolvers | resolving | remembered file 'mtx-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-t-mtx-context.lua' using hash 
'lua::mtx-t-mtx-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-t-mtx-contexts.lua' using hash 
'lua::mtx-t-mtx-contexts.lua'
resolvers | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers | resolving | remembered file 'mtx-context.lua'
mtxrun | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'
```
What's wrong with my installation?
Best,
Hong Feng
___
If your question is of interest to others as well, please add an entry to the 
Wiki!
maillist : ntg-context@ntg.nl (mailto:ntg-context@ntg.nl)/ 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl 
(https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl)
webpage : https://www.pragma-ade.nl (https://www.pragma-ade.nl)/ 
https://context.aanhet.net (https://context.aanhet.net)(mirror)
archive : https://github.com/contextgarden/context 
(https://github.com/contextgarden/context)
wiki : https://wiki.contextgarden.net (https://wiki.contextgarden.net)
___
--
Andrés Conrado Montoya
Andi Kú
andresconr...@gmail.com (mailto:andresconr...@gmail.com)
http://sesentaycuatro.com (http://sesentaycuatro.com)
http://messier87.com (http://messier87.com)
http://chiquitico.org (http://chiquitico.org)


Los fines no justifican los medios, porque la medida verdadera de nuestro 
carácter está dada por los medios que estamos dispuestos a utilizar, no por los 
fines que proclamamos.


“You develop an instant global consciousness, a people orientation, an 
intense dissatisfaction with the state of the world, and a compulsion to do 
something about it. From out there on the moon, international politics look so 
petty. You want to grab a politician by the scruff of the neck and drag him a 
quarter of a million miles out and say, ‘Look at that, you son of a bitch.’” — 
Apollo 14 astronaut Edgar Mitchell
___
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 on RPI400

2024-03-25 Thread Andres Conrado Montoya
You can invoke it directly, with a complete path, and it will work even if
it's not in your $PATH variable. In my personal installation I have context
at `/home/andi/Apps/lmtx/tex/texmf-linux-64/bin`, so I can call it saying
`/home/andi/Apps/lmtx/tex/texmf-linux-64/bin/context hello-world.tex` and
it works fine.

Is the `texmf-/bin` folder in your $PATH? or did you create a symlink
to a known path folder? If the latter, that could be the cause of your
problem. You need the bin folder of context in your path variable. Can you
send the output of `echo $PATH`? Does it work if you invoke it with a full
path?

El lun, 25 mar 2024 a las 18:14,  escribió:

> Hello,
>
> I have installed ConTeXt on my Raspberry Pi 400 (aarch64), tried to
> typeset this simple file:
>
> ```
> \starttext
>
> First tex file to make, hello, world!
>
> \stoptext
> ```
>
> but the test failed:
>
>
> ```
> $context hello-world.tex
> mtxrun | forcing cache reload
> resolvers | resolving | configuration files already identified
> resolvers | resolving | skipping configuration file
> 'selfautoparent:/texmf-context/web2c/texmfcnf.lua' (no valid format)
> resolvers | resolving | no texmf paths are defined (using TEXMF)
> resolvers | resolving |
> mtxrun | the resolver databases are not present or outdated
> resolvers | resolving | using suffix based filetype 'lua'
> resolvers | resolving | remembering file 'mtx-context.lua' using hash
> 'lua::mtx-context.lua'
> resolvers | resolving | using suffix based filetype 'lua'
> resolvers | resolving | remembering file 'mtx-contexts.lua' using hash
> 'lua::mtx-contexts.lua'
> resolvers | resolving | remembered file 'mtx-context.lua'
> resolvers | resolving | using suffix based filetype 'lua'
> resolvers | resolving | remembering file 'mtx-t-mtx-context.lua' using
> hash 'lua::mtx-t-mtx-context.lua'
> resolvers | resolving | using suffix based filetype 'lua'
> resolvers | resolving | remembering file 'mtx-t-mtx-contexts.lua' using
> hash 'lua::mtx-t-mtx-contexts.lua'
> resolvers | resolving | remembered file 'mtx-t-mtx-context.lua'
> resolvers | resolving | remembered file 'mtx-context.lua'
> mtxrun | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'
> ```
>
> What's wrong with my installation?
>
> Best,
> Hong Feng
>
> ___
> 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
>
> ___
>


-- 
Andrés Conrado Montoya
Andi Kú
andresconr...@gmail.com
http://sesentaycuatro.com
http://messier87.com
http://chiquitico.org

Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.


“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
___
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] ConTeXt on RPI400

2024-03-25 Thread hf
Hello,
I have installed ConTeXt on my Raspberry Pi 400 (aarch64), tried to typeset 
this simple file:
```
\starttext
First tex file to make, hello, world!
\stoptext

```
but the test failed:
```
$context hello-world.tex

mtxrun | forcing cache reload
resolvers | resolving | configuration files already identified
resolvers | resolving | skipping configuration file 
'selfautoparent:/texmf-context/web2c/texmfcnf.lua' (no valid format)
resolvers | resolving | no texmf paths are defined (using TEXMF)
resolvers | resolving |
mtxrun | the resolver databases are not present or outdated
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-context.lua' using hash 
'lua::mtx-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-contexts.lua' using hash 
'lua::mtx-contexts.lua'
resolvers | resolving | remembered file 'mtx-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-t-mtx-context.lua' using hash 
'lua::mtx-t-mtx-context.lua'
resolvers | resolving | using suffix based filetype 'lua'
resolvers | resolving | remembering file 'mtx-t-mtx-contexts.lua' using hash 
'lua::mtx-t-mtx-contexts.lua'
resolvers | resolving | remembered file 'mtx-t-mtx-context.lua'
resolvers | resolving | remembered file 'mtx-context.lua'
mtxrun | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'
```
What's wrong with my installation?
Best,
Hong Feng
___
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] (again) \xmlinlineprettyprinttext double hyphens

2024-03-24 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \startbuffer[demo]
  mtxrun --script check file
  \stopbuffer

  \startxmlsetups xml:initialize
\xmlsetsetup{#1}{code}{xml:*}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:code
\xmlprettyprinttext{#1}{none}
\xmlinlineprettyprinttext{#1}{none}
  \stopxmlsetups

  \definefontfamily[mainface][tt][TeX Gyre Cursor]
[features={default}]

  \setupbodyfont[mainface]

  \starttext
\xmlprocessbuffer{main}{demo}{}
  \stoptext

Current LMTX (2024.03.11 09:34) is giving different results for double
hyphens with \xmlprettyprinttext and \xmlinlineprettyprinttext.

Since the output of \xmlinlineprettyprinttext is a wrong argument (in
the sample), what am I missing here to get the right output with
\xmlinlineprettyprinttext?

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://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: Unknown units es and dk

2024-03-23 Thread Wolfgang Schuster

Jan Ulrich Hasecke via ntg-context schrieb am 23.03.2024 um 13:57:

I saw this in (the btw great) bachotex-stepbystep presentation

\definepapersize
[example]
[width=8.5es,
height=11es]


\setuptextbackground
[location=paragraph,
backgroundcolor=MyColors:4,
backgroundoffset=1dk,
frame=off]


The units "es" and "dk" are unknown to me.
What does they mean?


Regarding the dk unit: https://tug.org/TUGboat/tb42-3/tb132hagen-dk.pdf


A quote from the Luametatex source regarding the es unit:

The Edith and Tove were introduced at BachoTeX 2023 and because the 
error message
was still in feet we decided to adapt it accordingly so now in addition 
it reports
different values, including Theodores little feet measured by Arthur as 
being roughly

five Ediths.


Here is the fitting error message when you pass a dimension too large 
for TeX:


Dimension too large", I can't work with sizes bigger than
about 19 feet (45 Theodores as of 2023), 575 centimeters,
Toves, 230 Ediths or 16383 points. Continue and I'll use
the largest value I can.


You should also take a look at the lowlevel register manual 
(lowlevel-registers.pdf)

which explains how you can define your own units.

Wolfgang

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

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


[NTG-context] issue with \xmlinlineprettyprinttext

2024-03-20 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \startbuffer[demo]
  
  a --b c
  a --b c
  
  \stopbuffer

  \startxmlsetups xml:initialize
   \xmlsetsetup{#1}{doc|code|inlinecode}{xml:*}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:doc
 \xmlflush{#1}
  \stopxmlsetups

  \startxmlsetups xml:code
 \xmlprettyprinttext{#1}{none}
  \stopxmlsetups

  \startxmlsetups xml:inlinecode
 \xmlinlineprettyprinttext{#1}{none}
  \stopxmlsetups

  \definefontfamily[mainface][tt][TeX Gyre Cursor]
 [features={default, quality}]

  \setupbodyfont[mainface]

  \starttext
\xmlprocessbuffer{main}{demo}{}

\type{a --b c}
  \stoptext

Using current latest (from 2024.03.11 09:34), LMTX transforms "--" in
"–" (en-dash) only with \xmlinlineprettyprinttext (LuaTeX writes the
en-dash in the three cases).

This issue has been driving me crazy, since it took me a while what was
different here.

Is there something I can do to get \xmlinlineprettyprinttext as
\xmlprettyprinttext in this point?

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://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: command line arguments

2024-03-19 Thread Willi Egger
Hello Hraban,

I puzzled a while. To me the —arguments= option does not work. I saw then on 
the Wiki, that one can also add documentarguments as —schema=2UP 
—numberofpages=16.

I further changed to \startdocument … \stopdocument.

Please look at the attached file

Willi

impositiontest-2.tex
Description: Binary data


> On 19 Mar 2024, at 21:41, Hraban Ramm  wrote:
> 
> Following up on the other imposition question, I'm trying to make an example 
> file that shows an imposition schema according to command line arguments.
> 
> This way it works for the number of pages, as used in \dorecurse{\Pages}{…}, 
> but not for the imposition schema. Typesetting \Schema looks right, but 
> \setuparranging doesn’t work. Where's my error?
> 
> \def\Schema{\doifelsedocumentargument{schema}{\getdocumentargument{schema}}{1*8}}
> \def\Pages{\doifelsedocumentargument{numberofpages}{\getdocumentargument{numberofpages}}{16}}
> 
> \setuparranging[\Schema]
> 
> 
> Find the full example attached, I call it like
> 
> context --autopdf=auto --arrange impositiontest.tex --schema=TRYPTICHON 
> --numberofpages=32
> 
> Hraban
> 
> ___
> 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
> ___

___
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: Mikael’s missing math manual

2024-03-18 Thread Hraban Ramm

Am 18.03.24 um 07:36 schrieb Mikael Sundqvist:

Hi,

On Sun, Mar 17, 2024 at 10:57 PM Hraban Ramm  wrote:

… and another thing that came up in my workshops and in discussions at
our booth: the math manual is eagerly awaited! (My book too, but I can’t
answer most questions about math.)

Oh, I see. So, I should really try to get something out. It is
difficult to find enough time working on it, in particular since Hans
is always adding new (not only math) stuff, but I will try. It is fun
to participate in the development, and I do not want to delay it
(somebody has to push him and test, and so on...)

But I should probably get something out, even if that is not really
finished/polished. All the basics are there. Then it can be a
work-in-progress document, adding/modifying new stuff.


Yes, please! The version that you gave me a year ago is already really 
interesting and helpful, and Hans’ manuals are also often "in progress". 
A visible TODO marker might help – I’m using the following in my book to 
keep track of incomplete sections:


\defineregister[todos]
\define[1]\TODO{\inouter{\tt\color[red]{TODO}}\expanded{\todos{\structurevariable{title}}}\color[red]{\bf
 #1}\autoinsertnextspace}

…
\startsection[title=Lists]
\TODO{Research the options of \tex{setupitemgroup}!}
\stopsection
…

\startchapter[title=Work list]
  Sections that still need work.\blank

  \placetodos
\stopchapter

So I get a prominent marker in the content and the title of the affected 
section as an index.



There have been many changes along the way, and maybe at some time
some things were not really working, but later fixed.


I thought so, too.

For promotion I’d like to have a few examples where the difference 
between TeX/LaTeX default rendering and new ConTeXt rendering is visible.


Hraban___
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-18 Thread Hans Hagen

On 3/18/2024 1:31 AM, Jim wrote:

On Sat, Mar 16, 2024 at 15:20 (+0100), Hans Hagen wrote:


On 3/16/2024 2:10 PM, Jim wrote:

On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:



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.



Unfortunately, it seems that the maintainer feels that if we can't deal
with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
that's where it ended.  (I was arguing for plain TeX support at the time in
the linked^2 message, but I was able to add the definition for cmyk to my
own macro file, so I was able to process examples with cmyk colours.)

What does the maintainer mean by that ... context


The maintainer's comment was about plain TeX, not context.  Sorry if that
wasn't clear.


ah, good to know


In any case, I should have sent my request to Max alone, rather than the
ntg-context list, because if Max was going to push something there, I was
hoping that a second appeal for cmyk colour support in plain would be
nice.  (I'm not quite ready to give up all of my plain TeX files.)


if it's plain, indeed, too confusing otherwise (it's no problem asking 
plain questions here but in this tikz case kind of confusing)



can add profiles if configured to do so (best not to embed them) ... and
why should there be a profile anyway ... crappy arguments ..


I agree about the colour profile, but the last time I poked that bear, my
pleas fell on deaf ears.


not even plain needs color profiles and i hope tikz doesn't add them


[And in summary, to be clear: I'm good with the colour support in ConTeXt!]

ok

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://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-17 Thread Jim
On Sat, Mar 16, 2024 at 15:20 (+0100), Hans Hagen wrote:

> On 3/16/2024 2:10 PM, Jim wrote:
>> On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:

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

>> Unfortunately, it seems that the maintainer feels that if we can't deal
>> with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
>> that's where it ended.  (I was arguing for plain TeX support at the time in
>> the linked^2 message, but I was able to add the definition for cmyk to my
>> own macro file, so I was able to process examples with cmyk colours.)
> What does the maintainer mean by that ... context

The maintainer's comment was about plain TeX, not context.  Sorry if that
wasn't clear.

In any case, I should have sent my request to Max alone, rather than the
ntg-context list, because if Max was going to push something there, I was
hoping that a second appeal for cmyk colour support in plain would be
nice.  (I'm not quite ready to give up all of my plain TeX files.)

> can add profiles if configured to do so (best not to embed them) ... and
> why should there be a profile anyway ... crappy arguments ..

I agree about the colour profile, but the last time I poked that bear, my
pleas fell on deaf ears.

[And in summary, to be clear: I'm good with the colour support in ConTeXt!]

Jim
___
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-16 Thread Hans Hagen

On 3/16/2024 2:10 PM, Jim wrote:

On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:


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.


Unfortunately, it seems that the maintainer feels that if we can't deal
with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
that's where it ended.  (I was arguing for plain TeX support at the time in
the linked^2 message, but I was able to add the definition for cmyk to my
own macro file, so I was able to process examples with cmyk colours.)
What does the maintainer mean by that ... context can add profiles if 
configured to do so (best not to embed them) ... and why should there be 
a profile anyway ... crappy arguments .. especially because when i run


\usemodule[tikz]

\startTEXpage

\definecolor [colorone] [r=0,g=0,b=0.5]
\definecolor [colortwo] [c=0,m=1]

\starttikzpicture
\fill [colorone] (0,0) circle(2) ; % rgb
\fill [colortwo] (0,0) circle(1) ; % cmyk
\stoptikzpicture
\setupcolors[cmyk=no]
\starttikzpicture
\fill [colorone] (0,0) circle(2) ; % rgb
\fill [colortwo] (0,0) circle(1) ; % rgb
\stoptikzpicture

\stopTEXpage

here i get a pdf file with rgb and cmyk. Maybe I have an old tikz and 
something changed (wouldn't be the first time). So let's forget about 
maintainers and ugly hacks, and identify what is the real problem.


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
-


oeps.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://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-16 Thread Jim
On Fri, Mar 15, 2024 at 09:44 (+0100), Hans Hagen wrote:

> On 3/15/2024 12:53 AM, 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?

>> And, if anyone has the will to push this (or add it in to a ConTeXt
>> distribution version), I'd still like the cmyk support, even if there is no
>> ability to specify colour profiles:

>> \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil
>> {
>>  \pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
>>  \pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
>>  \pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}%
>>  \expandafter\edef\csname\string\color@#1\endcsname
>>  {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
>> }

>> I don't see that it would hurt anything, even if it doesn't give complete
>> cmyk support.

> We provide

> \pgf@context@registercolor
> \pgf@context@registergray
> \pgf@context@registerrgb
> \pgf@context@registercmyk

> in colo-ini that hook into the context color mechanism so be careful with
> patches.  I'm not going to spend time on other solutions that can interfere
> with internals.

Thanks Hans, I was not familiar with those.  The above code worked fine for
me in plain TeX (the last time I used it, anyway).

By the looks of things, Max has a vastly better idea of ConTeXt internals
than I do, and if his proposed \pgfutil@emu@rgb doesn't break anything, it
might give some confidence that the above \pgfutil@emu#cmyk won't either.
(Yeah, I know, that is hardly a robust argument of anything.)

> (I wonder when the moment comes that we have to take a snapshot of tikz and
> stay with that.)

I hope that time doesn't come, because either someone (you? :-) would be
left with an on-going job of patching the snapshot, or ConTeXt's version of
tikz would become increasingly different (and, presumably, increasingly
less capable than the "mainline" version).

Cheers.

Jim
___
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-16 Thread Jim
On Fri, Mar 15, 2024 at 01:53 (+0100), Aditya Mahajan wrote:

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

Unfortunately, it seems that the maintainer feels that if we can't deal
with cmyk profiles, we shouldn't have cmyk at all.  I don't agree, but
that's where it ended.  (I was arguing for plain TeX support at the time in
the linked^2 message, but I was able to add the definition for cmyk to my
own macro file, so I was able to process examples with cmyk colours.)

Jim
___
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: how to include an an svg file?

2024-03-16 Thread Jean-Pierre Delange
 another matter because svg dropped glyph support so now 
everything has to go through font features which in turn means that if 
one uses svg as output format one has to specify every character with 
possible abuse of a substitution feature that accesses it. So that is 
no longer a real interesting option, unless of course one exports all 
text as curves, just to be sure.


(I will extend general text suport but it will always be suboptimal 
but then, svg is not a long term archival format anyway.)


No upload yet as i also want to do some cleanup,

ps. For metapost lovers, here is some of the trickery used:

\startMPpage[offset=1ts]

    draw image (
    fill (unitsquare xscaled 10cm yscaled 4cm)
    withcolor svgcolor(0.5,0,0)
    ;

    registerluminositygroup ("test") (
    fill (unitsquare scaled 2cm) shifted (1cm,1cm)
    withshademethod "circular"
    withshadecolors (.6,.1)
    ) ;

    applyluminositygroup ("test") (
    fill (unitsquare scaled 2cm) shifted (1cm,1cm)
    withshademethod "circular"
    ) ;

    draw luminositygroup (
    fill (unitsquare scaled 2cm) shifted (4cm,1cm)
    withshademethod "circular"
    withshadecolors (.6,.1)
    ) (
    fill (unitsquare scaled 2cm) shifted (4cm,1cm)
    withshademethod "circular"
    ) ;

    draw luminosityshade (
    (unitsquare scaled 2cm) shifted (7cm,1cm)
    ) (
    withshademethod "circular"
    withshadecolors (.6,.1)
    ) (
    withshademethod "circular"
    ) ;
    ) ;

\stopMPpage

Not that intuitive and a bit ugly deep down but it works (there was no 
need to extend mp btw as we already have graphic grouping in the engine).


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://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
___system  > 
system  > ConTeXt  ver: 2024.01.24 22:39 LMTX  fmt: 2024.3.10  int: 
english/english
system  > 
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'C:/Users/adeim/context/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/adeim/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './ctx-test-MetaPost-pdf', input 
'./ctx-test-MetaPost-pdf.tex', result './ctx-test-MetaPost-pdf'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './ctx-test-MetaPost-pdf.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern rm 12pt' is loaded
structure   > sectioning > chapter @ level 2 : 0.1 -> MetaPost
pages   > flushing realpage 1, userpage 1, subpage 1
metapost> initializing instance 'metafun:1' using format 'metafun' and 
method 'double'
metapost> loading 'metafun' as 
'C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/metafun.mpxl'
 using method 'double'
metapost> initializing number mode 'double'
metapost> trace > This is MPLIB for LuaMetaTeX, version 3.14, running 
in double mode.
metapost> trace > 
metapost> trace > loading metafun for lmtx, including the plain 1.004 
base definitions
metapost> trace > 
pages   > flushing realpage 2, userpage 2, subpage 2
structure   > sectioning > chapter @ level 2 : 0.2 -> Hans tricky drawing
pages   > flushing realpage 3, userpage 3, subpage 3
metafun > log >
metafun > log > error: Isolated expression
metafun > log >
metapost> trace >  registerluminositygroup
metapost> trace >  (
metapost> trace >  fill ( unitsquare xscaled 10 cm yscaled 4 
cm ) withcolor svgcolor ( 0.5 , 0 , 0 ) ; registerluminositygroup ( "test" ) ( 
fi

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

2024-03-14 Thread Jim
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?

And, if anyone has the will to push this (or add it in to a ConTeXt
distribution version), I'd still like the cmyk support, even if there is no
ability to specify colour profiles:

\def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil
{
\pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
\pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
\pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}% 
\expandafter\edef\csname\string\color@#1\endcsname
{\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
}

I don't see that it would hurt anything, even if it doesn't give complete
cmyk support.

Cheers.
Jim

On Thu, Mar 14, 2024 at 17:18 (-0600), Max Chernoff wrote:

> Hi all,

> I've had a few patches applied to my installation for a little while
> now, so I figured that I should send them in. There's a diff at the end
> of the email, and the modified files are attached [but rejected by the
> mailing list, so sent separately to Hans]

>  * In the definition of "featurecreep()" in "lpdf-mis.lmt",
>"structures.pages.tobesaved[i].status" should be "[...].state" to
> match the definition of "pages.save" in "strc-pag.lua". 

>  * For the "resultof" runner in "util-sbx.lmt", the current io.popen
> mode only works with Windows. See the definition of "l_checkmodep" in
>"liolib.c".

>  * Some of the pgfplots 3D shaders appear to be broken,
> see https://tex.stackexchange.com/a/708121 .

>  * The TikZ "RGB" colour model does not currently work properly. This is
> internally used by "\usepgfplotslibrary[colorbrewer]" among others.
> See https://github.com/pgf-tikz/pgf/pull/1130 .

> Thanks,
> -- Max


> diff --git a/tex/generic/pgf/utilities/pgfutil-context.def 
> b/tex/generic/pgf/utilities/pgfutil-context.def
> index eddab09ab..66edb0980 100644
> --- a/tex/generic/pgf/utilities/pgfutil-context.def
> +++ b/tex/generic/pgf/utilities/pgfutil-context.def
> @@ -26,8 +26,17 @@
>  \def\pgfutil@definecolor#1#2#3{\csname pgfutil@emu@#2\endcsname{#1}#3\@nil}

>  
> \def\pgfutil@emu@rgb#1#2,#3,#4\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#3,#4}}}
> -\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#2,#2}}}
> +\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{gray}{#2}}}
>  
> \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}}
> +\def\pgfutil@emu@RGB#1#2,#3,#4\@nil{%
> +\begingroup
> +\pgfmathdivide@{#2}{255}\let\pgfutil@emu@RGB@r\pgfmathresult
> +\pgfmathdivide@{#3}{255}\let\pgfutil@emu@RGB@g\pgfmathresult
> +\pgfmathdivide@{#4}{255}\let\pgfutil@emu@RGB@b\pgfmathresult
> +
> \edef\pgf@marshal{\def\expandafter\noexpand\csname\string\color@#1\endcsname{%
> +
> \noexpand\xcolor@{}{}{rgb}{\pgfutil@emu@RGB@r,\pgfutil@emu@RGB@g,\pgfutil@emu@RGB@b}}}%
> +\expandafter\endgroup\pgf@marshal
> +}


>  % no need for x colors (users can load it if needed)
> diff --git a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex 
> b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> index 60d6274..106c490 100644
> --- a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> +++ b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> @@ -2804,6 +2804,9 @@
>  \def\pgfplotsretval{4}%
>  \fi
>  \fi
> + \if0\pgfplotsretval
> + \def\pgfplotsretval{5}
> + \fi
>  \pgfkeyslet{/pgfplots/surf shading/shading type}\pgfplotsretval%
>  %
>  \pgfplotsplothandlermesh@set@shader@colormap
> diff --git 
> a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def 
> b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> index 0046daa..b563732 100644
> --- 
> a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> +++ 
> b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> @@ -61,7 +61,7 @@
>  \pgfplotslibrarysurfusepath
>  \endpgfpicture
>  }%
> - \immediate\saveboxresource resources{
> + \saveboxresource resources{
>  /Pattern << \pgfplots@glob@TMPa >> % write the pattern resource dictionary
>  }\pgfutil@tempboxa
>  \leavevmode
> diff --git a/tex/context/base/mkxl/util-sbx.lmt 
> b/tex/context/base/mkxl/util-sbx.lmt
> index b48d4a9..0ee8a16 100644
> --- a/tex/context/base/mkxl/util-sbx.lmt
> +++ b/tex/context/base/mkxl/util-sbx.lmt
> @@ -393,7 +393,7 @@ local runners = {

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

2024-03-14 Thread Max Chernoff
Hi all,

I've had a few patches applied to my installation for a little while
now, so I figured that I should send them in. There's a diff at the end
of the email, and the modified files are attached [but rejected by the
mailing list, so sent separately to Hans]

 * In the definition of "featurecreep()" in "lpdf-mis.lmt",
   "structures.pages.tobesaved[i].status" should be "[...].state" to
   match the definition of "pages.save" in "strc-pag.lua". 
   
 * For the "resultof" runner in "util-sbx.lmt", the current io.popen
   mode only works with Windows. See the definition of "l_checkmodep" in
   "liolib.c".
   
 * Some of the pgfplots 3D shaders appear to be broken,
   see https://tex.stackexchange.com/a/708121 .
   
 * The TikZ "RGB" colour model does not currently work properly. This is
   internally used by "\usepgfplotslibrary[colorbrewer]" among others.
   See https://github.com/pgf-tikz/pgf/pull/1130 .
   
Thanks,
-- Max


diff --git a/tex/generic/pgf/utilities/pgfutil-context.def 
b/tex/generic/pgf/utilities/pgfutil-context.def
index eddab09ab..66edb0980 100644
--- a/tex/generic/pgf/utilities/pgfutil-context.def
+++ b/tex/generic/pgf/utilities/pgfutil-context.def
@@ -26,8 +26,17 @@
 \def\pgfutil@definecolor#1#2#3{\csname pgfutil@emu@#2\endcsname{#1}#3\@nil}

 
\def\pgfutil@emu@rgb#1#2,#3,#4\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#3,#4}}}
-\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#2,#2}}}
+\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{gray}{#2}}}
 
\def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}}
+\def\pgfutil@emu@RGB#1#2,#3,#4\@nil{%
+\begingroup
+\pgfmathdivide@{#2}{255}\let\pgfutil@emu@RGB@r\pgfmathresult
+\pgfmathdivide@{#3}{255}\let\pgfutil@emu@RGB@g\pgfmathresult
+\pgfmathdivide@{#4}{255}\let\pgfutil@emu@RGB@b\pgfmathresult
+
\edef\pgf@marshal{\def\expandafter\noexpand\csname\string\color@#1\endcsname{%
+
\noexpand\xcolor@{}{}{rgb}{\pgfutil@emu@RGB@r,\pgfutil@emu@RGB@g,\pgfutil@emu@RGB@b}}}%
+\expandafter\endgroup\pgf@marshal
+}


 % no need for x colors (users can load it if needed)
diff --git a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex 
b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
index 60d6274..106c490 100644
--- a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
+++ b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
@@ -2804,6 +2804,9 @@
 \def\pgfplotsretval{4}%
 \fi
 \fi
+ \if0\pgfplotsretval
+ \def\pgfplotsretval{5}
+ \fi
 \pgfkeyslet{/pgfplots/surf shading/shading type}\pgfplotsretval%
 %
 \pgfplotsplothandlermesh@set@shader@colormap
diff --git 
a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def 
b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
index 0046daa..b563732 100644
--- a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
+++ b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
@@ -61,7 +61,7 @@
 \pgfplotslibrarysurfusepath
 \endpgfpicture
 }%
- \immediate\saveboxresource resources{
+ \saveboxresource resources{
 /Pattern << \pgfplots@glob@TMPa >> % write the pattern resource dictionary
 }\pgfutil@tempboxa
 \leavevmode
diff --git a/tex/context/base/mkxl/util-sbx.lmt 
b/tex/context/base/mkxl/util-sbx.lmt
index b48d4a9..0ee8a16 100644
--- a/tex/context/base/mkxl/util-sbx.lmt
+++ b/tex/context/base/mkxl/util-sbx.lmt
@@ -393,7 +393,7 @@ local runners = {
 if trace then
 report("resultof: %s",command)
 end
-local handle = iopopen(command,"rb") -- already has flush
+local handle = iopopen(command,"r") -- already has flush
         if handle then
 local result = handle:read("*all") or ""
     handle:close()
diff --git a/tex/context/base/mkxl/lpdf-mis.lmt 
b/tex/context/base/mkxl/lpdf-mis.lmt
index 0f21cf9..a9cfe02 100644
--- a/tex/context/base/mkxl/lpdf-mis.lmt
+++ b/tex/context/base/mkxl/lpdf-mis.lmt
@@ -510,7 +510,7 @@ local function featurecreep()
 return -- fatal error
 end
 local label = p.viewerprefix or ""
-if p.status == v_stop then
+if p.state == v_stop then
 if not stopped then
 list[#list+1] = i - 1 -- pdf starts numbering at 0
 list[#list+1] = pdfdictionary {


___
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: how to include an an svg file?

2024-03-13 Thread Jean-Pierre Delange

Hi Hraban & Seyal

I can confirm that converting the *.svg file into a *.pdf file displays 
the colour shades correctly ...

(I used Gimp to export the smile.svg file to a smile03.pdf file).

The MWE below works correctly, even if you have to make finer 
adjustments to place the figure in a precise position on the page. As 
I'm in the process of enriching and clarifying a few pages of the 
ConTeXt wiki and the French wikibook, I'm interested in the details 
concerning the position of figures, images and photos etc. So please let 
me know (in private mail) how you make your documents (a MWE will do).


\starttext

\input tufte


\externalfigure[smile03.pdf][conversion=mp]

\stoptext



It seems to me that Pablo has been struggling with the fine graining of 
PDF files in recent months, but I think it was more about the 
information contained in the PDF output than the processing of PDF 
images in *.tex file output.



JP


Le 13/03/2024 à 09:16, Henning Hraban Ramm a écrit :

Am 12.03.24 um 23:59 schrieb seyal zavira:
You are correct. when i convert this svg to pdf via inkscape it works 
like a charm.


But what is standard way of including an svg file with context if we 
want to inkscape render the images?


\externalfigure[smile]

without any other settings, but inkscape must be callable on the 
command line (which doesn’t work for me on MacOS any more, must 
investigate…).


Hraban
___ 

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
___ 


ctx-test-metapost-svg.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://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] Creating a module for calligraphy practice templates

2024-03-12 Thread Andres Conrado Montoya
Hello, list!

I've been working on a module to typeset calligraphy practice templates
using ConTeXt and MetaPost. You are welcome to check it out on github:
https://github.com/conradolandia/pauta
I'm not including a MWE because the repository has all the current code. I
hope this is fine. I did not want to clutter the list with too much text.
The module is only a single file (t-pauta.mkxl) and some examples of use
and documentation that are still somewhat unfinished, but I've tried to
document the source code as much as I could. If you need clarification
about anything, please let me know.

(At the root of the repository, there is a file build.lua, that is not
really part of the project, just a custom tool I use to process the files,
a sort of minimal build system. You can ignore it.)

I welcome any kind of suggestions and dire warnings. I've tried to read the
wiki and the manuals carefully and made as many tests as possible, and in
general it works fine, but I have ADHD and things frequently get over
my head. There are still some things that don't work as they should, and
things that need improvement:

1. I use top/bottom areas to display some info. These areas are not being
handled properly so far. For example, if I place a chapter before the Pauta
macro invocation, there will be data on the top and bottom areas in the
last page of the chapter. I've tried using \page and clearing the areas,
which feels like cheating, but still does not work well. Any ideas on how
to better handle this are more than welcome.

2. I'm using what I found at
https://wiki.contextgarden.net/System_Macros/Handling_Arguments and
\getparameters to handle the arguments for my Pauta macro, but today I
found out about \processaction at
https://wiki.contextgarden.net/Module_Parameters and I'm not really sure if
I should change my module to work with this instead of \getparameters. In
general, after checking the source code of several modules, I'm not really
sure how much I have to follow the guidelines at
https://wiki.contextgarden.net/Module_Parameters or if those are the most
current recommendations.

3. I'm including in my module the code of the file hatching.mp that can be
found at
https://ctan.org/tex-archive/graphics/metapost/contrib/macros/hatching. I
did this for portability reasons, since it's less than 70 lines and has not
been updated in 20 years. But if it's better to have this in a separate
file, please let me know. Also, if a better method to create pattern filled
paths is available, please let me know, I confess I didn't look too much
into it yet. This has solved my requirement so far.

4. I want to be as close as possible to the new LMTX syntax and way of
doing things. so If you think I'm doing something in anachronistic ways,
please let me know.

In general, if someone wants to check it out and provide feedback so I can
improve it, with the objective of eventually being shared on
modules.contextgarden.net, will be much appreciated.

Thank you for your time, and have a great week!

-- 
Andrés Conrado Montoya
Andi Kú
andresconr...@gmail.com
http://sesentaycuatro.com
http://messier87.com
http://chiquitico.org

Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.


“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
___
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] \intertext and highlighting with \alignhere/\breakhere

2024-03-12 Thread Max Chernoff
Hi all,

Often I want to include a sentence/paragraph in the middle of a long
multipart formula. With the old \startalign/\stopalign formulas, I could
use \intertext{...} to do this, but this doesn't work with the new
\alignhere/\breakhere formulas. I've managed to find a "solution" for
this, although I'd prefer something a bit less hacky. Any ideas?

Also, is there a way to highlight an equation across an \alignhere? Once
again, I've found a "solution", but like before, it's pretty hacky.

Example files are attached.

Thanks,
-- Max
\setupindenting[yes, 3em]
\setuphead[section][page=yes]

\unprotect
\newbox\intertext_tmp_box
\newdimen\intertext_tmp_dimen

\starttexdefinition protected newintertext #1
\texthere[left]{
\setbox\intertext_tmp_box=\hbox{
\startframedtext[
offset=none,
width=\hsize,
frame=off,
]
\parindent = \v_spac_indentation_normal
\noindent
#1
\stopframedtext
}
\global\intertext_tmp_dimen = \ht\intertext_tmp_box
\vbox to 0pt{
\vskip\dimexpr 1ex - \baselineskip \relax
\box\intertext_tmp_box
\vss
}
\aftergrouped{
\aftergrouped{
\vadjust{
\penalty 1
\vskip\dimexpr \intertext_tmp_dimen - \baselineskip \relax
}
}
}
}
\breakhere
\stoptexdefinition
\protect

\starttext
\section{Old alignment}
\samplefile{knuth}
\placeformula\startformula\startalign
\NC \text{something} + \text{really} + \text{really} + \text{long} \NC= \sqrt{x} \NR[+]
\intertext{\samplefile{knuth}}
\NC d \NC= e + f \NR[+]
\NC g \NC= h + i
\stopalign\stopformula
\samplefile{knuth}


\section{“I expect to see \tex{noalign} only after the \tex{cr} of an alignment.”}
\starttyping
\samplefile{knuth}
\startformula
\text{something} + \text{really} + \text{really} + \text{long} \alignhere= \sqrt{x} \numberhere \breakhere
\intertext{\samplefile{knuth}}
d \alignhere= e + f \numberhere \breakhere
g \alignhere= h + i
\stopformula
\samplefile{knuth}
\stoptyping


\section{Alignment not kept}
\samplefile{knuth}
\startformula
\text{something} + \text{really} + \text{really} + \text{long} \alignhere= \sqrt{x} \numberhere
\stopformula
\samplefile{knuth}
\startformula
d \alignhere= e + f \numberhere \breakhere
g \alignhere= h + i
\stopformula
\samplefile{knuth}


\section{My hack}
\samplefile{knuth}
\startformula
\text{something} + \text{really} + \text{really} + \text{long} \alignhere= \sqrt{x} \numberhere \breakhere
\newintertext{\samplefile{knuth}}
d \alignhere= e + f \numberhere \breakhere
g \alignhere= h + i
\stopformula
\samplefile{knuth}
\stoptext
\unprotect
\newbox\hightlight_tmp_box

\definemathframed[_highlight][
location=mathematics,
frame=off,
background=color,
backgroundcolor=lightred,
backgroundoffset=0.25ex,
]

\tolerant\def\highlighthere#1\alignhere#2#3\breakhere{%
\setbox\hightlight_tmp_box=\hbox{%
\m{%
\forcedisplaymath%
#1#2\null%
}%
}%
\alignhere%
\phantom{%
\null#2\null%
}%
\mskip -8mu%
\hskip -\wd\hightlight_tmp_box%
\lower 1ex \hbox{%
\_highlight[
loffset=\wd\hightlight_tmp_box,
location=keep
]{%
\hskip -\wd\hightlight_tmp_box%
\forcedisplaymath%
#1#2#3%
}%
}%
\breakhere%
}
\protect

\starttext
\startformula
a \alignhere= b + c \breakhere
\highlighthere d + e \alignhere= f \breakhere
g \alignhere= h + i
\stopformula
\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: How can I do this?

2024-03-10 Thread Otared Kavian
Hi Hans and Hraban,

Thank you both for your remarks: indeed I am aware of the commands \m{} and 
\dm{} in ConTeXt, but for my work with math stuff I use the usual dollar signs 
for inline maths, since in this way it is easier for me to read the source on 
the one hand, and and on the hand when exchanging parts of a file with people 
using Plain TeX or LaTeX, it is more standard.

Best regards: Otared

> On 10 Mar 2024, at 10:16, Hans Hagen via ntg-context  
> wrote:
> 
> On 3/8/2024 6:36 PM, Henning Hraban Ramm wrote:
>> Am 08.03.24 um 17:56 schrieb Otared Kavian:
>>> Hi Ursula,
>>> 
>>> The reason for which you did not get the expected result is that you have « 
>>> } » missing in your file, that is the closing brace after your italic 
>>> command
>>> « {\it » at the end of your document.
>>> Moreover you did not have a \stoptext in your file, and a math command « \m 
>>> » was not written correctly. Talking of math, I personnaly prefer to 
>>> enclose in-line math between dollar signs $, that is writing « $\exists x 
>>> \in H$ » instead of  « \m{\exists x \in H} ».
>> Well, better stay with the modern ConTeXt approach of \m{}.
> for regular inline math we just use \im{...} (which has an \dm{...} companion 
> with displaystyle
> 
> 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://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
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95




___
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: \em issue in MkXL (2024.03.05 11:26)

2024-03-10 Thread Hans Hagen

On 3/10/2024 11:48 AM, Wolfgang Schuster wrote:

Hans Hagen via ntg-context schrieb am 10.03.2024 um 10:46:

On 3/10/2024 9:32 AM, Pablo Rodriguez via ntg-context wrote:

On 3/9/24 16:04, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 08.03.2024 um 19:39:

[...]
    \enableexperiments[fonts.compact]

Which seeems weird to me. Or at least, I thought I read that Hans
enabled it by default in LMTX.


AFAIR Hans uses the setting in his own documents.


I have been using it for a while.

I hope the issue with \glyphslant might be fixed to enable it again.


Then my question is whether this was caused by simply enabling compact
fonts or by doing it twice.


The results happen when you use compact mode and is a result of
\glyphslant which keeps the value of the italic style even when you
switch back to the upright style.


Many thanks for your explaination,

using the low level commands

\glyphscale
\glyphxscale
\glyphyscale
\glyphslant
\glyphweight

directly can have side efects when at an outer level these are also 
set, so you need to accumulate, like


\starttext

test {\glyphscale 2000 test \glyphscale \numericscaled1.2\glyphscale 
test} test


test {\glyphslant  500 test \glyphslant \numericscaled2.0\glyphslant 
test} test


test {\glyphweight 100 test \glyphweight\numericscaled2.0\glyphweight 
test} test


\stoptext


The problem is that compact mode uses them to apply the slanted feature 
without any manual use of the commands from a user.


\enableexperiments[fonts.compact]

\definefontfamily[mainface][rm][TeX Gyre Termes]
   [it={style:regular, features:{default,slanted}},
    sl={style:regular, features:{default,slanted}}]

\setupbodyfont[mainface]

\starttext

\startstyle[style=italic]normal {\em emphasized} normal\stopstyle

\stoptext

The only way to mask the effect is to create a new fontfeature with the 
minimum slant value and apply it to the upright style.


\definefontfeature [unslanted] [slant=0.001]

\definefontfamily[mainface][rm][TeX Gyre Termes]
   [features={default,unslanted},
    it={style:regular, features:{default,slanted}},
    sl={style:regular, features:{default,slanted}}]

ok, i'll fix that (build is down so no update)

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://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: Japanese

2024-03-10 Thread Emanuel Han via ntg-context
Hi all,

I added 
https://wiki.contextgarden.net/Chinese_Japanese_and_Korean#Meeting_the_JIS_X_4051_Requirements_for_Japanese_Text_Layout
with attached working example code and to-do list.
Thanks for any contributions!
The working example code is still a work in progress. Its text layout output 
meets already some of the requirements (see comments in the code). Among the 
ones to still be implemented are:
solid setting (no extra spacing between characters) 
https://www.w3.org/TR/jlreq/#fig1_8 if no requirement for line-adjustment 
https://www.w3.org/TR/jlreq/#term.line-adjustment
aligning of the lines to the Kihon-hanmen (optimizing the code below in this 
regard)

positioning and realm of headings https://www.w3.org/TR/jlreq/#fig3_1_9 
https://www.w3.org/TR/jlreq/#fig3_1_15 et al, and 
https://www.w3.org/TR/jlreq/#fig3_1_4

positioning of yokugo-ruby https://www.w3.org/TR/jlreq/#fig2_3_24

inline cutting note (warichu) https://www.w3.org/TR/jlreq/#fig2_4_1

emphasis with sesame dot or bullet

itemization https://www.w3.org/TR/jlreq/#fig2_5_6

indenting of quotation paragraphs https://www.w3.org/TR/jlreq/#fig2_5_7

tab setting https://www.w3.org/TR/jlreq/#fig2_6_1

furiwake https://www.w3.org/TR/jlreq/#fig2_7_2

jidori https://www.w3.org/TR/jlreq/#fig2_7_4

math https://www.w3.org/TR/jlreq/#fig2_7_6 and 
https://www.w3.org/TR/jlreq/#fig2_7_62

tategaki (writing vertically)

Best regards

Emanuel
On März 2 2024, at 7:00 pm, Wolfgang Schuster 
 wrote:
> Emanuel Han schrieb am 01.03.2024 um 16:23:
> >
> > Dear Wolfgang,
> > thank you for your valuable remarks. I integrated them, see corrected 
> > attached example.
> > Yes, correct layout examples exist. They're all showing vertical writing, 
> > but the rules and principles are exactly the same for horizontal writing.
> > position of the headers and footers: https://www.w3.org/TR/jlreq/#fig1_30
> See my attached gongitsune.tex example how you can squeeze text in a very 
> narrow header/footer.
> > aligning lines to the text box: https://www.w3.org/TR/jlreq/#fig1_3
> You can use the lines key for \setuplayout to let ConTeXt calculate the 
> necessary value for the text height.
> > protrusion of ruby: https://www.w3.org/TR/jlreq/#fig_ad1_6
> You're getting this for free because ruby text doesn't take up vertical 
> space, in case vertical text is working it would now stick into the margins 
> as expected.
> \starttext
> \ruledhbox{a \ruby{x}{y} b}
> \stoptext
>
>
> >
> > In my previous mail, I wrote wrong amounts of lines. They should be 46 
> > lines on one page, while the actual example doesn't show the 46th line.
> > It would be important to identify the reason why only 24 characters are 
> > used to create a line when 25 could be used. Then we can develop a method 
> > to turn that mechanism off or circumvent it.
> > Quotation from https://www.w3.org/TR/jlreq:
> > In principle, when composing a line with ideographic (cl-19) 
> > (https://www.w3.org/TR/jlreq/#cl-19), hiragana (cl-15) 
> > (https://www.w3.org/TR/jlreq/#cl-15) and katakana (cl-16) 
> > (https://www.w3.org/TR/jlreq/#cl-16) characters, no extra spacing appears 
> > between their character frame 
> > (https://www.w3.org/TR/jlreq/#term.character-frame). This is called solid 
> > setting (see Figure 5 (https://www.w3.org/TR/jlreq/#fig1_8)).
>
>
> 1. ConTeXt has a mechanism to typeset Japanese texts.
> 2. There are flaws in the output it produces but this nothing which can't be 
> fixed.
> 3. To fix the problems someone has to be passionate to fix them and we're 
> willing to help here.
> As you can see in my second example file japanese.tex there is a font feature 
> to create half sized parentheses etc. which isn't supported yet by ConTeXt's 
> mechanism for japanese and in case your willing to improve it this should be 
> taken care of as well.
> Wolfgang

japanese_mwe.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://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: \em issue in MkXL (2024.03.05 11:26)

2024-03-10 Thread Wolfgang Schuster

Hans Hagen via ntg-context schrieb am 10.03.2024 um 10:46:

On 3/10/2024 9:32 AM, Pablo Rodriguez via ntg-context wrote:

On 3/9/24 16:04, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 08.03.2024 um 19:39:

[...]
    \enableexperiments[fonts.compact]

Which seeems weird to me. Or at least, I thought I read that Hans
enabled it by default in LMTX.


AFAIR Hans uses the setting in his own documents.


I have been using it for a while.

I hope the issue with \glyphslant might be fixed to enable it again.


Then my question is whether this was caused by simply enabling compact
fonts or by doing it twice.


The results happen when you use compact mode and is a result of
\glyphslant which keeps the value of the italic style even when you
switch back to the upright style.


Many thanks for your explaination,

using the low level commands

\glyphscale
\glyphxscale
\glyphyscale
\glyphslant
\glyphweight

directly can have side efects when at an outer level these are also set, 
so you need to accumulate, like


\starttext

test {\glyphscale 2000 test \glyphscale \numericscaled1.2\glyphscale 
test} test


test {\glyphslant  500 test \glyphslant \numericscaled2.0\glyphslant 
test} test


test {\glyphweight 100 test \glyphweight\numericscaled2.0\glyphweight 
test} test


\stoptext


The problem is that compact mode uses them to apply the slanted feature 
without any manual use of the commands from a user.


\enableexperiments[fonts.compact]

\definefontfamily[mainface][rm][TeX Gyre Termes]
  [it={style:regular, features:{default,slanted}},
   sl={style:regular, features:{default,slanted}}]

\setupbodyfont[mainface]

\starttext

\startstyle[style=italic]normal {\em emphasized} normal\stopstyle

\stoptext

The only way to mask the effect is to create a new fontfeature with the 
minimum slant value and apply it to the upright style.


\definefontfeature [unslanted] [slant=0.001]

\definefontfamily[mainface][rm][TeX Gyre Termes]
  [features={default,unslanted},
   it={style:regular, features:{default,slanted}},
   sl={style:regular, features:{default,slanted}}]

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

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


[NTG-context] Re: \em issue in MkXL (2024.03.05 11:26)

2024-03-09 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 08.03.2024 um 19:39:

On 3/8/24 19:09, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 08.03.2024 um 18:50:

[...]
LMTX gets b, c and d in slanted form.

LuaTeX gets only b and c in slanted form.

[...]
I get b and d in italic which is the expected output.


Sorry, my LuaTeX is getting slanted b and d ("c" was my typo).

But I see what was causing my issue (line from
~/texmf/texmf-local/cont-loc.mkxl):

   \enableexperiments[fonts.compact]

Which seeems weird to me. Or at least, I thought I read that Hans
enabled it by default in LMTX.


AFAIR Hans uses the setting in his own documents.


Then my question is whether this was caused by simply enabling compact
fonts or by doing it twice.


The results happen when you use compact mode and is a result of 
\glyphslant which keeps the value of the italic style even when you 
switch back to the upright style.


\enableexperiments[fonts.compact]

\definefontfamily[mainface][rm][TeX Gyre Termes]
  [it={style:regular, features:{default,slanted}},
   sl={style:regular, features:{default,slanted}}]

\setupbodyfont[mainface]

\starttext
\tf h\showcurrentfont[]\crlf
\it h\showcurrentfont[]\crlf
%\glyphslant\zerocount
\tf h\showcurrentfont[]\crlf
\it h\showcurrentfont[]
\stoptext

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

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


[NTG-context] Re: \em issue in MkXL (2024.03.05 11:26)

2024-03-08 Thread Henning Hraban Ramm

Am 08.03.24 um 18:50 schrieb Pablo Rodriguez via ntg-context:

Dear list,

the following latest gets differents results when compiled with MkXL and
MkIV (in current latest from 2024.03.05 11:26):

   \definefontfamily[mainface][rm][TeX Gyre Termes]
 [features={default, quality},
  it={style: regular, features:{default, quality, slanted}},
  sl={style: regular, features:{default, quality, slanted}}]

   \setupbodyfontenvironment
   [default]
   [em=italic]

   \setupbodyfont[mainface]
   \starttext
   \startTEXpage[offset=1em]
   a\\
   \em b\\
   \em c\\
   \em d\\
   \stopTEXpage
   \stoptext

LMTX gets b, c and d in slanted form.

LuaTeX gets only b and c in slanted form.


With latest LMTX (2024.03.05), b and d are slanted, as I would expect.

This might be just a test case, but I’d avoid switches like \em without 
grouping.


Hraban
___
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: \em issue in MkXL (2024.03.05 11:26)

2024-03-08 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 08.03.2024 um 18:50:

Dear list,

the following latest gets differents results when compiled with MkXL and
MkIV (in current latest from 2024.03.05 11:26):

   \definefontfamily[mainface][rm][TeX Gyre Termes]
 [features={default, quality},
  it={style: regular, features:{default, quality, slanted}},
  sl={style: regular, features:{default, quality, slanted}}]

   \setupbodyfontenvironment
   [default]
   [em=italic]

   \setupbodyfont[mainface]
   \starttext
   \startTEXpage[offset=1em]
   a\\
   \em b\\
   \em c\\
   \em d\\
   \stopTEXpage
   \stoptext

LMTX gets b, c and d in slanted form.

LuaTeX gets only b and c in slanted form.

I think LMTX may have an issue here.

Could anyone be so kind to confirm this?


I get b and d in italic which is the expected output.

Wolfgang

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

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


[NTG-context] \em issue in MkXL (2024.03.05 11:26)

2024-03-08 Thread Pablo Rodriguez via ntg-context
Dear list,

the following latest gets differents results when compiled with MkXL and
MkIV (in current latest from 2024.03.05 11:26):

  \definefontfamily[mainface][rm][TeX Gyre Termes]
[features={default, quality},
 it={style: regular, features:{default, quality, slanted}},
 sl={style: regular, features:{default, quality, slanted}}]

  \setupbodyfontenvironment
  [default]
  [em=italic]

  \setupbodyfont[mainface]
  \starttext
  \startTEXpage[offset=1em]
  a\\
  \em b\\
  \em c\\
  \em d\\
  \stopTEXpage
  \stoptext

LMTX gets b, c and d in slanted form.

LuaTeX gets only b and c in slanted form.

I think LMTX may have an issue here.

Could anyone be so kind to confirm this?

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://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: imposition: getting to the last page of a booklet

2024-03-07 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 06.03.2024 um 20:17:

On 3/6/24 19:50, Wolfgang Schuster wrote:

[...]
Could you write the first line in plain language?


Look at the second example of the Lua code in the example below for each
command (the first example is your version), the third example is just a
condensed version of example 2.


Many thanks for your extended explanation, Wolfgang.


Here is another solution which uses \ifcase the select a different case 
dependent on the value of the remainder.


\def\beforequadruplenumber#1%
  {\ifcase\numexpr#1;4\relax
 \the\numexpr#1+3\relax % remainder = 0
   \or
 \the\numexpr#1+2\relax % remainder = 1
   \or
 \the\numexpr#1+1\relax % remainder = 2
   \or
 \the\numexpr#1+4\relax % remainder = 3
   \fi}

\def\afterquadruplenumber#1%
  {\ifcase\numexpr#1;4\relax
 \the\numexpr#1+1\relax % remainder = 0
   \or
 \the\numexpr#1+4\relax % remainder = 1
   \or
 \the\numexpr#1+3\relax % remainder = 2
   \or
 \the\numexpr#1+2\relax % remainder = 3
   \fi}



Now it is clearer to me (although I need some time to learn from it).


When you use \numexpr to perform arithmetic in TeX it is recommended to 
add a final \relax to stop the command from scanning to additional 
values, e.g. in the example below \testone takes value beyond the 
argument because \numexpr hasn't ended yet.


\starttext

\def\testone#1{\the\numexpr #1 + 1 }

\testone{1} + 1

\def\testtwo#1{\the\numexpr #1 + 1 \relax}

\testtwo{1} + 1

\stoptext

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

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


[NTG-context] Re: imposition: getting to the last page of a booklet

2024-03-06 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 04.03.2024 um 20:00:

On 2/28/24 19:28, Wolfgang Schuster wrote:

[...]
\def\beforequadruplenumber#1%
{\ifcase\numexpr#1+1;4\relax
   \number\numexpr#1+4\relax
 \else
   \number\numexpr#1+3-#1;4\relax
 \fi}


Sorry for not having answered before, Wolfgang.

I’m afraid I don’t get how \ifcase is deployed with as conditional
(being \ifcase used to give numbers for weekdays or months).


The \ifcase command is the TeX version of a switch statement from other 
programming languages.


The first case in \ifcase checks against zero which is shorter than 
writing "\ifnum ... = 0".



The semicolon is also mysterious to me, I don’t know what it does there
in plain language.


The semicolon is a undocumented extension (I noticed it in the 
definition of \page[quadruple]) of \numexpr in Luametatex for the 
modulus operator.



Sorry, I know it has to be simple, but the syntax is too cryptic for me.

Could you write the first line in plain language?


Look at the second example of the Lua code in the example below for each 
command (the first example is your version), the third example is just a 
condensed version of example 2.



Sorry for asking that. I’m afraid this would be the only way I could get
what \ifcase is doing there.


As was mentioned above I used it as a check when the remainder was 0.

 begin example
\startluacode

--~ interfaces.implement {
--~ name  = "beforequadruplenumber",
--~ arguments = "integer",
--~ actions   = function(n)
--~ if n % 4 == 0 then
--~ context(n + 3)
--~ elseif n % 4 == 1 then
--~ context(n + 2)
--~ elseif n % 4 == 2 then
--~ context(n + 1)
--~ elseif n % 4 == 3 then
--~ context(n + 4)
--~ end
--~ end
--~ }

--~ interfaces.implement {
--~ name  = "beforequadruplenumber",
--~ arguments = "integer",
--~ actions   = function(n)
--~ if (n + 1) % 4 == 0 then
--~ context(n + 4)
--~ else
--~ context(n + 3 - n % 4)
--~ end
--~ end
--~ }

interfaces.implement {
name  = "beforequadruplenumber",
arguments = "integer",
actions   = function(n)
context(n + (((n + 1) % 4 == 0) and 4 or (3 - n % 4)))
end
}

--~ interfaces.implement {
--~ name  = "afterquadruplenumber",
--~ arguments = "integer",
--~ actions   = function(n)
--~ if n % 4 == 0 then
--~ context(n + 1)
--~ elseif n % 4 == 1 then
--~ context(n + 4)
--~ elseif n % 4 == 2 then
--~ context(n + 3)
--~ elseif n % 4 == 3 then
--~ context(n + 2)
--~ end
--~ end
--~ }

--~ interfaces.implement {
--~ name  = "afterquadruplenumber",
--~ arguments = "integer",
--~ actions   = function(n)
--~ if n % 4 == 0 then
--~   context(n + 1)
--~ else
--~   context(n + 5 - n % 4)
--~ end
--~ end
--~ }

interfaces.implement {
name  = "afterquadruplenumber",
arguments = "integer",
actions   = function(n)
context(n + ((n % 4 == 0) and 1 or (5 - n % 4)))
end
}

\stopluacode

\unprotect
\def\beforequadruplenumber#1{\clf_beforequadruplenumber\numexpr#1\relax}
\def\afterquadruplenumber #1{\clf_afterquadruplenumber \numexpr#1\relax}
\protect

\starttext
\dorecurse{20}{\recurselevel\space = 
\beforequadruplenumber{\recurselevel}\par}\page
\dorecurse{20}{\recurselevel\space = \afterquadruplenumber 
{\recurselevel}\par}

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: missing metadata in LMTX

2024-03-06 Thread Pablo Rodriguez via ntg-context
On 3/6/24 15:54, Hans Hagen wrote:
> [...]
>> \setupmetadata
>>[title=FooBar]
>
> that's for those who go global

Many thanks for the new command, Hans.

I‘m afraid this new command breaks my compilation.

The error message isn’t very helpful for me (see below).

I wonder whether this requires a minimal sample to be fixed.

Many thanks for your help,

Pablo


tex error   > tex error on line 0 in file : Argument of \D9>:title
has an extra }



\par }
 \prerolltostring
#1->\beginlocalcontrol \setbox \b_syst_boxes \hbox {\expand
\everypreroll #1}
\normalexpanded {\setbox \b_syst_boxes \emptybox \endlocalcontrol
\boxtostring \b_syst_boxes }
 \scrn_identity_get
#1->\setidentityvariable {#1}{\prerolltostring
{\interactionparameter {#1}}
}


[[special cmd: end local call]]




I've run across a '}' that doesn't seem to match anything. For example,
'\def\a#1{...}' and '\a}' would produce this error. The '\par' that I've
just
inserted will cause me to report a runaway argument that might be the
root of the
problem.
mtx-context | fatal error: return code: 1
> exit status: 256

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


  1   2   3   4   5   6   7   8   9   10   >