[NTG-context] Re: QR Code

2023-12-18 Thread Pablo Rodriguez via ntg-context
On 12/18/23 20:34, Henning Hraban Ramm wrote:
> [...]
> Are you using MkIV (LuaTeX) or LMTX (LuaMetaTeX)?

Many thanks for your reply, Hraban.

I understood my issue with your reply (I known, your answer is intended
to Uschi).

It is also in the sent file:

 Creator:
   LuaMetaTeX 2.10.11 20230908 + ConTeXt LMTX 2023.09.26 18:19
 PDF Producer:
   LuaMetaTeX-2.10.11

> I guess a missing EPS means you load the MkIV version of the module,
> probably because "m-zint".
>
> I can’t help with Windows; since Hans developed it on Windows, it should
> work (but don’t ask me how).

I will try to explain what I understand from this (intended for Uschi).

Given that there are two modules (m-zint and zint), there are two options:

1. Either you use the LMTX module (\usemodule[zint]) and you need the
Zint library (as explained in
https://wiki.contextgarden.net/Barcodes#Zint_module).

2. Or you use the MkIV module (\usemodule[m-zint]) and you need the Zint
binary installed and CMD should be able to invoke it (already knowing
its past).

You may have the Zint binary installed, ConTeXt may be generating the
required EPS files, but either Inkscape is not installed (or its path is
unknown to the system), or ConTeXt cannot simply find where the
converted PDF versions of the zint images are.

If I have the following source in testing-barcodes.tex:

  \usemodule[m-zint]
  \starttext
  \startTEXpage[offset=1dk]
  \barcode[alternative=isbnx, text=9783865419026, width=4cm]
  \stopTEXpage
  \stoptext

ConTeXt compiles it generating to extra files (when compared to the pure
zint module for LMTX only):

  zint-isbnx-fe90eda0e93cf020312eps
  m_k_i_v_zint-isbnx-fe90eda0e93cf020312_eps_c60ccda70ef.pdf

(Removed some characters in strings so file names fit in a single line.)

The first file is generated by the Zint binary itself. The second one is
the automatic conversion (through Inkscape) that ConTeXt needs to embed
EPS (and SVG) files in the final PDF document.

If m_k_i_v_zint-*.pdf files are missing, the problem might be that
Inkscape isn’t installed (or its path is unknown to the system).

If also zint-*.eps files are missing, you should find where Zint is
generating them.

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

2023-12-18 Thread Pablo Rodriguez via ntg-context
On 12/18/23 17:05, Ursula Hermann wrote:
> […]
> I got what you see in the pdf.

Hi Uschi,

I‘m on Linux64 using LuaMetaTEx.

Contrary to the explanation from
https://wiki.contextgarden.net/Barcodes#Zint_module, I need the zint
package installed on Fedora.

I have safely removed the whole contents of
tex/texmf-linux64/bin/lib/luametatex/lib/zint (actually, I removed
tex/texmf-linux64/bin/lib).

But if Zint is not installed on my system, I get a compilation error,
not a simply not found error.

My error message reads:

  sh: line 1: zint: command not found
  zint --barcode=isbnx  --output= […]

At least on Linux64, it seems that barcode generation with Zint requires
its binary.

For Windows, your ConTeXt distribution might be missing the library (as
described in the wiki link provided).

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: Seeking advice for module that draws globes

2023-12-18 Thread Hans Hagen via ntg-context

On 12/18/2023 5:22 PM, Gavin wrote:

Hi Hans,


On Dec 18, 2023, at 3:12 AM, Hans Hagen via ntg-context  
wrote:

about names:

how about

t-luageo.lmt
t-luageo.mpxl

so that one knows what comes with the module (we do the same with s-* modules)


"t-luageo.lmt" is fine, but "t-luageo.mpxl" breaks the module. I think the line

\startMPdefinitions
loadmodule "luageo" ;
\stopMPdefinitions

finds “mp-luageo” but not “t-luageo”. Changing the line to "loadmodule 
“t-luageo” does not work either.


so how about  mp-t-luageo


and you can add the example to the end of the module


Done.


On Dec 18, 2023, at 3:08 AM, Hans Hagen via ntg-context  
wrote:


Also, we do have a strange artifact, at least when I run this code. There is a 
line running across Brazil:


i'm not sure where that comes from (you can try &&&)



I will use &&& in my upcoming module, t-discoworld.



(Drawn with eofill, for maximum grooviness.)

Is there a place I can read about disconnected paths, &&&&, and &&&? These are 
totally unfamiliar to me.
at some point in the luametafun manual and they are probabaly mentioned 
in some docs that describe development


it's anyway something introduced last year, so kind of new

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

2023-12-18 Thread vm via ntg-context



On 18/12/2023 17:05, Ursula Hermann wrote:

After compiling
\usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm] \blank[big]
\barcode[alternative=qrcode, text={wie weet waar willem wever woont},
width=3cm] \stoptext

I got , what you see in the pdf.

context 43.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: Seeking advice for module that draws globes

2023-12-18 Thread Gavin via ntg-context
Hi Hans,

> On Dec 18, 2023, at 3:12 AM, Hans Hagen via ntg-context  
> wrote:
> 
> about names:
> 
> how about
> 
> t-luageo.lmt
> t-luageo.mpxl
> 
> so that one knows what comes with the module (we do the same with s-* modules)

"t-luageo.lmt" is fine, but "t-luageo.mpxl" breaks the module. I think the line

\startMPdefinitions
   loadmodule "luageo" ;
\stopMPdefinitions

finds “mp-luageo” but not “t-luageo”. Changing the line to "loadmodule 
“t-luageo” does not work either.

> and you can add the example to the end of the module

Done.

> On Dec 18, 2023, at 3:08 AM, Hans Hagen via ntg-context  
> wrote:
> 
>> Also, we do have a strange artifact, at least when I run this code. There is 
>> a line running across Brazil:
>> 
> i'm not sure where that comes from (you can try &&&)


I will use &&& in my upcoming module, t-discoworld.

(Drawn with eofill, for maximum grooviness.)

Is there a place I can read about disconnected paths, &&&&, and &&&? These are 
totally unfamiliar to me.

Gavin___
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

2023-12-18 Thread vm via ntg-context



On 18/12/2023 15:13, Ursula Hermann wrote:

Dear  List

I was interested how it works.

So I started this example.

\starttext

\usemodule[m-zint]

\barcode[alternative=isbnx, text=9783865419026, width=4cm]

\barcode[alternative=qrcode, text={https://wiki.contextgarden.net},
width=3cm]

\stoptext

Is that the right way?

just \usemodule[zint]



For what it is worth, the [zint] variant does not work on my linux 
platform, the [m-zint] does work correctly.


\usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm]
\blank[big]
\barcode[alternative=qrcode, text={wie weet waar willem wever woont}, 
width=3cm]

\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: Seeking advice for module that draws globes

2023-12-18 Thread Hans Hagen via ntg-context

On 12/17/2023 11:22 PM, Gavin via ntg-context wrote:

Hello ConTeXters,

I wrote a little ConTeXt module for drawing globes. I would love some advice on 
how to improve it and share it. The code is quite short (about 250 lines). Most 
of the work is done by Lua, which reads the data files and calculates paths. 
These paths are passed to MetaFun, which draws the globe.

about names:

how about

t-luageo.lmt
t-luageo.mpxl

so that one knows what comes with the module (we do the same with s-* 
modules)


and you can add the example to the end of the module

\continueifinputfile{t-luageo.mkxl}

\starttext
exaple code
\stoptext

and then process the module to get the example

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: Seeking advice for module that draws globes

2023-12-18 Thread Hans Hagen via ntg-context

On 12/18/2023 4:49 AM, Gavin wrote:

Hi Hans,

Thanks for all the suggestions! I am going through them carefully.


- in mp you can do this

vardef theglobe(expr lat, lon) =
for i = 1 upto lua.mp.makeglobe(lat, lon):
(lua.mp.getglobepath(i)) &&&&
endfor
cycle
enddef ;


Does "&&&&" allow a disconnected path? I haven’t seen "&&&&" or a disconnected 
path before.

Also, we do have a strange artifact, at least when I run this code. There is a 
line running across Brazil:




I only got the line for (23,0), not for other latitude and longitude. I’m not sure what caused that. The code 
for cutting and mending paths that cross the horizon is tricky. I’m not sure how it will interact with 
"&&&&" and “cycle" connecting everything.

i'm not sure where that comes from (you can try &&&)

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: Seeking advice for module that draws globes

2023-12-17 Thread Gavin via ntg-context
Hi Hans,

Thanks for all the suggestions! I am going through them carefully.

> - in mp you can do this
> 
> vardef theglobe(expr lat, lon) =
>for i = 1 upto lua.mp.makeglobe(lat, lon):
>(lua.mp.getglobepath(i)) &&&&
>endfor
>cycle
> enddef ;

Does "&&&&" allow a disconnected path? I haven’t seen "&&&&" or a disconnected 
path before.

Also, we do have a strange artifact, at least when I run this code. There is a 
line running across Brazil:



I only got the line for (23,0), not for other latitude and longitude. I’m not 
sure what caused that. The code for cutting and mending paths that cross the 
horizon is tricky. I’m not sure how it will interact with "&&&&" and “cycle" 
connecting everything.

Gavin_______
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: Seeking advice for module that draws globes

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

On 12/17/2023 11:22 PM, Gavin via ntg-context wrote:

Hello ConTeXters,

I wrote a little ConTeXt module for drawing globes. I would love some advice on 
how to improve it and share it. The code is quite short (about 250 lines). Most 
of the work is done by Lua, which reads the data files and calculates paths. 
These paths are passed to MetaFun, which draws the globe.


Just some quiks remarks ...

- you use the right strategy (tex/lua/mp)

- in mp you can do this

vardef theglobe(expr lat, lon) =
for i = 1 upto lua.mp.makeglobe(lat, lon):
(lua.mp.getglobepath(i)) &&&&
endfor
cycle
enddef ;

and then:

\startMPpage
GlobeDiameter = 10cm ;
fill fullcircle
scaled GlobeDiameter
withcolor .9white ;
path p ; p := theglobe(23, 0)
scaled .5GlobeDiameter
;
draw p
withpen pencircle scaled .2mm
withcolor blue
withtransparency (1,.5) ;
fill p
withcolor red
withtransparency (1,.5) ;
draw fullcircle
scaled GlobeDiameter
withcolor black ;
\stopMPpage

i use transparency to demo that a single path has advantages; you'll 
also notice that the runtime is actually at the mp end.


- in your lua code do this

local cosd = math.cosd
local sind = math.sind
local sqrt = math.sqrt

- also, use "MP.makeglobe" in the mp code and at the lua end function 
MP.makeglobe"" as that is the user namespace.


I'll mail you the lua file with some suggestions. When all is stable I 
can spend a few hours on optimizing if needed.



I am a novice at both Lua and MetaPost. I’m also new to Git and have never 
shared anything of substance with the ConTeXt community. (This barely counts as 
substantive, but I figure it’s best to start small.) I’m sure many of you could 
find opportunities for improvement with even a quick glance at the code. I 
welcome anything, from advice on performance to suggestions about the license. 
My most pressing questions are these:



1. How do I avoid redrawing diagrams with every typeset? The globe above takes 
about 0.7s, which is not bad, but it adds up in a book with many diagrams.


see previous mail


2. How do I organize this according to TDS for sharing? I know what TDS is and 
why it’s important, but that’s about it!

3. Should I be creating a namespace for this module, or launching a separate 
MetaFun instance? I have a general sense of what “namespace” and “instance” 
mean is this context, but I don’t know the consequences or the how-to.

I’d like to share this module, even though the potential demand is tiny, at 
best. I’m going through the Module Writing Guidelines 
(https://wiki.contextgarden.net/Modules#Module_writing_guidelines), but there 
is a lot that I don’t understand in those instructions. Questions 2 and 3 above 
relate to the instructions that are most mysterious to me. I think I can figure 
most of the others out.

I have been using ConTeXt for several years to write a high school physics 
textbook (along with the problem sets, tests, equations sheets, etc.). I wrote 
this module because I needed globes in some diagrams. I found an old MetaPost 
tool, mp-geo, that seemed to have the right ingredients, but I couldn’t get it 
to work, so I wrote my own tool using the data files from mp-geo. Hans and 
others on the list gave me valuable advice for these globes a couple years ago 
(and gave other valuable advice on all sorts of things before and since).

Many diagrams in my physics book use TikZ and pgfplots. I'd like to convert 
everything to MetaFun. I think the best way will be writing a few more modules 
for things like graphs (including polar and 3D plots), simple circuits, simple 
Feynman diagrams, etc. I’m hoping that these would be useful to the ConTeXt 
community. The luageo module has the basic design I’d like to use for the 
others: Lua for data handling and calculations, producing paths that are drawn 
by MetaFun. With some mentoring from the generous ConTeXt community, I’m hoping 
we can provide MetaFun alternatives to some of the TikZ libraries.


next year Mikael S and I are going to look into 3D (and projections) as 
we can only work on math when we have a parallel metafun pet project.



I have an alpha version of luagraph by Alan Braslau, which was helpful in 
designing luageo. Working on luagraph is my next project.

Gavin



___
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: Seeking advice for module that draws globes

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

On 12/17/2023 11:22 PM, Gavin via ntg-context wrote:


1. How do I avoid redrawing diagrams with every typeset? The globe above takes 
about 0.7s, which is not bad, but it adds up in a book with many diagrams.


\startbuffer[demo]
\usemodule [luageo]
\startMPpage
GlobeDiameter = 10cm ;
fill fullcircle scaled GlobeDiameter withcolor .9white ;  % Fill a 
circle with the water color.
drawglobe(23, 0) scaled GlobeDiameter withcolor .75white ;% Draw 
the land.
draw fullcircle scaled GlobeDiameter withcolor black ;% Add a 
border, if you want.

\stopMPpage
\stopbuffer

\typesetbuffer[demo]


2. How do I organize this according to TDS for sharing? I know what TDS is and 
why it’s important, but that’s about it!


Hraban will guide you here.


3. Should I be creating a namespace for this module, or launching a separate 
MetaFun instance? I have a general sense of what “namespace” and “instance” 
mean is this context, but I don’t know the consequences or the how-to.

If the code is robust there is no need for an instance.

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] Seeking advice for module that draws globes

2023-12-17 Thread Gavin via ntg-context
Hello ConTeXters,

I wrote a little ConTeXt module for drawing globes. I would love some advice on 
how to improve it and share it. The code is quite short (about 250 lines). Most 
of the work is done by Lua, which reads the data files and calculates paths. 
These paths are passed to MetaFun, which draws the globe.

Below is an example document with the output. (I attached a small .png of the 
output for the mailing list. The output PDF has excessive detail.) The module 
(code and data) is on GitHub at https://github.com/GavinPolhemus/luageo.

\usemodule [luageo]
\startMPpage
GlobeDiameter = 10cm ;
fill fullcircle scaled GlobeDiameter withcolor .9white ;  % Fill a circle 
with the water color.
drawglobe(23, 0) scaled GlobeDiameter withcolor .75white ;% Draw the land, 
centered on the given latitude and longitude.
draw fullcircle scaled GlobeDiameter withcolor black ;% Add a border, 
if you want.
\stopMPpage



I am a novice at both Lua and MetaPost. I’m also new to Git and have never 
shared anything of substance with the ConTeXt community. (This barely counts as 
substantive, but I figure it’s best to start small.) I’m sure many of you could 
find opportunities for improvement with even a quick glance at the code. I 
welcome anything, from advice on performance to suggestions about the license. 
My most pressing questions are these:

1. How do I avoid redrawing diagrams with every typeset? The globe above takes 
about 0.7s, which is not bad, but it adds up in a book with many diagrams.

2. How do I organize this according to TDS for sharing? I know what TDS is and 
why it’s important, but that’s about it!

3. Should I be creating a namespace for this module, or launching a separate 
MetaFun instance? I have a general sense of what “namespace” and “instance” 
mean is this context, but I don’t know the consequences or the how-to.

