Re: [NTG-context] SVG style ignored after double semicolon

2022-05-08 Thread Thangalin via ntg-context
Hi again,

In tex/texmf-context/tex/context/base/mkxl/mlib-svg.lmt the following regex
appears a few times (line 1502, 1556, and 1570):

gmatch(VAR,"%s*([^:]+):%s*([^;]+);?")

It may be helpful to first normalize the string by appending a semicolon to
the end, allowing for:

for w in (VAR .. ";"):gmatch("([^;]*);") do ...

Splitting 'w' afterwards on the colon within key:value pairs would still be
necessary, so maybe that approach is a wash.

Aside, when I made changes to the file, I couldn't get either a report() or
a print() statement to show up in the output, even when running with
--debug. Any hints on how to sprinkle debug info into the code? Or was I
barking up the wrong source file?

Cheers!

On Sun, May 8, 2022 at 1:33 AM Thangalin  wrote:

> Hey hey,
>
> The following produces a filled square, rather than an empty one:
>
> \startbuffer[svg]
> 
>style="stroke:rgb(0,0,0);;fill:none" />
> 
> \stopbuffer
>
> \starttext
>   \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
> \stoptext
>
> Remove the extra semicolon to get the expected result:
>
> 
>style="stroke:rgb(0,0,0);fill:none" />
> 
>
> It appears that a style immediately following two semicolons is ignored.
>
> The SVG was generated using the following R code:
>
> svg("filename.svg");
> plot(rnorm(200));
> dev.off()
>
> Arguably, R's SVG routines could be a bit tighter. Can the MP SVG parser
> code be relaxed to skip "empty" semicolons?
>
> $ context --version
> mtx-context | current version: 2022.05.02 16:19
>
> Much appreciated.
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Is there a "smart" capitalisation implementation?

2022-05-08 Thread Hans Hagen via ntg-context

On 5/8/2022 6:55 AM, Zhichu via ntg-context wrote:

Hi,

I am going to convince the Board of a journal to consider ConTeXt as an 
additional option.
I want to make a module before I say anything. Right now I have this 
title problem.


The journal requires the titles to be CAPITALISED, except for the 
acronyms. I'm currently
using backticks`...`to wrap it and replace it with\egroup 
...\WORD\bgroup{} with
lpeg. This kinda works, but that's so ugly. Besides, the actual story is 
that I also want to

add markdown as an option, so the backticks actually have meanings.

I also checked thetypo-cap.luafile to get a clue. But I used to use TeX 
exclusively

and I have to admit that it's so overwhelming for a newbie.

I really like the way wherebibtextreats words enclosed in curly braces 
are ignored.
Or are there something that's less aggressive than\WORDso the LaTeX 
trick works:

\def\NoCaseChange#1{\noexpand\NoCaseChange{\noexpand#1}}

\starttext

\protected\def\casing[#1]{\groupedcommand{\setcharactercasing[#1]}{}}
\protected\def\nocasing 
{\groupedcommand{\setcharactercasing[reset]}{}}


\setuphead[chapter][textstyle=\WORD]

\chapter{some \nocasing{kept} text or \casing[Word]{more} text}

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] 32-bit OpenBSD

2022-05-08 Thread Mojca Miklavec via ntg-context
On Sat, 7 May 2022 at 22:37, Alain Delmotte via ntg-context
 wrote:
>
> Hi!
>
> Le 1/05/2022 à 11:01, Mojca Miklavec via ntg-context a écrit :
>
> Hi,
>
> How long do we want/need to keep running the builders for 32-bit OpenBSD?
>
> It's taking 2 or 3 times longer to build binaries than for the 64-bit
> OS (not that this is super relevant since ppc builder is a whole order
> of magnitude slower anyway: building TL there takes about 6 hours) and
> I suspect that nobody is using those 32-bit binaries anyway.
>
> Mojca
>
> My portable is a 32-bit on which I am running Lubuntu 18.04;

But that's 32-bit Linux rather than 32-bit OpenBSD. I was explicitly
asking about OpenBSD only.

> but i didn't upgrade ConTeXt lmtx for long as, as I did understand, there is 
> no more new binaries.

We never (intentionally) stopped providing support for that.
Is something not working for you if you try to do a clean installation
(in another directory)?

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

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


[NTG-context] SVG style ignored after double semicolon

2022-05-08 Thread Thangalin via ntg-context
Hey hey,

The following produces a filled square, rather than an empty one:

\startbuffer[svg]

  

\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext

Remove the extra semicolon to get the expected result:


  


It appears that a style immediately following two semicolons is ignored.

The SVG was generated using the following R code:

svg("filename.svg");
plot(rnorm(200));
dev.off()

Arguably, R's SVG routines could be a bit tighter. Can the MP SVG parser
code be relaxed to skip "empty" semicolons?

$ context --version
mtx-context | current version: 2022.05.02 16:19

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

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


Re: [NTG-context] How to place "Content" and other chapter-level titles the same vertical distance from the top?

2022-05-08 Thread Denis Maier via ntg-context
Or change the setup of unnumbered chapter titles...
Add a forced blank before there.

Denis



