[NTG-context] Re: Framed Text with Chapter Numbers as Counter

2023-09-17 Thread Wolfgang Schuster

Jeroen schrieb am 16.09.2023 um 22:28:
This MWE has a framed text for some verbatim text (code) with as title 
ref. a counter 1, 2, etc.. Is there a way to change this frame text 
title as following with the chapter number and a sequential number and 
the title.


Code Fragment 1.1 (The First Title)
Code Fragment 1.2 (The Second Title)
Code Fragment 2.1 (The Third Title)

MWE:

[...]

\defineenumeration
   [Counter]
   [title=yes,
    alternative=empty,
    before=\startCountFramedText,
    after=\stopCountFramedText]


\defineenumeration
  [Counter]
  [  title=yes,
   alternative=empty,
  text=Code Fragment,
   way=bychapter,
prefix=yes,
before=\startCountFramedText,
 after=\stopCountFramedText]

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

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

[NTG-context] Re: Framed Text with Chapter Numbers as Counter

2023-09-17 Thread Jeroen
That works fine except that the following line does only issue the
sequential number and not the chapter number.

Refer to \in{code fragment}[tit1] bla

MWE:

\startuseMPgraphic{CountFrame}
  picture p; numeric w, h, o;
  p := textext.rt("\wrappedcurrentconstruction");
  w := OverlayWidth;
  h := OverlayHeight;
  o := BodyFontSize;
  p := p shifted (2o,h-ypart center p);
  draw p;
  path b;
  b := boundingbox p enlarged (o/10);
  path a;
  a := (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner b,h);
  drawoptions (withpen pencircle scaled 1pt withcolor black);
  draw a;
  draw b;
  setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay
  [CountFrame]
  [\useMPgraphic{CountFrame}]

\defineframedtext
  [CountFramedText]
  [frame=off,
   background=CountFrame,
   offset=\bodyfontsize,
   width=\textwidth,
%  style={\switchtobodyfont[11pt,tt]}]
   bodyfont=11pt,
   style={\tt}]

\defineenumeration
  [Code]
  [title=yes,
   alternative=empty,
   before=\startCountFramedText,
   after=\stopCountFramedText,
   left={\somenamedheadnumber{chapter}{current}.}]

\starttext

\startchapter
  [title=first]

\startCode
  [title={The First Title},
   reference={tit1}]
   Some verbatim text
\stopCode

\startCode
  [title={The Second Title},
   reference={tit2}]
   Some verbatim text
\stopCode

Refer to \in{code fragment}[tit1] bla

\stopchapter

\startchapter
  [title=second]

\startCode
  [title={The Third Title},
   reference={tit3}]
   Some verbatim text
\stopCode

\stopchapter

\stoptext

Op zo 17 sep 2023 om 17:31 schreef Bruce Horrocks :

>
>
> > On 16 Sep 2023, at 21:28, Jeroen  wrote:
> >
> > This MWE has a framed text for some verbatim text (code) with as title
> ref. a counter 1, 2, etc.. Is there a way to change this frame text title
> as following with the chapter number and a sequential number and the title.
>
> Amemd the \defineenumeration as follows:
>
> \defineenumeration
>   [Counter]
>   [title=yes,
>alternative=empty,
>before=\startCountFramedText,
>after=\stopCountFramedText,
>left={\somenamedheadnumber{chapter}{current}:}]
>
> —
> 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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Framed Text with Chapter Numbers as Counter

2023-09-17 Thread Bruce Horrocks


> On 16 Sep 2023, at 21:28, Jeroen  wrote:
> 
> This MWE has a framed text for some verbatim text (code) with as title ref. a 
> counter 1, 2, etc.. Is there a way to change this frame text title as 
> following with the chapter number and a sequential number and the title.

Amemd the \defineenumeration as follows:

\defineenumeration
  [Counter]
  [title=yes,
   alternative=empty,
   before=\startCountFramedText,
   after=\stopCountFramedText,
   left={\somenamedheadnumber{chapter}{current}:}]

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

[NTG-context] Re: Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2023-09-17 Thread Pablo Rodriguez
On 9/17/23 10:01, Cron Daemon wrote:
>  [...]
>  general/manuals/luametatex.pdf

Many thanks for the new release, Hans.

I‘m afraid there is some issue with the generation of that file, since
its size declined from 1.5MB to 180K.

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

[NTG-context] Re: Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2023-09-17 Thread Michael Loescher

Hello,

after the update the latest luametatex.pdf cannot be opened, the file is 
corrupted.

Am 17.09.2023 um 10:01 schrieb Cron Daemon:

receiving incremental file list
  ./
  ctan.lsr
  document-2.htm
  download-1.htm
  download-2.htm
  logo-ade.png
  logo-cts.png
  logo-pod.png
  rss.xml
  show-fil.pdf
  context/latest/
  context/latest/cont-lmt.zip
  context/latest/cont-mpd.zip
  context/latest/cont-ppc.zip
  context/latest/cont-sci.zip
  context/latest/cont-tmf.zip
  context/latest/cont-tst.7z
  context/latest/cont-tst.tar.xz
  context/latest/cont-tst.zip
  general/manuals/
  general/manuals/luametatex.pdf
  general/manuals/primitives.pdf
  
  sent 185,495 bytes  received 41,503,755 bytes  3,335,140.00 bytes/sec

  total size is 562,644,378  speedup is 13.50


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10
232388526   
/var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10/current
359137939   
/var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10
359137939   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

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

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


[NTG-context] Re: streams reversed?

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

On 9/16/2023 12:57 AM, jbf wrote:

Thanks Idris.

See my response to Bruce, and indeed his response to mine earlier. I'll 
have to leave it at that for now. Too many other matters pressing.


Julian
This is why mechanism like these never come to completion: it takes 
times, experimenting, documenting, basically a cycle that can take a 
while. Quite often it stops when some (intermediate) goal is reached and 
no more time is available. That lowers the priority.


Hans

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

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

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


[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2023-09-17 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 general/manuals/
 general/manuals/luametatex.pdf
 general/manuals/primitives.pdf
 
 sent 185,495 bytes  received 41,503,755 bytes  3,335,140.00 bytes/sec
 total size is 562,644,378  speedup is 13.50


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10
232388526   
/var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10/current
359137939   
/var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10
359137939   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2023-09-17 Thread Hans Hagen

On 9/17/2023 9:04 AM, Max Chernoff wrote:

Hi Aditya,


For some reason, there is an extra \relax written to file after
`\the\numexp\clf_lastypos\relax` (there is no such relax after
`\the\numexpr\clf_lastxpos\relax`). The test.pgf file is:

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

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


\numexpr stops at the first non-expandable or non-digit token. If
\clf_last[xy]pos expands to an integer, then that's the \relax, but if
it expands to a float, then that's the decimal point.

With Lua, adding, subtracting, or multiplying two integers will give you
an integer, but dividing gives you a float. So somewhere in the backend,
the vertical position is probably divided but the horizontal position is
only added or subtracted.

To fix this, change lines 2344--2345 of anch-pos.lmt from

implement { name = "lastxpos", actions = function() 
context(jobpositions.lastx) end }
implement { name = "lastypos", actions = function() 
context(jobpositions.lasty) end }

to

implement { name = "lastxpos", actions = function() context("%.0f", 
jobpositions.lastx) end }
implement { name = "lastypos", actions = function() context("%.0f", 
jobpositions.lasty) end }


it's better to do some rounding earlier on

Hans


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

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

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


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

2023-09-17 Thread Hans Hagen

On 9/17/2023 3:26 AM, Aditya Mahajan wrote:

Hi,

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

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

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

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

i'll round the values

wrt relaxes, these can creep in as side effect of tex pushing back 
looked-ahead and not used tokens (there are wasy around this but it's 
not relevant here)


Hans

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

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

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


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

2023-09-17 Thread Max Chernoff
Hi Aditya,

> For some reason, there is an extra \relax written to file after
> `\the\numexp\clf_lastypos\relax` (there is no such relax after
> `\the\numexpr\clf_lastxpos\relax`). The test.pgf file is:
> 
> \macro {A}{23930350}{43358454.0\relax } \macro {B}{39564274.0\relax
>   }{14083538}
> 
> Any ideas on why is the extra \relax written after lastypos and how to
> fix that?

\numexpr stops at the first non-expandable or non-digit token. If
\clf_last[xy]pos expands to an integer, then that's the \relax, but if
it expands to a float, then that's the decimal point. 

With Lua, adding, subtracting, or multiplying two integers will give you
an integer, but dividing gives you a float. So somewhere in the backend,
the vertical position is probably divided but the horizontal position is
only added or subtracted.

To fix this, change lines 2344--2345 of anch-pos.lmt from

   implement { name = "lastxpos", actions = function() 
context(jobpositions.lastx) end }
   implement { name = "lastypos", actions = function() 
context(jobpositions.lasty) end }

to

   implement { name = "lastxpos", actions = function() context("%.0f", 
jobpositions.lastx) end }
   implement { name = "lastypos", actions = function() context("%.0f", 
jobpositions.lasty) end }

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

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