I’d like to share this module, even though the potential demand is tiny, at 
best. I’m going through the Module Writing Guidelines 
(https://wiki.contextgarden.net/Modules#Module_writing_guidelines), but there 
is a lot that I don’t understand in those instructions. Questions 2 and 3 above 
relate to the instructions that are most mysterious to me. I think I can figure 
most of the others out.

I have been using ConTeXt for several years to write a high school physics 
textbook (along with the problem sets, tests, equations sheets, etc.). I wrote 
this module because I needed globes in some diagrams. I found an old MetaPost 
tool, mp-geo, that seemed to have the right ingredients, but I couldn’t get it 
to work, so I wrote my own tool using the data files from mp-geo. Hans and 
others on the list gave me valuable advice for these globes a couple years ago 
(and gave other valuable advice on all sorts of things before and since).

Many diagrams in my physics book use TikZ and pgfplots. I'd like to convert 
everything to MetaFun. I think the best way will be writing a few more modules 
for things like graphs (including polar and 3D plots), simple circuits, simple 
Feynman diagrams, etc. I’m hoping that these would be useful to the ConTeXt 
community. The luageo module has the basic design I’d like to use for the 
others: Lua for data handling and calculations, producing paths that are drawn 
by MetaFun. With some mentoring from the generous ConTeXt community, I’m hoping 
we can provide MetaFun alternatives to some of the TikZ libraries.

I have an alpha version of luagraph by Alan Braslau, which was helpful in 
designing luageo. Working on luagraph is my next project.

Gavin


___
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: APA 7 and https

2023-12-16 Thread Alan Braslau via ntg-context
A "better" solution is to put

doi = {https://doi.org/__doi__},

in your bibtex database

but I would actually use

url = {https://doi.org/__doi__},

Not all editors want the complete url for the doi, but some do.
The current scheme lets the user define url= and doi= as they wish (and
even both) and does not impose a particular format.

Alan



On Fri, 15 Dec 2023 22:07:25 -
rauricast...@gmail.com wrote:

> Hi
> 
> I found a solution to reach APA7 list and links.
> 
> Using
> $PATH/ConTeXtPATH/tex/texmf-context/tex/context/base/mkiv/publ-imp-apa.mkvi
> in line 1306-1312,  where \starttexdefinition mutable protected
> btx:apa:doi \texdefinition {btx:format:goto} {
> url(https://doi.org/\btxflush{doi})
> } {
>\hyphenatedurl{https://\btxflush{doi}}
> }
> \stoptexdefinition
> 
> Change:
> url(http://dx.doi.org/\btxflush{doi}) to
> url(https://doi.org/\btxflush{doi}) and 
> \hyphenatedurl{doi:\btxflush{doi}} to
> \hyphenatedurl{https://\btxflush{doi}}. 
> 
> With this two changes the correct format in the list of publications
> is shown according apa7 and as well https links instead of http links
> will be generated, which is also needed in apa7. Not all apa7
> definitions are yet reach with this changes, but its a small step
> towards.
> 
> Merry Christmas.
> 
> Oliver
___
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] How to input first n lines from file?

2023-12-16 Thread Joel via ntg-context
With the command `\input file`, I can input the entire contents of `file.tex`. 
Is there a way to limit it to the first n lines, for instance, something like 
`\input[10]` file would only input the first 10 lines from `file.tex` and 
ignore the rest of the lines.
--Joel
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2023-12-16 Thread Hans Hagen via ntg-context

On 12/16/2023 9:17 AM, Peter Münster wrote:

Hi,

I get an "runaway error" with the following example:

--8<---cut here---start->8---
\definestartstop[H][color=blue, before={\startmode[h]}, after={\stopmode}]
\starttext
test
\startH
   TEST
\stopH
\stoptext
--8<---cut here---end--->8---

How could I create such start-stop pair please?

doesn't work because \stopmode is a delimiter when shipped

\usemodule[abbreviations-logos]

\defineblock [H] [before=\startcolor[blue],after=\stopcolor]
\keepblocks[H]

\starttext
test

\beginH
   TEST
\endH

test
\stoptext


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: About framedtext

2023-12-13 Thread Alan Braslau via ntg-context
On Wed, 13 Dec 2023 18:55:34 +0100
Wolfgang Schuster  wrote:

> This was added a few years ago (AFAIR to provide something similar to 
> the TikZ color command).

You actually mean similar to the MetaPost color command.

Alan ;-)
___
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: regular online meet-up

2023-12-13 Thread Floris van Manen via ntg-context




On 13/12/2023 10:50, Henning Hraban Ramm wrote:


at https://lecture.senfcall.de/hen-rbr-rku-oke
(same, but shorter: https://u.mtxrun.eu/ctxmtg)

ConTeXt users of all levels are welcome!




https://lecture.senfcall.de/gdpr/consent?url=https://lecture.senfcall.de/hen-rbr-rku-oke#


gets blocked by firefox on Linux due to Content-Security-Policy

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

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


[NTG-context] Re: Fractions

2023-12-10 Thread Gavin via ntg-context
Hello fraction fascinated friends,

> On Dec 10, 2023, at 5:24 AM, Henning Hraban Ramm  wrote:
> 
> Am 09.12.23 um 23:30 schrieb Mikael Sundqvist:
>> Hi,
>> On Sat, Dec 9, 2023 at 4:39 PM Wolfgang Schuster
>>  wrote:
>>> 
>>> Fabrice Couvreur schrieb am 09.12.2023 um 17:19:
>>> 
>>> Very clear !
>>> In typography for Mathematics books, what choice should we make for the 
>>> best possible result ?
>>> 
>>> A question better answered by Mikael or Aditya!
>> Thank you for your trust, Wolfgang. I am not sure I have something
>> valuable to say in addition to Adityas suggestion \frac{1/3} in inline
>> math. In any case, I attach a passage, with suggestions inspired by
>> Lansburgh's book (iin Swedish). Not sure the file size makes it
>> through to the list, though.
> 
> Thank you!
> 
> I usually only need simple inline fractions like 1/n, 1/2 or 3/8 in text.
> With these and \frac, the spacing below the numerator (depth) is too big, 
> while the denominator sticks too tightly to the fraction bar.
> (Of course I use regular numbers for fractions, not mediaeval.)
> 
> Usually I’d prefer “vulgar fractions”, but \vulgarfraction looks “horrible” 
> in comparison to the few usual fractions contained in fonts (like ½ & ¾).
> 
> I tried to use the OpenType fraction features to no avail.
> 
> So I’m still looking for “the best” solution for simple fractions inline.
> 
> Hraban

I also use fractions frequently, so I’ve tried a few things.

Some fonts have superior and inferior numbers that can be used to make small 
slash fractions. I’ve done this, but my method is not pretty. Hraban suggested 
using font features for this, but I haven’t learned how to do that. Any advice 
is welcome.

Example code below uses the Libertinus font, which has these superior and 
inferior numbers, to produce sample paragraph demonstrating a few options for 
fractions in text.

Gavin


\usetypescriptfile[libertinus]
\setupbodyfont [libertinus,11pt]%
\setupinterlinespace[line=3.1ex]

\define\fracone{\getnamedglyphdirect{libertinus}{onesuperior}} % 1
\define\fracthree{\getnamedglyphdirect{libertinus}{threesuperior}} % 3
\define\fracnine{\getnamedglyphdirect{libertinus}{ninesuperior}} % 9

\define\thirteenths{\textfraction\getnamedglyphdirect{libertinus}{oneinferior}\getnamedglyphdirect{libertinus}{threeinferior}}
 % /13

\define\onethirteenth{\text{\fracone\thirteenths}} % 1/13
\define\threethirteenths{\text{\fracthree\thirteenths}} % 3/13
\define\ninethirteenths{\text{\fracnine\thirteenths}} % 9/13

\starttext
Some small fractions are already available in many fonts, like \onehalf\ and 
\onethird. Others can be built using superior and inferior numbers in some 
fonts. This includes the fractions required to
find the normal and shearing stresses on an oblique plane defined by 
$l=\sqrt{\threethirteenths}$, $m=\sqrt{\onethirteenth}$, and 
$n=\sqrt{\ninethirteenths}$.
Of course, you could just find the normal and shearing stresses on an oblique 
plane defined by $l=\sqrt{3/13}$, $m=\sqrt{1/13}$, and $n=\sqrt{9/13}$.
Vulgar fractions are between these extremes.
Find the normal and shearing stresses on an oblique plane defined by 
$l=\sqrt{\vfrac{3}{13}}$, $m=\sqrt{\vfrac{1}{13}}$, and 
$n=\sqrt{\vfrac{9}{13}}$.
I included more text than strictly necessary in this example to demonstrate the 
effect on line spacing.
\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: margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Jigé via ntg-context
 Thanks Wolfgang.

Is this expected behavior? I'm very much confused with my second example:

\setuppapersize[A5][A4]
%\setuplayout[location=middle]
\setuplayout[location=middle,width=middle]
%\setuplayout[location=middle,width=middle,backspace=2.5cm]
\usemodule[ipsum]
\starttext
\showframe
Hello
\stoptext

With just \setuplayout[location=middle] the left margin gets outside the left 
edge, there's also a gap to the right of the right margin and, to the eye, it 
seems that the sum 
leftmargin+leftmargindistance+textwidth+rightmargindistance+rightmargin doesn 
not match the page width.

With \setuplayout[location=middle,width=middle] all is symmetrical but the two 
margins go outside the edges.

With e.g. \setuplayout[location=middle,width=middle,backspace=2.5cm] I can fit 
everything by manually adjusting the backspace to I'm not sure what the right 
value.

I couldn't adjust the page layout on some more complex document, so I'm going 
back to the most basic layout and trying to make it work on the simplest 
document possible.

JG Le dimanche 10 décembre 2023 à 11:53:07 UTC+1, Wolfgang Schuster 
 a écrit :  
 
 Jigé via ntg-context schrieb am 10.12.2023 um 11:30:
> Hi all,
> I've been struggling with basic page layout.
>
> The left margin extends outside the left edge of the page.
> Example (from the wiki):
>
> \setuppapersize[A4][A4] % this is the default and may be omitted
> \setuplayout[backspace=20mm,

leftmargin=10mm,
leftmargindistance=5mm,

>      width=110mm,
>      topspace=20mm,
>      header=0mm,
>      footer=0mm,
>      height=250mm]
> \starttext
> \showlayout
> \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: Fractions (was \placefigure[location=here...] problem)

2023-12-10 Thread Hans Hagen via ntg-context

On 12/9/2023 4:33 PM, Aditya Mahajan wrote:

On Sat, 9 Dec 2023, Wolfgang Schuster wrote:


\starttext

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

\stoptext


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

radicals are somewhat special to deal with:

- multidimensional delimiter
- vertical spacing inside
- horizontal spacing oustside
- anchoring degrees
- left and right radicals
- more consistent rules (char based)
- size dependent additional spacing (avoid clash)
- normalize size across formula
- lack of granularity in variants sizes

by now we have dealt with all of that (some not in the current release), 
think of additional control in the engine, compensation for insufficient 
opentype math features, companion fonts with more sizes


there will always be suboptimal cases but the average is ok (we put 
radical - character kerning on hold because it is a lot of definitions) 
and we don't want to add hard to fight heuristics


so to inline: in most cases the solution that Adirya suggests will work 
out okay with respect toline spacing


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] margin bigger than backspace pushes it outside the edge

2023-12-10 Thread Jigé via ntg-context
Hi all,
I've been struggling with basic page layout.

The left margin extends outside the left edge of the page.
Example (from the wiki):

\setuppapersize[A4][A4] % this is the default and may be omitted
\setuplayout[backspace=20mm,
    width=110mm,
    topspace=20mm,
    header=0mm,
    footer=0mm,
    height=250mm]
\starttext
\showlayout
\stoptext

Another example:

\setuppapersize[A5][A4]
\setuplayout[location=middle]
\usemodule[ipsum]
\starttext
\showframe
\ipsum
\stoptext

Thanks,
Jean-Guillaume

mise_en_page-layout.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: mtx-synctex.lua question

2023-12-08 Thread Hans Hagen via ntg-context

On 12/7/2023 7:23 PM, Jim wrote:

Hi,

In mtx-synctex.lua, inside
 local function findlocation(filename,page,xpos,ypos,tolerance)
there is the following code:
 for s=1,tolerance,max(tolerance//10,1) do
 locate( s, 0) if fi ~= 0 then tl = s ; goto done end
 locate(-s, 0) if fi ~= 0 then tl = s ; goto done end
 locate( s, s) if fi ~= 0 then tl = s ; goto done end
 locate( s,-s) if fi ~= 0 then tl = s ; goto done end
 locate(-s, s) if fi ~= 0 then tl = s ; goto done end
 locate(-s,-s) if fi ~= 0 then tl = s ; goto done end
 end

Is the omission of the
 locate(0, s) ...
and
 locate(0, -s) ...
cases intentional, or is that an oversight?

If intentional, can someone explain the rationale to me?

it's too long ago to remember the reason ... did you test with and without?

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: (again) wrong destination types?

2023-12-06 Thread Pablo Rodriguez via ntg-context
On 12/5/23 00:21, Bruce Horrocks wrote:
>> On 3 Dec 2023, at 15:26, Pablo Rodriguez via ntg-context wrote:
>> […]
>> My issue is that I cannot avoid having "page=name" for links to external
>> documents, but this breaks footnotes and other special operation links.
>
> What are you using for links to external documents? If just a single
> command such as \goto then you might be able to get away with defining a
> wrapper (e.g. \myGoto) that does
> \setupinteraction[state=start,page=name,focus=standard] then the \goto
> command then \setupinteraction[state=start,page=fit,focus=standard]
> afterwards.

Many thanks for your reply, Bruce.

The following code seems to solve my issues:

  \def\MyGoTo#1[#2]{\setupinteraction[state=start, style=,
  display=new, color=, contrastcolor=,
  page={auto,name},
  focus=standard]%
\goto{#1}[#2]}
  \setupinteraction[state=start, style=,
  display=new, color=, contrastcolor=,
  page={no},
  focus=standard]

I didn’t thought this issue would be so easy to be solved.

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: externalfigure crashed

2023-12-06 Thread Pablo Rodriguez via ntg-context
On 12/4/23 20:44, Hans Hagen via ntg-context wrote:
> On 12/4/2023 5:38 PM, Pablo Rodriguez via ntg-context wrote:
>>> […]
>> Does the above mean that ConTeXt will be able to sign PDF documents with
>> digital certificates?
> Well, that's what singing is, right? The problem is actually less in the
> signing than in the certificates themselves.
>
> Basically one can sign (with some certificate) and then validate.

Many thanks for your explanation, Hans.

These are great news. I wonder whehter it would be feasible to extend
this to use smart cards (through Firefox).

Many thanks the new implementations,

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: Inline math spacing

2023-12-04 Thread Hans Hagen via ntg-context

On 12/4/2023 2:42 PM, Alexandre Christe wrote:

Hi Hans,

Thanks for your answer. It helps a lot. Would there be a way to only add 
space when inline math is not followed by punctuation, i.e., when inline 
math is followed by a space?



A. Christe
Le 4 déc. 2023 à 14:08 +0100, Hans Hagen , a écrit :


\setupmathematics[textdistance=.25em plus .1em minus .1em]


Hm, I can make it optional (engine feature then) but will discuss it 
with Mikael first.


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: externalfigure crashed

2023-12-04 Thread Hans Hagen via ntg-context

On 12/4/2023 5:38 PM, Pablo Rodriguez via ntg-context wrote:

On 11/24/23 18:16, Hans Hagen via ntg-context wrote:

[…]
will do for now ... i can't upload a new installer .. pending the built;
the advantage is that i can do some experiments that would otherwise
break the current version (making compact font mode very close to
normal, pdf signing […]


Sorry, Hans, if I am missing the point.

Does the above mean that ConTeXt will be able to sign PDF documents with
digital certificates?
Well, that's what singing is, right? The problem is actually less in the 
signing than in the certificates themselves.


Basically one can sign (with some certificate) and then validate.


% sign-001.tex

\setupinteraction[state=start]

\definefield[signature][signed]

\defineoverlay[signature][my signature]

\starttext
\startTEXpage[offset=1ts,frame=on,framecolor=darkblue]
sign: \inframed
  [background=signature,framecolor=darkred]
  {\fieldbody[signature][width=3cm,option=hidden]}
\stopTEXpage
\stoptext

after neing processed:

mtxrun --script pdf --sign --certificate=sign-001.pem --password=test 
sign-001 (--library)


and:

mtxrun --script pdf --validate --certificate=sign-001.pem 
--password=test sign-001 (--library)


etc. works 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: externalfigure crashed

2023-12-04 Thread Pablo Rodriguez via ntg-context
On 11/24/23 18:16, Hans Hagen via ntg-context wrote:
> […]
> will do for now ... i can't upload a new installer .. pending the built;
> the advantage is that i can do some experiments that would otherwise
> break the current version (making compact font mode very close to
> normal, pdf signing […]

Sorry, Hans, if I am missing the point.

Does the above mean that ConTeXt will be able to sign PDF documents with
digital certificates?

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: Inline math spacing

2023-12-04 Thread Hans Hagen via ntg-context

On 12/4/2023 6:43 AM, Alexandre Christe wrote:

Hi,

Here’s a MWE:

\setupinterlinespace[line=3ex]

\definefontfeature[default][default][lnum=yes,tnum=yes]
\usetypescriptfile[alegreya_libertinus]
\setupbodyfont[alegreya-light,ss,10pt]
\setupmathematics[autopunctuation={all}]

% math definitions
\enablemathautospacing % more global
% \enablemathautofencing % more global
\enablemathautonumbers % more global
% \autofences % more local

\usemodule[ipsum]

\starttext

\ipsum

\stoptext

And I attach the two files to setup the font.

no math ... anyway

\showglyphs

\dorecurse{100}{test \im{\frac{#1}{3}} test }

\setupmathematics[textdistance=.25em plus .1em minus .1em]

\dorecurse{100}{test \im{\frac{#1}{3}} test }

will give more space but it's mostly optical that the math related 
spacing looks doferent from regular spaces.


-
  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: marginwidths

2023-12-03 Thread Pablo Rodriguez via ntg-context
On 11/22/23 18:03, Wolfgang Schuster wrote:
> Hans van der Meer via ntg-context schrieb am 22.11.2023 um 15:45:
>> But changing the width of the section in the middle is not changing.

dr. van der Meer,

your sample works for me if you add width=fit, such as in:

  \setuplayout[width=fit, leftmargin=6cm,rightmargin=10cm]
  \showframe
  \starttext
  \ConTeXt\space\contextversion\blank
  before the \type{\starttext}:\crlf
  \type{\setuplayout[leftmargin=6cm,rightmargin=10cm]}\crlf
  make no difference in displayed frame
  \showlayout
  \stoptext

I wonder whether I might be missing something, since this option is not
mentioned by Wolfgang.

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: unwanted blank page

2023-12-03 Thread Pablo Rodriguez via ntg-context
On 11/22/23 09:57, madiazm.eo...@gmail.com wrote:
> Thanks a lot Pablo for your comments, I think my bad English did not
> let me be clear.
Sorry (also for my delay in answering), but it was totally my fault (I
totally missed your point)..

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: (again) wrong destination types?

2023-12-03 Thread Pablo Rodriguez via ntg-context
On 11/22/23 00:06, Bruce Horrocks wrote:
> [...]
> I changed your example to the following:
> \setupinteraction[state=start, page=name, focus=standard]
> \starttext
> \input knuth \par
> a\footnote{b} \par
> \dorecurse{7}{\input knuth \par}
> \stoptext

Many thanks for your fast reply, Bruce.

I wanted to reply much sooner, but it was really impossible for me.

>From your explanation, the first link (body to footnote, your point b)
has destination to fit the whole page inside the viewer.

The second link (footnote to body, your point c) has the destination to
reach a position inside the page (where the destination lies). This is
what "focus=standard" should achieve.

In PDF terms (simplified), fit to page destinations are /Fit
destinations and placed destinations are /XYZ destinations.

This sample shows what might be the root issue here:

  \setupinteraction[state=start, page=name, focus=standard]
  \starttext
  \completecontent
  \chapter{Chapter}
  a\footnote{b}
  \stoptext

ConTeXt handles internally links in categories. For some reason unknown
to me, "page=name" triggers that special operation links contain /Fit
instead /XYZ destinations.

This is similar to the wrong link destinations (fit instead of standard)
from TOC (but not in footnotes [which are right]) when compiled with MkIV:

  \setupinteraction[state=start, focus=standard]
  \starttext
  \completecontent
  \chapter{Chapter}
  a\footnote{b}
  \stoptext

I hope it is clearer now. Let me know if it is not.

My issue is that I cannot avoid having "page=name" for links to external
documents, but this breaks footnotes and other special operation links.

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: multipage metapost output from ConTeXt

2023-12-02 Thread Emanuel Han via ntg-context
Thank you Mikael,
this works!
Emanuel

On Dez. 2 2023, at 7:46 pm, Mikael Sundqvist  wrote:
> Hi,
>
> I don't know if \startMPinclusions \stopMPinclusions shall work with
> \startMPpage and \stopMPpage. In this case, one can use a separate
> graphics:
>
> \startuseMPgraphic{base}
> picture p[];
> path TheFrame ;
> TheFrame := fullsquare scaled 5in ;
> z1 = (60,40);
> z2 = (40,90);
> z3 = (10,70);
>
> p1:=image(
> label("Word 1", z1);
> );
>
> p2:=image(
> label("Mot 2", z2);
> );
>
> p3:=image(
> label("Parola 3", z3);
> );
>
> \stopuseMPgraphic
> \starttext
> \dorecurse{3}{ % Frame
> \startMPpage[pagestate=start]
> \includeMPgraphic{base}
> currentime := #1 ;
> % Just for learning :
> draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> draw textext("T="(currentime)) scaled 2 shifted(0,2in)
> withcolor magenta ;
> for k=1 upto currentime: addto currentpicture also p[k]; endfor
> setbounds currentpicture to TheFrame ;
>
> desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> \stopMPpage
> }
>
> \stoptext
> /Mikael
> On Sat, Dec 2, 2023 at 6:14 PM Emanuel Han via ntg-context
>  wrote:
> >
> > Hi Mikael,
> >
> > here's a very simple mwe for the label(textext()) issue. On page 1, the 
> > text "Word 1" should be drawn in position z1. On page 2, the same text in 
> > the same position should be visible, and the text "Mot 2" in position p2 
> > should be added. And so on.
> >
> > \startMPinclusions
> >
> > picture p[];
> > path TheFrame ;
> > TheFrame := fullsquare scaled 5in ;
> >
> > z1 = (60,40);
> > z2 = (40,90);
> > z3 = (10,70);
> >
> > p1:=image(
> > label(textext("Word 1"), z1);
> > );
> >
> > p2:=image(
> > label(textext("Mot 2"), z2);
> > );
> >
> > p3:=image(
> > label(textext("Parola 3"), z3);
> > );
> >
> > \stopMPinclusions
> >
> > \starttext
> >
> > \dorecurse{3}{ % Frame
> > \startMPpage[pagestate=start]
> > currentime := #1 ;
> > % Just for learning :
> > draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> > draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> > magenta ;
> > for k=1 upto currentime: draw p[k]; endfor
> > setbounds currentpicture to TheFrame ;
> >
> > desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> > currentpicture := currentpicture xysized (desiredformat ,desiredformat );
> >
> > \stopMPpage
> > }
> >
> > \stoptext
> >
> > On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> >
> > Hi Emanuel,
> >
> > I am not sure I understand your question, and since you use fonts that
> > i do not have, I cannot test your example as is. But, maybe, if you
> > want to redraw a picture, you can do
> >
> > addto currentpicture also p1;
> >
> > where you want it.
> >
> > /Mikael
> >
> > PS For the text thing, I did not get it. Could one have a _very
> > simple_ example showing only that problem and no other problem?
> >
> > On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> > >
> > > You didn't specify the color of path A in p2 and p4. So it's drawn in 
> > > black.
> > > The other issue, I can't help.
> > >
> > > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> > >>
> > >> So is there a way to circumvent these issues? Or an explanation for this 
> > >> behavior, so that I can try to find a solution by myself?
> > >>
> > >> Thanks
> > >> Emanuel
> > >>
> > >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> > >>  wrote:
> > >>
> > >> Dear Aditya and Fabrice,
> > >> thanks for your responses.
> > >>
> > >> I included some of Fabrice's code into mine for testing purpose, and 
> > >> indeed the multipage works now.
> > >> What is bizarre is that issues appear now that didn't appear before:
> > >>
> > >> Path A is drawn with color red on page 1, and in color black on all 
> > >> following pages, while it should stay red.
> > >> textext(, ) is overwriting  with 
> > >> "T="(currentime) which has been used previously in textext() 
> > >> b

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

2023-12-02 Thread Emanuel Han via ntg-context
Hi Mikael,

here's a very simple mwe for the label(textext()) issue. On page 1, the text 
"Word 1" should be drawn in position z1. On page 2, the same text in the same 
position should be visible, and the text "Mot 2" in position p2 should be 
added. And so on.
\startMPinclusions
picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;

z1 = (60,40);
z2 = (40,90);
z3 = (10,70);

p1:=image(
label(textext("Word 1"), z1);
);

p2:=image(
label(textext("Mot 2"), z2);
);

p3:=image(
label(textext("Parola 3"), z3);
);

\stopMPinclusions
\starttext
\dorecurse{3}{ % Frame
\startMPpage[pagestate=start]
currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
magenta ;
for k=1 upto currentime: draw p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );

\stopMPpage
}

\stoptext
On Dez. 2 2023, at 5:22 pm, Mikael Sundqvist  wrote:
> Hi Emanuel,
>
> I am not sure I understand your question, and since you use fonts that
> i do not have, I cannot test your example as is. But, maybe, if you
> want to redraw a picture, you can do
>
> addto currentpicture also p1;
> where you want it.
> /Mikael
> PS For the text thing, I did not get it. Could one have a _very
> simple_ example showing only that problem and no other problem?
>
> On Sat, Dec 2, 2023 at 12:58 PM fv leung  wrote:
> >
> > You didn't specify the color of path A in p2 and p4. So it's drawn in black.
> > The other issue, I can't help.
> >
> > Emanuel Han via ntg-context  於 2023年12月2日 週六 下午7:23寫道:
> >>
> >> So is there a way to circumvent these issues? Or an explanation for this 
> >> behavior, so that I can try to find a solution by myself?
> >>
> >> Thanks
> >> Emanuel
> >>
> >> On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context 
> >>  wrote:
> >>
> >> Dear Aditya and Fabrice,
> >> thanks for your responses.
> >>
> >> I included some of Fabrice's code into mine for testing purpose, and 
> >> indeed the multipage works now.
> >> What is bizarre is that issues appear now that didn't appear before:
> >>
> >> Path A is drawn with color red on page 1, and in color black on all 
> >> following pages, while it should stay red.
> >> textext(, ) is overwriting  with 
> >> "T="(currentime) which has been used previously in textext() 
> >> before the for k=1 endfor loop. This overwriting happens only for the 
> >> first textext() which occurs inside the for k=1 endfor loop. All other 
> >> textext() inside the for k=1 endfor loop are not drawn at all. If the line 
> >> « draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> >> magenta ; » is commented out, the first textext() inside the for k=1 
> >> endfor loop is not drawn neither. It must be an issue with textext(), 
> >> because when I replace textext() by lmt_outline[], the text is drawn.
> >>
> >> Adjusted mwe:
> >>
> >> \enableregime[utf] % enable unicoded input
> >>
> >> \definefontfamily [RomanFont] [rm] [calluna]
> >>
> >> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> >>
> >> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> >>
> >> \definefontfeature
> >> [fea]
> >> [mode=node,language=dflt,script=arab,
> >> init=yes,
> >> medi=yes,
> >> fina=yes,
> >> isol=yes,
> >> calt=yes,
> >> rlig=yes,
> >> tlig=yes,
> >> trep=yes,
> >> curs=yes,
> >> kern=yes,
> >> mark=yes
> >> ]
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
> >> [features=fea]
> >> \stoptypescript
> >>
> >> \starttypescript [serif] [notonaskharabic]
> >> \usetypescript[serif][fallback]
> >> \definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
> >> \definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
&g

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

2023-12-02 Thread Emanuel Han via ntg-context
So is there a way to circumvent these issues? Or an explanation for this 
behavior, so that I can try to find a solution by myself?

Thanks
Emanuel

On Nov. 29 2023, at 12:25 pm, Emanuel Han via ntg-context  
wrote:
> Dear Aditya and Fabrice,
> thanks for your responses.
>
> I included some of Fabrice's code into mine for testing purpose, and indeed 
> the multipage works now.
> What is bizarre is that issues appear now that didn't appear before:
> Path A is drawn with color red on page 1, and in color black on all following 
> pages, while it should stay red.
>
> textext(, ) is overwriting  with "T="(currentime) 
> which has been used previously in textext() before the for k=1 endfor loop. 
> This overwriting happens only for the first textext() which occurs inside the 
> for k=1 endfor loop. All other textext() inside the for k=1 endfor loop are 
> not drawn at all. If the line « draw textext("T="(currentime)) scaled 
> 2 shifted(0,2in) withcolor magenta ; » is commented out, the first textext() 
> inside the for k=1 endfor loop is not drawn neither. It must be an issue with 
> textext(), because when I replace textext() by lmt_outline[], the text is 
> drawn.
>
>
> Adjusted mwe:
>
> \enableregime[utf] % enable unicoded input
> \definefontfamily [RomanFont] [rm] [calluna]
> \definefontfamily [KoreanFont] [rm] [applemyungjo]
> \definefontfamily [JapaneseFont] [rm] [hannotatesc]
> \definefontfeature
> [fea]
> [mode=node,language=dflt,script=arab,
> init=yes,
> medi=yes,
> fina=yes,
> isol=yes,
> calt=yes,
> rlig=yes,
> tlig=yes,
> trep=yes,
> curs=yes,
> kern=yes,
> mark=yes
> ]
>
> \starttypescript [serif] [notonaskharabic]
> \definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] 
> [features=fea]
> \definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] 
> [features=fea]
> \definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
> [features=fea]
> \definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
> [features=fea]
> \stoptypescript
>
> \starttypescript [serif] [notonaskharabic]
> \usetypescript[serif][fallback]
> \definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
> \definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
> \definefontsynonym [SerifBold] [notonaskharabic-Bold] [features=fea]
> \definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic] 
> [features=fea]
> \stoptypescript
>
> \starttypescript [notonaskharabic]
> \definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default]
> \stoptypescript
>
> \usetypescript[notonaskharabic]
> \setupbodyfont [RomanFont]
>
> \usecolors[crayola]
>
> \startMPinclusions
> picture p[];
> path TheFrame ;
> TheFrame := fullsquare scaled 5in ;
>
> z0 = (0,0);
> z1 = (60,40);
> z2 = (40,90);
> z3 = (10,70);
> z4 = (30,50);
> z5 = (90,70);
> z6 = (-10,70);
>
> path A; A = z0..z1..z2..z3..z4 ;
> pair AStartPoint; AStartPoint = point 0 of A;
> pair AEndPoint; AEndPoint = point 4 of A;
> path B; B = z5..z6;
> pair BStartPoint; BStartPoint = point 0 of B;
> pair BEndPoint; BEndPoint = point 1 of B;
> path C; C = AStartPoint..AEndPoint;
>
> p1:=image(
> draw A withcolor red;
> );
>
> p2:=image(draw A; label(lmt_outline [
> text = "\JapaneseFont 日本語"
> ], AEndPoint););
>
> p3:=image(
> label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, BStartPoint);
> );
>
> p4:=image(draw A; label(lmt_outline [
> text = "\KoreanFont 한국어"
> ], AStartPoint););
>
> p5:=image(
> label(textext("bāng"), BEndPoint);
> draw C withcolor green;
> );
>
> p6:=image(
> draw B withcolor blue;
> );
> \stopMPinclusions
>
> \starttext
> \dorecurse{6}{ % Frame
> \setupMPpage[background=color, backgroundcolor=SpringGreen]
> \startMPpage[pagestate=start]
> currentime := #1 ;
> % Just for learning :
> draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
> draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
> magenta ;
> for k=1 upto currentime: draw p[k]; endfor
> setbounds currentpicture to TheFrame ;
>
> desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
> currentpicture := currentpicture xysized (desiredformat ,desiredformat );
>
> \stopMPpage
> }
>
> \stoptext
> On Nov. 27 2023, at 11:25 pm, Aditya Mahajan  wrote:
> > On Mon, 27 Nov 2023, Fabrice L wrote:
> >
> > > Hi,
> > >
> > > It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage 
> > > multiple times. Here is an example which build an anima

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

2023-11-29 Thread Emanuel Han via ntg-context
Dear Aditya and Fabrice,
thanks for your responses.

I included some of Fabrice's code into mine for testing purpose, and indeed the 
multipage works now.
What is bizarre is that issues appear now that didn't appear before:
Path A is drawn with color red on page 1, and in color black on all following 
pages, while it should stay red.

textext(, ) is overwriting  with "T="(currentime) 
which has been used previously in textext() before the for k=1 endfor loop. 
This overwriting happens only for the first textext() which occurs inside the 
for k=1 endfor loop. All other textext() inside the for k=1 endfor loop are not 
drawn at all. If the line « draw textext("T="(currentime)) scaled 2 
shifted(0,2in) withcolor magenta ; » is commented out, the first textext() 
inside the for k=1 endfor loop is not drawn neither. It must be an issue with 
textext(), because when I replace textext() by lmt_outline[], the text is drawn.

Adjusted mwe:

\enableregime[utf] % enable unicoded input
\definefontfamily [RomanFont] [rm] [calluna]
\definefontfamily [KoreanFont] [rm] [applemyungjo]
\definefontfamily [JapaneseFont] [rm] [hannotatesc]
\definefontfeature
[fea]
[mode=node,language=dflt,script=arab,
init=yes,
medi=yes,
fina=yes,
isol=yes,
calt=yes,
rlig=yes,
tlig=yes,
trep=yes,
curs=yes,
kern=yes,
mark=yes
]

\starttypescript [serif] [notonaskharabic]
\definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] [features=fea]
\definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] [features=fea]
\definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
[features=fea]
\definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
[features=fea]
\stoptypescript

\starttypescript [serif] [notonaskharabic]
\usetypescript[serif][fallback]
\definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
\definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
\definefontsynonym [SerifBold] [notonaskharabic-Bold] [features=fea]
\definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic] 
[features=fea]
\stoptypescript

\starttypescript [notonaskharabic]
\definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default]
\stoptypescript

\usetypescript[notonaskharabic]
\setupbodyfont [RomanFont]

\usecolors[crayola]

\startMPinclusions
picture p[];
path TheFrame ;
TheFrame := fullsquare scaled 5in ;

z0 = (0,0);
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);
z4 = (30,50);
z5 = (90,70);
z6 = (-10,70);

path A; A = z0..z1..z2..z3..z4 ;
pair AStartPoint; AStartPoint = point 0 of A;
pair AEndPoint; AEndPoint = point 4 of A;
path B; B = z5..z6;
pair BStartPoint; BStartPoint = point 0 of B;
pair BEndPoint; BEndPoint = point 1 of B;
path C; C = AStartPoint..AEndPoint;

p1:=image(
draw A withcolor red;
);

p2:=image(draw A; label(lmt_outline [
text = "\JapaneseFont 日本語"
], AEndPoint););

p3:=image(
label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, BStartPoint);
);

p4:=image(draw A; label(lmt_outline [
text = "\KoreanFont 한국어"
], AStartPoint););

p5:=image(
label(textext("bāng"), BEndPoint);
draw C withcolor green;
);

p6:=image(
draw B withcolor blue;
);
\stopMPinclusions

\starttext
\dorecurse{6}{ % Frame
\setupMPpage[background=color, backgroundcolor=SpringGreen]
\startMPpage[pagestate=start]
currentime := #1 ;
% Just for learning :
draw TheFrame withpen pencircle scaled .1in withcolor magenta ;
draw textext("T="(currentime)) scaled 2 shifted(0,2in) withcolor 
magenta ;
for k=1 upto currentime: draw p[k]; endfor
setbounds currentpicture to TheFrame ;

desiredformat := 1080;% In pixels (will be converted by default at 72dpi)
currentpicture := currentpicture xysized (desiredformat ,desiredformat );

\stopMPpage
}

\stoptext
On Nov. 27 2023, at 11:25 pm, Aditya Mahajan  wrote:
> On Mon, 27 Nov 2023, Fabrice L wrote:
>
> > Hi,
> >
> > It is fun fact very easy to do. You just use \startMPpage (…) \stopMPpage 
> > multiple times. Here is an example which build an animation of a particle 
> > moving according to a Brownian motion.
>
> A very similar option is to pass a variable to a metapost drawing. This is 
> what I use:
> https://adityam.github.io/context-blog/post/metapost-animation/
> It only works when viewed in acrobat, you can just comment out the animation 
> part and wrap it in \startTEXpage .. \stopTEXpage to get multi-page animation.
> Aditya_______
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> _

[NTG-context] Re: mathalignment; alignment of columns

2023-11-28 Thread wolfgangbackes--- via ntg-context
Obviously someone has taken pity on me: 
https://wiki.contextgarden.net/Command/setupmathalignment
A thousand thanks to the silent hero.

Regards,
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] multipage metapost output from ConTeXt

2023-11-27 Thread Emanuel Han via ntg-context
How can I achieve multipage metapost output from ConTeXt? The result should be 
a multipage pdf. It contains just a metapost graphic per page. The graphic has 
always the same bounding box and evolves from page to page: Some elements to be 
drawn are added, and some others would ideally also be removed, while keeping 
elements which has already been drawn on previous pages. I can manage when it 
is not possible to remove elements (in that case I'll just cover them with a 
covering element).

I saw that it is possible to achieve my goal with standalone metapost, as 
described here: 
https://tex.stackexchange.com/questions/471662/mptopdf-is-multipage-output-pdf-possible
But I'll need to achieve this with Metapost inside ConTeXt because I use labels 
in Metapost which print text in Japanese, Korean , Arabic and Roman script: 
Thanks to ConTeXt, I can define appropriate fonts for each script. All this 
works already in my working example.
The only unsolved problem is to ship out multiple pages.
For the minimal working example, I didn't remove the font defining part, 
because having 4 different fonts is a condition of my use case. The graphic on 
the other hand is some simple dummy nonsense graphic not from my project. The 
graphic is in the provided example drawn as a summing up of layered drawing 
steps (6 steps, to be precise), so no removing is implemented here (because I 
don't know how that would be done). If each of the figures 1 to 6 of my mwe can 
be put alone on a page, I'd be already very happy. Now, they're put on top of 
each other all on the same single page, also on top of figure 0.
The desired multipage pdf will be used in presentation mode of a pdf viewer and 
skipped forward and backward from page to page (that is from drawing step to 
drawing step).
mwe:
\enableregime[utf] % enable unicoded input
\definefontfamily [RomanFont] [rm] [calluna]
\definefontfamily [KoreanFont] [rm] [applemyungjo]
\definefontfamily [JapaneseFont] [rm] [hannotatesc]
\definefontfeature
[fea]
[mode=node,language=dflt,script=arab,
init=yes,
medi=yes,
fina=yes,
isol=yes,
calt=yes,
rlig=yes,
tlig=yes,
trep=yes,
curs=yes,
kern=yes,
mark=yes
]

\starttypescript [serif] [notonaskharabic]
\definefontsynonym [notonaskharabic-Light] [name:notonaskharabic] [features=fea]
\definefontsynonym [notonaskharabic-Bold] [name:notonaskharabic] [features=fea]
\definefontsynonym [notonaskharabic-Italic] [name:notonaskharabic] 
[features=fea]
\definefontsynonym [notonaskharabic-Bold-Italic] [name:notonaskharabic] 
[features=fea]
\stoptypescript

\starttypescript [serif] [notonaskharabic]
\usetypescript[serif][fallback]
\definefontsynonym [Serif] [notonaskharabic-Light] [features=fea]
\definefontsynonym [SerifItalic] [notonaskharabic-Italic] [features=fea]
\definefontsynonym [SerifBold] [notonaskharabic-Bold] [features=fea]
\definefontsynonym [SerifBoldItalic] [notonaskharabic-Bold-Italic] 
[features=fea]
\stoptypescript

\starttypescript [notonaskharabic]
\definetypeface [notonaskharabic] [rm] [serif] [notonaskharabic] [default]
\stoptypescript

\usetypescript[notonaskharabic]
\setupbodyfont [RomanFont]

\starttext
\startMPcode
picture p[];
path bb; %bounding box

z0 = (0,0);
z1 = (60,40);
z2 = (40,90);
z3 = (10,70);
z4 = (30,50);
z5 = (90,70);
z6 = (-10,70);

path A; A = z0..z1..z2..z3..z4 ;
pair AStartPoint; AStartPoint = point 0 of A;
pair AEndPoint; AEndPoint = point 4 of A;
path B; B = z5..z6;
pair BStartPoint; BStartPoint = point 0 of B;
pair BEndPoint; BEndPoint = point 1 of B;
path C; C = AStartPoint..AEndPoint;

% drawing steps:
p1:=image(
draw A withcolor red;
);

p2:=image(
label(textext("\JapaneseFont 日本語"), AEndPoint);
);

p3:=image(
label(textext("\notonaskharabic \textdir TRT دانگ") scaled 1.2, AStartPoint);
);

p4:=image(
label(textext("\KoreanFont 한국어"), BStartPoint);
);

p5:=image(
label(textext("\RomanFont bāng"), BEndPoint);
draw C withcolor green;
);

p6:=image(
draw B withcolor blue;
);

beginfig(0); %% the whole picture for the common bbox
for k=1 upto 6: draw p[k]; endfor
bb:=bbox(currentpicture);
endfig;

for $=1 upto 6:
beginfig($);
for k=1 upto $: draw p[k]; endfor
setbounds currentpicture to bb;
endfig;
endfor

\stopMPcode
\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: mathalignment; alignment of columns

2023-11-25 Thread wolfgangbackes--- via ntg-context
By the way, if it's been a few years since the changeover, isn't it surprising 
that the examples on the contextgarden website still use the old syntax?
Are you aware of an official announcement of the new syntax? After all, this 
seems to mean that old texts are no longer rendered correctly, at least not 
after a new PDF generation. This is no small matter.
___
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: mathalignment; alignment of columns

2023-11-25 Thread wolfgangbackes--- via ntg-context
No, it seems to have been my mistake. I must apologize. I have tested the 
syntax with the preceding column numbers again, and lo and behold: it works. 
Unfortunately, I can no longer understand what went wrong with my first test of 
the new syntax. In any case, thank you very much for your support. You have 
helped me a lot.
___
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: mathalignment; alignment of columns

2023-11-24 Thread wolfgangbackes--- via ntg-context
Thank you very much for the quick reply. But I had already tried this syntax 
before, because I had found it somewhere by chance. But it didn't work either, 
as you can also verify on the page https://context-on-web.eu/.

Regards,
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] mathalignment; alignment of columns

2023-11-24 Thread wolfgangbackes--- via ntg-context
Something as elementary as "mathenvironment" can't really be faulty, can it? 
According to my recent tests, a mathalignment environment does not seem to 
react (any more) to the values of the "align" option.
The source code hab been rendered correctly a few years ago,

Minimal example 1:

\starttext
\startformula
\startmathalignment[n=2,align={left, right}]
\NC always aligned to the right \NC = u + at, \NR
\NC d \NC = ut + \frac12 at^2. \NR
\stopmathalignment
\stopformula 
\stoptext

Despite "align={left, right}", the first column is aligned to the right and the 
second to the left. This does not change, no matter which values I assign to 
"align", for example align={middle, middle}.

The align option is also ignored in the case of other column numbers., for 
example:

\starttext 
\startformula
\startmathalignment[n=1,align=left]
\NC This single column should \NR
\NC be left-aligned, \NR
\NC but it is centered. \NR
\stopmathalignment
\stopformula 
\stoptext

 What am I missing here? Where is my mistake?

Regards
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: externalfigure crashed

2023-11-24 Thread Hans Hagen via ntg-context

On 11/22/2023 10:02 PM, Hans van der Meer via ntg-context wrote:

Here too, I find 'undefined' from \meaning\expandeddetokenize

\ifdefined\expandeddetokenize\else
\let\expandeddetokenize\detokenize
\fi

will do for now ... i can't upload a new installer .. pending the built; 
the advantage is that i can do some experiments that would otherwise 
break the current version (making compact font mode very close to 
normal, pdf signing, adapting to the latest validation, math magick, 
etc); so fixes have to wait (but are done anyway)


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: Compatibility Issue with TikZ/Spy Library in ConTeXt: Seeking Solutions

2023-11-24 Thread wolfgangbackes--- via ntg-context
Many thanks for this great magic powder. It works without a hitch. You have 
made my day!

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] Compatibility Issue with TikZ/Spy Library in ConTeXt: Seeking Solutions

2023-11-24 Thread wolfgangbackes--- via ntg-context
Hello,
I am reaching out to seek assistance regarding a compatibility issue I have 
encountered after installing ConTeXt on a new computer. The problem arises when 
attempting to compile documents that utilize the spy library; the LuaTeX engine 
returns the following error message:

"error (luacall): invalid number
mtx-context | fatal error: return code: 1"

Unfortunately, the error message provides no additional clues. To investigate 
further, I created a minimal example, which you can easily verify at 
https://context-on-web.eu/. The example employs the spy library within a TikZ 
environment. Surprisingly, the same example runs without error on my local 
LaTeX engine, indicating a potential compatibility issue between ConTeXt and 
the spy library.

Here is the minimal example for your reference:

\starttext
\usemodule[tikz]
\usetikzlibrary {spy}
\starttikzpicture[spy using overlays={size=12mm}]
\draw (0,0) -- (1,1) -- (2,-1);
\spy [blue,magnification=5] on (1,1) in node at (3,0);
\stoptikzpicture
\stoptext

I am curious if anyone else has encountered a similar problem with the spy 
library and ConTeXt and, if so, if there is a known solution. Any insights or 
guidance would be greatly appreciated.

Thank you for your time and assistance.

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

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


[NTG-context] Re: externalfigure crashed

2023-11-22 Thread Hans van der Meer via ntg-context
Here too, I find 'undefined' from \meaning\expandeddetokenize

yours sincerely
dr. Hans van der Meer



> On 22 Nov 2023, at 21:55, Aditya Mahajan  wrote:
> 
> On Wed, 22 Nov 2023, Wolfgang Schuster wrote:
> 
>> Hans van der Meer schrieb am 22.11.2023 um 21:22:
>>> The problem persists. Here the new logfile.
>> 
>> 1. What is the version of your Luametatex binary?
>> 
>> luametatex --version
>> This is LuaMetaTeX, Version 2.10.11
> 
> For me, it is the same:
> 
> This is LuaMetaTeX, Version 2.10.11
> 
>> 
>> 2. What do you get in your log-file with the following example!
>> 
>> \starttext
>> \show\expandeddetokenize
>> \stoptext
>> 
>> On my system I can find the following line:
>> 
>> > \expandeddetokenize=primitive \expandeddetokenize
> 
> \expandeddetokenize=undefined
> 
> Not sure why this is the case!
> 
> Aditya___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

_______
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] externalfigure crashed