Von: Maier, Denis Christian (UB)
Gesendet: Sonntag, 8. Mai 2022 09:24:51
An: mailing list for ConTeXt users
Cc: Joel
Betreff: AW: [NTG-context] How to place "Content" and other chapter-level 
titles the same vertical distance from the top?

Maybe define your own chapter command and use a vbox.
Look at this example from the wiki:

\setuppapersize[A6][A6]
\setupbodyfont[8pt]
\def\MyChapterCommand#1#2%
  {\vbox to 4cm\bgroup
 {#1\hskip.75em #2}
 \vss
 \egroup}
\setuphead[chapter][header=nomarking, command=\MyChapterCommand]
\starttext
\chapter{test} \input tufte
\stoptext

That's not exactly what you want, but you can adapt it.

Denis

Von: ntg-context  im Auftrag von Joel via 
ntg-context 
Gesendet: Sonntag, 8. Mai 2022 04:49:32
An: ntg-context@ntg.nl
Cc: Joel
Betreff: [NTG-context] How to place "Content" and other chapter-level titles 
the same vertical distance from the top?

I created a chapter title style with a large number telling the chapter number, 
and below it the title of the chapter.

It looks like this:

-
1   <--really big chapter number
=== <-- there is a border created by a background image between these
How to keep  <--chapter title
fish

This is the article <-- the article begins
about how to keep
fish
-

\definefontsize[a]%
\definefontsize[b]%
\definefontsize[c]%
\definefontsize[l]%
\setupbodyfontenvironment[default]%
[%
a=1.200,
b=1.440,
c=1.728,
l=8.916
]%
%

\setuplabeltext[chapter=\strut]
\setuphead[chapter][style=\ssc,placehead=yes,expansion=yes,page=yes,
numbercommand=\groupedcommand{}{\blank[1cm]},
alternative=middle,
numberstyle=ssl,
numbercolor=green,
strut=yes]

\starttext

\completecontent

\chapter{Test}
\input knuth

\chapter{Test}
\input knuth

\stoptext

The problem I'm facing, is anytime a chapter title is called, such as "Content" 
in complete content, or something in the appendix, such as one of the indexes, 
no number is printed above, so the vertical distance from the top of the page 
to the top of the chapter title changes. I need these to be consistent, as 
there is a background image, with vertical lines.

Basically, if I call \chapter{}, it appears perfectly aligned vertically on the 
page, with no other settings. But when calling \completecontent or a similar 
title that won't get a number, because the number isn't placed, it is 
vertically higher on the page, but I need it to be printed the same height, as 
it it had an invisible number.

I've tried adding strut (the code has it in two places), but don't know if I've 
used it appropriately, and it didn't solve the problem.

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

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


Re: [NTG-context] How to place "Content" and other chapter-level titles the same vertical distance from the top?

2022-05-08 Thread Denis Maier via ntg-context
Maybe define your own chapter command and use a vbox.
Look at this example from the wiki:

\setuppapersize[A6][A6]
\setupbodyfont[8pt]
\def\MyChapterCommand#1#2%
  {\vbox to 4cm\bgroup
 {#1\hskip.75em #2}
 \vss
 \egroup}
\setuphead[chapter][header=nomarking, command=\MyChapterCommand]
\starttext
\chapter{test} \input tufte
\stoptext

That's not exactly what you want, but you can adapt it.

Denis

Von: ntg-context  im Auftrag von Joel via 
ntg-context 
Gesendet: Sonntag, 8. Mai 2022 04:49:32
An: ntg-context@ntg.nl
Cc: Joel
Betreff: [NTG-context] How to place "Content" and other chapter-level titles 
the same vertical distance from the top?

I created a chapter title style with a large number telling the chapter number, 
and below it the title of the chapter.

It looks like this:

-
1   <--really big chapter number
=== <-- there is a border created by a background image between these
How to keep  <--chapter title
fish

This is the article <-- the article begins
about how to keep
fish
-

\definefontsize[a]%
\definefontsize[b]%
\definefontsize[c]%
\definefontsize[l]%
\setupbodyfontenvironment[default]%
[%
a=1.200,
b=1.440,
c=1.728,
l=8.916
]%
%

\setuplabeltext[chapter=\strut]
\setuphead[chapter][style=\ssc,placehead=yes,expansion=yes,page=yes,
numbercommand=\groupedcommand{}{\blank[1cm]},
alternative=middle,
numberstyle=ssl,
numbercolor=green,
strut=yes]

\starttext

\completecontent

\chapter{Test}
\input knuth

\chapter{Test}
\input knuth

\stoptext

The problem I'm facing, is anytime a chapter title is called, such as "Content" 
in complete content, or something in the appendix, such as one of the indexes, 
no number is printed above, so the vertical distance from the top of the page 
to the top of the chapter title changes. I need these to be consistent, as 
there is a background image, with vertical lines.

Basically, if I call \chapter{}, it appears perfectly aligned vertically on the 
page, with no other settings. But when calling \completecontent or a similar 
title that won't get a number, because the number isn't placed, it is 
vertically higher on the page, but I need it to be printed the same height, as 
it it had an invisible number.

I've tried adding strut (the code has it in two places), but don't know if I've 
used it appropriately, and it didn't solve the problem.

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

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