2023-11-22 Thread Hans van der Meer via ntg-context
When \externalfigure could not find the file it used to graciously place a rectangle kindly telling the user that the file has not been found.But now, however, it seems the default in this case is a crash. Very annoying in comparison with the earlier behaviour.I might make a mistake, but the MWE is as simple as can be.The filename is test.jpeg, then this runs ok:\starttext\externalfigure[test.jpeg][]\stoptextBut this crashes, see the log:\starttext\externalfigure[test.jpg][]\stoptext
yours sincerelydr. Hans van der Meer

showlayout.log
Description: Binary data




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

2023-11-22 Thread Hans van der Meer via ntg-context
But changing the width of the section in the middle is not changing. Adapt \textwidth narrows the textwidth but does not allow wider margins.see next example. So how to adapt the page to for example:[leftmargin 40mm][middle what is left][rightmargin 60mm] this should leave 210-40-60=110mm in the middle, but doesn't.The textwidth is narrowed but the margins refuse to obey their setting.
yours sincerelydr. Hans van der Meer\setuppapersize[A4][A4]\setuplayout[leftmargin=40mm,rightmargin=60mm,textwidth=110mm]\showframe\starttextsetuplayout: leftmargin=40mm, rightmargin=60mm, textwidth=110mm\crlfabc\dotfill xyz\crlf\stoptext

showlayout.pdf
Description: Adobe PDF document




On 22 Nov 2023, at 14:46, Marco Patzer  wrote:On Wed, 22 Nov 2023 14:17:29 +0100Hans van der Meer via ntg-context  wrote:I would like to change the width of the margins on the page.In the MWE here, the pagelayout does not seem to obey the\setuplayout command. Why are the margins shown uneffected by\setuplayout?Works as expected here. The margins have changed and \showlayoutgives you:  \leftmarginwidth  =  6cm  \rightmarginwidth = 10cmChange the example to:  \setuplayout    [leftmargin=6mm,  %% mm, not cm rightmargin=10mm]That way you better see the effect on the page.Marco___
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] marginwidths

2023-11-22 Thread Hans van der Meer via ntg-context
I would like to change the width of the margins on the page.In the MWE here, the pagelayout does not seem to obey the \setuplayout command. Why are the margins shown uneffected by \setuplayout?
yours sincerelydr. Hans van der Meer







showlayout.pdf
Description: Adobe PDF document


showlayout.tex
Description: Binary data
___
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: Metapost label text surrounded by white border

2023-11-20 Thread Emanuel Han via ntg-context
Thanks Hraban. This indeed helped. 

It‘s my first reply in this mailing list. Hope I do it right by „replying to 
all“.

> Am 19.11.2023 um 19:37 schrieb Henning Hraban Ramm :
> 
> Am 19.11.23 um 16:41 schrieb Emanuel Han via ntg-context:
>> I'd like to surround black text with a white 1mm thick border in a Metapost 
>> label. Here is my code, which doesn't draw the border at all and which draws 
>> the text in white instead of black (I'm using mkiv and mkxl version 
>> 2023.09.26 18:19 on osx-arm6):
>> |
>> |beginfig(1);
>> % Define the text and colors
>> string label_text;
>> label_text = "Your Text";
>> color text_color, border_color;
>> text_color = black;
>> border_color = white;
>> % Draw the label with the specified colors
>> label(textext(label_text) scaled 1.0, origin) withcolor text_color 
>> withpen pencircle scaled 1mm withcolor border_color;
>> endfig;|
> 
> Have a look into luametafun.pdf (p.10) if lmt_outline does what you want.
> 
> 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] (again) wrong destination types?

2023-11-20 Thread Pablo Rodriguez via ntg-context
Dear list,

sorry for insisting, but this is important for my documents.

I have the following sample:

 \setupinteraction[state=start, page=name, focus=standard]
  \starttext
  a\footnote{b}
  \stoptext

If page is set to anything different than no in \setupinteractionscreen,
focus=standard will not work (it will be used as focus=fit).

Could anyone confirm the issue or explain me what I’m doing wrong?

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: unwanted blank page

2023-11-20 Thread Pablo Rodriguez via ntg-context
On 11/19/23 23:34, madiazm.eo...@gmail.com wrote:
> sorry if i dont get your problem right understood, but i'm completely
> new to context.

Hi Miguel,

I’m afraid it isn’t entirely clear whether you intend to ask something
or not.

> I use a hack not to get the number not printed in the title page
> (though I define sectionblocks for keeping different numbering systems
> for the table of contents and the document)

Section blocks are intended for that.

Just a comment, if your cover (or title) page involves a one and only
single page, you may use makeups, such as in:

  \starttext
  \startmakeup[standard][pagestate=start]
  \dorecurse{25}{\input knuth}
  \stopmakeup
  \stoptext

My sample explicitly displays that makeups are intended for a single page.

Since actual content for that makeup would fit in six pages without the
makeup, it looks weird inside it.

> I use \setuppagenumbering[location=] for not getting the number
> printed and then I reset the page numbering for the next sections. I
> copy my code so that you know what I do.
> Sorry if it doesnt help

If you are showing your code to list members, fine.

Sorry, but if there is a question here, I’m afraid you need to be more
explicit asking your question.

Just some comments:

> %%
> %%% LOS BLOQUES %
> %%%

In a minimal sample, comments as the previous one don’t provide any clue
to understand your code or the issue you might be dealing with.

It is wiser to keep the sample to its minimal form.

>   \startsectionblock[portada]
>   \setuppagenumbering[location=]
>   \input{03_portadaEval.tex}%this is my title page

It is better to provide actual content than a file name.

BTW, if its contents cannot be in more than a single page, the approach
suggested above might be easier.


> \startfrontmatter[]

Empty brackets are not required here.

> \start
>   \setuplayout[re
>   \setupinterlinespace[.8ex]

I would say that this is extremely small even for an "x" to fit in.

Again, 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: learning about the grid

2023-11-20 Thread Pablo Rodriguez via ntg-context
On 11/19/23 23:17, madiazm.eo...@gmail.com wrote:
> Thanks, Pablo and Henning
>
> I suppose I am making a mistake with my setupinterlinearspace. My
> school asks for Times New Roman (I use termes) 12pt and
> onehalfspacing. In latex I used linespread{1.3} and so I supposed
> setting ConTeXt with setupinterlinearspace[1.3ex] was the right way.

Hi Miguel,

sorry, but I don’t have any idea what \linespread might mean for LaTeX
in plain English.

Some ConTeXt users may also use LaTeX too, but don’t rely on that.

> (I read somewhere that vertical spaces should be measured in ex and
> horizontal spaces in em; maybe it's not widely accepted).

As far as I know, em is defined by the width of the capital 'M' and ex
is defined by the height of the lowercase 'x'.

With your requirements, I think it is easier to set line spacing to one
and a half line with 1.5em, such as in:

  \setupbodyfont[termes]
  \starttext
  \the\exheight\\
  \the\dimexpr3\exheight\\
  \the\emwidth
  \the\dimexpr1.5\emwidth\\
  \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] Metapost label text surrounded by white border

2023-11-19 Thread Emanuel Han via ntg-context
I'd like to surround black text with a white 1mm thick border in a Metapost 
label. Here is my code, which doesn't draw the border at all and which draws 
the text in white instead of black (I'm using mkiv and mkxl version 2023.09.26 
18:19 on osx-arm6):

beginfig(1);
% Define the text and colors
string label_text;
label_text = "Your Text";
color text_color, border_color;
text_color = black;
border_color = white;
% Draw the label with the specified colors
label(textext(label_text) scaled 1.0, origin) withcolor text_color withpen 
pencircle scaled 1mm withcolor border_color;
endfig;___
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: learning about the grid

2023-11-19 Thread Pablo Rodriguez via ntg-context
On 11/19/23 13:27, Miguel Diaz wrote:
> [...]

Hi Miguel,

I don’t use the grid. This is also the default in ConTeXt.

I’m not sure whether I’m getting your point here.

See what the difference between not enabling the grid and enabling it:

  \showframe\showgrid
  \setupwhitespace[medium]
  \starttext
\input knuth
  \setuplayout[grid=yes]\page
\input knuth
  \stoptext

> 1. Why are the lines printed one over the other when grid=no? how do
> profis then use context without grid?

As said, ConTeXt is \setuplayout[grid=no] by default.

As far as I can recall it, the default value is
\setupinterlinespace[line=2.85ex].

I have just discovered that with values such as line=1.3ex,
\setuplayout[grid=yes] behaves very differently than with values such as
line=2ex (and above).

I mean, lines follow the grid when the text fits. See the difference with:

  \showframe\showgrid
  \setupinterlinespace[line=1.3ex]
  \starttext
\dorecurse{25}{asa aeo eau}
  \setuplayout[grid=yes]\page
\dorecurse{25}{asa aeo eau}
  \stoptext

According to https://wiki.contextgarden.net/Grid_typesetting (feel free
to improve the article), a way of solving this would be to wrap your
stuff inside:

  \startlinecorrection
  ...
  \stoplinecorrection

The problem is that your interline space is too small to prevent line
collapsing.

ex is the height of the lowercase 'x'. Are you sure that your school
doesn’t require 1.3em (height of capital 'M') as interline space instead?

You can get yourself the values:

  \starttext
  \the\exheight\\
  %\the \dimexpr1.3\exheight\\
  \the\emwidth
  \stoptext

The first line will give you 1ex is about 5.7pt (with the default font
used by ConTeXt). 1.3ex would be less than 6.75pt.

The value of 1em is the value of the font size. Default for ConTeXt is
12pt, so 1em has to be 12pt.

I think it is clear now that an interline space of 1.3ex calls for line
overlapping.

That being said, I don’t know why the grid avoids collapsing them (if
the person explicitly asks for this).

> 2. Is there a document where I can read how the grid is conceived to
> work for the many options in a simple way?

See the wiki article above. The mailing list is also a way of getting help.

One suggestion, please always provide a minimal working sample (that can
be copied, pasted and compiled automatically), when you ask for help.

How minimal? Well, they cannot lack essential parts to be compiled.
Other than that, they should only contain required content to reproduce
your issue.

This minimal working sample helps the one who reads to understand what
you are dealing with.

Otherwise, it is really hard to understand which kind of issue you might
be facing (consider that no one else may read your mind or be in front
of your computer).

I hope 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] unwanted blank page

2023-11-19 Thread Hans van der Meer via ntg-context
I should have a first page without pagenumber and pagenumbers on the subsequent ones.However the MWE here introduces an unwanted blank page from the call to \setuppagenumbering[state=start].And the \setuppagenumbering has to come after the \page, of course.Should I program otherwise?
yours sincerelydr. Hans van der Meer




% test pagenumbering start-stop\setuppapersize[A5][A5]\starttext\setuppagenumbering[state=stop]\ConTeXt\space\contextversion\blankThis is page 1 without pagenumber.\crlf\page\setuppagenumbering[state=start]This should be a page with pagenumber 2.\crlfBut the pagenumber is 3 instead after blank page 2.\stoptext

extrapage.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] wrong destination types?

2023-11-17 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setupinteraction[state=start, page=name, focus=standard]
  \starttext
  a\footnote{b}
  \stoptext

In \setupinteraction, "focus=standard" is ignored when I use "page=name".

I mean, link destinations are to the full page and they alter the page
view (when the document is not viewed as full page).

Sorry, I don’t have other way to say it. I should get (only named
destination value):

  7 0 obj
  <<
/D [ 6 0 R /XYZ 76.84458 722.7349 null ]
  >>
  endobj

And I’m getting:

  4 0 obj
  <<
/D [ 1 0 R /Fit ]
/S /GoTo
  >>
  endobj

Could anyone confirm the issue or explain me what I’m doing wrong?

BTW, "page=name" is required for references to named destinations in
external documents.

I get the same results with both LMTX and MkIV from current latest
(2023.09.26 18:19).

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] [ how to force hyphenation all words ]

2023-11-16 Thread vm via ntg-context

Is there a command in context to force every word in a text to
hyphenate? e.g to typeset a text with "ge-dach-ten-streep-jes"

Thanks
.Floris
___
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: named destinations in /GoToR

2023-11-14 Thread Pablo Rodriguez via ntg-context
On 11/13/23 23:30, Michal Vlasák wrote:
>> […]
>> With the previous code, the only destination reads in the PDF source:
>>
>>   5 0 obj
>>   <<
>> /D [ 0 /Fit ]
>> /F (whatever.pdf)
>> /S /GoToR
>>   >>
>>   endobj
>
> It seems that the default mode for outer (external file) references is
> the "auto" mode. This one seems to load the whatever.pdf file, check the
> named destinations and decide based on that.

Many thanks for your explanation, Michal.

I was totally ignorant of the page key in \setupinteraction.

It works fine now, with both the options you provided (and the patch,
many thanks for both).

I have accidentally discovered an issue in which users may run in an
uninteded ways.

If many destinations have the same identifier, only the first one is
generated.

Using the following sample:

  \setupinteraction[state=start,
focus=standard]
  \starttext
  \dorecurse{5}{\dorecurse{5}
{\chapter[\recurselevel]{Chapter}
  \section[sec-\recurselevel]{Section}}}
  \stoptext

Of course, this kind of identifiers have to be unique to be useful, but
I wonder whether they may be created adding something like:

  identifier
  identifier-1
  identifier-2
  identifier-3
  …
  identifier-n

This way (or a similar one) all named destinations are created.

Of course, when linking with \goto, \in, \at, \about, the right
identifier should be chosen.

With links within the same document, correcting the identifier (or the
link destination) is a trivial matter.

With links from external documents, there may be no option to generate
the external files again. If destinations are there, inspecting the
external document is an option.

Would it be possible that already given destination identifiers could
automatically have another indentifier to generate a new destination?

I hope my explanation is clear. Let me know if it isn’t and I try to
ellaborate it further (in a clearer way ).

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] named destinations in /GoToR

2023-11-13 Thread Pablo Rodriguez via ntg-context
Dear list,

imagine I have a PDF document (named "whatever.pdf") such as the one
generated from this source:

  \setupinteraction[state=start,
focus=standard]
  \starttext
  \dorecurse{5}
{\chapter[\recurselevel]{Chapter}
  \section[sec-\recurselevel]{Section}}
  \stoptext

This source only samples PDF documents not generated with ConTeXt. This
means that no .tuc file may be available and named destinations may
contain only digits.

Then I need to access some named destinations from a document such as:

  \setupinteraction[state=start,
focus=standard]
  \starttext
  \dorecurse{5}
{\goto{Chapter \recurselevel}[whatever.pdf::\recurselevel],
  \goto{section \recurselevel}[whatever.pdf::sec-\recurselevel]\par}
  \stoptext

Sorry, but after reading again lpdf-ano.mkxl I’m not sure whether I can
get named destinations (such as "/D (4)" or "/D (sec-3)") and how I
could get them.

With the previous code, the only destination reads in the PDF source:

  5 0 obj
  <<
/D [ 0 /Fit ]
/F (whatever.pdf)
/S /GoToR
  >>
  endobj

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: \doifemptyelse issue?

2023-11-13 Thread Pablo Rodriguez via ntg-context
On 11/13/23 13:10, Bruce Horrocks wrote:
> The following MWE gives "false false" instead of "false true". I'm
> sure this used to work (18 months or more ago!) as I found it when
> re-processing an old document.> [...]
> There is a work-around using \doiftext instead as that seems to work
> okay with recalled dataset values but I thought I'd raise it.
Hi Bruce,

some time ago Wolfgang explained
(https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/message/7OO5P34S56RGR5G3K7LXS6DTZWAJGUDZ/):

> \doifempty(else) doesn't expand the argument and any argument counts as
> not empty. To satisfy the command you can expand the first argument
> (\normalexpanded) or you use \doifnothing(else) which expands the argument.

I don’t know whether is what is preveiting your test here, but
\doifnothingelse seems to work fine with your sample.

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: hard clipping in ConTeXt?

2023-11-13 Thread Pablo Rodriguez via ntg-context
On 11/11/23 11:02, Hans Hagen via ntg-context wrote:
> On 11/10/2023 6:17 PM, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> Is there any way to have a hard clipping in ConTeXt?
>>
>> I mean, that only the contents of the clipped section is added to the
>> resulting PDF document?
>
> one has to render a document (page stream) in order to wee what end up
> where .. a viewer has that info so it can decide to act upon it (apart
> from some gambling with words clipped in the middle of a character)
>
> this is not something for context to provide (it would mean keeping
> track of what gets clipped, and then compensating for it because it can
> still contribute to placement of following stuff, and then how about
> half clipped stuff)

Many thanks for your reply, Hans.

Now it is clear to me that what I asked is too complex to be achieved
with ConTeXt (since it is mainly outside its scope).

> if i had a lifespan of 1000 years or were on a boring trip to another
> planet it might make a nice (although pointless) challenge to keep me
> occupied

From the user perspective, it is important to know that the full page is
included in the document (which may lead to unintended consequences).

I have accidentally discovered this myself the other day and I’m going
to check the wiki to add this information (if not included).

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] placing \externalfigure

2023-11-12 Thread Hans van der Meer via ntg-context
In placing \externalfigure[file] I observe the figure is placed with its bottom 
on the baseline, thus:

[externalfigure]
--- baseline

I looked into the option list of setupexternalfigure but could not find one 
whereby the location with respect to the baseline is either top, bottom or 
center.
Such an option might not exist and then I must program around it. But I prefer 
to use something that is already there and fits my needs.

yours sincerely
dr. Hans van der Meer



___
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: hard clipping in ConTeXt?

2023-11-11 Thread Hans Hagen via ntg-context

On 11/10/2023 6:17 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \setuplayout[page]
   \starttext
 \clip[hoffset=5mm, voffset=5mm, width=15mm, height=15mm]
 {\externalfigure[xml-mkiv.pdf]}
   \stopnotmode
   \stoptext

Using PDF.js (from current Firefox), xpdf, Evince, mupdf-gl, the viewer
is able to find "dealing", altough it cannot be displayed.

Okular and Sumatra (with Wine in Linux) are not able to find "dealing".

Is there any way to have a hard clipping in ConTeXt?

I mean, that only the contents of the clipped section is added to the
resulting PDF document?


one has to render a document (page stream) in order to wee what end up 
where .. a viewer has that info so it can decide to act upon it (apart 
from some gambling with words clipped in the middle of a character)


this is not something for context to provide (it would mean keeping 
track of what gets clipped, and then compensating for it because it can 
still contribute to placement of following stuff, and then how about 
half clipped stuff)


if i had a lifespan of 1000 years or were on a boring trip to another 
planet it might make a nice (although pointless) challenge to keep me 
occupied


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] hard clipping in ConTeXt?

2023-11-10 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setuplayout[page]
  \starttext
\clip[hoffset=5mm, voffset=5mm, width=15mm, height=15mm]
{\externalfigure[xml-mkiv.pdf]}
  \stopnotmode
  \stoptext

Using PDF.js (from current Firefox), xpdf, Evince, mupdf-gl, the viewer
is able to find "dealing", altough it cannot be displayed.

Okular and Sumatra (with Wine in Linux) are not able to find "dealing".

Is there any way to have a hard clipping in ConTeXt?

I mean, that only the contents of the clipped section is added to the
resulting PDF document?

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: XRechnung

2023-11-10 Thread Pablo Rodriguez via ntg-context
On 11/10/23 11:29, Henning Hraban Ramm wrote:
> Am 10.11.23 um 09:37 schrieb juh+ntg-context--- via ntg-context:
>> Hi,
>>
>> does anyone produce the XML-based invoice called XRechnung with ConTeXt?
>> I don't know if XRechnung is the european name or only used in Germany?
>
> In German it’s ZUGFeRD, the international name is Factur-X:
> https://www.pdf-tools.com/pdf-knowledge/zugferd-standard-electronic-invoices/

According to https://www.ferd-net.de/standards/zugferd/, they may even
be two different things (but I haven’t checked it).

> I always wanted to implement it, but never actually tried.
> It’s based on PDF/A, and I’m not sure about the proper workflow to get that.

Someone told some time ago that https://github.com/speedata/publisher
implements ZugFeRD. Again, no idea how or to which extent.

https://zugferd.github.io/ provides more info. Version 2 of ZUGFeRD
seems to be Factur-X (according to them).

If you allow me the pun (as a foreigner and non-native speaker), the
name seems to be too near to something like »Zug-Pferd« (I know it is
nonsense in German, but ZUGFeRD seems the name for an act or a
regulation [which German-speaking countries love to do]).

Just in case it might help (for the links),

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] XRechnung

2023-11-10 Thread juh+ntg-context--- via ntg-context

Hi,

does anyone produce the XML-based invoice called XRechnung with ConTeXt? 
I don't know if XRechnung is the european name or only used in Germany?


juh

___
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] \xmlinclusion?

2023-11-09 Thread Hans van der Meer via ntg-context
I cannot get \xmlinclusion working. Below an MWE with its output. What I am missing here or is \xmlinclusion not ok?\startxmlsetups demo	\xmlsetsetup{#1}{		root|test	}{demo:*}\stopxmlsetups\xmlregisterdocumentsetup{demo}{demo}\startxmlsetups demo:root	\blank{\bf Start test}\crlf	\string\xmlinclusion\{\#1\} ===> "\xmlinclusion{#1}"\crlf	\xmlflush{#1}\crlf	{\bf End test}\blank\stopxmlsetups\startxmlsetups demo:test	\xmlflush{#1}\stopxmlsetups\starttext\currentdate-\currenttime\quad\ConTeXt-version=\contextversion\blankThe following text is on page 52 of xml-mkiv.pdf:\crlf\type{\xmlinclusion{...}}\crlfreturns the file where the node comes from\blankFollows the test of this claim:\xmlprocessfile{demo}{demo.xml}{}\blank\typefile{demo.xml}\stoptext	node TEST

xml-inclusion.pdf
Description: Adobe PDF document

met vriendelijke groet,dr. Hans van der MeerBurgemeester Rijnderslaan 244 ingang D1185 MC Amstelveentel. 020 6452701 / 06 53743629




___
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: [ metapost -> svg ]

2023-11-07 Thread vm via ntg-context




On 07/11/2023 14:54, Lutz Haseloff wrote:


mutool convert -o metapost.svg -O text=path metapost.pdf

Hope it helps a little


yes, mutool was the key to remember.
thanks!

.F
___
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 problem - labels missing from the main diagram on the Page Layout page

2023-11-05 Thread peter.hopcroft--- via ntg-context
I see this problem on my iPad: Safari and Orion browsers. 

I do not see this problem on my mac: Safari and Orion browsers. 

Peter

> On 6/11/2023, at 8:19 AM, Henning Hraban Ramm  wrote:
> 
> Am 05.11.23 um 19:11 schrieb Bruce Horrocks:
>> When I go to the page layout page on the Contextgarden wiki
>>   <https://wiki.contextgarden.net/Page_Layout>
>> the "typesetting areas" diagram is missing its text labels. If I click on 
>> the diagram the Wiki takes me to the underlying layout.svg file and then I 
>> /do/ see the labels.
>> This happens in both Safari and Firefox.
>> Any suggestions as to what needs to be changed to get the diagram to display 
>> correctly?
> 
> Probably a problem on your side – works for me with Firefox and Chrome based 
> browsers. And I’ve no clue which setting would influence that.
> 
> Web developer tools as well as Inkscape show that there’s no real text in the 
> SVG, just paths.
> 
> 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: command to process CSV file (database module)

2023-11-05 Thread Pablo Rodriguez via ntg-context
On 11/5/23 13:56, Pablo Rodriguez via ntg-context wrote:
> [...]
> I get an error about an unexpected symbol near "\" in the line of
> "\processdatabasefile".
>
> Could anyone enlighten me about what I am missing here?

Replying to myself, thanks to the wiki
(https://wiki.contextgarden.net/Commands_with_optional_arguments).

It seems that the command has to be defined as unexpanded, such as in:

  \setupinteraction[state=start]
  \setupattachments[method=hidden]
  \usemodule[database]

  \starttext

  \unexpanded\def\ItemContents#1#2#3{\doiftext{#2}
{\item {\em #1}\attachment[file=#2, name=\currentitemnumber-#2]%
  \doiftext{#3}{ (also available at #3)}}}

  \defineseparatedlist
 [test]
 [separator={,},
  quotechar={"},
  before={\startitemize[n]},after={\stopitemize},
  first={\ItemContents},last={.},
  left={\{},right={\}}]

  \processdatabasefile[test][context-documents.csv]

  \stoptext

It is not clear for me why is this needed, but it might be one of the
many aspects of expansion that average users cannot understand 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] [ metapost -> svg ]

2023-11-05 Thread vm via ntg-context



With the latest lmtx installed, what would be the correct cli command to 
generate a svg outputfile from a metapost source?


.Floris
___
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] command to process CSV file (database module)

2023-11-05 Thread Pablo Rodriguez via ntg-context
Dear list,

These are the following first four lines of a CSV file:

,,
"About \LuaTeX\ and
\ConTeXt","about.pdf","https://www.pragma-ade.com/general/manuals/about.pdf;
"l2r, r2l: A Few
Tips","bidi.pdf","https://www.pragma-ade.com/general/manuals/bidi.pdf;
"Flowcharts","charts-mkiv.pdf",

Faking a command such as \cA, \cB and \cC (for contents of columns A, B
or C) I would like to create a source document with an enumeration that
contains:

  \doiftext{\cB}
{\item {\em\cA}\attachment[file=\cB]%
  \doiftext{\cC}{ (also available at \cC)}.}

I would like to do that with the "database" module.

So far I have adapted the itemize environment, but I don't get the
contents for items right:

  \usemodule[database]

  \starttext

  \def\ItemContents#1#2#3{\doiftext{#2}
{\item {\em #1}\attachment[file=#2]%
  \doiftext{#3}{ (also available at #3)}.}}

  \defineseparatedlist
 [test]
 [separator={,}, % tab
  quotechar={"}, % tab
  before={\startitemize[n]},after={\stopitemize},
  first={\ItemContents},last={.},
  left={\{},right={\}}]

  \processdatabasefile[test][context-documents.csv]

  \stoptext

I get an error about an unexpected symbol near "\" in the line of
"\processdatabasefile".

Could anyone enlighten me about what I am missing here?

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: How to encircle text?

2023-11-05 Thread Pablo Rodriguez via ntg-context
On 11/5/23 12:59, anton.chig...@mail.com wrote:
> Wow!
> This certainly is not the noobie version!
> All I wanted was to put a circle around a letter
> for emphasis.

Anton,

it works as you intend:

  \starttext
  \startusableMPgraphic{MetaCirc}
   draw fullcircle
   xyscaled
  (OverlayWidth-OverlayLineWidth,OverlayHeight-OverlayLineWidth)
   withpen pencircle scaled OverlayLineWidth
   withcolor OverlayColor ;
  \stopusableMPgraphic

  \defineoverlay[MetaCirc][\useMPgraphic{MetaCirc}]

  a\dontleavehmode\framed
 [background=MetaCirc,
  backgroundcolor=red,
  frame=off,
  location=bottom,
  rulethickness=1pt]
 {b}c
  \stoptext

Just in case it helps,

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: How to encircle text?

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

On 11/5/2023 7:23 AM, anton.chig...@mail.com wrote:

I want to use \bigcirc to encircle text.
Is there a way to do it.

if you're wiling to compensate for its depth:

\defineoverlay
  [BigCirc]
  [{\scale
  [width=\overlaywidth]
  {\setbox0\hpack{\bigcirc}\raise\dp0\box0}}]

\framed
  [background=BigCirc,
 % frame=off,
   width=3cm,
   height=3cm]
  {test}

but bigcirc isn't meant for that

\startusableMPgraphic{MetaCirc}
draw fullcircle
xyscaled 
(OverlayWidth-OverlayLineWidth,OverlayHeight-OverlayLineWidth)

withpen pencircle scaled OverlayLineWidth
withcolor OverlayColor ;
\stopusableMPgraphic

\defineoverlay[MetaCirc][\useMPgraphic{MetaCirc}]

\framed
  [background=MetaCirc,
   backgroundcolor=red,
   frame=off,
   rulethickness=1pt]
  {test}

\framed
  [background=MetaCirc,
   backgroundcolor=blue,
   rulethickness=.5pt]
  {test}

is more flexibel in the end

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: Adobe Source Typescript With Design Sizes

2023-11-01 Thread Hans Hagen via ntg-context

On 10/31/2023 8:18 PM, Vincent Hennebert wrote:

Hello there,

I had mentioned this on a thread some (long) time ago, finally got 
around to finishing a first version of a typescript with the Adobe 
Source font family, in all its weight alternatives and design sizes (the 
latter being available in the Serif style only).


Comments welcome. If it looks good I can upload it to the wiki, on the 
Typescripts_examples page I guess.


I have no tiem now to figure out this (somewhat excessive) amount of 
fonts - hopefully we will not end up in a world where all fonts have 
many weights which makes it easier for designers not to make choices and 
delegate that to users instead. That said,


- attached a different approach

- in your variant you can put the lua in the lfg file (at the top) and 
then add \loadfontgoodies[...] before where the functions are used


I'm not sure if we can talk of design sizes here. It's more about 
'usage' because a display vs subhead vs ... variant is not about mixing 
depending on scale (e.g. using display for 20 pt in a 15 pt setup versus 
using scaled regular for 20pt and then display 20pt for e.g. a title 
page or 50pt on posters).



(I have Questions For the Experts further down...)


maybe a side effect of not defining a math font


About Adobe Source
==

The fonts are available on GitHub [1]. They are the descendants of the 
Source {Serif,Sans,Code} Pro fonts described in the type-imp-source.mkiv 
typescript available in the ConTeXt distribution. Due to major changes, 
Serif Pro was renamed into Serif 4 in, well, its version 4 [2] (that’s 
the version that introduces design sizes, a.k.a. optical sizes), and 
Sans Pro was renamed into Sans 3 [3].


[1] https://github.com/adobe-fonts/
[2] https://github.com/adobe-fonts/source-serif/releases/tag/4.004R
[3] https://github.com/adobe-fonts/source-sans/issues/192


Usage
=

Short version: store the attached typescript and its helper Lua files 
somewhere on your file system where ConTeXt will find them ($HOME/texmf 
for example), then use in your document:


     \setupbodyfont[adobesource]

Long version: The default typescript name is adobesource (also available 
as adobesource-regular) and has design sizes enabled.


Each weight is also available: adobesource-extralight, 
adobesource-light, etc., all the way to adobesource-black. There is also 
a medium weight, that selects the regular versions of Serif and Sans, 
but the medium version of Mono (just slightly bolder than the regular 
one, presumably for better on-screen rendering in terminals).


Design sizes can be disabled by adding -nodesignsize- to the typescript 
name: adobesource-nodesignsize-extralight, etc.


Finally, I thought it would be cool to over-engineer the typescript a 
little bit and provide direct access to the design sizes (in case one 
would want a narrower version for body text, or a bolder and more 
expanded version for titles, etc.). Here they are, again in all their 
weights: adobesource-caption-extralight, adobesource-smtext-light, 
adobesource-subhead, adobesource-display-bold, etc. The ‘regular’ design 
size is accessed by simply using adobesource-nodesignsize.



Questions For the Experts
=

To avoid a gigantic typescript file with a lot of duplication, I 
offloaded the font filename calculation to a Lua function (see attached 
adobesource.lua). I initially wanted to put the Lua code inside the 
typescript, but then I had all sorts of weird Lua compilation errors. 
The very same code works fine when included in a normal document though. 
Could it be that typescripts are processed in some special mode that 
doesn’t like Lua syntax? As a workaround, I put the code in an external 
file and require it from inside the typescript.


In the goodies file, I use what I believe is the largest possible font 
size that can be used in ConTeXt (16,383pt) to select the Display design 
size. Otherwise, text above that size will fall back to the default, 
regular design size.


Now, since I use the goodies file only when design sizes are enabled, I 
thought I could make it more robust by using AdobeSource4Display as a 
default, that is, for any size above 16.5pt. However, if I mix design 
sizes enabled and disabled in a document, the disabled one seems to be 
using the goodies file even though it’s not mentioned in the typescript. 
Any idea of why? For example:


\usetypescriptfile[adobesource]
\usebodyfont[adobesource]
\setupbodyfont[adobesource-nodesignsize]
\starttext
This text is typeset in Display when Regular should be used.

\switchtobodyfont[adobesource]
This text is typeset in Regular with design sizes enabled.
\stoptext


What’s Next
===

* A harmonious-looking companion math font.
* A harmonious-looking companion math font that uses glyphs from Adobe 
Serif 4 when available.



Thanks,
Vincent

___
If your question

[NTG-context] Re: Inline mathematics is stretched

2023-10-30 Thread Hans Hagen via ntg-context

On 10/30/2023 8:05 AM, Mia Bikey wrote:

Yes well of course no issue arises if I just change the whole font.
But I wanted to keep using the mono font thus reporting issues with it.

In that case you have to go for flushleft

\setupalign[verytolerant,nothyphenated,flushleft]

because otherwise tex will try to come to the best solution by using 
stretch and shrink and therefore stretch and shrink in interatom spacing 
wins over little or none in mono spacing


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: Inline mathematics is stretched

2023-10-29 Thread Hans Hagen via ntg-context

On 10/29/2023 1:33 PM, Mia Bikey wrote:

Hi,
I was using \setupalign[verytolerant,stretch] so that the mono font does 
not go inside the right inline image but after using that command the 
inline math seems to spread.

how about just using this

\setupbodyfont[concrete]

\starttext

When $a, b, c$ are given, two values of $x$ and no more can be found 
which shall make the function $ax^2 + bx + c$ vanish; that is, the 
equation always has two roots and no more. The roots may be equal or 
unequal, real or imaginary, according to circumstances.


\stoptext

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: Double sided pages leave a thin white line on the right side

2023-10-28 Thread Pablo Rodriguez via ntg-context
On 10/28/23 16:26, Mia Bikey wrote:
> Well I was using firefox to open my pdf and did not check it on anything
> else.
> I opened the pdf in sumatra, adobe, microsoft edge and yeah there is no
> white line.
> Seems like it is a firefox issue then.

Hi Mia,

opening your attachment with Firefox 119 (and the version of PDF.js that
comes with it) on Linux, I was not able to find any white line in your
attachment or in the output from the you source (with zoom set to 400%).

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: Testing whether an XML attribute exists

2023-10-17 Thread Hans van der Meer via ntg-context
But there is also
\ifxmlattempty{#1}{prefix} .. \else .. \fi

yours sincerely
dr. Hans van der Meer



> On 17 Oct 2023, at 13:37, Taco Hoekwater  wrote:
> 
> 
> 
>> On 17 Oct 2023, at 12:43, Michael Guravage  
>> wrote:
>> 
>> Hi,
>> 
>> I am typesetting a very simple address list whose source is written in XML.  
>> Typesetting choices need to be made dependent on the presence of various 
>> attributes; consider the following  element. 
>> 
>> 
>> 
>> If the prefix attribute exists I'l like the name to appear as, e.g. 'Boer, 
>> den."  The several XML attribute testing functions in the XML manual appear 
>> to discriminate on an attribute's value. I tried  \xmldoifnotatt in an 
>> attempt to say, "TRUE if prefix does not match an empty string",  since I am 
>> not interested in the attribute's value but only whether or not it exists. 
>> The code below doesn't work. If someone who knows why it doesn't work would 
>> enlighten my ignorance I would be most grateful. A brief explanation and 
>> example of \xmldoifatt, \xmldoifnotatt, and \xmldoifelseatt would be 
>> exceedingly helpful.
>> 
>> \startxmlsetups xml:list:family
>>  {\bf \xmlatt{#1}{surname} \xmldoifnotatt{#1, prefix, ''} {, 
>> \xmlatt{#1}{prefix}}} \crlf
> 
> 
> Syntax error there, you need:
> 
>  \xmldoifnotatt{#1}{prefix}{}{, \xmlatt{#1}{prefix}}
> 
> Best wishes,
> Taco
> ___
> 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: colors for links

2023-10-14 Thread Hans Hagen via ntg-context

On 10/14/2023 7:55 PM, Pablo Rodriguez wrote:

On 10/14/23 14:19, Hans Hagen via ntg-context wrote:

On 10/12/2023 3:14 PM, Pablo Rodriguez wrote:

[…]
I see that the directive for link borders only allows one color for
links per document.


Many thanks for your reply, Hans.

I apologize for my poor explanation of the issue.

Wanting to give a minimal sample, I didn’t add my full interaction setup:

   \setupinteraction
 [state=start,
  style=,
  color=,
  contrastcolor=,
  display=new,
  focus=standard]
   \enabledirectives
 [references.border=darkgreen]

I wanted to be able to setup the interactive link color only, not to add
any color to the link text. This would be similar to the following object:

   <<
 /Type /Annot
 /A 3 0 R
 /Border 1 0 R
 /C [ 0 .6 0 ]
 /F 4
 /Subtype /Link
 /Rect [ 11.148045 64.22294 29.080798 78.65044 ]
   >>

The "references.border" directive sets all /C keys in /Link objects to
one single color in the same document.


indeed, because these objects get creates when apage is shipped out and 
we don't let additional color (or style for tham matter) information 
travel with the link info



I may edit a single file by hand (such as in the attachment), but I
won’t be able to do that in a larger PDF source.

>

Drawing something in the document (avoiding the interactive link border)
is not the solution here.


you mentioned that you use it for checking so then rendered different 
whatever styling is reasonable; once you render a final version the 
single color will do



Would it be possible that \setupinteraction could have a bordercolor
key, such as the color one?


All is possible but not all should be done, especially not features that
mostly serve a few viewers (like acrobat) and don't really relate to
typesetting.


Interaction is key in cases such as the one described, because this kind
of interaction avoids two things (or a twofold situation):

* Link borders won’t be printed in paper and they’ll be displayed on screen.

* This kind of interactivity avoids having to provide recipients with
two versions of pretty much the same document (screen and print version).


it's one of the nice things about tex that one can easily generate two 
versions; for screen i'd even make a landscape instead of portrait 
version and maybe for phones yet another



Having to deal with more than one version of almost any documents tends
to cause confussion to most people and it eventually leads to errors.

Sorry, but I have to keep resulting PDF documents as simple as possible.
For their recipients, but this also helps me.


but one color will do then in the final document ... multiple for 
different links / targets is also confusing



Of course, one clear objection to my approach is that PDFium (the PDF
viewer in Chrome/Edge) doesn’t display annotation borders.


indeed


There are a handful of PDF features that PDFium doesn’t support
(attachments and electronic signatures, to name other two).


indeed ... and after decades of pdf that tells a story ... maybe no one 
using or programming open source viewers care much about it and when 
different viewers also behave different we end up with endless 
adaptation and patching which is no fun either



In that case, many people understand that PDF (the format itself) is
“PDF according to Google” (or “PDF according to Microsoft”, since PDF is
opened with Edge by default since Win7).


hard to say what is default ... esp when bugs become/became features ...


I experience this at work every single day and I’m tired to tell people
“please, use Acrobat to display PDF documents and make it your default
PDF viewer” (otherwise, it is impossible to know whether a PDF document
is electronically signed or not [among other features]).


i admit that i never nbother about signed documents; the last time i got 
some link to an adobe server telling me that i had to sign something i 
just removed the mail (who knows what they do with your data)



Your workaround works best when you have only one medium to handle the
document (only displayed on screen). Since it also avoids annotations,
it will work with all (or almost all) PDF viewers. Even if a document
doesn’t need to be printed now, it doesn’t mean it won’t be needed to
print it in the future (so this might give issues in the long run).


yes but you wanted it for checking, so then a 'temporary' rendering as 
mentioned can work ok; it can even be more visible if you use think borders



On the general issue here [PDF features only implemented by Acrobat and
few viewers], it is a fact Acrobat is only one PDF viewer. But it can be
considered the «de facto» standard implementation of the format.


with the user interface becoming more horrible every i try to avoid the 
reader (sumatra works just fine)


(viewers in broswers or mail agents can also be weird: currently my 
thunderbird shows white text on black pages, if at all)


[NTG-context] Re: colors for links

2023-10-14 Thread Hans Hagen via ntg-context

On 10/12/2023 3:14 PM, Pablo Rodriguez wrote:

Hi Hans,

I have the following source, which tries to resemble three kinds of links:

 \setupinteraction[state=start, style=, focus=standard]

 \def\inone#1{%
   \start\setupinteraction[color=darkgreen]%
   \enabledirectives[references.border=darkgreen]%
   \goto{#1}[url(#1)]\stop}
 \def\intwo#1{%
   \start\setupinteraction[color=darkred]%
   \enabledirectives[references.border=darkred]%
   \goto{#1}[url(#1)]\stop}
 \def\inthree#1{%
   \start\setupinteraction[color=darkblue]%
   \enabledirectives[references.border=darkblue]%
   \goto{#1}[url(#1)]\stop}

 \starttext
 \startTEXpage[offset=1dk, align=middle]
 \inone{one}\blank
 \intwo{two}\blank
 \inthree{three}\blank
 \stopTEXpage
 \chapter[one]{First chapter}
 \chapter[two]{Second chapter}
 \chapter[three]{Second chapter}
 \stoptext

I see that the directive for link borders only allows one color for
links per document.

In my real-world documents, I need to make three different border links:
for destinations inside the document (/GoTo), for destinations in other
documents (/GoToR or /GoToE) and for external destinations (/URI).

With the current document I write now, I have over a hundred links in
twenty pages. Being able to visually distinguish each link helps
interaction with the document (reading or even writing it).

Would it be possible that \setupinteraction could have a bordercolor
key, such as the color one?
All is possible but not all should be done, especially not features that 
mostly serve a few viewers (like acrobat) and don't really relate to 
typesetting.


That said, we can add some styling. First of all, you can use a bit of 
abstraction


\defineinteraction[one]  [color=darkgreen,style=\underbar]
\defineinteraction[two]  [color=darkred,  style=\underbar]
\defineinteraction[three][color=darkblue, style=\underbar]

\def\inone#1{%
  \start\setinteraction[one]%
  \goto{#1}[url(#1)]\stop}
\def\intwo#1{%
  \start\setinteraction[two]%
  \goto{#1}[url(#1)]\stop}
\def\inthree#1{%
  \start\setinteraction[three]%
  \goto{#1}[url(#1)]\stop}

which already might help you. To make it easier I'll add \namedgoto do 
that one can say:


\def\inone  #1{\namedgoto[#1]{#1}[url(#1)]}
\def\intwo  #1{\namedgoto[#1]{#1}[url(#1)]}
\def\inthree#1{\namedgoto[#1]{#1}[url(#1)]}

I'll also add \outline and \outlined

\defineinteraction[one]  [color=darkgreen,style=\outlined]%
\defineinteraction[two]  [color=darkred,  style=\outline]%
\defineinteraction[three][color=darkblue, style=\outlined]%

which of course you then will wikify ...

I attached an example but there is no upload (will happen when the build 
is running again because I can't make osx bins 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
-


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: regular online meetup

2023-10-11 Thread Hans Hagen via ntg-context

On 10/11/2023 11:28 AM, Bruce Horrocks wrote:

I'd quite like to discuss this if people don't mind.
<https://www.mail-archive.com/ntg-context@ntg.nl/msg105880.html>

There's a PDF attached which illustrates the issue.

exploring / solutions to this has been moved off list

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: How can I use a variable for a MetaPost coordinate ?

2023-10-05 Thread peter.hopcroft--- via ntg-context
Yes, indeed. The metafun manual also explains things about overlays and layers 
I hadn't known. I'd previously ignored that manual.

Thank you,
Peter

> On 5/10/2023, at 7:05 PM, Thomas A. Schmitz  
> wrote:
> 
> Have a look at chapter 6.4 of the metafun manual. You need StartPage ... 
> StopPage in your MPcode, then you can knock yourself out by using variables 
> such as PaperHeight or TextHeight and do all sorts of calculations.
> 
> All best
> 
> Thomas
> 
> On 10/5/23 05:54, peter.hopcroft--- via ntg-context wrote:
>> Hello list, I want to draw lines on a page. I want to pass my line 
>> coordinates as a percent of \width or \textheight, rather than as 
>> millimetres. So that if I change the page size I don't need to change the 
>> coordinates. The MWE below compiles but the pdf does not have any lines 
>> drawn on it. Is there a way of doing calculations on the coordinates for the 
>> draw using ConTexT variables like \textheight? Thank you, Peter Hopcroft
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
> 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 : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
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: checkbox in fields show the word yes

2023-10-05 Thread juh via ntg-context
Hi,

three years later I would like to hint to this thread again and ask if
there is hope that checkboxes will work better in Acrobat any time soon. 

Am Fri, Dec 11, 2020 at 06:28:36PM +0100 schrieb Hans Hagen:
> On 12/11/2020 6:13 PM, Andres Conrado Montoya wrote:
> > Firefox doesn't show the "yes", nor Acrobat X, but SumatraPDF does. I
> > modified your definition as:
> > 
> > \definefield[test][check][cbox][][]
> > 
> > And now the "yes" doesn't appear. However, I don't know how this affects
> > the functionality of the form.
> these symbols (esp how deafults are handles) has alwaye been a bit of a mess
> in acrobat (read: different per version) and relates to appearance streams
> and such (when a form is made in acrobat these streams get added, it could
> even be some dingbat kicking in or being vectorized or ... seen all kind of
> variants) ... officially a rendering should listen to some keys that relate
> to it but this is not always the case
> 
> (part of the problem is, i think, that esp for check fields a bugs or
> behaviour  has become a feature which makes it kin dof inconsisten twith the
> rest of the widgets .. it's even worse when one uses parent / child across
> pages ... it hasn;t helped that hardly any viewer supported it which in turn
> means no feedback)
> 
> (in lmtx iu could probably generate appearance streams but i'll only do that
> when i have an application for these widgets so that i can test it)
> 
> 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 / 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
> ___

-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] How can I use a variable for a MetaPost coordinate ?

2023-10-04 Thread peter.hopcroft--- via ntg-context
Hello list,

I want to draw lines on a page. I want to pass my line coordinates as a percent 
of \width or \textheight, rather than as millimetres. So that if I change the 
page size I don't need to change the coordinates. 

The MWE below compiles but the pdf does not have any lines drawn on it. 

Is there a way of doing calculations on the coordinates for the draw using 
ConTexT variables like \textheight?

Thank you,
Peter Hopcroft

--

\starttext
Some text

\startMPcode
pickup pensquare scaled 1pt;
draw (0mm,0mm)--(0mm,\textheight) withcolor red 
\stopMPcode

More text

\startMPcode
pickup pensquare scaled 1pt;
draw (0mm,0mm)--(0mm,50mm) scaled \numexpr\textheight/50mm\relax
\stopMPcode

\stoptext


--

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

maillist : {listname} / https://mailman.ntg.nl/mailman3/lists/{list_id}
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: Chemistry in LMTX

2023-10-02 Thread Alan Braslau via ntg-context
On Sun, 1 Oct 2023 10:49:34 +0200
Henning Hraban Ramm  wrote:

> >> chem-str.lua seems to be an updated version by Alan & Hans
> >>
> >> Did I miss something?  
> > 
> > work in progress ... i'm working on that (part of the math upgrade)
> > so best wait till we're stable  
> 
> Ok, thank you

The current code is not very broken - I just used it extensively in a
book that was published. There are many quarks in its conception,
dating from the original MKII model.

Alan
___
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: bibliography questions

2023-10-02 Thread Alan Braslau via ntg-context
On Mon, 2 Oct 2023 13:13:52 +0200
Henning Hraban Ramm  wrote:

> Consider:
> @Book {rattenhka,
> author = "Bettina von Arnim and Gisela von Arnim",
> title = "Das Leben der Hochgräfin Gritta von Rattenzuhausbeiuns",
> …
> }
> 
> The authors are usually given as “Bettina and Gisela von Arnim”
> (mother and daughter; similar “Jacob and Wilhelm Grimm” as brothers
> or “Bettina and Achim von Arnim” as a couple) – is there a good
> solution for related authors?

Multiple authors should be treated as multiple authors. That they are
related is not and should not be a consideration in citing works. At
least this is the practice that I know of for academic texts.

You can cheat and try to define one author with a combined first name,
like
author={Eames, Ray & Earl},
but I don't know how that parses as I have never tried it; "and" is a
reserved token used to define multiple authors. I wouldn't do it as I
can think of many examples (Bjaer & Bjaer) where we give both credit,
individually.

Alan
___
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: Offline documentations

2023-10-02 Thread Hans van der Meer via ntg-context
I find offline documentation in the installed ConteXt files in 
ConTeXt/tex/texmf-context/doc/context/documents/general/manuals 
with more in neighboring directories. Hope this helps.

met vriendelijke groet,
dr. Hans van der Meer
Burgemeester Rijnderslaan 244 ingang D
1185 MC Amstelveen
tel. 020 6452701 / 06 53743629

> On 2 Oct 2023, at 10:55, Henning Hraban Ramm  wrote:
> 
> 
> __

___
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: wiki update: Modules

2023-10-01 Thread Jeong Dal via ntg-context
Dear Hraban,

When I wrote a class material for Linear Algebra, it is nice to use \pmatrix 
and \bmatrix etc. 
But, for example, to write a result matrix of the product of two matrices, I 
need to calculate it somewhere and copy it to my text. Hence, I tried to use 
Lua to handle it in the ConTeXt. And, it is nicely working.
During the process, I asked many questions to Hans and he gladly helped me.
It is the first time for me to code using Lua, so my coding was clumsy. 
However,  Hans corrected it to be usable in ConTeXt even though he is very very 
busy in many things.
And, he made it a module and put it in the list.
Thanks Hans.

Finally I finished several chapters on Linear Algebra using that code.
It was many years ago.
Here is a document of it. I confirm that it is running well without any problem.

I hope that someone who wants to write an article on Linear Algebra use it.

Thanks for reading.

Best regards,

Dalyoung




matrixDoc.tex
Description: Binary data



> 2023. 10. 1. 오후 6:01, Henning Hraban Ramm  작성:
> 
> Am 01.10.23 um 05:51 schrieb Otared Kavian:
>> Hi Hraban,
>> Thank you for your updating of the modules stuff.
>> As far as I remember the matrix features are not related to any modules, but 
>> rather are part of LMTX. In nay case next week I will look at the page
>> https://wiki.contextgarden.net/Matrix_in_maths 
>> <https://wiki.contextgarden.net/Matrix_in_maths>
>> and verify that eveything on that page works fine and is up to date.
> 
> Thank you!
> 
> But there _is_ a matrix module (hey, I just looked through all this stuff!) 
> by Jeong Dalyoung & Hans; apparently it can do matrix calculations.
> 
> https://source.contextgarden.net/tex/context/modules/mkiv/m-matrix.mkiv
> 
> Hraban
> 
> ___
> 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] Finding the position of an image on the page.

2023-10-01 Thread peter.hopcroft--- via ntg-context


Hello list,

Can I find the position of an image on the page after I have placed the image 
with \externalfigure? 

For example, the top, left corner of the image might be 50 mm in from left side 
of page and 120 mm down from the top of the page.

I know I can use \getfiguredimensions to find information about the placed  
image, but it does  not give me the position of the image.

Thank you
Peter Hopcroft
___
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: Toggling the symbol for the zero-width joiner and related Unicode control characters

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

On 9/22/2023 3:51 PM, Hamid,Idris wrote:


-- Original Message --
 From "Hans Hagen" mailto:j.ha...@xs4all.nl>>
To "ntg-context@ntg.nl<mailto:ntg-context@ntg.nl>" 
mailto:ntg-context@ntg.nl>>
Date 9/22/2023 7:15:25 AM
Subject [NTG-context] Re: Toggling the symbol for the zero-width joiner and 
related Unicode control characters

** Caution: EXTERNAL Sender **

On 9/22/2023 2:39 PM, Hamid,Idris wrote:

b. we want all Unicode control symbols to be suppressed in final pdf output 
(for, e.g., printing).

they basically are unless some font features keeps them around which is
out of our control

irr it was you who wanted them to be wiped decades ago as some fonts
visualized them by default

Yes, that's exactly the point: Somewhere along the course of history, it became 
standard for Arabic-script fonts (and other cursive-script fonts as well) to 
include symbols for the control characters.

In typo-rep there is also

%D \starttyping
%D \definefontfeature[default][default][mode=node,formatters=strip]
%D \stoptyping

You included some notes about Khaled, so I guess he faced the same issue. His 
Amiri font displays the symbols by default, as do other Arabic fonts.

(It seems he never considered making it an opentype feature in the font itself, 
but since his focus is/was XeTeX/HB (HB is rather rigid and dictatorial) I 
guess that's not surprising.)


I admit that I don't follow what happens with xetex (they changed the 
rendere at some point indeed) not HB (I only notice that it gets updates 
frequently in the tex live repository which makes me wonder how one 
retains compatility unless one freezes). I actually kept the lib binding 
code that can use it around for your font testing (we wanted to see what 
uniscribe does), not sure if it still works.


Anyway, we're entering the bug cq. side effect becomes feature area 
here; just like yesterdays perfect bidi algorithm is todays less pefect 
one replaced by ...



But therein lies the problem: ConTeXt shows the rendering by default, and we 
need to turn it off. Since most non-Latin typography targets Uniscribe 
applications which allows for toggling, the font developers (commercial or 
free) don't have to concern themselves with this issue.


if context shows it then it is not a feature but hard coded shapes which 
is weird; how does one know what to 'remove' or not? And in what stage? 
If they are zero width it is simple to ignore them in the backend, if 
they have dimensions (w/h/d) then they contributed and wiping is tricky



Since Word rules the world, most font designers target it. Since Word provides 
for toggling the symbols -- needed for editing purposes -- there was no need 
for Arabic-script font designers to worry about the symbols showing up where 
they are not wanted.

(I suppose that InDesign behaves the same way.)


I don't know ... irr these dtp programs are more like "if you want this 
feature applied select a range of characters and apply it"



That's what was meant when I spoke of the continued effects of the WYSIWYG 
curse: It saved font designers from having to think much about this issue.


In some way it's also flaws in the open type approach. Basically that 
happens when application stuff becomes a standard and one forgets that 
it was (is) application driven. (And you haven't seen variable fonts and 
color fonts yet ... no pretty standards either.)



Not really -) This brings us to the point of consistency: For Arabic-script fonts, hard 
symbolic rendering of the Unicode control characters is the rule, not the exception. So 
not "an inconsistent mess" -- at least not as far as Arabic-script typography 
is concerned.


Funny rules ... but I'm not going top enable 'wipe' by default: after 
all, one gets what one deserves, nto what one likes (which can differ 
per day). But you can enable the wiping. We can of course ignore in the 
backend when zero width but then how to explain that they contributed to 
the ht/dp (unless we wipe these dimensions) ... all slow-downers



so you want to see soem zwj sumbol in a rendered text?

Only in verbatim/\type'd text where it is appropriate, even necessary. Thanks 
to Word/WYSIWYG, the rule is de facto, but it is not de jure -)

Ideally, Scintilla (Scite, Notepad++, etc.) should do the same, or provide a 
toggle, as MS Notepad does.

(Tangent: In terms of Unicode functionality, MS Notepad is still unrivalled, 
even in 2023!)

We agree that for final printed output it is not appropriate (except perhaps in 
a paper that discusses Unicode, fonts, etc., in which case it can be rendered 
using the figures or symbols mechanism -- or toggled as needed.)

so what is it now:

- for verbatim you can use almfixed and they show up (when they have a 
glyph)
- for other fonts if they have them they show up (unless gone in the 
process ot rendering)

- but you 

[NTG-context] Re: Toggling the symbol for the zero-width joiner and related Unicode control characters

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

On 9/22/2023 6:16 AM, Hamid,Idris wrote:



-- Original Message --
 From "Hans Hagen" mailto:j.ha...@xs4all.nl>>
To "Hamid,Idris" mailto:idris.ha...@colostate.edu>>; "mailing list 
for ConTeXt users" mailto:ntg-context@ntg.nl>>
Date 9/21/2023 3:29:22 PM
Subject Re: [NTG-context] Re: Toggling the symbol for the zero-width joiner and 
related Unicode control characters
   Many thanks, Hans. The method appears to work only for nbsp, not zwj etc. 
Here is the updated MWE:

===
\startTEXpage[offset=1em]
\disabletrackers[typesetters.directions]
\disabletrackers[typesetters.zwj]
\disabletrackers[typesetters.zwnj]
\disabletrackers[typesetters.nbsp]
\definedfont[almfixed at 14pt]
ZWJ: ‌
ZWNJ: ‍
NBSP:
\stopTEXpage
===

See attached, please advise.
joiners are part of replacement etc and can come and go ... they are
characters (we could visualize them but one never knows for sure if one
sees them)

nbsp are spaces and become glue that we can trace reliable in the node list

Many thanks. Ok, here is another MWE featuring a workaround using fallbacks:

==
\definefontfallback[nosymbols] [file:lmmono10-regular] [200C,200D] [force=yes]
\starttypescript [serif] [alm] [name]
 \definefontsynonym [Serif] [ArabicLatinSerif]
\stoptypescript
\starttypescript [mono] [alm] [name]
 \definefontsynonym [Mono]  [ArabicLatinMono]
\stoptypescript
\starttypescript [serif] [alm]
 \definefontsynonym [ArabicLatinSerif] [file:almfixed] % 
[fallbacks=nosymbols]
\stoptypescript
\starttypescript [mono] [alm]
 \definefontsynonym [ArabicLatinMono] [file:almfixed] [fallbacks=nosymbols]
\stoptypescript
\starttypescript [almfixed-nosymbols]
\definetypeface [\typescriptone] [rm] [serif] [alm] [default]
\definetypeface [\typescriptone] [tt] [mono] [alm] [default]
\stoptypescript
\usetypescript[almfixed-nosymbols]
\setupbodyfont[almfixed-nosymbols,12pt]
\startTEXpage[offset=1em]
\rm
ZWJ: ‌
ZWNJ: ‍
NBSP:
\tt
ZWJ: ‌
ZWNJ: ‍
NBSP:
\stopTEXpage
==

Under \rm we get the symbols, and under \tt they are suppressed. Of course it 
doesn't matter what fallback font one uses, as long as it has no 
control-character symbols.

1. Can this approach be generalized to get what we want, viz., a way to toggle 
the symbols?


given the inconsistency in what is or is not in a font the only way out 
is to have our own visualization (consistent across fonts) and even then 
it would add some mess because we're talking of a mix of characters that 
can have gone (as part of rendering) or are not characters at all but 
spacing


so, in that case only 'verbatim' is a candidate for visualization, not 
so much typeset text



2. \enabletrackers[typesetters.nbsp] gives a colored box, which is at least 
something.. But how can we get the NBSP symbol that's alerady in the font?


it's gone by that time ... the line break mmechanism uses glue, not 
characters



3. Ideally:
a. we want all Unicode control symbols to show up in verbatim or in \typebuffer 
(as in a text editor);


only there (with some non interfering rendering i guess) and even then 
it's probably an additonal pass over the node list



b. we want all Unicode control symbols to be suppressed in final pdf output 
(for, e.g., printing).


they basically are unless some font features keeps them around which is 
out of our control



But some fonts meant for printing have symbols for Unicode control chars -- 
that poses a challenge.


so an inconsistent mess not worth wasting time on (as this is hobbyism 
only fun can be a motivational factir)



And some fonts meant for verbatim/editing do not have symbols for the control 
chars -- that also poses a challenge.  AlmFixed, of course, has them.

Most minimally decent Arabic fonts have symbols for the Unicode control chars 
as default, including Scheherazade, Amiri, Uthmanic, and Noto Naskh Arabic -- 
all free fonts.

Industry workhorses like Linotype Lotus (Arabic) also have them.


i'm not interested in those .. can't afford them for playing around
purposes .. we only look into commercial fonts if we get a dozen 
unresticted copies for context developers



Uniscribe applications like Notepad/Word allow for toggling in a WYSIWYG 
context -- can't speak for HarfBuzz -- so there is no harm in having explicit 
symbols in the font.


sure, as long as there is no rendering ... they show the input


The upshot is that, for non-Latin scripts, some toggling capability in ConTeXt 
is important to have -- even inescapable for Arabic-script piblishing.


a bit subjectiev arguing -)


Perhaps others who use Arabic-script or Indic, etc., can chime in.. Am hopeful 
that we can figure something out!

sore, but not with 'instant priority' (unless it is some project)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 4

[NTG-context] Re: stackrel in context?

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

On 9/21/2023 11:21 AM, Aditya Mahajan wrote:

On Thu, 21 Sep 2023, Xavier B. wrote:


Hi,

I want to write:

$0,00\stackrel{\smallfrown}{4}$

like latex 
[https://tex.stackexchange.com/questions/39225/differences-between-stackrel-and-stackbin]

but context LMTX does not recognize stackrel

What can I do?


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

a teaser for Aditya:

\definemathstackers[toprel][top][mathclass=\mathrelationcode]
\definemathstackers[topbin][top][mathclass=\mathbinarycode]

\definemathextensible[toprel][frownedupon]["2322]
\definemathextensible[topbin][frowned]["2322]

\starttext
$x \frownedupon{4} y + \frowned{!} z = 10$
\stoptext


-
  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: Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2023-09-18 Thread vm via ntg-context




On 18/09/2023 17:47, Hans Hagen wrote:


i uploaded again now using binaries i compiled on my machine (linux 64 
and windows 32/64/arm -- maybe a good time time to drop 32 bit)


works!
.F
___
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-18 Thread vm via ntg-context




On 18/09/2023 17:07, Michael Loescher wrote:


\starttext
\type{hello}
\stoptext



here too (linux pop!os 22.04) something goes unexpected:


! Control sequence expected instead of undefined.
 \buff_verbatim_type_normal
...chained \t!verbatim \currenttype \??type \clf_type 
data{\protecteddetokenize

{#1}}tab{\typeparameter \c!tab }method{\p_buff_op ...

\type{ hello }
You injected something that confused the parser, maybe by using some Lua 
call.



and it shows
{hello}
on the page
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[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] rotation weirdness

2023-09-16 Thread Hans van der Meer via ntg-context
I encountered something weird, that I cannot explain. It could be an error, but I was not able to pinpoint this.It seems as if the \rotate macro plays havoc with the macro definitions used to set the color of the frame and an outside title.Placing the outside title before the rotate proves that the call to \rotate is the culprit.I enclose an MWE with a little jpeg figure as illustration.
yours sincerelydr. Hans van der Meer\def\formattitle#1{\color[\boxtitlecolor]{#1\strut}}\def\boxfigurerotate#1#2{%	\rotate[rotation=10]%	{%		\externalfigure[#1]%		[rulethickness=4pt,width=100pt,height=50pt,frame=on,framecolor=\boxframecolor,]%	}%	\formattitle{#2}%}\def\boxfigure#1#2{%		\externalfigure[#1]%		[rulethickness=4pt,width=100pt,height=50pt,frame=on,framecolor=\boxframecolor,]%	\formattitle{#2}%}\def\boxtitlecolor{blue}\def\boxframecolor{blue}\starttext\ConTeXt\ \contextversion\blankProblem:\crlfit looks like \type{\rotate[]{}} kills the definition of boxtitlecolor.Changing the names of the titlecolor/framecolor definitions makes no difference.\crlfWhy is this? ConTeXt error?\blank\boxfigure{test}{norotation: title color is blue}\blank\boxfigurerotate{test}{rotation: title color should be blue but is not}\blank\def\boxframecolor{red}\boxfigurerotate{test}{rotation: title color different from framecolor now blue}\stoptext

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

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

[NTG-context] Re: # verbatim typesetting

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

On 9/7/2023 2:47 PM, Marcus Vinicius Mesquita wrote:

Dear List,

The MWE below gives a pdf with two #'s instead of only one. Why is that?

\starttext

\startluacode
 context.type("#")
\stopluacode

\stoptext
because by default tex loves to duplicate hashes when it serializes 
token lists


as this seems to be "the month of the duplicate hashes" i looked it what 
we did so far can also work here and i sort of managed although there 
might be more cases (when im done with this we probably "have it the 
other way around" which could mean adapting some code in the tex-lua 
context system that actually depends on duplication or where we work 
around it and no longer need to)


the complication is mostly in moving token lists around, them beign 
serialized and deserialized etc but i guesa at some point we'll get 
there (original tex doesn't really have this problem because there 
serialization hashes will triggere errors in cases where they are not 
permitted anyway)


no upload as i need to test more

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: XML, multiple spaces encoded as %20 get merged into one space

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

On 9/6/2023 4:59 PM, Pablo Rodriguez wrote:

On 9/6/23 12:28, denis.ma...@unibe.ch wrote:

Hi,

I have the example below that uses the three images in the attachment.
For some reason multiple spaces encoded as %20 get merged into a single %20.


Hi Denis,

this is standard TeX behavior (not only related to XML):

   \starttext
   \externalfigure[test  two spaces.pdf]
   \externalfigure[test  not two spaces.pdf]
   \stoptext

I don‘t know whether this is intended or not.

That being said, more than one consecutive space in a file name (I would
say it) is rather an exception than the rule.

Fixing this may cause more trouble that it might seem at first.
The problem with escaping is that there can be several round trips and 
it's kind of hard to predict usage and such. Also, take this:




Then, as i don't have these graphics, the test failed after a catch on 
the fact that tex didn't like the string for rendering in the 'unknown 
figure' drop in and after another catch the { } were not shown ...


Anyway, with a little magic i can now at least make this work but it 
needs testing with existing documents because it's not like we can 
update the xml stuff every thiem we have yet another exception (ok, 
those using sane image names are probably okay).


So, in a next update you can test some,

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] Fwd: escaping \ in Lua

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





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

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

Dear list,

I have the following source:

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

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

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

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

Many thanks for your help,

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


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

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

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


<    1   2   3   4   5   6   7   8   9   10   >