[NTG-context] Re: Why Difference Between \placefloat and \definefloat

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


Hraban

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


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

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

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

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

\stoptext


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

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


[NTG-context] \par and \startlines

2024-04-26 Thread denis.maier
Hi,

I'm trying to typeset a poem from XML, but I can't figure out how to make the 
inbetween key working here.
As the source is XML, I cannot just add an empty line to start a new group of 
lines inside \startlines...\stoplines. I guess, there must be a command to do 
that, but \par seems to have no effect here.
How can this be done?

Best,
Denis

%%%
\setuplines[before={\blank},after={\blank},inbetween={ARE WE INBETWEEN?\blank}]

% XML Nodes auswählen
\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

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

\startxmlsetups xml:poem
\startlines
   \xmlflush{#1}
\stoplines
\stopxmlsetups

\startxmlsetups xml:stanza
   \xmlflushlinewise{#1}\par %this has no effect
\stopxmlsetups

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

\startbuffer[test]




The
lines
are
there!


The
lines
are
there!



\stopbuffer


\starttext

This works:

\startlines
The
lines
are
there!

The
lines
are
there!
\stoplines

Apparently, \type{\par} has no effect here:

\startlines
The
lines
are
there!\par% \par has no effect here
The
lines
are
there!
\stoplines

For background, this is what I'm actually trying to do:

\xmlprocessbuffer{test}{test}{}

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

2024-04-24 Thread Henning Hraban Ramm

Am 24.04.24 um 01:00 schrieb Bruce Horrocks:

In the source there is a comment relating to location:

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

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


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


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

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


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

2024-04-24 Thread Bruce Horrocks


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

In the source there is a comment relating to location:


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

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

—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] Wiki - question about Command/ pages which start with a space character

2024-04-14 Thread garulfo
Hi all,

Is it on purpose that 128 pages "https://wiki.contextgarden.net/Command/ 
" start with a space character ?
I didn't find an explanation in https://wiki.contextgarden.net/Command

For example, these two pages exist :
- https://wiki.contextgarden.net/Command/startbuffer
- https://wiki.contextgarden.net/Command/_startbuffer

If it is on purpose: 
- What is the purpose, and which page should contain which documentation?

If it is not: 
- Is there a way to automatically merge the content of the couple of pages, and 
to remove the "wrong" pages, or should it be done manually ?

Thanks for your help.

List :
Command/ attachment
Command/ background
Command/ bar
Command/ beginblock
Command/ button
Command/ characterkerning
Command/ comment
Command/ completecombinedlist
Command/ completelistoffloats
Command/ completelistofsorts
Command/ completelistofsynonyms
Command/ completeregister
Command/ copylabeltext
Command/ ctxfunction
Command/ ctxfunctiondefinition
Command/ currentlabel
Command/ delimitedtext
Command/ description
Command/ enumeration
Command/ fence
Command/ fraction
Command/ framed
Command/ framedtext
Command/ getbuffer
Command/ hbox
Command/ help
Command/ high
Command/ highlight
Command/ label
Command/ labellanguage
Command/ labeltext
Command/ labeltexts
Command/ language
Command/ leftlabeltext
Command/ linenote
Command/ low
Command/ lowhigh
Command/ lowmidhigh
Command/ margindata
Command/ mathcommand
Command/ mathdoubleextensible
Command/ mathextensible
Command/ mathframed
Command/ mathmatrix
Command/ mathornament
Command/ mathoverextensible
Command/ mathovertextextensible
Command/ mathradical
Command/ mathtriplet
Command/ mathunderextensible
Command/ mathundertextextensible
Command/ mathunstacked
Command/ nextparagraphs
Command/ note
Command/ ornament
Command/ paragraphs
Command/ placecombinedlist
Command/ placefloat
Command/ placelistoffloats
Command/ placelistofsorts
Command/ placelistofsynonyms
Command/ placement
Command/ placepairedbox
Command/ placeregister
Command/ presetlabeltext
Command/ referenceformat
Command/ register
Command/ rightlabeltext
Command/ script
Command/ section
Command/ seeregister
Command/ setupcombinedlist
Command/ setupitemgroup
Command/ setuplabeltext
Command/ setuppairedbox
Command/ setupregister
Command/ shift
Command/ sorting
Command/ startattachment
Command/ startbackground
Command/ startbuffer
Command/ startcolumnset
Command/ startcomment
Command/ startdelimitedtext
Command/ startdescription
Command/ starteffect
Command/ startenumeration
Command/ startfittingpage
Command/ startfloattext
Command/ startformula
Command/ startframedtext
Command/ starthelp
Command/ startindentedtext
Command/ startitemgroup
Command/ startlabeltext
Command/ startlinenote
Command/ startlines
Command/ startmakeup
Command/ startmathalignment
Command/ startmathcases
Command/ startmathmatrix
Command/ startmixedcolumns
Command/ startnarrower
Command/ startnote
Command/ startpagecolumns
Command/ startparagraphs
Command/ startparallel
Command/ startplacefloat
Command/ startplacepairedbox
Command/ startsection
Command/ startsectionblock
Command/ startstartstop
Command/ startstop
Command/ startstyle
Command/ starttabulate
Command/ starttextbackground
Command/ starttyping
Command/ startviewerlayer
Command/ startxtable
Command/ stoplinenote
Command/ style
Command/ synonym
Command/ textbackground
Command/ textnote
Command/ tooltip
Command/ type
Command/ typebuffer
Command/ unit
___
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: international type design

2024-04-07 Thread hf
It is an interesting team.


2024年4月5日 02:52, "Henning Hraban Ramm"  写到:

> Have a look at these beautiful font designs:
> 
> https://esadtype.esad-amiens.fr/
> 
> Unfortunately the fonts are not available (yet).
> 
> Take your time to browse the papers about intention, design process etc.
> 
> I just browsed the dissertation about the (Vietnamese) "Dilinh" font and 
> 
> found the considerations interesting.
> 
> "Gul" has matching Devanagari & Latin, "Tarisel" has variations from
> 
> readable text to abstracted lombardic unciale, and "Wierd" has matching
> 
> deconstructivist outlines for Arabic & Latin…
> 
> 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: incosistent output of --- dash

2024-04-06 Thread Hans Hagen

On 4/6/2024 1:38 PM, Wolfgang Schuster wrote:

Henning Hraban Ramm schrieb am 06.04.2024 um 12:23:

Am 06.04.24 um 11:43 schrieb madiazm.eo...@gmail.com:

Hi everyone,
I'm a bit puzzled because I usually don't get an em-dash when I type 
tree hyphens. If I use the command \emdash, no problem but when I use 
the hyphens some days it works... and somedays I see three small 
hyphens.
I tried it on overleaf and of ContextOnWeb with the same 
inconsistency. If I create a new file it usually works right; but 
when I overwrite an existing file subtituting a hyphen for three 
where the dash should be I sometimes get it right and sometimes wrong.
It is not the pdf viewer since I get good or bad results in all, the 
overleaf pdf preview tool, the context on web preview tool and the 
mozilla integrated pdf viewer.


Am I missing something on the use of this ligature? (the question is 
just out of curiosity, since I plan to create a command that adds a 
hairspace after or before the dash, since I don't like it to stick to 
some letters like "o".


Generally, “we” try to reduce active characters as much as possible, 
that’s why -- and --- usually /don’t/ produce en or em dashes. You can 
activate these ligatures as a font feature though (AFAIR 
"latexhyphens", can’t find it…).


The name of the option has changes a few times and the current setting 
is textcontrol=collapsehyphens.



Some editors and some fonts do automatical replacements.


In this case it could be the wrong symbol in the document, there are 
many dashes in unicode which look similar in the input and output files.


\starttext

\startbuffer
\starttabulate[|T]
\NC U+0002D \NC - \NC -- \NC --- \NC\NR
\NC U+02011 \NC ‑ \NC ‑‑ \NC ‑‑‑ \NC\NR
\NC U+02012 \NC ‒ \NC ‒‒ \NC ‒‒‒ \NC\NR
\stoptabulate
\stopbuffer

\getbuffer

\setupbodyfont[pagella]

\getbuffer

\stoptext
detail: it is not a real fontfeature (as tlig in mkiv) but implemented 
differently with a bit more control, so we have


\nohyphencollapsing
\dohyphencollapsing

etc too as control options. These collapsed hyphens are also configured 
as valid hyphenation chars.


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: blank line and \placefigure

2024-04-06 Thread Thomas Meyer

Here is a minimal example that better describes my problem.
It seems to depend on the size of the image. 30 mm and 40 mm width 
works, 35 mm does not.
I have not tested height, although the image I want to use would be 
portrait format.


\setuplayout[grid=yes]
\setupinterlinespace[line=15pt]
\starttext
\input{knuth}
\startlinecorrection
\placefigure[left, none]
[]{}\externalfigure[cow.pdf][width=40mm]
\input{knuth}
\stoplinecorrection
\stoptext

Thomas

Am 06.04.24 um 13:43 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 06.04.2024 um 12:56:

Am 06.04.24 um 12:48 schrieb Thomas Meyer:
how can I suppress a blank line between a text paragraph and 
\placefigure?

I get one there, but I don't want it.


Did you try
\setupfloat[figure][spacebefore=,]
?
or "none" or "{disable,nowhite,back}"


You can set the space only for *all* floats, e.g.

    \setupfloat[spacebefore=...,spaceafter=...]

and not for a single float type only.

Wolfgang

___ 

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


maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net 
(mirror)

archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___ 

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

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


[NTG-context] Re: blank line and \placefigure

2024-04-06 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 06.04.2024 um 12:56:

Am 06.04.24 um 12:48 schrieb Thomas Meyer:
how can I suppress a blank line between a text paragraph and 
\placefigure?

I get one there, but I don't want it.


Did you try
\setupfloat[figure][spacebefore=,]
?
or "none" or "{disable,nowhite,back}"


You can set the space only for *all* floats, e.g.

    \setupfloat[spacebefore=...,spaceafter=...]

and not for a single float type only.

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

2024-04-06 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 06.04.2024 um 12:23:

Am 06.04.24 um 11:43 schrieb madiazm.eo...@gmail.com:

Hi everyone,
I'm a bit puzzled because I usually don't get an em-dash when I type 
tree hyphens. If I use the command \emdash, no problem but when I use 
the hyphens some days it works... and somedays I see three small 
hyphens.
I tried it on overleaf and of ContextOnWeb with the same 
inconsistency. If I create a new file it usually works right; but 
when I overwrite an existing file subtituting a hyphen for three 
where the dash should be I sometimes get it right and sometimes wrong.
It is not the pdf viewer since I get good or bad results in all, the 
overleaf pdf preview tool, the context on web preview tool and the 
mozilla integrated pdf viewer.


Am I missing something on the use of this ligature? (the question is 
just out of curiosity, since I plan to create a command that adds a 
hairspace after or before the dash, since I don't like it to stick to 
some letters like "o".


Generally, “we” try to reduce active characters as much as possible, 
that’s why -- and --- usually /don’t/ produce en or em dashes. You can 
activate these ligatures as a font feature though (AFAIR 
"latexhyphens", can’t find it…).


The name of the option has changes a few times and the current setting 
is textcontrol=collapsehyphens.



Some editors and some fonts do automatical replacements.


In this case it could be the wrong symbol in the document, there are 
many dashes in unicode which look similar in the input and output files.


\starttext

\startbuffer
\starttabulate[|T]
\NC U+0002D \NC - \NC -- \NC --- \NC\NR
\NC U+02011 \NC ‑ \NC ‑‑ \NC ‑‑‑ \NC\NR
\NC U+02012 \NC ‒ \NC ‒‒ \NC ‒‒‒ \NC\NR
\stoptabulate
\stopbuffer

\getbuffer

\setupbodyfont[pagella]

\getbuffer

\stoptext

Wolfgang

\starttext

\startbuffer
\starttabulate[|T]
\NC U+0002D \NC - \NC -- \NC --- \NC\NR
\NC U+02011 \NC ‑ \NC ‑‑ \NC ‑‑‑ \NC\NR
\NC U+02012 \NC ‒ \NC ‒‒ \NC ‒‒‒ \NC\NR
\stoptabulate
\stopbuffer

\getbuffer

\setupbodyfont[pagella]

\getbuffer

\stoptext


hyphen.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: incosistent output of --- dash

2024-04-06 Thread Henning Hraban Ramm

Am 06.04.24 um 11:43 schrieb madiazm.eo...@gmail.com:

Hi everyone,
I'm a bit puzzled because I usually don't get an em-dash when I type tree 
hyphens. If I use the command \emdash, no problem but when I use the hyphens 
some days it works... and somedays I see three small hyphens.
I tried it on overleaf and of ContextOnWeb with the same inconsistency. If I 
create a new file it usually works right; but when I overwrite an existing file 
subtituting a hyphen for three where the dash should be I sometimes get it 
right and sometimes wrong.
It is not the pdf viewer since I get good or bad results in all, the overleaf 
pdf preview tool, the context on web preview tool and the mozilla integrated 
pdf viewer.

Am I missing something on the use of this ligature? (the question is just out of 
curiosity, since I plan to create a command that adds a hairspace after or before the 
dash, since I don't like it to stick to some letters like "o".


Generally, “we” try to reduce active characters as much as possible, 
that’s why -- and --- usually /don’t/ produce en or em dashes. You can 
activate these ligatures as a font feature though (AFAIR "latexhyphens", 
can’t find it…).


Some editors and some fonts do automatical replacements.

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

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


[NTG-context] incosistent output of --- dash

2024-04-06 Thread madiazm . eoicc
Hi everyone,
I'm a bit puzzled because I usually don't get an em-dash when I type tree 
hyphens. If I use the command \emdash, no problem but when I use the hyphens 
some days it works... and somedays I see three small hyphens.
I tried it on overleaf and of ContextOnWeb with the same inconsistency. If I 
create a new file it usually works right; but when I overwrite an existing file 
subtituting a hyphen for three where the dash should be I sometimes get it 
right and sometimes wrong.
It is not the pdf viewer since I get good or bad results in all, the overleaf 
pdf preview tool, the context on web preview tool and the mozilla integrated 
pdf viewer.

Am I missing something on the use of this ligature? (the question is just out 
of curiosity, since I plan to create a command that adds a hairspace after or 
before the dash, since I don't like it to stick to some letters like "o".

thanks
___
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] international type design

2024-04-04 Thread Henning Hraban Ramm

Have a look at these beautiful font designs:
https://esadtype.esad-amiens.fr/
Unfortunately the fonts are not available (yet).

Take your time to browse the papers about intention, design process etc.

I just browsed the dissertation about the (Vietnamese) "Dilinh" font and 
found the considerations interesting.


"Gul" has matching Devanagari & Latin, "Tarisel" has variations from 
readable text to abstracted lombardic unciale, and "Wierd" has matching 
deconstructivist outlines for Arabic & Latin…


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

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


[NTG-context] Re: OT: San Seriffe

2024-04-01 Thread Keith McKay

Shurely Shome Mishtake. It should be grauniad_sans!

https://wordhistories.net/2017/06/05/origin-of-grauniad/

Keith

On 01/04/2024 15:45, Henning Hraban Ramm wrote:

Am 01.04.24 um 16:34 schrieb Hans Hagen via ntg-context:

On 4/1/2024 3:56 PM, Henning Hraban Ramm wrote:

in honour of Knuth and the current occasion:
https://realdougwilson.com/writing/san-serriffe

the subject title suggest that you found an open type version


Well, I found one, but it‘s not free:
https://commercialtype.com/catalog/guardian_sans

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: OT: San Seriffe

2024-04-01 Thread Henning Hraban Ramm

Am 01.04.24 um 16:34 schrieb Hans Hagen via ntg-context:

On 4/1/2024 3:56 PM, Henning Hraban Ramm wrote:

in honour of Knuth and the current occasion:
https://realdougwilson.com/writing/san-serriffe

the subject title suggest that you found an open type version


Well, I found one, but it‘s not free:
https://commercialtype.com/catalog/guardian_sans

Hraban

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

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


[NTG-context] Re: OT: San Seriffe

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

On 4/1/2024 3:56 PM, Henning Hraban Ramm wrote:

in honour of Knuth and the current occasion:
https://realdougwilson.com/writing/san-serriffe

the subject title suggest that you found an open type version

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

2024-04-01 Thread Henning Hraban Ramm
"
local blob = found ~= "" and io.loaddata(found) or ""
if blob == ""  then
report("category: %s, filename: %s, not 
found",category,filename)
else
done = done + 1
report("category: %s, filename: %s, 
merged",category,filename)
end
return format("; category: %s\n; filename: 
%s\n%s\n\n",category,filename,blob)
end)
end
if done > 0 then
report("saving '%s' (%s files merged)",destinationdata,done)
io.savedata(destinationdata,data)
else
report("skipping '%s' (no files merged)",destinationdata)
end
end
local templatename = "textpad-context-template.txt"
local templatedata = resolvers.findfile(templatename) or ""
if templatedata == "" then
report("unable to locate template '%s'",templatename)
else
merge(templatedata, "context.syn",   { "tex commands","context 
commands" })
if environment.argument("textpad") == "latex" then
merge(templatedata, "context-latex.syn", { "tex 
commands","context commands", "latex commands" })
end
end
local r = { }
local c = io.loaddata("context-commands-en.txt") or "" -- sits on 
the same path
local e = io.loaddata("context-environments-en.txt") or "" -- sits on 
the same path
for s in gmatch(c,"\\(.-)%s") do
r[#r+1] = format("\n!TEXT=%s\n\\%s\n!",s,s)
end
for s in gmatch(e,"\\start(.-)%s+\\stop(.-)") do
r[#r+1] = format("\n!TEXT=%s (start/stop)\n\\start%s 
\\^\\stop%s\n!",s,s,s)
end
sort(r)
insert(r,1,"!TCL=597,\n!TITLE=ConTeXt\n!SORT=N\n!CHARSET=DEFAULT")
io.savedata("context.tcl",concat(r,"\n"))
-- cleanup
os.remove("context-commands-en.txt")
os.remove("context-environments-en.txt")
end
end

function scripts.interface.editor(editor,split,forcedinterfaces)
require("char-def")

local interfaces = forcedinterfaces or environment.files or userinterfaces
if not interfaces.en then
-- loaded as script so we have "cont-yes.*" as name
interfaces = { "en" }
end
--
 -- local filename = "i-context.xml"
local filename = "context-en.xml"
local xmlfile  = resolvers.findfile(filename) or ""
if xmlfile == "" then
report("unable to locate %a",filename)
return
end
--
local filename = "mult-def.lua"
local deffile  = resolvers.findfile(filename) or ""
if deffile == "" then
report("unable to locate %a",filename)
return
end
local interface = dofile(deffile)
if not interface or not next(interface) then
report("invalid file %a",filename)
return
end
local variables = interface.variables
local constants = interface.constants
local commands  = interface.commands
local elements  = interface.elements
--
local collected = { }
--
report("generating files for %a",editor)
report("loading %a",xmlfile)
local xmlroot = xml.load(xmlfile)
 -- xml.include(xmlroot,"cd:interfacefile","filename",true,function(s)
 -- local fullname = resolvers.findfile(s)
 -- if fullname and fullname ~= "" then
 -- report("including %a",fullname)
 -- return io.loaddata(fullname)
 -- end
 -- end)
 -- local definitions = { }
 -- for e in xml.collected(xmlroot,"cd:interface/cd:define") do
 -- definitions[e.at.name] = e.dt
 -- end
 -- local function resolve(root)
 -- for e in xml.collected(root,"*") do
 -- if e.tg == "resolve" then
 -- local resolved = definitions[e.at.name or ""]
 -- if resolved then
 -- -- use proper replace helper
 -- e.__p__.dt[e.ni] = resolved
 -- resolved.__p__ = e.__p__
 -- resolve(resolved)
 -- end
 -- end
 -- end
 -- end
 -- resolve(xmlroot)

-- todo: use sequence

for i=1,#interfaces do
local interface  = interfaces[i]
local i_commands = { }
local i_environments = { }
local start = elements.start[interface] or elements.start.en
l

[NTG-context] issue with \xmlinlineprettyprinttext

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

I have the following sample:

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

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

  \xmlregistersetup{xml:initialize}

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

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

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

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

  \setupbodyfont[mainface]

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

\type{a --b c}
  \stoptext

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

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

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

Many thanks for your help,

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

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


[NTG-context] Re: can we do binding correction?

2024-03-19 Thread Willi Egger
Hi Hraban,

> On 19 Mar 2024, at 21:56, Hraban Ramm  wrote:
> 
> Thank you Willi!
> 
> Generally I know for what binding correction is used, I just never tried to 
> set it up. If I look carefully at one of our printed booklets, the printshop 
> also didn’t. So I'd need pageshift without applying imposition (setting it up 
> wouldn’t hurt).

I organise this always with correction to the backspace.

> 
> I didn’t think about vertical pageshift, but of course that’s also needed for 
> cross-folded sheets.
> 
> I'm not sure how (horizontal) pageshift is supposed to work with full page 
> images without introducing white borders, but bleed at the inner edge should 
> be enough.
> 
> Theoretically the shift value should be the same as the paper thickness 
> (don’t you think?), but there’s some deformation involved, so a factor might 
> make sense?

I think that this would be quite cumbersome, paper thickness of higly coated 
papers vs. novel-printing paper… I believe one would have to establish this 
thickness for each project unless the same paper is used...


> Unfortunately I threw out my old books on printing technology long ago, and 
> my newer one doesn’t cover bookbinding (I’m not at home anyway).

I think, that many printshops do not possess neither old books including 
bookbinding nor do they care about the wishes of the binder … Pity, that you 
threw them out, but i understand, that circumstances might be such that you 
have to take decisions…

Willi
> 
> Hraban
> 
> Am 19.03.24 um 17:01 schrieb Willi Egger:
>> Hi Hraban,
>> 
>> I think we should clarify this.
>> 
>> Binding correction is a fixed amount of whitespace in the spine added to the 
>> inner white-space. This is to ensure, that the binding, which is consuming 
>> white-space, keeps the inner white-space optically as intended..
>> 
>> The page shift mechanism works only with imposition enabled. This ensures, 
>> that the type-setting area does not creep towards the spine because multiple 
>> sheets of paper are folded in the spine.
>> 
>> I doubt whether it is enough to have the measure of the thickness do 
>> determine this creeping effect, because we are making folds which are 
>> probably more circles than just adding thickness of paper.
>> 
>> 
>> Willi
>> 
>>> On 18 Mar 2024, at 17:35, Hraban Ramm  wrote:
>>> 
>>> 
>>> Am 17.03.24 um 23:54 schrieb Wolfgang Schuster:
>>>> Hraban Ramm schrieb am 17.03.2024 um 22:48:
>>>>> Hi, this question was rised in my ConTeXt beginners workshop* at Chemnitz 
>>>>> Linux Days today:
>>>>> 
>>>>> Can I configure binding correction for saddle-stitched or thread-bound 
>>>>> booklets, and if, does it only work with arranging (imposition) or can I 
>>>>> enable it somehow for the layout (if the printshop does the imposition)?
>>>> 1. \definepageshift + \setuppageshift
>>>> 
>>>> 2. \setuplayout[horoffset=]
>>>> 
>>>>> Also I recognized I'm not sure about the difference of the layout 
>>>>> parameters backspace and cutspace.
>>>> backspace is the inner margin and cutspace the outer
>>>> 
>>> Hi Wolfgang, thank you! Seems like I was too dense to understand the 
>>> description for the \setuplayout parameters in the wiki (and there are more 
>>> that I never used, oh my…), and since I never use ConTeXt’s imposition for 
>>> serious print products (and never set up a scheme myself), I didn’t know 
>>> about pageshift.
>>> 
>>> Ok, if I leave imposition to the printshop and they don't do binding 
>>> correction in their workflow, I'd need to set horoffset differently for 
>>> every single page (i.e. first, second, second-to-last and last the same; 
>>> 3th, 4th and from back the same etc.). Or is pageshift applied 
>>> independently from arranging?
>>> 
>>> And then, it makes no sense to add the same value all the time. I don’t 
>>> know if BCOR works this way in LaTeX, but one value (paper thickness) 
>>> should be enough in combination with an imposition schema. I.e. if I define 
>>> a paper thickness and the number of pages that are in one booklet (as a 
>>> single booklet or part of a "proper" book), then the page shift should work 
>>> automatically.
>>> 
>>> Well, for a single booklet, it could. In a book, booklets can have 
>>> different numbers of pages, and then you'd need to define a list… Okay, too 
>>> c

[NTG-context] Re: can we do binding correction?

2024-03-19 Thread Hraban Ramm

Thank you Willi!

Generally I know for what binding correction is used, I just never tried 
to set it up. If I look carefully at one of our printed booklets, the 
printshop also didn’t. So I'd need pageshift without applying imposition 
(setting it up wouldn’t hurt).


I didn’t think about vertical pageshift, but of course that’s also 
needed for cross-folded sheets.


I'm not sure how (horizontal) pageshift is supposed to work with full 
page images without introducing white borders, but bleed at the inner 
edge should be enough.


Theoretically the shift value should be the same as the paper thickness 
(don’t you think?), but there’s some deformation involved, so a factor 
might make sense?


Unfortunately I threw out my old books on printing technology long ago, 
and my newer one doesn’t cover bookbinding (I’m not at home anyway).


Hraban

Am 19.03.24 um 17:01 schrieb Willi Egger:

Hi Hraban,

I think we should clarify this.

Binding correction is a fixed amount of whitespace in the spine added to the 
inner white-space. This is to ensure, that the binding, which is consuming 
white-space, keeps the inner white-space optically as intended..

The page shift mechanism works only with imposition enabled. This ensures, that 
the type-setting area does not creep towards the spine because multiple sheets 
of paper are folded in the spine.

I doubt whether it is enough to have the measure of the thickness do determine 
this creeping effect, because we are making folds which are probably more 
circles than just adding thickness of paper.


Willi


On 18 Mar 2024, at 17:35, Hraban Ramm  wrote:


Am 17.03.24 um 23:54 schrieb Wolfgang Schuster:

Hraban Ramm schrieb am 17.03.2024 um 22:48:

Hi, this question was rised in my ConTeXt beginners workshop* at Chemnitz Linux 
Days today:

Can I configure binding correction for saddle-stitched or thread-bound 
booklets, and if, does it only work with arranging (imposition) or can I enable 
it somehow for the layout (if the printshop does the imposition)?

1. \definepageshift + \setuppageshift

2. \setuplayout[horoffset=]


Also I recognized I'm not sure about the difference of the layout parameters 
backspace and cutspace.

backspace is the inner margin and cutspace the outer


Hi Wolfgang, thank you! Seems like I was too dense to understand the 
description for the \setuplayout parameters in the wiki (and there are more 
that I never used, oh my…), and since I never use ConTeXt’s imposition for 
serious print products (and never set up a scheme myself), I didn’t know about 
pageshift.

Ok, if I leave imposition to the printshop and they don't do binding correction 
in their workflow, I'd need to set horoffset differently for every single page 
(i.e. first, second, second-to-last and last the same; 3th, 4th and from back 
the same etc.). Or is pageshift applied independently from arranging?

And then, it makes no sense to add the same value all the time. I don’t know if BCOR 
works this way in LaTeX, but one value (paper thickness) should be enough in combination 
with an imposition schema. I.e. if I define a paper thickness and the number of pages 
that are in one booklet (as a single booklet or part of a "proper" book), then 
the page shift should work automatically.

Well, for a single booklet, it could. In a book, booklets can have different 
numbers of pages, and then you'd need to define a list… Okay, too complicated. 
It’s the printshops's responsibility anyway, and nobody complained about my 
books so far. (I'm not perfectionist enough to care.)

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
___

___
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  

[NTG-context] Re: can we do binding correction?

2024-03-19 Thread Willi Egger
Hi Hraban,

I think we should clarify this.

Binding correction is a fixed amount of whitespace in the spine added to the 
inner white-space. This is to ensure, that the binding, which is consuming 
white-space, keeps the inner white-space optically as intended..

The page shift mechanism works only with imposition enabled. This ensures, that 
the type-setting area does not creep towards the spine because multiple sheets 
of paper are folded in the spine.

I doubt whether it is enough to have the measure of the thickness do determine 
this creeping effect, because we are making folds which are probably more 
circles than just adding thickness of paper.


Willi

> On 18 Mar 2024, at 17:35, Hraban Ramm  wrote:
> 
> 
> Am 17.03.24 um 23:54 schrieb Wolfgang Schuster:
>> Hraban Ramm schrieb am 17.03.2024 um 22:48:
>>> Hi, this question was rised in my ConTeXt beginners workshop* at Chemnitz 
>>> Linux Days today:
>>> 
>>> Can I configure binding correction for saddle-stitched or thread-bound 
>>> booklets, and if, does it only work with arranging (imposition) or can I 
>>> enable it somehow for the layout (if the printshop does the imposition)?
>> 
>> 1. \definepageshift + \setuppageshift
>> 
>> 2. \setuplayout[horoffset=]
>> 
>>> Also I recognized I'm not sure about the difference of the layout 
>>> parameters backspace and cutspace.
>> 
>> backspace is the inner margin and cutspace the outer
>> 
> Hi Wolfgang, thank you! Seems like I was too dense to understand the 
> description for the \setuplayout parameters in the wiki (and there are more 
> that I never used, oh my…), and since I never use ConTeXt’s imposition for 
> serious print products (and never set up a scheme myself), I didn’t know 
> about pageshift.
> 
> Ok, if I leave imposition to the printshop and they don't do binding 
> correction in their workflow, I'd need to set horoffset differently for every 
> single page (i.e. first, second, second-to-last and last the same; 3th, 4th 
> and from back the same etc.). Or is pageshift applied independently from 
> arranging?
> 
> And then, it makes no sense to add the same value all the time. I don’t know 
> if BCOR works this way in LaTeX, but one value (paper thickness) should be 
> enough in combination with an imposition schema. I.e. if I define a paper 
> thickness and the number of pages that are in one booklet (as a single 
> booklet or part of a "proper" book), then the page shift should work 
> automatically.
> 
> Well, for a single booklet, it could. In a book, booklets can have different 
> numbers of pages, and then you'd need to define a list… Okay, too 
> complicated. It’s the printshops's responsibility anyway, and nobody 
> complained about my books so far. (I'm not perfectionist enough to care.)
> 
> 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: issue with typing in footnotes

2024-03-18 Thread Pablo Rodriguez via ntg-context
On 3/17/24 23:58, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 17.03.2024 um 17:38:
>> [...]
>> As far as I know, this sample should be compiled without any issue.
>>
>> Could you be so kind to confirm the issue or explain me what am I missing?
>
> The footnote environment is just a fancy way for a command with a
> argument and buffers don't like being part of arguments.
>
> You can put the code in buffer outside of the footnote and type the
> content of the buffer in the footnote.

Many thanks for your reply, Wolfgang.

Everything is clear to me now.

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: issue with typing in footnotes

2024-03-17 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 17.03.2024 um 17:38:

Dear list,

I have the following sample (which was on the way of showing another issue):

   \starttext
   a
   \starttyping
   b
   \stoptyping
   c
   \startfootnote
   a
   \starttyping
   b
   \stoptyping
   c
   \stopfootnote
   \stoptext

Current latest (from 2024.03.11 09:34) breaks compilation with both LMTX
and LuaTeX.

As far as I know, this sample should be compiled without any issue.

Could you be so kind to confirm the issue or explain me what am I missing?


The footnote environment is just a fancy way for a command with a 
argument and buffers don't like being part of arguments.


You can put the code in buffer outside of the footnote and type the 
content of the buffer in the footnote.


 begin example
\starttext

\def\startfoo#1\stopfoo{#1}

% \startfoo
% xxx
% \starttyping
% yyy
% \stoptyping
% zzz
% \stopfoo

\startbuffer
yyy
\stopbuffer

\startfoo
xxx
\typebuffer
zzz
\stopfoo

\stoptext
 end example

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

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


[NTG-context] Re: how to include an an svg file?

2024-03-16 Thread Jean-Pierre Delange
/mpxl/mp-node.mpxl
 
fullname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-node.mpxl
 usedmethod=database
system  >   29: filename=mp-apos.mpxl filetype=mp 
foundname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-apos.mpxl
 
fullname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-apos.mpxl
 usedmethod=database
system  >   30: filename=mp-abck.mpxl filetype=mp 
foundname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-abck.mpxl
 
fullname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-abck.mpxl
 usedmethod=database
system  >   31: filename=mp-asnc.mpxl filetype=mp 
foundname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-asnc.mpxl
 
fullname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-asnc.mpxl
 usedmethod=database
system  >   32: filename=mp-blob.mpxl filetype=mp 
foundname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-blob.mpxl
 
fullname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-blob.mpxl
 usedmethod=database
system  >   33: filename=mp-lmtx.mpxl filetype=mp 
foundname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-lmtx.mpxl
 
fullname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-lmtx.mpxl
 usedmethod=database
system  >   34: filename=mp-text.mpxl filetype=mp 
foundname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-text.mpxl
 
fullname=C:/Users/adeim/context/tex/texmf-context/metapost/context/base/mpxl/mp-text.mpxl
 usedmethod=database
system  >   35: filename=smile.svg foundname=smile.svg 
fullname=C:/Users/adeim/context/Travail/tests/smile.svg usedmethod=direct
system  >   36: filename=lpdf-pdx.xml filetype=tex 
foundname=C:/Users/adeim/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml
 
fullname=C:/Users/adeim/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml
 usedmethod=database
system  > stop used files
system  > start commandline options
system  >   currentrun="1"
system  >   fulljobname="./ctx-test-MetaPost-pdf.tex"
system  >   input="./ctx-test-MetaPost-pdf.tex"
system  >   kindofrun="1"
system  >   maxnofruns="9"
system  >   texmfbinpath="C:/Users/adeim/context/tex/texmf-win64/bin"
system  > stop commandline options
system  > start commandline files
system  >1: ./ctx-test-MetaPost-pdf.tex
system  > stop commandline files
modules > start used modules
modules > stop used modules
system  > 
system  > status after finishing run
system  > 
system  >   
---
system  >   string   pool   hash lookup   node  
token buffer  input   file   nest  parameter   save 
  font   language   mark insert
system  >   
---
system  >   max2097152  120971522097152  1  
 1000  1 10   2000  1 10 50 
10  1  1500
system  >   min 15   1000 15 15200  
  100100  1500   1000  2 10 
   250250 50 10
system  >   set 50   1000 25 25   5000  
 1000   1000 10   2000  1 10 50 
10250250250
system  >   stp 10100 10 10 50  
   25100  1250   1000  1  1 
   250250 50 25
system  > 
system  >   mem 15 971734 15   200  
  100100  1500   1000  2  1
7401088 96   1200320
system  >   all240 971734240  1800  
  800100 32  16000  88000  8 16
7401088 96  28800  10240
system  > 
system  >   ini    2145984 927347  0  48815  0  
   541251  

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

2024-03-14 Thread Jim
Max (et al),

were you hoping the ConTeXt distribution would ship its own
pgfutil-context.def, or were you hoping that someone could convince Henri
to put the RGB change in?

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

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

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

Cheers.
Jim

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

> Hi all,

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

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

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

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

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

> Thanks,
> -- Max


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

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


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

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

2024-03-14 Thread Max Chernoff
Hi all,

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

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


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

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


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


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

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


[NTG-context] Re: weird character normalization in the wiki

2024-03-11 Thread Pablo Rodriguez via ntg-context
On 3/11/24 09:31, Taco Hoekwater wrote:
>> On 9 Mar 2024, at 09:35, Pablo Rodriguez via ntg-context 
>>  wrote:
>>
>> Sure, they may be a workaround to type codepoints instead of characters
>> (such as with \utfchar{0x1fbb}, but wouln’t it be possible to disable
>> that character normalization in the wiki?
>
> AFAIK, Wikimedia’s Unicode normalisation can not be turned off.

Hi Taco,

then I have to use the woraround.

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: weird character normalization in the wiki

2024-03-11 Thread Taco Hoekwater
Hi,



> On 9 Mar 2024, at 09:35, Pablo Rodriguez via ntg-context  
> wrote:
> 
> Sure, they may be a workaround to type codepoints instead of characters
> (such as with \utfchar{0x1fbb}, but wouln’t it be possible to disable
> that character normalization in the wiki?

AFAIK, Wikimedia’s Unicode normalisation can not be turned off.


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
___


[NTG-context] weird character normalization in the wiki

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

https://wiki.contextgarden.net/Greek#Monotonic_and_Acute_Accent includes
two samples that should display the difference betweeen the monotonic
accent and the polytonic acute accent (which generate two different
characters for each such accented vowel).

Excluding other implications, these are two different characters. In
some fonts each pair of different characters for each accented letter
lead to the same glyph, in other fonts those glyphs are different.

This sample shows the difference (there should display two slightly
different accents [unless there is some character normalization on the
way]):

  \definefontfamily[mainface][rm][EBGaramond]
  \setupbodyfont[mainface, 500pt]
  \definecolor [tred]  [r=1,t=.5,a=1]
  \definecolor [tblue] [b=1,t=.25,a=1]
  \starttext
  \startTEXpage[offset=1ex]
  \startoverlay
{\color[tred]{Ά}}
{\color[tblue]{Ά}}
  \stopoverlay
  \stopTEXpage
  \stoptext

The problem that I have is tricky. Thanks to character normalization (at
least in Firefox), searching for "á" will also find "a" (unless “Match
diacritics” is enabled).

I’m afraid the wiki is performing some character normalization, which
renders samples in
https://wiki.contextgarden.net/Greek#Monotonic_and_Acute_Accent useless.

Searching for "Ά" in https://wiki.contextgarden.net/Greek should give
not more than 4 matches (not case-sensitive and with “Match diacritics”
[or similar filter for your browser] enabled). I‘m afraid I get none.

While editing the article searching for "Ά" (case-insensitive and not
normalizing characters), gave me 4 matches, but only in the source (no
ocurrence was found in the preview).

Once changes are saved, "Ά" occurrences dissapear (since they seem to be
normalized).

Sure, they may be a workaround to type codepoints instead of characters
(such as with \utfchar{0x1fbb}, but wouln’t it be possible to disable
that character normalization in the wiki?

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] multicolumn title and abstact (bachotex) using tugboat.mkxl

2024-03-07 Thread Damien Thiriet via ntg-context

Hello,


I am currently writing my paper for last year's BachoTeX proceedings.
I am using tugboat.mkxl module to design the layout.

In bachotex proceedings, the author's data and abstract are on a single 
column and the article is usually typeset on two columns.

Comments in tugboat.mkxl states:

%D We have several column mechanisms and they all serve a different 
purpose. Here we
%D use pagecolumns. They support much of what we can do in single 
columns, but of
%D course there are exceptions. Floats can go into columns of aremoved 
to the top or
%D bottom when there is no room. We don't span mid column. Notes can go 
in columns
%D or at the end. We can start with a single column (for titles and 
such).


I can't figure out which part of the file should be used/adapted to 
start with a single column.
What I did is to put datas and abstract in a frame and use \placefigure. 
As stated in pagecolumns
manual, everything is put on the top of next page. (BTW, there is a 
typo: «of aremoved»)


I don't know, whether this MWE helps is relevant, but just in case, here 
is what I did:


* copy tugboat.mkxl to a new file p-bachotex.mkxl
* changed p-bachotex.mkxl like this:

\startsetups bachotex:naglowek:columns
\defineframedtext [Dane]
\setupframedtext
[Dane]
[width=18cm ,
 align=normal,
 frame=no]
\definenarrower
[Streszczenia]
[2*middle]

\startplacefigure [location={here,none}]
{\startDane
{\tfa\getvariable{tugboat}{author}}\par
\getvariable{tugboat}{address}\par
{\tt\getvariable{tugboat}{email}}\par

\startStreszczenia
\doifelsebufferempty {abstract} {
% no abstract
} {
\blank[line]

\enforced\let\\\endgraf
\setups[tugboat:abstract:setup]
\startAbstracts[title={Abstract}]
\stopAbstracts
}
\stopStreszczenia
\stopDane}
\stopplacefigure
\stopsetups

\startsetups tugboat:article:start

  \starttext

\setups{tugboat:columns:presets}

\setups{tugboat:banner:setup:\getvariable{tugboat}{type}}

\setupheadertexts
[\setups{tugboat:banner:text:article}]
[pagenumber]

\setuppagenumber
[number=\getvariable{tugboat}{page}]

\startmode[columns]
\startpagecolumns
\stopmode

\setups[tugboat:introduction:article]
\doifmodeelse{columns}{
\setups{bachotex:naglowek:columns}
} {
\setups{bachotex:naglowek:nocolumns}
}

\stopsetups

My article begins so:

\enablemode [columns]
\usemodule [bachotex]

% skipped tugboat variables for this MWE

\StartAbstract
  \input tufte
\StopAbstract
\StartArticle
   \input knuth
\StopArticle

Thank you for your help

Damien T
___
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] Wiki page : Mixed languages sample (French, Ancient Greek, Arabic, Chinese)

2024-03-01 Thread Jean-Pierre Delange
ι. ταῦτα δὴ ἐκαλλωπισάμην, ἵνα καλὸς 
παρὰ καλὸν ἴω}.


\noindent \quotation{Je rencontrai, dit-il, Socrate, sortant du bain et 
les pieds chaussés de sandales, ce qui n'est guère dans ses habitudes, 
et je lui demandai où il allait si beau. Il me répondit : «Je vais dîner 
chez Agathon. Je me suis dérobé hier à la fête qu'il a donnée en 
l'honneur de sa victoire, parce que je craignais la foule; mais je me 
suis engagé à venir le lendemain : voilà pourquoi je me suis paré; je 
voulais être beau pour venir chez un beau garçon}\inmargin{Platon, {\em 
Banquet}, 174a}.


\stopnarrower

On pourrait assurément faire mieux en matière d'édition. Par exemple, 
mettre le texte grec à gauche et sa traduction française à droite sur la 
même page, ce qui donnerait quelque chose comme ceci :


\startnarrower[1*left,1*right]\tfx\setupinterlinespace

\startTwoColumns

\quotation{Ἔφη γάρ οἱ Σωκράτη ἐντυχεῖν λελουμένον τε καὶ τὰς βλαύτας 
ὑποδεδεμένον, ἃ ἐκεῖνος ὀλιγάκις ἐποίει· καὶ ἐρέσθαι αὐτὸν ὅποι ἴοι οὕτω 
καλὸς γεγενημένος. καὶ τὸν εἰπεῖν ὅτι· Ἐπὶ δεῖπνον εἰς Ἀγάθωνος. χθὲς 
γὰρ αὐτὸν διέφυγον τοῖς ἐπινικίοις, φοβηθεὶς τὸν ὄχλον· ὡμολόγησα δ᾽ εἰς 
τήμερον παρέσεσθαι. ταῦτα δὴ ἐκαλλωπισάμην, ἵνα καλὸς παρὰ καλὸν 
ἴω}.\TwoColumns


\quotation{Je rencontrai, dit-il, Socrate, sortant du bain et les pieds 
chaussés de sandales, ce qui n'est guère dans ses habitudes, et je lui 
demandai où il allait si beau. Il me répondit : «Je vais dîner chez 
Agathon. Je me suis dérobé hier à la fête qu'il a donnée en l'honneur de 
sa victoire, parce que je craignais la foule ; mais je me suis engagé à 
venir le lendemain : voilà pourquoi je me suis paré ; je voulais être 
beau pour venir chez un beau garçon}.


\stopTwoColumns

\stopnarrower

\section{Éditer avec \LaTeX : l'alternative \ConTeXt}

Les lecteurs habitués ont reconnu dans les paragraphes précédents la 
marque et la technique du logiciel d'édition \LaTeX. Cependant, 
l'utilisation de ce logiciel repose sur un ensemble assez important de 
déclarations et il est nécessaire d'avoir une longue pratique pour 
arriver à jouer avec, sinon la puissance, du moins la finesse de \LaTeX. 
Les commandes sont très nombreuses et il faut recourir souvent à un 
Manuel pour se remémorer les subtilités qui ont permis d'atteindre tel 
rendu à l'impression. Bien entendu, il existe des logiciels commerciaux 
d'aide à l'édition professionnelle pour le secteur des Humanités. Mais 
d'une part ils sont payants et relativement coûteux pour une personne, 
sans parler du prix des licences pour les groupements professionnels 
d'enseignants et de chercheurs.


Devant cet état de choses, on peut se tourner vers \ConTeXt, qui n'est 
pas une alternative à \LaTeX, mais une manière plus synthétique (voire 
plus élégante) d'utiliser \LaTeX. \ConTeXt, de même que \LaTeX, est une 
suite logicielle qui contient les macros de \LaTeX, les routines du 
langage {\em Perl}, ainsi que les macros de \LuaTeX. On peut donc 
définir à peu près tout ce qui est exigé au niveau de l'édition 
professionnelle, sans entrer dans la connaissance technique du langage 
\LaTeX. Bien entendu, on n'échappera pas à un certain nombre de 
questions techniques, si l'on veut travailler avec ce type d'outil : 
pour le mathématicien, rendre possible la présentation et l'édition 
parfaites d'équations complexes, mais aussi de schémas et de tableaux 
nécessite un apprentissage assez poussé. C'est vrai aussi pour les les 
utilisateurs qui viennent des Humanités, qui connaissent leur domaine, 
et qui veulent rédiger un document simple, un article de revue, voir des 
chapitres entiers d'un ouvrage. Très certainement, ce sont les éditeurs 
qui se chargent de la mise en page (sur la base d'une feuille de style 
Word) du document que l'on veut publier. Mais parfois, s'il s'agit d'un 
dossier de plusieurs articles, voire d'une édition avec une aide 
financière à la publication, on aimerait avoir la main sur la qualité du 
document imprimé. C'est une des raisons qui font que l'on pourrait 
désirer maîtriser la chaîne éditoriale, non seulement pour se passer 
éventuellement d'un éditeur, mais pour disposer d'un aperçu de son 
propre travail.



\section{Faire coexister du Grec, du Chinois et de l'Arabe dans le même 
texte}


Il n'est pas d'usage commun de lire dans le même document du texte 
courant en français, une référence en grec, par exemple, lorsque dans le 
{\em Timée}, Platon indique que le plus difficile est de commencer par 
un commencement qui soit naturel (κατὰ φύσιν ἀρχήν)\inmargin{Platon, 
{\em Timée}, 29b.}, une indication du nom du philosophe chinois {\em 
Tchouang Tseu} (en {\em pinyin}\footnote{Le {\em pinyin} (chinois 
classique 漢語拼音, littéralement “assembler les sons de la langue des 
Han”), est une romanisation de la langue chinoise, qui est écrite en 
alphabet latin. Ainsi, au lieu d'écrire 漢語拼音 en chinois traditionnel, ou 
bien 汉语拼音 en chinois simplifié, on écrira {\em Hànyù Pīnyīn}.} Zhuangzi 
et en chinois classique et simplifié :

[NTG-context] Re: output filename with SHA256

2024-02-27 Thread Pablo Rodriguez via ntg-context
On 2/23/24 23:58, Bruce Horrocks wrote:
>> On 23 Feb 2024, at 13:32, Pablo Rodriguez via ntg-context 
>>  wrote:
>> [...]
>> Is there any way to check if compilation needs any other run?
>> [...]
> Rather than use the wrapup() hook can why not rename the file using
> a second job on the command line?
>
> So your compile command might look like:
>
>   $ context jobname.tex add_sha.tex

Hi Bruce,

this totally makes sense to me.

But (shame on me!) this is the first time I will type context followed
by two files.

This is also the first time when I see that invoking ConTeXt with more
than a file makes sense to me.

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: output filename with SHA256

2024-02-23 Thread mf

Il 23/02/24 14:32, Pablo Rodriguez via ntg-context ha scritto:

Dear list,

I have the following sample file:

\starttext
whatever

\startluacode
luatex.wrapup(
   function()
 local t = {}
 local pdf_file_name = tex.jobname..".pdf"
 local sha_pdf = utilities.sha2.hash256(io.loaddata(pdf_file_name))
 local c_r = environment.currentrun
 t[c_r] =  sha_pdf
 local exists_pdf = ("%s_%s-%s.pdf"):format(c_r-1, tex.jobname, t[c_r-1])
 if io.exists(exists_pdf) then os.remove(exists_pdf) end
 os.rename(pdf_file_name, ("%s_%s-%s.pdf"):format(c_r, tex.jobname,
sha_pdf))
   end
)
\stopluacode
\stoptext

In short, it adds its SHA256 to the final filename.

Since renames the PDF document in each run, I would like to remove the
output from the previous run.

The table seems not to store the value from a previous run.

I see now that I am creating it again with each run.

Is there any way to check if compilation needs any other run?

Many thanks for your help,

Pablo
___


Hello Pablo,

you can keep the log, tuc and pdf file of every run with the --keeplog, 
--keeptuc and --keeppdf options (type "context --help --expert" to know 
about the file naming).


A new run is started unless:

- the maxruns number of runs has been reached

- the tuc file is identical to the one of the previous run

Massi
___
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 lines in tables?

2024-02-22 Thread Henning Hraban Ramm

Am 22.02.24 um 18:35 schrieb Hans Hagen via ntg-context:

On 2/21/2024 7:47 PM, Henning Hraban Ramm wrote:

(I’m sure I already used that somewhere… Must document…)
ok, new feature dedicated to Hraban ... who then of course has to 
document it.


This is nice.
Thank you, will do.

(Actually I’m not much interested in dashed borders but to have lines 
affected by my sketchy style - courtesy of Aditya et al., see below)


Taco, will the syntax pages in the wiki update automatically to a newer 
version?



"""
\startuseMPgraphic{mp:sketchy}
input mp-sketch.mp;
sketchypaths;

sketch_amount := 1 + (uniformdeviate 2);
sketch_passes := 3;
sketch_segments := 2 + (uniformdeviate 3);
sketch_length := OverlayWidth / 3;

draw topboundary withpen pensquare withcolor lightgray;
naturalizepaths;
\stopuseMPgraphic

\defineoverlay[sketchylines][\useMPgraphic{mp:sketchy}]

\setupTABLE[r][first][style=bold]
\setupTABLE[r][each][
topoffset=1em,bottomoffset=0.5em,
background=sketchylines,
% would be nice if the background wouldn’t start at each column
]
\setupTABLE[c][each][frame=off]
\bTABLE[]
\bTR
\bTD{Stadt}\eTD
\bTD{Land}\eTD
\bTD{Fluss}\eTD
\eTR
\dorecurse{10}{
\bTR
\bTD\strut \eTD\bTD \eTD\bTD \eTD
\eTR
}
\eTABLE
"""


Hraban%D \module
%D   [   file=mp-sketch.mp
%Dversion=2021.05.13
%D  title=\CONTEXT\ \METAPOST\ graphics,
%D   subtitle=Sketch drawing,
%D author=Aditya Mahajan,
%D   date=\currentdate,
%D  copyright={Aditya Mahajan}]

%D This metapost module is inspired by a TeX.SE question:
%D http://tex.stackexchange.com/q/39296/323
%D
%D I thought that it would be fun to implement a similar feature in MetaPost.
%D
%D To use this package in MetaPost:
%D
%D \starttyping
%Dinput mp-sketch;
%D
%Dbeginfig(1)
%D  sketchypaths; % Make draw and fill sketchy
%D  ...
%D  naturalizepaths; % Restore the value of draw and fill
%D  ...
%Dendfig
%D \stoptyping
%D
%D The code is heavily inspired by Hans Hagen's Metafun macros.
%D
%D The macro \type{sketchypaths} is modeled after \type{visualizepaths} from
%D \filename{mp-tool}.

def sketchypaths =
let draw = sketchdraw ;
let fill = sketchfill ;
enddef ;

%D Check if \filename{mp-tool} is loaded
if not known context_tool :
  let normaldraw = draw;
  let normalfill = fill;

  def naturalizepaths =
  let fill = normalfill ;
  let draw = normaldraw ;
  enddef ;
fi

%D The variable \type{sketch_amount} determines the amount of randomness in the
%D drawing
numeric sketch_amount; sketch_amount := 0.75bp;

%D The variable \type{sketch_passes} determines the number of times the path
%D is drawn
numeric sketch_passes; sketch_passes := 1;

%D Based on \type{randomized}. Assumes p is path:
numeric sketch_segments; sketch_segments := 20;

%D Length (time) of line segments:
numeric sketch_length; sketch_length := 5mm;

primarydef p sketchrandomized s = (
if path p :
for t = 0 step 1/sketch_segments until 1-1/sketch_segments :
((point   (t*arclength(p)) on p) 
randomshifted s) .. controls
((postcontrol (t*arclength(p)) on p) 
randomshifted s) and
((precontrol  ((t+1/sketch_segments)*arclength(p)) on p) 
randomshifted s) ..
endfor
% TODO: beide Ansätze kombinieren. Eckpunkte erhalten!

%for t = 0 step sketch_length until arclength p:
%  (point (arctime t of p) of p) randomshifted s ..
%endfor
if cycle p : % funktioniert nicht
  cycle
else :
  ((point   (arclength(p)) on p) randomshifted 
s)
  %(point (arctime t of p) of p) randomshifted s
fi
else :
p
fi
) enddef ;



%D The macro \type{sketchdraw} draws the randomized path. The
%D \type{expr} ... \type{text} trick is copied from the definition of
%D \type{drawarrow}
def sketchdraw expr p =
   do_sketchdraw(p)
enddef;

def do_sketchdraw(expr p) text t =
  if (path p) :
  for i = 1 upto max(1,sketch_passes) :
normaldraw p
   sketchrandomized sketch_amount
   withtransparency ("multiply", 1/max(1,sketch_passes))
   t ;
  endfor;
  else :
  normaldraw p t;
  fi
enddef;

%D The macro \type{sketchfill} randomizes the path before filling it.
def sketchfill expr p =
  do_sketchfill(p)
enddef ;

def do_sketchfill(expr p) text t =
  if (path p) :
  for i = 1 upto max(1,sketch_passes) :
normalfill p
   sketchrandomized sketch_amount
   withtransparency ("multiply", 1/max(1,sketch_passes))
   t ;
  endfor;
  else :
  normalfill p t;
  fi
enddef;

picture NoisePattern;
NoisePattern := image(
  pickup pencircle xyscaled 0.5bp;
  numeric pmax ; pmax := 7 ;
  numeric x ; numeric y ;
for i = 1 upto pmax:
for j = 1 upto pmax:
  

[NTG-context] Re: Sorry for once more asking, i am at Work

2024-02-21 Thread Ursula Hermann
Dear Pablo and Gavin, 

Many many many Thanks. Ok so I took pdflatex away now, and could compile 
selected. 

Uschi 

-Ursprüngliche Nachricht-
Von: Pablo Rodriguez via ntg-context  
Gesendet: Mittwoch, 21. Februar 2024 10:24
An: Gavin via ntg-context 
Cc: Pablo Rodriguez 
Betreff: [NTG-context] Re: Sorry for once more asking, i am at Work

On 2/20/24 19:03, Gavin via ntg-context wrote:
> […]
> I don’t know how you are calling PdfLaTeX to typeset your document, 
> context-test.tex, but that is what you are doing.

Hi Uschi and Gavin,

I will try to go the same way you propose, Gavin. Otherwise, Uschi may find it 
hard to follow totally independent suggestions.

Uschi, if you are compiling your ConTeXt sources using WinEdt, your issue might 
be the wrong button (or the wrong keystroke combination).

You might be invoking pdflatex directly, or maybe a button or keystroke 
combination is labelled ConTeXt and it may really be invoking pdflatex.

In that case, you have to check WinEdt to see which command is run when you 
start the compilation process (which command you really invoke).

Another way to see which ConTeXt binary you invoke would be to type in the 
command prompt "context --version" (with no path specified) and "where context".

But this is independent from the issue that you get pdflatex when you intend 
context.

I hope it helps now,

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Sorry for once more asking, i am at Work

2024-02-21 Thread Pablo Rodriguez via ntg-context
On 2/20/24 19:03, Gavin via ntg-context wrote:
> […]
> I don’t know how you are calling PdfLaTeX to typeset your document,
> context-test.tex, but that is what you are doing.

Hi Uschi and Gavin,

I will try to go the same way you propose, Gavin. Otherwise, Uschi may
find it hard to follow totally independent suggestions.

Uschi, if you are compiling your ConTeXt sources using WinEdt, your
issue might be the wrong button (or the wrong keystroke combination).

You might be invoking pdflatex directly, or maybe a button or keystroke
combination is labelled ConTeXt and it may really be invoking pdflatex.

In that case, you have to check WinEdt to see which command is run when
you start the compilation process (which command you really invoke).

Another way to see which ConTeXt binary you invoke would be to type in
the command prompt "context --version" (with no path specified) and
"where context".

But this is independent from the issue that you get pdflatex when you
intend context.

I hope it helps now,

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: Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Emanuel Han via ntg-context
Thanks Mikael. This helped indeed.
I updated my example on the Metapost page in the wiki accordingly.

The`pagestate=start` functionality is not documented in the wiki. It's not 
clear for which context commands it can or should be used. Who is willing to 
help out here?
Best regards
Emanuel
On Feb. 19 2024, at 2:39 pm, Mikael Sundqvist  wrote:
> Hi,
>
> Try
> \startTEXpage[pagestate=start]
> /Mikael
> On Mon, Feb 19, 2024 at 2:31 PM Emanuel Han via ntg-context
>  wrote:
> >
> >  I just made a strange observation in the output pdf of the attached 
> > layer_set.tex, which is that when opening it with a pdf viewer like skim or 
> > macos preview and showing miniatures, all pages except the last one show 
> > page number 1 (the last showing page number 2).
> >
> > Which was not the case with the output pdf of the attached 
> > multipage_metapost_mwe-very_simple.tex.
> >
> > How can I change my code to have proper consecutive page numbering in a pdf 
> > viewer?
> >
> > On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context 
> >  wrote:
> >
> > I think I could solve all the problems. Attached the finalized working 
> > example. I created the 
> > https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages 
> > entry with it. Feel free to modify.
> >
> > Cheers
> > Emanuel
> >
> > On Feb. 16 2024, at 7:56 am, Mikael Sundqvist  wrote:
> >
> > Hi,
> >
> > not sure I get what you are missing. But you can try
> >
> > setbounds currentpicture to (fullsquare scaled 200) ;
> >
> > in base. And then do
> >
> > \dorecurse{5}{
> > \startTEXpage[offset=1DK]
> > \useMPgraphic{layerset#1}
> > \stopTEXpage
> > }
> >
> > if that is the looping you are after.
> >
> > /Mikael
> >
> > On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context
> >  wrote:
> > >
> > > Resp. the solution should be such that each generated PDF page has the 
> > > same dimension, the same background colour and a page number and the 
> > > metapost content on each page has the same scaling factor.
> > >
> > > On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context 
> > >  wrote:
> > >
> > > Dear Mikael,
> > >
> > > I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> > > on), because I need the "setbounds currentpicture to TheFrame" and also 
> > > because I need page numbering inside the MPpage, as done with draw 
> > > textext(decimal(currentime)).
> > >
> > > So, how can I use the \useMPgraphic{layerset1} etc. inside the 
> > > \dorecurse, assuming I name my layersets "layerset1", "layerset2", 
> > > "layerset3" etc.?
> > >
> > > Emanuel
> > >
> > > On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
> > >  wrote:
> > >
> > > Dear Mikael,
> > > thanks a lot!
> > > this seems to be the solution! And it looks beatiful enough to me 
> > > I'll try to port all my layers to this new method and see if I run into 
> > > new problems again 
> > >
> > > Emanuel
> > >
> > >
> > > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> > >
> > > Hi
> > >
> > > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> > >  wrote:
> > > >
> > > > Dear list,
> > > >
> > > > the attached .tex file is the minimal working example we discussed 
> > > > today in the online meeting.
> > > >
> > > > I realized that the approach of looping through k of p[k] is not 
> > > > fitting my needs, because it's not flexible enough.
> > > >
> > > > I need another approach, one which works with layer sets.
> > > >
> > > > I would stop using p as an array, because with the layer sets approach 
> > > > we don't have a fixed order of the layers.
> > > >
> > > > So the definition of the layers would be something like
> > > >
> > > > picture layerA;
> > > > layerA:=image(
> > > > label("Word 1", z1);
> > > > );
> > > >
> > > > picture layerW;
> > > > layerW:=image(
> > > > label("Mot 2", z2);
> > > > );
> > > >
> > > > picture layerM;
> > > > layerM:=image(
> > > > label("Parola 3"

[NTG-context] Re: Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Mikael Sundqvist
Hi,

Try

\startTEXpage[pagestate=start]

/Mikael

On Mon, Feb 19, 2024 at 2:31 PM Emanuel Han via ntg-context
 wrote:
>
>  I just made a strange observation in the output pdf of the attached 
> layer_set.tex, which is that when opening it with a pdf viewer like skim or 
> macos preview and showing miniatures, all pages except the last one show page 
> number 1 (the last showing page number 2).
>
> Which was not the case with the output pdf of the attached 
> multipage_metapost_mwe-very_simple.tex.
>
> How can I change my code to have proper consecutive page numbering in a pdf 
> viewer?
>
> On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context 
>  wrote:
>
> I think I could solve all the problems. Attached the finalized working 
> example. I created the 
> https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry 
> with it. Feel free to modify.
>
> Cheers
> Emanuel
>
> On Feb. 16 2024, at 7:56 am, Mikael Sundqvist  wrote:
>
> Hi,
>
> not sure I get what you are missing. But you can try
>
> setbounds currentpicture to (fullsquare scaled 200) ;
>
> in base. And then do
>
> \dorecurse{5}{
> \startTEXpage[offset=1DK]
> \useMPgraphic{layerset#1}
> \stopTEXpage
> }
>
> if that is the looping you are after.
>
> /Mikael
>
> On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context
>  wrote:
> >
> > Resp. the solution should be such that each generated PDF page has the same 
> > dimension, the same background colour and a page number and the metapost 
> > content on each page has the same scaling factor.
> >
> > On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context 
> >  wrote:
> >
> > Dear Mikael,
> >
> > I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> > on), because I need the "setbounds currentpicture to TheFrame" and also 
> > because I need page numbering inside the MPpage, as done with draw 
> > textext(decimal(currentime)).
> >
> > So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
> > assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
> >
> > Emanuel
> >
> > On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
> >  wrote:
> >
> > Dear Mikael,
> > thanks a lot!
> > this seems to be the solution! And it looks beatiful enough to me 
> > I'll try to port all my layers to this new method and see if I run into new 
> > problems again 
> >
> > Emanuel
> >
> >
> > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> >
> > Hi
> >
> > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> >  wrote:
> > >
> > > Dear list,
> > >
> > > the attached .tex file is the minimal working example we discussed today 
> > > in the online meeting.
> > >
> > > I realized that the approach of looping through k of p[k] is not fitting 
> > > my needs, because it's not flexible enough.
> > >
> > > I need another approach, one which works with layer sets.
> > >
> > > I would stop using p as an array, because with the layer sets approach we 
> > > don't have a fixed order of the layers.
> > >
> > > So the definition of the layers would be something like
> > >
> > > picture layerA;
> > > layerA:=image(
> > > label("Word 1", z1);
> > > );
> > >
> > > picture layerW;
> > > layerW:=image(
> > > label("Mot 2", z2);
> > > );
> > >
> > > picture layerM;
> > > layerM:=image(
> > > label("Parola 3", z3);
> > > );
> > >
> > > picture layerC;
> > > layerC:=image(
> > > label("Wort 4", z3+z1);
> > > );
> > >
> > > picture layerY;
> > > layerY:=image(
> > > label("Nummer 5", z2+z3);
> > > );
> > >
> > > picture layerU;
> > > layerU:=image(
> > > label("number 6", z2+z1);
> > > );
> > >
> > > After that, I would define layer sets and layer subsets. This will be 
> > > done manually for each layer set and each layer subset.
> > > I don't know the proper syntax to do that. Let's assume we could use a 
> > > variable type called "myset".
> > >
> > > myset layersubsetGamma;
> > > layersubsetGamma:={layerU,layerM};
> > >
> > > In my logic, the layers will be drawn i

[NTG-context] Fwd: Re: Working with layer sets with Metapost

2024-02-19 Thread Emanuel Han via ntg-context
 I just made a strange observation in the output pdf of the attached layer_set.tex, which is that when opening it with a pdf viewer like skim or macos preview and showing miniatures, all pages except the last one show page number 1 (the last showing page number 2). Which was not the case with the output pdf of the attached multipage_metapost_mwe-very_simple.tex. How can I change my code to have proper consecutive page numbering in a pdf viewer?On Feb. 17 2024, at 11:03 am, Emanuel Han via ntg-context  wrote:I think I could solve all the problems. Attached the finalized working example. I created the https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry with it. Feel free to modify.CheersEmanuelOn Feb. 16 2024, at 7:56 am, Mikael Sundqvist  wrote:Hi,not sure I get what you are missing. But you can trysetbounds currentpicture to (fullsquare scaled 200) ;in base. And then do\dorecurse{5}{\startTEXpage[offset=1DK]\useMPgraphic{layerset#1}\stopTEXpage}if that is the looping you are after./MikaelOn Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context wrote:>> Resp. the solution should be such that each generated PDF page has the same dimension, the same background colour and a page number and the metapost content on each page has the same scaling factor.>> On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context  wrote:>> Dear Mikael,>> I actually need to keep the \dorecurse mechanism of the mwe (from line 44 on), because I need the "setbounds currentpicture to TheFrame" and also because I need page numbering inside the MPpage, as done with draw textext(decimal(currentime)).>> So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?>> Emanuel>> On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context  wrote:>> Dear Mikael,> thanks a lot!> this seems to be the solution! And it looks beatiful enough to me > I'll try to port all my layers to this new method and see if I run into new problems again >> Emanuel>>> On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:>> Hi>> On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context>  wrote:> >> > Dear list,> >> > the attached .tex file is the minimal working example we discussed today in the online meeting.> >> > I realized that the approach of looping through k of p[k] is not fitting my needs, because it's not flexible enough.> >> > I need another approach, one which works with layer sets.> >> > I would stop using p as an array, because with the layer sets approach we don't have a fixed order of the layers.> >> > So the definition of the layers would be something like> >> > picture layerA;> > layerA:=image(> > label("Word 1", z1);> > );> >> > picture layerW;> > layerW:=image(> > label("Mot 2", z2);> > );> >> > picture layerM;> > layerM:=image(> > label("Parola 3", z3);> > );> >> > picture layerC;> > layerC:=image(> > label("Wort 4", z3+z1);> > );> >> > picture layerY;> > layerY:=image(> > label("Nummer 5", z2+z3);> > );> >> > picture layerU;> > layerU:=image(> > label("number 6", z2+z1);> > );> >> > After that, I would define layer sets and layer subsets. This will be done manually for each layer set and each layer subset.> > I don't know the proper syntax to do that. Let's assume we could use a variable type called "myset".> >> > myset layersubsetGamma;> > layersubsetGamma:={layerU,layerM};> >> > In my logic, the layers will be drawn in the order of their appearance within the {}. In the example, drawn content of layerM might cover drawn content of layerU.> >> > Contrary to a layer subset, each layer set will result in a PDF page, and thus the layer sets are related to each other by an inner order. That's why I would use an array variable here with [].> >> > I don't know how to append a set. In the following example, I assumed there would be a function myappend(, )> >> > myset layerset[];> > layerset1 := {layerW,layerA};> > layerset2 := myappend{layerset1, layerY};> > layerset3 := myappend{layerset2, layersubsetGamma};> > layerset4 := myappend{layerset2, layerU};> > layerset5 := myappend{layerset4, layersubsetGamma};> >> > Finally, I would need each layerset[k] typeset on its own pdf page. And of course on each page k, only the layers which appear in the definition of the layerset[k] should be drawn on top of each other in the order as they appear in that definition.> >>

[NTG-context] Re: Problem with wiki example

2024-02-17 Thread Shiv Shankar Dayal
Never mind it was my idiocy.

On Sun, Feb 18, 2024 at 3:29 AM Shiv Shankar Dayal <
shivshankar.da...@gmail.com> wrote:

> I found following on Wiki to produce PDF out of standalone type(
> https://wiki.contextgarden.net/Sharing_graphics):
>
> \starttext
>  \startMPpage
>   draw fullcircle scaled 10cm ;
>  \stopMPPage
> \stoptext
>
> It generates a PDF but when I open it with Evince, Evince complains that
> no page was found
> and does not show anything. Any help would be much appreciated.
>
> --
> Respect,
> Shiv Shankar Dayal
>


-- 
Respect,
Shiv Shankar Dayal
___
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] Problem with wiki example

2024-02-17 Thread Shiv Shankar Dayal
I found following on Wiki to produce PDF out of standalone type(
https://wiki.contextgarden.net/Sharing_graphics):

\starttext
 \startMPpage
  draw fullcircle scaled 10cm ;
 \stopMPPage
\stoptext

It generates a PDF but when I open it with Evince, Evince complains that no
page was found
and does not show anything. Any help would be much appreciated.

-- 
Respect,
Shiv Shankar Dayal
___
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: Working with layer sets with Metapost

2024-02-17 Thread Emanuel Han via ntg-context
I think I could solve all the problems. Attached the finalized working example. 
I created the 
https://wiki.contextgarden.net/MetaPost#Layer_sets_as_individual_pages entry 
with it. Feel free to modify.

Cheers
Emanuel

On Feb. 16 2024, at 7:56 am, Mikael Sundqvist  wrote:
> Hi,
>
> not sure I get what you are missing. But you can try
> setbounds currentpicture to (fullsquare scaled 200) ;
> in base. And then do
> \dorecurse{5}{
> \startTEXpage[offset=1DK]
> \useMPgraphic{layerset#1}
> \stopTEXpage
> }
>
> if that is the looping you are after.
> /Mikael
> On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context
>  wrote:
> >
> > Resp. the solution should be such that each generated PDF page has the same 
> > dimension, the same background colour and a page number and the metapost 
> > content on each page has the same scaling factor.
> >
> > On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context 
> >  wrote:
> >
> > Dear Mikael,
> >
> > I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> > on), because I need the "setbounds currentpicture to TheFrame" and also 
> > because I need page numbering inside the MPpage, as done with draw 
> > textext(decimal(currentime)).
> >
> > So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
> > assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
> >
> > Emanuel
> >
> > On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
> >  wrote:
> >
> > Dear Mikael,
> > thanks a lot!
> > this seems to be the solution! And it looks beatiful enough to me 
> > I'll try to port all my layers to this new method and see if I run into new 
> > problems again 
> >
> > Emanuel
> >
> >
> > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> >
> > Hi
> >
> > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> >  wrote:
> > >
> > > Dear list,
> > >
> > > the attached .tex file is the minimal working example we discussed today 
> > > in the online meeting.
> > >
> > > I realized that the approach of looping through k of p[k] is not fitting 
> > > my needs, because it's not flexible enough.
> > >
> > > I need another approach, one which works with layer sets.
> > >
> > > I would stop using p as an array, because with the layer sets approach we 
> > > don't have a fixed order of the layers.
> > >
> > > So the definition of the layers would be something like
> > >
> > > picture layerA;
> > > layerA:=image(
> > > label("Word 1", z1);
> > > );
> > >
> > > picture layerW;
> > > layerW:=image(
> > > label("Mot 2", z2);
> > > );
> > >
> > > picture layerM;
> > > layerM:=image(
> > > label("Parola 3", z3);
> > > );
> > >
> > > picture layerC;
> > > layerC:=image(
> > > label("Wort 4", z3+z1);
> > > );
> > >
> > > picture layerY;
> > > layerY:=image(
> > > label("Nummer 5", z2+z3);
> > > );
> > >
> > > picture layerU;
> > > layerU:=image(
> > > label("number 6", z2+z1);
> > > );
> > >
> > > After that, I would define layer sets and layer subsets. This will be 
> > > done manually for each layer set and each layer subset.
> > > I don't know the proper syntax to do that. Let's assume we could use a 
> > > variable type called "myset".
> > >
> > > myset layersubsetGamma;
> > > layersubsetGamma:={layerU,layerM};
> > >
> > > In my logic, the layers will be drawn in the order of their appearance 
> > > within the {}. In the example, drawn content of layerM might cover drawn 
> > > content of layerU.
> > >
> > > Contrary to a layer subset, each layer set will result in a PDF page, and 
> > > thus the layer sets are related to each other by an inner order. That's 
> > > why I would use an array variable here with [].
> > >
> > > I don't know how to append a set. In the following example, I assumed 
> > > there would be a function myappend(,  > > initial set should be appended with>)
> > >
> > > myset layerset[];
> > > layerset1 := {layerW,layerA};
> > > layerset2 := myappend{layerset1, layerY};
> > > layerset3 := myapp

[NTG-context] behaviour sy in externalfigure

2024-02-16 Thread Hans van der Meer via ntg-context

The scaling in \externalfigure[][] with option sy=number seems to have a discrete change in behaviour between sy=1.0 and sy=(not 1.0).The MWE (see below, FIGURE REMOVED BECAUSE OTHERWISE  MESSAGE TOO LARGE) shows that factor sy≠1.0 is applied to the original height of the figure, but for sy=1.0 the height is changed proportional to the reduction in width.Thus the series sy=0.999 sy=1.0 sy=1.001 has a discontinuity in the scaling of height.I would expect sy=1.0 to return the figure in the original height.Is this behaviour on purpose? With the current behaviour I must provide for sy=1.0 => sy=1.001 in order to get the original height. Although not to difficult with a jump to Lua code, I would prefer not.yours sincerelydr. Hans van der Meer\starttext\ConTeXt\space version \contextversion\blank\type{\externalfigure[testfile.jpg]} source figure\crlf\externalfigure[testfile.jpg]\crlf\type{\externalfigure[testfile.jpg][width=5cm]}\crlf\externalfigure[testfile.jpg][width=5cm]\crlfExplanation: height scaled proportional to the width reduction.\blank\type{\externalfigure[testfile.jpg][width=5cm,sy=0.999]}\crlf\externalfigure[testfile.jpg][width=5cm,sy=1.001]\crlfExplanation: sy different from 1.0 applies sy to original height.\blank\type{\externalfigure[testfile.jpg][width=5cm,sy=1.0]}\crlf\externalfigure[testfile.jpg][width=5cm,sy=1.0]\crlfExplanation: sy=1.0 exactly is ignored?\blank\type{\externalfigure[testfile.jpg][width=5cm,sy=1.001]}\crlf\externalfigure[testfile.jpg][width=5cm,sy=1.001]\crlfExplanation: sy different from 1.0 applies sy to original height.\blank\stoptext

testsyscaling.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: Working with layer sets with Metapost

2024-02-15 Thread Mikael Sundqvist
Hi,

not sure I get what you are missing. But you can try

setbounds currentpicture to (fullsquare scaled 200) ;

in base. And then do

\dorecurse{5}{
\startTEXpage[offset=1DK]
\useMPgraphic{layerset#1}
\stopTEXpage
}

if that is the looping you are after.

/Mikael

On Fri, Feb 16, 2024 at 6:54 AM Emanuel Han via ntg-context
 wrote:
>
> Resp. the solution should be such that each generated PDF page has the same 
> dimension, the same background colour and a page number and the metapost 
> content on each page has the same scaling factor.
>
> On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context 
>  wrote:
>
> Dear Mikael,
>
> I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> on), because I need the "setbounds currentpicture to TheFrame" and also 
> because I need page numbering inside the MPpage, as done with draw 
> textext(decimal(currentime)).
>
> So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
> assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
>
> Emanuel
>
> On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
>  wrote:
>
> Dear Mikael,
> thanks a lot!
> this seems to be the solution! And it looks beatiful enough to me 
> I'll try to port all my layers to this new method and see if I run into new 
> problems again 
>
> Emanuel
>
>
> On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
>
> Hi
>
> On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
>  wrote:
> >
> > Dear list,
> >
> > the attached .tex file is the minimal working example we discussed today in 
> > the online meeting.
> >
> > I realized that the approach of looping through k of p[k] is not fitting my 
> > needs, because it's not flexible enough.
> >
> > I need another approach, one which works with layer sets.
> >
> > I would stop using p as an array, because with the layer sets approach we 
> > don't have a fixed order of the layers.
> >
> > So the definition of the layers would be something like
> >
> > picture layerA;
> > layerA:=image(
> > label("Word 1", z1);
> > );
> >
> > picture layerW;
> > layerW:=image(
> > label("Mot 2", z2);
> > );
> >
> > picture layerM;
> > layerM:=image(
> > label("Parola 3", z3);
> > );
> >
> > picture layerC;
> > layerC:=image(
> > label("Wort 4", z3+z1);
> > );
> >
> > picture layerY;
> > layerY:=image(
> > label("Nummer 5", z2+z3);
> > );
> >
> > picture layerU;
> > layerU:=image(
> > label("number 6", z2+z1);
> > );
> >
> > After that, I would define layer sets and layer subsets. This will be done 
> > manually for each layer set and each layer subset.
> > I don't know the proper syntax to do that. Let's assume we could use a 
> > variable type called "myset".
> >
> > myset layersubsetGamma;
> > layersubsetGamma:={layerU,layerM};
> >
> > In my logic, the layers will be drawn in the order of their appearance 
> > within the {}. In the example, drawn content of layerM might cover drawn 
> > content of layerU.
> >
> > Contrary to a layer subset, each layer set will result in a PDF page, and 
> > thus the layer sets are related to each other by an inner order. That's why 
> > I would use an array variable here with [].
> >
> > I don't know how to append a set. In the following example, I assumed there 
> > would be a function myappend(,  > set should be appended with>)
> >
> > myset layerset[];
> > layerset1 := {layerW,layerA};
> > layerset2 := myappend{layerset1, layerY};
> > layerset3 := myappend{layerset2, layersubsetGamma};
> > layerset4 := myappend{layerset2, layerU};
> > layerset5 := myappend{layerset4, layersubsetGamma};
> >
> > Finally, I would need each layerset[k] typeset on its own pdf page. And of 
> > course on each page k, only the layers which appear in the definition of 
> > the layerset[k] should be drawn on top of each other in the order as they 
> > appear in that definition.
> >
> > I'm very curious to hear your suggestions.
> >
>
> Not beautiful, perhaps, but maybe something like this could work? I
> think there is no way out of doing some manual work to tell what you
> want included on each page.
>
> \startuseMPgraphic{base}
> z1 = origin ;
> z2 = (10,50) ;
> z3 = (40,30) ;
>
> picture layerA;
> layerA:=image(
> label("Word 1", z1);

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
Resp. the solution should be such that each generated PDF page has the same 
dimension, the same background colour and a page number and the metapost 
content on each page has the same scaling factor.

On Feb. 15 2024, at 11:10 pm, Emanuel Han via ntg-context  
wrote:
> Dear Mikael,
>
> I actually need to keep the \dorecurse mechanism of the mwe (from line 44 
> on), because I need the "setbounds currentpicture to TheFrame" and also 
> because I need page numbering inside the MPpage, as done with draw 
> textext(decimal(currentime)).
> So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
> assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
> Emanuel
> On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context 
>  wrote:
> > Dear Mikael,
> > thanks a lot!
> > this seems to be the solution! And it looks beatiful enough to me 
> > I'll try to port all my layers to this new method and see if I run into new 
> > problems again 
> >
> > Emanuel
> >
> > On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> > > Hi
> > >
> > > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> > >  wrote:
> > > >
> > > > Dear list,
> > > >
> > > > the attached .tex file is the minimal working example we discussed 
> > > > today in the online meeting.
> > > >
> > > > I realized that the approach of looping through k of p[k] is not 
> > > > fitting my needs, because it's not flexible enough.
> > > >
> > > > I need another approach, one which works with layer sets.
> > > >
> > > > I would stop using p as an array, because with the layer sets approach 
> > > > we don't have a fixed order of the layers.
> > > >
> > > > So the definition of the layers would be something like
> > > >
> > > > picture layerA;
> > > > layerA:=image(
> > > > label("Word 1", z1);
> > > > );
> > > >
> > > > picture layerW;
> > > > layerW:=image(
> > > > label("Mot 2", z2);
> > > > );
> > > >
> > > > picture layerM;
> > > > layerM:=image(
> > > > label("Parola 3", z3);
> > > > );
> > > >
> > > > picture layerC;
> > > > layerC:=image(
> > > > label("Wort 4", z3+z1);
> > > > );
> > > >
> > > > picture layerY;
> > > > layerY:=image(
> > > > label("Nummer 5", z2+z3);
> > > > );
> > > >
> > > > picture layerU;
> > > > layerU:=image(
> > > > label("number 6", z2+z1);
> > > > );
> > > >
> > > > After that, I would define layer sets and layer subsets. This will be 
> > > > done manually for each layer set and each layer subset.
> > > > I don't know the proper syntax to do that. Let's assume we could use a 
> > > > variable type called "myset".
> > > >
> > > > myset layersubsetGamma;
> > > > layersubsetGamma:={layerU,layerM};
> > > >
> > > > In my logic, the layers will be drawn in the order of their appearance 
> > > > within the {}. In the example, drawn content of layerM might cover 
> > > > drawn content of layerU.
> > > >
> > > > Contrary to a layer subset, each layer set will result in a PDF page, 
> > > > and thus the layer sets are related to each other by an inner order. 
> > > > That's why I would use an array variable here with [].
> > > >
> > > > I don't know how to append a set. In the following example, I assumed 
> > > > there would be a function myappend(,  > > > initial set should be appended with>)
> > > >
> > > > myset layerset[];
> > > > layerset1 := {layerW,layerA};
> > > > layerset2 := myappend{layerset1, layerY};
> > > > layerset3 := myappend{layerset2, layersubsetGamma};
> > > > layerset4 := myappend{layerset2, layerU};
> > > > layerset5 := myappend{layerset4, layersubsetGamma};
> > > >
> > > > Finally, I would need each layerset[k] typeset on its own pdf page. And 
> > > > of course on each page k, only the layers which appear in the 
> > > > definition of the layerset[k] should be drawn on top of each other in 
> > > > the order as they appear in 

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
Dear Mikael,

I actually need to keep the \dorecurse mechanism of the mwe (from line 44 on), 
because I need the "setbounds currentpicture to TheFrame" and also because I 
need page numbering inside the MPpage, as done with draw 
textext(decimal(currentime)).
So, how can I use the \useMPgraphic{layerset1} etc. inside the \dorecurse, 
assuming I name my layersets "layerset1", "layerset2", "layerset3" etc.?
Emanuel
On Feb. 15 2024, at 10:07 pm, Emanuel Han via ntg-context  
wrote:
> Dear Mikael,
> thanks a lot!
> this seems to be the solution! And it looks beatiful enough to me 
> I'll try to port all my layers to this new method and see if I run into new 
> problems again 
>
> Emanuel
>
> On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> > Hi
> >
> > On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
> >  wrote:
> > >
> > > Dear list,
> > >
> > > the attached .tex file is the minimal working example we discussed today 
> > > in the online meeting.
> > >
> > > I realized that the approach of looping through k of p[k] is not fitting 
> > > my needs, because it's not flexible enough.
> > >
> > > I need another approach, one which works with layer sets.
> > >
> > > I would stop using p as an array, because with the layer sets approach we 
> > > don't have a fixed order of the layers.
> > >
> > > So the definition of the layers would be something like
> > >
> > > picture layerA;
> > > layerA:=image(
> > > label("Word 1", z1);
> > > );
> > >
> > > picture layerW;
> > > layerW:=image(
> > > label("Mot 2", z2);
> > > );
> > >
> > > picture layerM;
> > > layerM:=image(
> > > label("Parola 3", z3);
> > > );
> > >
> > > picture layerC;
> > > layerC:=image(
> > > label("Wort 4", z3+z1);
> > > );
> > >
> > > picture layerY;
> > > layerY:=image(
> > > label("Nummer 5", z2+z3);
> > > );
> > >
> > > picture layerU;
> > > layerU:=image(
> > > label("number 6", z2+z1);
> > > );
> > >
> > > After that, I would define layer sets and layer subsets. This will be 
> > > done manually for each layer set and each layer subset.
> > > I don't know the proper syntax to do that. Let's assume we could use a 
> > > variable type called "myset".
> > >
> > > myset layersubsetGamma;
> > > layersubsetGamma:={layerU,layerM};
> > >
> > > In my logic, the layers will be drawn in the order of their appearance 
> > > within the {}. In the example, drawn content of layerM might cover drawn 
> > > content of layerU.
> > >
> > > Contrary to a layer subset, each layer set will result in a PDF page, and 
> > > thus the layer sets are related to each other by an inner order. That's 
> > > why I would use an array variable here with [].
> > >
> > > I don't know how to append a set. In the following example, I assumed 
> > > there would be a function myappend(,  > > initial set should be appended with>)
> > >
> > > myset layerset[];
> > > layerset1 := {layerW,layerA};
> > > layerset2 := myappend{layerset1, layerY};
> > > layerset3 := myappend{layerset2, layersubsetGamma};
> > > layerset4 := myappend{layerset2, layerU};
> > > layerset5 := myappend{layerset4, layersubsetGamma};
> > >
> > > Finally, I would need each layerset[k] typeset on its own pdf page. And 
> > > of course on each page k, only the layers which appear in the definition 
> > > of the layerset[k] should be drawn on top of each other in the order as 
> > > they appear in that definition.
> > >
> > > I'm very curious to hear your suggestions.
> > >
> >
> > Not beautiful, perhaps, but maybe something like this could work? I
> > think there is no way out of doing some manual work to tell what you
> > want included on each page.
> >
> > \startuseMPgraphic{base}
> > z1 = origin ;
> > z2 = (10,50) ;
> > z3 = (40,30) ;
> >
> > picture layerA;
> > layerA:=image(
> > label("Word 1", z1);
> > );
> >
> > picture layerW;
> > layerW:=image(
> > label("Mot 2", z2);
> > );
> >
> > picture layerM;
> > layerM:=image(
> > label("Parola 3", z3);
> > 

[NTG-context] Re: Working with layer sets with Metapost

2024-02-15 Thread Emanuel Han via ntg-context
Dear Mikael,
thanks a lot!
this seems to be the solution! And it looks beatiful enough to me 
I'll try to port all my layers to this new method and see if I run into new 
problems again 

Emanuel

On Feb. 15 2024, at 8:19 am, Mikael Sundqvist  wrote:
> Hi
>
> On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
>  wrote:
> >
> > Dear list,
> >
> > the attached .tex file is the minimal working example we discussed today in 
> > the online meeting.
> >
> > I realized that the approach of looping through k of p[k] is not fitting my 
> > needs, because it's not flexible enough.
> >
> > I need another approach, one which works with layer sets.
> >
> > I would stop using p as an array, because with the layer sets approach we 
> > don't have a fixed order of the layers.
> >
> > So the definition of the layers would be something like
> >
> > picture layerA;
> > layerA:=image(
> > label("Word 1", z1);
> > );
> >
> > picture layerW;
> > layerW:=image(
> > label("Mot 2", z2);
> > );
> >
> > picture layerM;
> > layerM:=image(
> > label("Parola 3", z3);
> > );
> >
> > picture layerC;
> > layerC:=image(
> > label("Wort 4", z3+z1);
> > );
> >
> > picture layerY;
> > layerY:=image(
> > label("Nummer 5", z2+z3);
> > );
> >
> > picture layerU;
> > layerU:=image(
> > label("number 6", z2+z1);
> > );
> >
> > After that, I would define layer sets and layer subsets. This will be done 
> > manually for each layer set and each layer subset.
> > I don't know the proper syntax to do that. Let's assume we could use a 
> > variable type called "myset".
> >
> > myset layersubsetGamma;
> > layersubsetGamma:={layerU,layerM};
> >
> > In my logic, the layers will be drawn in the order of their appearance 
> > within the {}. In the example, drawn content of layerM might cover drawn 
> > content of layerU.
> >
> > Contrary to a layer subset, each layer set will result in a PDF page, and 
> > thus the layer sets are related to each other by an inner order. That's why 
> > I would use an array variable here with [].
> >
> > I don't know how to append a set. In the following example, I assumed there 
> > would be a function myappend(,  > set should be appended with>)
> >
> > myset layerset[];
> > layerset1 := {layerW,layerA};
> > layerset2 := myappend{layerset1, layerY};
> > layerset3 := myappend{layerset2, layersubsetGamma};
> > layerset4 := myappend{layerset2, layerU};
> > layerset5 := myappend{layerset4, layersubsetGamma};
> >
> > Finally, I would need each layerset[k] typeset on its own pdf page. And of 
> > course on each page k, only the layers which appear in the definition of 
> > the layerset[k] should be drawn on top of each other in the order as they 
> > appear in that definition.
> >
> > I'm very curious to hear your suggestions.
> >
>
> Not beautiful, perhaps, but maybe something like this could work? I
> think there is no way out of doing some manual work to tell what you
> want included on each page.
>
> \startuseMPgraphic{base}
> z1 = origin ;
> z2 = (10,50) ;
> z3 = (40,30) ;
>
> picture layerA;
> layerA:=image(
> label("Word 1", z1);
> );
>
> picture layerW;
> layerW:=image(
> label("Mot 2", z2);
> );
>
> picture layerM;
> layerM:=image(
> label("Parola 3", z3);
> );
>
> picture layerC;
> layerC:=image(
> label("Wort 4", z3+z1);
> );
>
> picture layerY;
> layerY:=image(
> label("Nummer 5", z2+z3);
> );
>
> picture layerU;
> layerU:=image(
> label("number 6", z2+z1);
> );
> \stopuseMPgraphic
>
> \startuseMPgraphic{Gamma}
> draw layerU ;
> draw layerM ;
> \stopuseMPgraphic
>
> \startuseMPgraphic{layerset1}
> \includeMPgraphic{base}
> draw layerW ;
> draw layerA ;
> \stopuseMPgraphic
>
> \startuseMPgraphic{layerset2}
> \includeMPgraphic{layerset1} ;
> draw layerY ;
> \stopuseMPgraphic
>
> \startuseMPgraphic{layerset3}
> \includeMPgraphic{layerset2} ;
> \includeMPgraphic{Gamma} ;
> \stopuseMPgraphic
>
>
> \startuseMPgraphic{layerset4}
> \includeMPgraphic{layerset2} ;
> draw layerU ;
> \stopuseMPgraphic
>
> \startuseMPgraphic{layerset5}
> \includeMPgraphic{layerset4} ;
> \includeMPgraphic{Gamma} ;
> \stopuseMPgraphi

[NTG-context] /AFRelationship for attachments

2024-02-15 Thread Pablo Rodriguez via ntg-context
Dear list,

the new lpdf-wid.lmt contains in lines 302 and 377:

  local relation  = specification.relation or "Unspecified"

  AFRelationship = pdfconstant(relation),

The following sample compiled with current latest:

  \setupinteraction[state=start]
  \starttext
  attachment\attachment[method=hidden, relation=Data, file=xml-mkiv.pdf]
  \stoptext

Gives the following object:

  2 0 obj
  <<
/AFRelationship /Unspecified
/EF <<
  /F 1 0 R
>>
    /F (xml-mkiv.pdf)
/Type /Filespec
/UF 
  >>
  endobj

Sorry, but which is the right way to specify the /AFRelationship for
embedded documents?

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: Working with layer sets with Metapost

2024-02-14 Thread Mikael Sundqvist
Hi

On Thu, Feb 15, 2024 at 1:03 AM Emanuel Han via ntg-context
 wrote:
>
> Dear list,
>
> the attached .tex file is the minimal working example we discussed today in 
> the online meeting.
>
> I realized that the approach of looping through k of p[k] is not fitting my 
> needs, because it's not flexible enough.
>
> I need another approach, one which works with layer sets.
>
> I would stop using p as an array, because with the layer sets approach we 
> don't have a fixed order of the layers.
>
> So the definition of the layers would be something like
>
> picture layerA;
> layerA:=image(
> label("Word 1", z1);
> );
>
> picture layerW;
> layerW:=image(
> label("Mot 2", z2);
> );
>
> picture layerM;
> layerM:=image(
> label("Parola 3", z3);
> );
>
> picture layerC;
> layerC:=image(
> label("Wort 4", z3+z1);
> );
>
> picture layerY;
> layerY:=image(
> label("Nummer 5", z2+z3);
> );
>
> picture layerU;
> layerU:=image(
> label("number 6", z2+z1);
> );
>
> After that, I would define layer sets and layer subsets. This will be done 
> manually for each layer set and each layer subset.
> I don't know the proper syntax to do that. Let's assume we could use a 
> variable type called "myset".
>
> myset layersubsetGamma;
> layersubsetGamma:={layerU,layerM};
>
> In my logic, the layers will be drawn in the order of their appearance within 
> the {}. In the example, drawn content of layerM might cover drawn content of 
> layerU.
>
> Contrary to a layer subset, each layer set will result in a PDF page, and 
> thus the layer sets are related to each other by an inner order. That's why I 
> would use an array variable here with [].
>
> I don't know how to append a set. In the following example, I assumed there 
> would be a function myappend(,  should be appended with>)
>
> myset layerset[];
> layerset1 := {layerW,layerA};
> layerset2 := myappend{layerset1, layerY};
> layerset3 := myappend{layerset2, layersubsetGamma};
> layerset4 := myappend{layerset2, layerU};
> layerset5 := myappend{layerset4, layersubsetGamma};
>
> Finally, I would need each layerset[k] typeset on its own pdf page. And of 
> course on each page k, only the layers which appear in the definition of the 
> layerset[k] should be drawn on top of each other in the order as they appear 
> in that definition.
>
> I'm very curious to hear your suggestions.
>

Not beautiful, perhaps, but maybe something like this could work? I
think there is no way out of doing some manual work to tell what you
want included on each page.

\startuseMPgraphic{base}
z1 = origin ;
z2 = (10,50) ;
z3 = (40,30) ;

picture layerA;
layerA:=image(
label("Word 1", z1);
);

picture layerW;
layerW:=image(
label("Mot 2", z2);
);

picture layerM;
layerM:=image(
label("Parola 3", z3);
);

picture layerC;
layerC:=image(
label("Wort 4", z3+z1);
);

picture layerY;
layerY:=image(
label("Nummer 5", z2+z3);
);

picture layerU;
layerU:=image(
label("number 6", z2+z1);
);
\stopuseMPgraphic

\startuseMPgraphic{Gamma}
draw layerU ;
draw layerM ;
\stopuseMPgraphic

\startuseMPgraphic{layerset1}
\includeMPgraphic{base}
draw layerW ;
draw layerA ;
\stopuseMPgraphic

\startuseMPgraphic{layerset2}
\includeMPgraphic{layerset1} ;
draw layerY ;
\stopuseMPgraphic

\startuseMPgraphic{layerset3}
\includeMPgraphic{layerset2} ;
\includeMPgraphic{Gamma} ;
\stopuseMPgraphic


\startuseMPgraphic{layerset4}
\includeMPgraphic{layerset2} ;
draw layerU ;
\stopuseMPgraphic

\startuseMPgraphic{layerset5}
\includeMPgraphic{layerset4} ;
\includeMPgraphic{Gamma} ;
\stopuseMPgraphic

\starttext

\startTEXpage[offset=1DK]
\useMPgraphic{layerset1}
\stopTEXpage

\startTEXpage[offset=1DK]
\useMPgraphic{layerset2}
\stopTEXpage

\startTEXpage[offset=1DK]
\useMPgraphic{layerset3}
\stopTEXpage

\startTEXpage[offset=1DK]
\useMPgraphic{layerset4}
\stopTEXpage

\startTEXpage[offset=1DK]
\useMPgraphic{layerset5}
\stopTEXpage

\stoptext

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

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


[NTG-context] Working with layer sets with Metapost

2024-02-14 Thread Emanuel Han via ntg-context
Dear list,

the attached .tex file is the minimal working example we discussed today in the 
online meeting.
I realized that the approach of looping through k of p[k] is not fitting my 
needs, because it's not flexible enough.
I need another approach, one which works with layer sets.
I would stop using p as an array, because with the layer sets approach we don't 
have a fixed order of the layers.
So the definition of the layers would be something like
picture layerA;
layerA:=image(
label("Word 1", z1);
);

picture layerW;
layerW:=image(
label("Mot 2", z2);
);

picture layerM;
layerM:=image(
label("Parola 3", z3);
);

picture layerC;
layerC:=image(
label("Wort 4", z3+z1);
);

picture layerY;
layerY:=image(
label("Nummer 5", z2+z3);
);

picture layerU;
layerU:=image(
label("number 6", z2+z1);
);

After that, I would define layer sets and layer subsets. This will be done 
manually for each layer set and each layer subset.
I don't know the proper syntax to do that. Let's assume we could use a variable 
type called "myset".

myset layersubsetGamma;
layersubsetGamma:={layerU,layerM};

In my logic, the layers will be drawn in the order of their appearance within 
the {}. In the example, drawn content of layerM might cover drawn content of 
layerU.
Contrary to a layer subset, each layer set will result in a PDF page, and thus 
the layer sets are related to each other by an inner order. That's why I would 
use an array variable here with [].
I don't know how to append a set. In the following example, I assumed there 
would be a function myappend(, )
myset layerset[];
layerset1 := {layerW,layerA};
layerset2 := myappend{layerset1, layerY};
layerset3 := myappend{layerset2, layersubsetGamma};
layerset4 := myappend{layerset2, layerU};
layerset5 := myappend{layerset4, layersubsetGamma};

Finally, I would need each layerset[k] typeset on its own pdf page. And of 
course on each page k, only the layers which appear in the definition of the 
layerset[k] should be drawn on top of each other in the order as they appear in 
that definition.
I'm very curious to hear your suggestions.
Thanks
Emanuel



multipage_metapost_mwe-very_simple.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: \type ignores space between command and bracket

2024-02-02 Thread Hans Hagen via ntg-context

On 2/2/2024 11:16 AM, wolfgangbackes--- via ntg-context wrote:

I have stumbeld across the same bug. Seems to be very elementary, but is still 
present after many years. Sigh.

don't confuse bugs and features ...

\starttext

here a \type{\test  is}  done
here a \type{\test [is]} done
here a \type{\test {is}} done

here a \type[compact=yes]{\test  is}  done
here a \type[compact=yes]{\test [is]} done
here a \type[compact=yes]{\test {is}} done

here a \type[compact=all]{\test  is}  done
here a \type[compact=all]{\test [is]} done
here a \type[compact=all]{\test {is}} done

\stoptext

it helps to read a bit about how tex handles spaces esp after control 
sequences and when passing stuff in arguments ... then sit down and 
ponder possible solutions for a while ...


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: \type ignores space between command and bracket

2024-02-02 Thread wolfgangbackes--- via ntg-context
I have stumbeld across the same bug. Seems to be very elementary, but is still 
present after many years. Sigh.
___
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: \framed{\externalfigure} vs \externalfigure[frame=on]

2024-01-27 Thread Jim
On Sat, Jan 27, 2024 at 19:12 (+0100), Pablo Rodriguez via ntg-context wrote:

> On 1/27/24 17:44, Jim wrote:
>> The wiki page for \setupexternalfigure says
>>  "Show frame around image. Most(?) options of \setupframed are usable!"

Hi Pablo,

> I’m afraid that this is a too generous statement.

I can't disagree with you!  ;-)

> https://www.pragma-ade.com/general/qrcs/setup-en.pdf#page=218 shows
> which keys and values \setupexternalfigure allows.

Thanks for that pointer.

>> I tried to put a frame around a picture (using \externalfigure with
>> frame=on) but I didn't get the frame to play nicely (see example below).  I
>> can get the frame where I want it if instead I do
>>  \framed[frame=on,...]{\externalfigure...}
>> but this leaves me wondering whether
>> (1) I am misinterpreting the wiki pages,
>> (2) The wiki pages are misleading/wrong, or

> I would say, that the offset and frameoffset don’t seem to be available
> in \setupexternalfigure.

And yet, experiments suggest that frameoffset does indeed do something (in,
specifically, \externalfigure, I didn't yet try \setupexternalfigure).

Given that frameoffset does something and is not mentioned in setup-en.pdf,
I will add to my wonderment

(2') the summary in setup-en.pdf is incomplete.

>> (3) There is a bug in some code.


>> If anyone would care to enlighten me, I would appreciate it.

>> In particular, the offset=... option of \externalfigure does not seem to be
>> consistent with the offset=... option of \framed.

> I hope it is clear now.

Well, given that (at least on my computer, with context updated a couple of
days ago) frameoffset does do something.  So I still see an inconsistency.

I would be happy to help out by editing the wiki to accurately describe
reality.  The problem is, I'm not sure what reality is supposed to be on
this point.  For example, if I edited the wiki to say that offset has no
effect in \setupexternalfigure, and it turns out that some (recent?) change
to something else broke 'offset=', then I wouldn't want to add
misinformation.

>> Here is the example... one and all should be able to directly run it, but
>> the text above and below each picture may make the issues clear without
>> having to run the code.  (The result I was looking for is the second figure
>> in this example.)

> To get offset in the frame of the image, you need a different frame from
> the external figure itself (or so it seems).

As I mentioned, on my system I can get a frame offset from the image
without using \frame, but unfortunately it is the type of frame which is
"invisible" to the layout of the page.

> I hope it helps,

It does (a bit), thanks again for your time.

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

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


[NTG-context] Re: LuaMetaTeX code

2024-01-19 Thread Hans Hagen

On 1/19/2024 9:31 AM, Shiv Shankar Dayal wrote:

I see code like

# define luametatex_version          210
# define luametatex_revision         10
# define luametatex_release          10
# define luametatex_version_string   "2.10.10"

starting with C99 these become unnecessary. Rather they should be like 
const int luametatex_version=210; const char* 
luametatex_version_string="2.10.10";


These ensure type-safety in the code and are good coding practice.
Good coding practice discussions are wasted on me (you don't want me to 
look at your tex code -)


The versioning is abit special in te xdue to the fact thet some numbers 
en dup in registers and others as token list (string). I have considered 
changing that but it would also break some 'testing for tex version' so 
for now we have to accept this mix of tex/etex/pdftex inheritance.


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: LuaMetaTeX code

2024-01-19 Thread Shiv Shankar Dayal
Dear Taco,

I will send new messages to dev mailing lists. Let me join it first.

On Fri, Jan 19, 2024 at 2:11 PM Taco Hoekwater  wrote:

>
> Hi Shiv,
>
> Can you move this discussion to the dev-context list, please?
> https://mailman.ntg.nl/mailman3/lists/dev-context.ntg.nl/
>
> Best wishes,
> Taco
>
>
> > On 19 Jan 2024, at 09:31, Shiv Shankar Dayal <
> shivshankar.da...@gmail.com> wrote:
> >
> > I see code like
> >
> > # define luametatex_version  210
> > # define luametatex_revision 10
> > # define luametatex_release  10
> > # define luametatex_version_string   "2.10.10"
> >
> > starting with C99 these become unnecessary. Rather they should be like
> const int luametatex_version=210; const char*
> luametatex_version_string="2.10.10";
> >
> > These ensure type-safety in the code and are good coding practice.
> >
> > On Fri, Jan 19, 2024 at 1:56 PM Shiv Shankar Dayal <
> shivshankar.da...@gmail.com> wrote:
> > Dear Hans,
> >
> > I saw the C code of LuaMetaTeX and I saw a lot of gotos which is not
> good coding practice. These potions of code which have goto should be
> refactored.
> >
> > I am a C programmer, but I know very little of TeX. If you can point me
> towards where should I start for TeX(perhaps TeX Book or TeX for the
> Impatient), I can help with refactoring of code to make is more
> efficient/easier.
> >
> > --
> > Respect,
> > Shiv Shankar Dayal
> >
> >
> > --
> > Respect,
> > Shiv Shankar Dayal
> >
> ___
> > 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
> >
> ___
>
> —
> Taco Hoekwater  E: t...@bittext.nl
> genderfluid (all pronouns)
>
>
>
> ___
> 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
>
> ___
>


-- 
Respect,
Shiv Shankar Dayal
___
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: LuaMetaTeX code

2024-01-19 Thread Taco Hoekwater

Hi Shiv,

Can you move this discussion to the dev-context list, please? 
https://mailman.ntg.nl/mailman3/lists/dev-context.ntg.nl/

Best wishes,
Taco


> On 19 Jan 2024, at 09:31, Shiv Shankar Dayal  
> wrote:
> 
> I see code like
> 
> # define luametatex_version  210
> # define luametatex_revision 10
> # define luametatex_release  10
> # define luametatex_version_string   "2.10.10"
> 
> starting with C99 these become unnecessary. Rather they should be like const 
> int luametatex_version=210; const char* luametatex_version_string="2.10.10";
> 
> These ensure type-safety in the code and are good coding practice.
> 
> On Fri, Jan 19, 2024 at 1:56 PM Shiv Shankar Dayal 
>  wrote:
> Dear Hans,
> 
> I saw the C code of LuaMetaTeX and I saw a lot of gotos which is not good 
> coding practice. These potions of code which have goto should be refactored.
> 
> I am a C programmer, but I know very little of TeX. If you can point me 
> towards where should I start for TeX(perhaps TeX Book or TeX for the 
> Impatient), I can help with refactoring of code to make is more 
> efficient/easier.
> 
> -- 
> Respect,
> Shiv Shankar Dayal
> 
> 
> -- 
> Respect,
> Shiv Shankar Dayal
> ___
> 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
> ___

— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)


___
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: LuaMetaTeX code

2024-01-19 Thread Shiv Shankar Dayal
I see code like

# define luametatex_version  210
# define luametatex_revision 10
# define luametatex_release  10
# define luametatex_version_string   "2.10.10"

starting with C99 these become unnecessary. Rather they should be like
const int luametatex_version=210; const char*
luametatex_version_string="2.10.10";

These ensure type-safety in the code and are good coding practice.

On Fri, Jan 19, 2024 at 1:56 PM Shiv Shankar Dayal <
shivshankar.da...@gmail.com> wrote:

> Dear Hans,
>
> I saw the C code of LuaMetaTeX and I saw a lot of gotos which is not good
> coding practice. These potions of code which have goto should be refactored.
>
> I am a C programmer, but I know very little of TeX. If you can point me
> towards where should I start for TeX(perhaps TeX Book or TeX for the
> Impatient), I can help with refactoring of code to make is more
> efficient/easier.
>
> --
> Respect,
> Shiv Shankar Dayal
>


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

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


[NTG-context] Re: Why LuaMetaTex is so slow?

2024-01-18 Thread Aditya Mahajan
On Fri, 19 Jan 2024, Hans Hagen via ntg-context wrote:

> On 1/19/2024 12:34 AM, Aditya Mahajan wrote:
> > On Thu, 18 Jan 2024, Hans Hagen wrote:
> > 
> >> Of course we'll never be as fast as (pure) plain tex (no layers added) or
> >> latex (which often is advocated as faster than context).
> > 
> > I was curious, so did a quick experiment: typeset \input knuth 500 times.
> > Here are the results:
> > 
> > pdflatex: 547 pages/sec
> > lualatex: 308 pages/sec
> 
> opentype or type 1 ?

type 1. I did not change anything in the defaults. I'll try to figure out how 
to load opentype fonts in latex, and test lualatex. 

> > MKIV: 130 pages/sec
> > LMTX: 147 pages/sec
> 
> that is weird as lmtx is always faster here (we loose some 15% on the backend
> compared to luatex, maybe even more, but we gain back quite a bit elsewhere
> for various reasons)

LMTX is faster for me as well.

> > Interestingly, pdflatex, lualatex, and MkIV all generated pdf with 1112
> > pages, while LMTX generated a pdf with 1250 pages. Both MkIV and LMTX take
> > the same time to run (8.5 sec) but LMTX generates more pages so it is
> > faster.
> 
> puzzling
> 
> > Of course, this is a meaningless experiment from a practical point of view
> > as a 1000 page document will be more complex than just text.
> % engine=pdftex  1.2
> % engine=luatmetatex 1.6
> % engine=luatex  1.8
> % engine=xetex   2.4
> 
> \starttext
> 
> \dorecurse{500} {
> \input knuth \par
> }
> 
> \stoptext
> 
> 125 pages, so how does your test file look

5000 recursions (not 500, sorry about that). 


\starttext

\dorecurse{5000}{\ReadFile{knuth}}

\stoptext

I'll send you the PDFs offlist. 

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: Why LuaMetaTex is so slow?

2024-01-18 Thread Hans Hagen via ntg-context

On 1/19/2024 12:34 AM, Aditya Mahajan wrote:

On Thu, 18 Jan 2024, Hans Hagen wrote:


Of course we'll never be as fast as (pure) plain tex (no layers added) or
latex (which often is advocated as faster than context).


I was curious, so did a quick experiment: typeset \input knuth 500 times. Here 
are the results:

pdflatex: 547 pages/sec
lualatex: 308 pages/sec


opentype or type 1 ?


MKIV: 130 pages/sec
LMTX: 147 pages/sec


that is weird as lmtx is always faster here (we loose some 15% on the 
backend compared to luatex, maybe even more, but we gain back quite a 
bit elsewhere for various reasons)



Interestingly, pdflatex, lualatex, and MkIV all generated pdf with 1112 pages, 
while LMTX generated a pdf with 1250 pages. Both MkIV and LMTX take the same 
time to run (8.5 sec) but LMTX generates more pages so it is faster.


puzzling


Of course, this is a meaningless experiment from a practical point of view as a 
1000 page document will be more complex than just text.

% engine=pdftex  1.2
% engine=luatmetatex 1.6
% engine=luatex  1.8
% engine=xetex   2.4

\starttext

\dorecurse{500} {
\input knuth \par
}

\stoptext

125 pages, so how does your test file look

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: Why LuaMetaTex is so slow?

2024-01-18 Thread Hans Hagen

On 1/18/2024 7:56 PM, Shiv Shankar Dayal wrote:




In comparison to LaTeX with LuaHBTeX, ConTeXt with LuaMetaTeX is
lightning fast.

pdfTeX is 8bit, and Knuth’s plain TeX is very low level – for a fairer
comparison, try the TeXbook on LuaMetaTeX (I don’t know if “plain”
works
though).

I understand that why it is slow, but the problem is that the difference 
is too high.

My book has lots of math, so perhaps that is the reason.

You can run the texbook with \tracingall and see what actually happens.

The texbook uses plain tex (very lightweight) with a dedicated style 
(also lightweight). On the contrary context uses layers of abstraction, 
a more complex font, math, structure, page etc etc etc sytstem.


In fact, plain tex had to be as it is because otherwise it would take 
ages to process teh texbook. On a pc one could see the page numbers 
crawl so in the end wr're quite okay nowadays.


If you run context with \tracingall you'll see that more goes on.

For me 40 pps sounds not that bad. If you use only text you can get to 
500 pps but that's not realistic. Maybe your style is suboptimal.


Also, open type fonts, opentype math, unicode, color, etc etc comes at a 
price. And, compared to pdftex, in most cases luametatex is faster on 
documents of average complexity. If you also use xml and/or metapost you 
migh tbe dragged down to a few pages per second while lmtx doesn't 
suffer much.


Anyway, if you think it can be made faster you can always post code to 
this list that identifies bottlenecks.


Of course we'll never be as fast as (pure) plain tex (no layers added) 
or latex (which often is advocated as faster than context).


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] Suggestions and problems of the manuals

2024-01-17 Thread Gerion Entrup
Hi,

I discovered the manuals in the context distribution. My general way to
built the manuals were these steps:
```
# execute one time
git clone https://github.com/contextgarden/context.git
cd context/doc/context/sources/general/manuals/

# for every manual
cd $MANUALFOLDER
context $MAIN_MANUAL_FILE.tex
```
Is there a way to speed this up, so to build all manuals with one
command (some make file or shell script for example)?

I saw some problems within the manuals:
- In units/units-mkiv.tex the spacing seems not to work with current
  LMTX. See the attached screenshot (units-mkiv.png) for my rendering.
  In my understanding the spaces should differ.
- I changed some typos(?) and other stuff in that file. The patch is
  attached (0001-units-mkiv-improve.patch).
- math/math-mkiv.tex seems not to compile. The last lines of the log:
system  >
system  > ConTeXt  ver: 2024.01.08 11:23 LMTX  fmt: 2024.1.16  
int: english/english
system  >
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'/home/gerion/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name 
'/home/gerion/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > jobfiles > using path: 
/home/gerion/src/context/doc/context/sources/general/manuals/math
system  > files > jobname 
'./math-mkiv-t-b-ce3b35636ef01ee62897a2beb76049e0', input 
'./math-mkiv-t-b-ce3b35636ef01ee62897a2beb76049e0.tmp', result 
'./math-mkiv-t-b-ce3b35636ef01ee62897a2beb76049e0'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name 
'./math-mkiv-t-b-ce3b35636ef01ee62897a2beb76049e0.tmp'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern rm 12pt' is loaded
visualize   > enabled
open source > level 2, order 3, name 'math-spacing-001.tex'
close source> level 2, order 3, name 'math-spacing-001.tex'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 1, order 3, name 
'./math-mkiv-t-b-ce3b35636ef01ee62897a2beb76049e0.tmp'
backend > xmp > using file 
'/home/gerion/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
mkiv lua stats  > used config file: 
selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/home/gerion/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.003 seconds, 0 scans 
with scantime 0.000 seconds, 0 shared scans, 15 found files, scanned paths: 

mkiv lua stats  > stored bytecode data: 515 modules (0.131 sec), 105 
tables (0.007 sec), 620 chunks (0.139 sec)
mkiv lua stats  > traced context: maxstack: 1743, freed: 0, 
unreachable: 1743
mkiv lua stats  > cleaned up reserved nodes: 103 nodes, 7 lists of 437
mkiv lua stats  > node memory usage: 6649 attribute, 1 glue, 144 
gluespec, 4868 glyph, 1220 hlist, 1 kern, 645 mathspec, 2 penalty, 616 rule, 2 
temp, 7 whatsit
mkiv lua stats  > node list callback tasks: 16 unique task lists, 12 
instances (re)created, 235 calls
mkiv lua stats  > driver time: 0.021 seconds
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.000 seconds saving, 0.000 seconds 
loading
mkiv lua stats  > callbacks: file: 137, saved: 1212, direct: 2, 
function: 814, value: 429, message: 0, bytecode: 620, late 0, total: 3214 (3214 
per page)
mkiv lua stats  > randomizer: resumed with value 0.82928645897044
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > loaded fonts: 4 files: latinmodernmath-companion.otf, 
latinmodern-math.otf, lmmonoltcond10-regular.otf, lmroman10-regular.otf
mkiv lua stats  > font engine: otf 3.135, afm 1.513, tfm 1.000, 27 
instances, 21 shared in backend, 4 common vectors, 17 common hashes, load time 
0.299 seconds
mkiv lua stats  > visualization time: 0.005 seconds
mkiv lua stats  > math tweaking time: 0.145 seconds, 24 math goodie 
tables
mkiv lua stats  > page group warning: transparencies are used but no 
pagecolormodel is set
mkiv lua stats  > font embedding time: 0.003 seconds, 3 fonts
mkiv lua stats  > result saved in file: 
math-mkiv-t-b-ce3b35636ef01ee62897a2beb76049e0.pdf, compresslevel 1, 
objectcompresslevel 3, 14 streams, 0 uncompressed, 9 compressed, 5 not 
compressed, threshold 40
mkiv lua stats  > positions: 4 c

[NTG-context] Re: Why the way key-value argument is called affected the document's output?

2024-01-08 Thread Hans Hagen

On 1/8/2024 11:05 PM, 1114...@gmail.com wrote:

Hi,

I was cleaning and formatting my context file and then when I compiled it, the 
output I got introduced extra vertical spacings at the section headings that 
weren't there in the previous compilations. I had to spend enormous amount of 
time trying to fix it so to emulate my previous outputs. Turns out the problem 
was how I called one of the key-value argument in the document.

I really wanna know the reason why it did influenced the output?

Provided below is the minimal source code (and it is producing different 
outputs, meaning the vertical spacings are not same, on my device running the 
version released in the September and also tested with the latest release.)


"""
%% differences in outputs, for how "grid=yes" is called.

%% Type 1.
%\setuplayout[grid=yes]


Here you set the grid variable to "yes".


%% Type 2.
%\setuplayout[
%grid=yes
%]


Here you set the grid variable to "yes " so a trailing space.


\setuphead[section][grid=low] %% needed to observe the output difference
\starttext

\title{Alpha}
\subsection{Beta}
\input{knuth}

\stoptext

So this is ok:

\setupfoo
 [a=A,
  b=B]

\setupfoo
 [a=A,
  b=B,
 ]

I'm not aware of funmdamental changes in the parse, apart from that in 
many setup commands one can now do this:


\setupfoo
  [A=\this[works],
   B=\that[doestoo]]

as nested brackets are handled.

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] Why the way key-value argument is called affected the document's output?

2024-01-08 Thread 111414w
Hi,

I was cleaning and formatting my context file and then when I compiled it, the 
output I got introduced extra vertical spacings at the section headings that 
weren't there in the previous compilations. I had to spend enormous amount of 
time trying to fix it so to emulate my previous outputs. Turns out the problem 
was how I called one of the key-value argument in the document.

I really wanna know the reason why it did influenced the output?

Provided below is the minimal source code (and it is producing different 
outputs, meaning the vertical spacings are not same, on my device running the 
version released in the September and also tested with the latest release.)


"""
%% differences in outputs, for how "grid=yes" is called.

%% Type 1.
%\setuplayout[grid=yes]

%% Type 2.
%\setuplayout[
%grid=yes
%]

\setuphead[section][grid=low] %% needed to observe the output difference
\starttext

\title{Alpha}
\subsection{Beta}
\input{knuth}

\stoptext
"""


Best regards,
Ali
___
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: Size of subscript notations

2023-12-29 Thread Fabrice Couvreur
Thank you for your suggestion but in the following example the operational
symbol is too big as well as the number 1.

\mapfontsize[modern][script] [.4]
\mapfontsize[modern][scriptscript][.2]

\setupbodyfont[modern,12pt]

\startTEXpage[offset=1DK]
  \m{z_{n+1}}
\stopTEXpage

Le ven. 29 déc. 2023 à 14:47, Mikael Sundqvist  a écrit :

> Hi,
>
> On Fri, Dec 29, 2023 at 3:17 PM Fabrice Couvreur
>  wrote:
> >
> > Hi,
> > To type my lessons or other, I use the Modern font in 12 pt or 11 pt. I
> find that the subscript notations are a little too big : how can I improve
> this ?
> > Thanks
> > Fabrice
> >
> > \m{ \forall n \in N, z_{n+1}=\frac{i}{3}z_n}
>
> you could try something like (here with too small numbers only to show...)
>
> \mapfontsize[modern][script] [.4]
> \mapfontsize[modern][scriptscript][.2]
>
> \setupbodyfont[modern,10pt]
>
> \startTEXpage[offset=1DK]
> \m{3^{2^3}}
> \stopTEXpage
>
> I hope it helps.
>
> /Mikael
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
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: Size of subscript notations

2023-12-29 Thread Mikael Sundqvist
Hi,

On Fri, Dec 29, 2023 at 3:17 PM Fabrice Couvreur
 wrote:
>
> Hi,
> To type my lessons or other, I use the Modern font in 12 pt or 11 pt. I find 
> that the subscript notations are a little too big : how can I improve this ?
> Thanks
> Fabrice
>
> \m{ \forall n \in N, z_{n+1}=\frac{i}{3}z_n}

you could try something like (here with too small numbers only to show...)

\mapfontsize[modern][script] [.4]
\mapfontsize[modern][scriptscript][.2]

\setupbodyfont[modern,10pt]

\startTEXpage[offset=1DK]
\m{3^{2^3}}
\stopTEXpage

I hope it helps.

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

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


[NTG-context] Size of subscript notations

2023-12-29 Thread Fabrice Couvreur
Hi,
To type my lessons or other, I use the Modern font in 12 pt or 11 pt. I
find that the subscript notations are a little too big : how can I improve
this ?
Thanks
Fabrice

\m{ \forall n \in N, z_{n+1}=\frac{i}{3}z_n}
___
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-21 Thread Ursula Hermann
Dear LIst,


I used today the help of WinEdt , because of the PATH for the QR Code i wanted 
to try, and i found this one, sorry, a little bit long:

PATH

The PATH environment variable contains a list of directories where Windows 
should search for executable files when the path specification is not present 
in the command line. It is important that you understand that WinEdt launches 
external applications (such as TeX or LaTeX) through the associated command 
line (with additional parameters), which is passed to the appropriate Windows 
API function. WinEdt merely makes the process transparent by providing a 
customizable user-defined GUI (Graphical User Interface) in the form of a 
toolbar button (or a menu item) named LaTeX. WinEdt does not know in advance if 
and where you have installed your TeX and thus avoids calling the executables 
with a full path specification. However, it is strongly recommended that your 
PATH contains the TeX bin directory. In the Diagnosis page of this dialog, 
WinEdt will display the PATH variable particular to your system.

Recent versions of TeX put their bin folder to the Windows PATH variable during 
installation. It is by this means that WinEdt can detect them automatically. If 
your PATH variable (as displayed in Diagnosis page) does not contain this 
folder (e.g. the folder where latex.exe is to be found), you probably don't 
have a properly installed TeX System! It is strongly recommended that you 
install TeX and Ghostscript as administrator or power user and thus allow the 
installations to initialize the required registry keys and environment 
variables.

If you have any doubts about the PATH settings, start the Command Prompt from 
the Windows Start menu or WinEdt's Accessories menu (or WinEdt's toolbar 
button) and type the command:

  echo %PATH%


This displays the value of your current PATH environment variable.

If you have a good reason to put any folder on your Windows PATH, you can do so 
by changing the Windows environment variable PATH. This is done through the 
Windows Control Panel (System -> Advanced -> Environment Variables). Details 
depend on your version of Windows and are explained in Windows help. You should 
not expect extensive support from the WinEdt Team when it comes to configuring 
your Windows.

Changes to the PATH variable made through WinEdt's PATH page in the Execution 
Modes interface affect only WinEdt and applications launched from it. In most 
cases, this is exactly what one wants. By default, you'll find something like 
this:

[X][X][X][X]

WinEdt inserts its own root folder %B to the PATH; this makes it possible to 
launch WinEdt from other applications (launched from it) without specifying the 
location of WinEdt.exe. For example, YAP's inverse search command can be 
manually defined in its Options dialog as:

  WinEdt.exe "[Open(|%f|);SelPar(%l,8);]"


If necessary, you can add additional folders that will be inserted to the PATH 
variable. For example:

  %B;C:\My TeX\Win32\Bin;C:\My Accessories\Bin


By default, WinEdt also detects the TeX and Ghostscript bin folders (or you can 
specify them manually in the Execution Modes interface). Unless these folders 
are already included in the PATH variable, WinEdt will insert them, thus making 
it easy to launch TeX executables (such as latex.exe) and GS's 
gswin64c.exe/gswin32c.exe, which is used for ps -> pdf conversion...

In the above example, MiKTeX's bin folder got included to the PATH during 
MiKTeX's installation, while the GS folder had to be added by WinEdt...

Note: Many users believe that putting some folder on their PATH will allow 
LaTeX to find ".sty" or ".cls" files in that folder. Wrong! TeX does not search 
the Windows PATH for any of its input files. TeX uses its own FNDB (for good 
reason) and you should consult your TeX manual to learn about where to place 
such files and how to properly install them! Windows PATH only allows WinEdt 
(or other programs, including the Command Prompt) to launch an executable with 
its name rather than full specification, which isn't known in advance, and 
which depends on where you have installed your accessories. If, after the 
executable is launched, it fails to perform the task, the PATH (or WinEdt) 
usually has nothing to do with the problem and you should focus on other 
reasons (including possible errors in your document – read the error message or 
log file produced by the accessory in question)...


Variables

WinEdt itself does not use any environment variables. However, applications 
that are launched from WinEdt may depend on them. In particular, TeX 
accessories can use such variables to obtain a list of additional directories 
where they search for input files, bibliography databases, etc... The 
documentation that comes with your TeX System or any other accessory describes 
the rules. You should consult this documentation in order to de

[NTG-context] Re: underbrace label across two lines

2023-12-20 Thread Dean Hung
Hi Mikael,

Thanks for your reply -- I was able to get great results after using the
\startbuffer ... \stopbuffer approach.

I'm still a bit of a beginner with ConText so I wasn't clear on what the
meaning of the $ symbols in your reply?

The reason I have been using the underbraces is for explaining how
botanical naming conventions work.
In certain fields of botany/horticulture, plant types follow certain rules
for naming.  Here is a fictitious name
as an example:

Loremphylla mikaelii forma alba 'Aditya'

Genus = Loremphylla
Species = mikaelii
botanical form = forma
Cultivar Epithet = 'Aditya'

The problem I was running into was the labels might have more words than
can be contained within the space allotted
on one line (i.e., Cultivar Epithet would not fit in the space on the same
line, and hence my question on how to force a \crlf
between those two words).

Best,

Dean


On Wed, Dec 20, 2023 at 2:27 AM Mikael Sundqvist  wrote:

> Hi,
>
> On Wed, Dec 20, 2023 at 8:01 AM Dean Hung  wrote:
> >
> > Hi list,
> >
> > Following on from Aditya's solution to my previous question, I have run
> into a separate issue and would appreciate any assistance.
> >
> > Sometimes text under the underbrace can become quite long, and should be
> split into two (or more) lines.  In the example below, "firstline" should
> be the top line of the underbrace label, and "secondline" should be on the
> lower line of the underbrace label, but as it stands, both are printed on
> the same line.
> >
> > \underbrace[mindepth=0.5cm]{\tf x+y+z}_{\vrule width 0pt height
> 0.5cm\relax\text{firstline secondline}}
> >
> > I have tried using \\ and \crlf, but to no avail.
> >
> > Any help would be greatly appreciated!
> >
> > Dean
>
> Hi,
>
> Hans will add some annotation mechanism (already on my computer to
> test a bit). In your case you can use the first example here:
>
> \startbuffer
> \unframed
> [align=middle,toffset=0.5cm]
> {firstline\crlf secondline}
> \stopbuffer
>
> $
> \underbrace
> [mindepth=0.5cm]
> {\tf x + y + z}
> _
> {\mtext{\getbuffer}}
>
> \quad
>
> \mathannotation
> [bottom={\getbuffer}]
> {\underbrace
> [mindepth=0.5cm]
> {\tf x + y + z}
> }
> $
>
> Since I am the curious type, I wonder a bit what is the use case here?
> Do you mind explaining and providing the complete example? (The reason
> I ask is that there might be better ways to do what you are doing.)
>
> /Mikael
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
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: underbrace label across two lines

2023-12-20 Thread Mikael Sundqvist
Hi,

On Wed, Dec 20, 2023 at 8:01 AM Dean Hung  wrote:
>
> Hi list,
>
> Following on from Aditya's solution to my previous question, I have run into 
> a separate issue and would appreciate any assistance.
>
> Sometimes text under the underbrace can become quite long, and should be 
> split into two (or more) lines.  In the example below, "firstline" should be 
> the top line of the underbrace label, and "secondline" should be on the lower 
> line of the underbrace label, but as it stands, both are printed on the same 
> line.
>
> \underbrace[mindepth=0.5cm]{\tf x+y+z}_{\vrule width 0pt height 
> 0.5cm\relax\text{firstline secondline}}
>
> I have tried using \\ and \crlf, but to no avail.
>
> Any help would be greatly appreciated!
>
> Dean

Hi,

Hans will add some annotation mechanism (already on my computer to
test a bit). In your case you can use the first example here:

\startbuffer
\unframed
[align=middle,toffset=0.5cm]
{firstline\crlf secondline}
\stopbuffer

$
\underbrace
[mindepth=0.5cm]
{\tf x + y + z}
_
{\mtext{\getbuffer}}

\quad

\mathannotation
[bottom={\getbuffer}]
{\underbrace
[mindepth=0.5cm]
{\tf x + y + z}
}
$

Since I am the curious type, I wonder a bit what is the use case here?
Do you mind explaining and providing the complete example? (The reason
I ask is that there might be better ways to do what you are doing.)

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

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


[NTG-context] Re: About framedtext

2023-12-13 Thread Henning Hraban Ramm

Am 13.12.23 um 18:19 schrieb Wolfgang Schuster:

Fabrice Couvreur schrieb am 13.12.2023 um 19:03:

Hi,
Is this a bug or not ?
The key to coloring the background of the text seems to no longer work.


There is a problem with the corner option, you can either hope it gets 
fixed in the next release
(corner=round still works) or create your own background as metapost 
graphic with rounded corners.


Oh, yes, here’s Hans’ fix.

Hraban
if not modules then modules = { } end modules ['lpdf-rul'] = {
version   = 1.001,
comment   = "companion to grph-rul.mkiv",
author= "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license   = "see context related readme files"
}

-- todo: split backend and pdf

local tonumber, tostring, next, type = tonumber, tostring, next, type
local concat, setmetatableindex = table.concat, table.setmetatableindex

local attributes   = attributes
local nodes= nodes

local bpfactor = number.dimenfactors.bp

local nuts = nodes.nuts
local ruleactions  = nuts.rules.ruleactions

local getwhd   = nuts.getwhd

local lefttoright_code = tex.directioncodes.lefttoright

local mpcolor  = attributes.colors.mpcolor

local trace_mp = false  trackers.register("rules.mp", function(v) 
trace_mp = v end)

local report_mp= logs.reporter("rules","mp")

local floor= math.floor
local getrandom= utilities.randomizer.get
local formatters   = string.formatters

local setdimen = tex.setdimen
local isdimen  = tex.isdimen
local setmacro = tokens.setters.macro

local codeinjections   = backends.registered.pdf.codeinjections

local d_rule_width  = isdimen("d_rule_width")
local d_rule_height = isdimen("d_rule_height")
local d_rule_depth  = isdimen("d_rule_depth")
local d_rule_h  = isdimen("d_rule_h")
local d_rule_v  = isdimen("d_rule_v")
local d_rule_line   = isdimen("d_rule_line")
local d_rule_offset = isdimen("d_rule_offset")
local d_rule_factor = isdimen("d_rule_factor")

-- This is very pdf specific. Maybe move some to lpdf-rul.lua some day.

local pdfprint ; pdfprint = function(...) pdfprint = lpdf.print return 
pdfprint(...) end

do

local simplemetapost = metapost.simple
local cachesize  = 0
local maxcachesize   = 256*1024
local cachethreshold = 1024
local caching= false -- otherwise random issues so we need a 
dedicated randomizer first

 -- local maxcachesize   = 8*1024
 -- local cachethreshold = 1024/2

local cache = setmetatableindex(function(t,k)
local v = simplemetapost("rulefun",k) -- w, h, d
cachesize = cachesize + #v
if cachesize > maxcachesize then
 -- print("old",cachesize)
for k, v in next, t do
local n = #v
if n > cachethreshold then
t[k] = nil
cachesize = cachesize - n
end
end
 -- print("new",cachesize)
end
 -- print(cachesize,maxcachesize,cachethreshold,#v)
t[k] = v
return v
end)

local replacer = utilities.templates.replacer

-- todo: RuleColor -> just string ?
-- todo: fetch them instead fo push them

-- local predefined = {
-- ["fake:word"] = replacer [[
-- FakeWord(%width%,%height%,%depth%,%line%,%color%);
-- ]],
-- ["fake:rule"] = replacer[[
-- %initializations%
-- FakeRule(%width%,%height%,%depth%,%line%,%color%);
-- ]],
-- ["fake:rest"] = replacer [[
-- RuleDirection := "%direction%" ;
-- RuleOption := "%option%" ;
-- RuleWidth := %width% ;
-- RuleHeight := %height% ;
-- RuleDepth := %depth% ;
-- RuleH := %h% ;
-- RuleV := %v% ;
-- RuleThickness := %line% ;
-- RuleFactor := %factor% ;
-- RuleOffset := %offset% ;
-- def RuleColor = %color% enddef ;
-- %data%;
-- ]]
-- }

local predefined = {
["fake:word"] = replacer [[
FakeWord(RuleWidth,RuleHeight,RuleDepth,RuleThickness,RuleColor);
]],
["fake:rule"] = replacer[[
%initializations%
FakeRule(RuleWidth,RuleHeight,RuleDepth,RuleThickness,RuleColor);
]],
["fake:rest"] = replacer [[
%data%;
]]
}

local initialized = false ;

local function rule_mp(p,h,v,i,n)
local name  = p.name or "fake:rest"
local ht= p.height or 0
local dp= p.depth  or 0
local total = ht + dp
local code  = (predefined[name] or predefined["fake:rest"]) {
data  = p.data or "",
  -- -- width = p.width * bpfactor,
  -- -- height= p.height * bpfactor,
  -- -

[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] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Aditya Mahajan
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}$. 

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: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 09.12.2023 um 16:13:

Hi Wolfgang,
I'm reading this thread and I'm interested because I type a lot of 
text with mathematical formulas.
In fact, I find that \dfrac{} creates unsightly leading space and that 
\frac{} is too small. What is the difference between \frac{} and 
\tfrac{} ?


\frac switches the math style while \tfrac (textstyle), \dfrac 
(displaystyle) and \sfrac (scriptstyle) enforce a certain style.


 begin example
\startbuffer[frac]
\frac{1}{2} + \dfrac{1}{2} - \tfrac{1}{2} + \sfrac{1}{2}
\stopbuffer

\starttext

\startformula
\getbuffer[frac]
\stopformula

\m{\getbuffer[frac]}

\startformula
  \frac
    {\getbuffer[frac]}
    {\getbuffer[frac]}
\stopformula

\m{\frac
  {\getbuffer[frac]}
  {\getbuffer[frac]}}

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Fabrice Couvreur
Hi Wolfgang,
I'm reading this thread and I'm interested because I type a lot of text
with mathematical formulas.
In fact, I find that \dfrac{} creates unsightly leading space and that
\frac{} is too small. What is the difference between \frac{} and \tfrac{} ?
Fabrice

Le sam. 9 déc. 2023 à 14:00, Henning Hraban Ramm  a écrit :

> Am 09.12.23 um 14:43 schrieb Wolfgang Schuster:
> > anton.chig...@mail.com schrieb am 09.12.2023 um 14:15:
> > \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
>
> There’s also \vulgarfraction{1}{3} (but probably not suitable for your
> application).
>
> 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: Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Henning Hraban Ramm

Am 09.12.23 um 14:43 schrieb Wolfgang Schuster:

anton.chig...@mail.com schrieb am 09.12.2023 um 14:15:
\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


There’s also \vulgarfraction{1}{3} (but probably not suitable for your 
application).


Hraban

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

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


[NTG-context] Fractions (was \placefigure[location=here...] problem)

2023-12-09 Thread Wolfgang Schuster

anton.chig...@mail.com schrieb am 09.12.2023 um 14:15:

I worked, ;-), thanks.
Let me ask you another thing, how can I avoid messing up the
line spacing by using \sqrt and \frac, the line that follows these has increased
line spacing in the pdf output

code:
Find the normal and shearing stresses on an oblique plane defined by
$l=\sqrt{\frac{3}{13}}$, $m=\sqrt{\frac{1}{13}}$, and $n=\sqrt{\frac{9}{13}}$.


Complete working minimal examples are preferred over code snippets.

To avoid single lines with different spacing you can either increase the 
line spacing for all
lines with \setupinterlinespace or you use a different fraction command 
which uses

smaller numbers or creates inline fractions.

\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

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] externalfigure regression?

2023-12-03 Thread Thangalin
Hi,

>From the wiki <https://wiki.contextgarden.net/Command/externalfigure>:

"When the file extension is .auto or method=auto is used, ConTeXt reads the
first few bytes of the file to determine the filetype. Such an
auto-discovery is useful for remote images that do not have a file
extension."

current version: 2023.09.26 18:19

Code:

% SOT
\starttext
  \startplacefigure
\externalfigure[https://placekitten.com/408/287][method=auto]
  \stopplacefigure
\stoptext
% EOT

Expected: Cute kitten photo.
Actual: Error.

Is this a regression? Or has the syntax changed (stale wiki)?

Specifying the type works (I'd've thought it not necessary to specify the
method at all, given both magic headers and HTTP content-type could
determine the type):

% SOT
\starttext
  \startplacefigure
\externalfigure[https://placekitten.com/408/287][method=jpg]
  \stopplacefigure
\stoptext
% EOT

See also:

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/main/java/com/keenwrite/io/MediaTypeSniffer.java#L53

https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/src/main/java/com/keenwrite/io/MediaType.java#L218
___
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-03 Thread Alexandre Christe
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.

A. Christe
Le 3 déc. 2023 à 22:44 +0100, Hans Hagen , a écrit :
> On 12/3/2023 10:31 PM, Alexandre Christe wrote:
> > Dear list,
> >
> > I’m facing some strange spacing with inline maths. Sometimes the space
> > is ok (like around the first two fractions), but sometimes it is way too
> > little. Do I miss to configure something?
> your spacing is little between words too .. hard to tell without MWE
>
> 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
> ___


libertinus-with-alegreya-math.lfg
Description: Binary data


type-imp-alegreya_libertinus.mkiv
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-12-03 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 03.12.2023 um 16:33:

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.


IIRC width=fit is intended for presentation styles because it uses 
margin and edge values

to calculate the text area.

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: 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] Converting XHTML captions to ConTeXt captions

2023-11-26 Thread Thangalin
I'd like to capture a caption and apply it to the block-level element that
immediately follows. In the MWE, is there a more "ConTeXt way" to
accomplish the task of adding captions to tables, figures, blockquotes, etc?

% SOT
\startbuffer[demo]

Caption 1 
table 1 with caption
table 2 without caption
Caption 3 
table 3 with caption

\stopbuffer

\startxmlsetups xml:demo
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{a|p|body|table}{xml:*}
  \xmlsetsetup{\xmldocument}{span[@class='caption']}{xml:span}

  \define\CaptionText{}
  \define\AnchorXref{}
\stopxmlsetups

\startxmlsetups xml:span
  \define\CaptionText{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:a
  \define\AnchorXref{\xmlatt{#1}{data-type}-\xmlatt{#1}{name}}
\stopxmlsetups

\startxmlsetups xml:body \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:p \xmlflush{#1}\par \stopxmlsetups
\startxmlsetups xml:table
  \blank
  \doifelsetext{\CaptionText}{%
\startplacetable[
  title={\ignorespaces\CaptionText{}\removeunwantedspaces.},
  reference={\AnchorXref}
]

\define\CaptionText{}
\define\AnchorXref{}
  }{
\startplacetable
  }

\startembeddedxtable
  \startxtablebody[body]
\startxrow
  \startxcell
\xmlflush{#1}
  \stopxcell
\stopxrow
  \stopxtablebody
\stopembeddedxtable
  \stopplacetable
  \blank
\stopxmlsetups

\xmlregistersetup{xml:demo}

\starttext
  \xmlprocessbuffer{demo}{demo}{}
\stoptext
% EOT
___
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] Drawing calligraphy practice grid in metafun

2023-11-20 Thread Andres Conrado Montoya
Hello list
I've been working on a little project of mine. I give calligraphy workshops
and I have been using a nice tool created by Josselin Cuette, available at
http://ductus.josselincuette.com/ to generate practice templates for
interested people.

However, I would prefer to have an offline solution. This adventure started
with the usual insidious idea: "I could do this in ConTeXt! And this is a
great opportunity to learn metafun!"

A couple weeks later, I have an almost ready product! It compiles fine, but
I have the following issue: The template creates a Line, composed of
Sections. And uses variables to assign a measurement for the nib-width, and
an amount of ascender, x-height and descender Sections (nib-widths), to
compose a Line.

But also, I would like to, if needed, display nib-width marks on the left
side. My code so far generates marks, but only for the first Line. I think
they are generated but maybe they are placed on top of each other, maybe?
I'm not sure why my logic is not working.

Also, if I change the amount for ascenders, descenders of x-height, the
marks are not drawn correctly.

My current path for a mark is a custom path emulating two unit squares,
nib-width size, on top of each other, with the top one shifted a nib-width
to the right. A little bit like a chess board, or a scale ruler on a map.
But this would only work in Lines that have an even amount of Sections. I'm
not sure how to proceed with that... I tried using unit squares, but that
made things very complex, and after fumbling around I managed to get this
far.

If you can take a look, or have some advice, it would be greatly
appreciated. I hope it is understandable.

My code:

%%
\setuppapersize[letter,landscape][letter,landscape]
\setuplayout[backspace=15mm,width=250mm,header=0mm,footer=0mm]

\startreusableMPgraphic{pauta}
  % Global variables:

  % Show nib-width marks
  boolean marks ; marks := true ;

  % Path for nib-width
  path mark ; mark := (0,0) -- (1,0) -- (1,2) -- (2,2) -- (2,1) -- (0,1) --
cycle ;

  % Line width
  numeric line ; line := \the\textwidth ;

  % Type box
  numeric box ; box := \the\textheight ;

  % Nib width (distance between lines)
  numeric nib ; nib := 3mm ;

  % Ascenders for writing line
  numeric asc ; asc := 3 ;

  % x-height for writing line
  numeric med ; med := 4 ;

  % Descenders for writing line
  numeric dsc ; dsc := 3 ;

  % Total height of a writing line in mm (including asc, med, and dsc)
  numeric lineHeight ;
  lineHeight = (asc + med + dsc) * nib ;

  % Available lines on a page
  numeric availableLines ;
  availableLines = round(box / lineHeight) - 1 ;

  % Starting position
  numeric start ; start := 0 ;

  % Macros

  % Draw a section of a line (ascender, x-height or descender)
  vardef Section(expr lines, initial) =
draw (0, initial) -- (line, initial) withpen pencircle scaled 0.2mm ;
for i=0 step 1 until lines :
  save final ; final = i*nib ;
  pair a; a = (0, final + initial) ;
  pair b; b = (line, final + initial) ;
  draw a -- b withpen pencircle scaled 0.1mm ;
  % If marks=true show nib-width marks
  if marks = true:
fill mark scaled nib yshifted (final*2) ;
  fi ;
endfor ;
  draw (0, final + initial) -- (line, final + initial)
withpen pencircle scaled 0.2mm ;
final + initial
  enddef ;

  % Draw a line with the three secions (asc, med, dsc)
  vardef Line(expr descender, ascender, xheight, initial) =
numeric dd, oo, aa ;
% Líneas
dd = Section(descender, initial) ;
oo = Section(xheight, dd) ;
aa = Section(ascender, oo) ;
% Devolver posicion final con espacio para siguiente renglon
aa + nib*2
  enddef ;

  % Llenar la página con renglones
  for i=1 upto availableLines :
start := Line(dsc, asc, med, start) ;
  endfor ;
\stopreusableMPgraphic

\startdocument
  \startstandardmakeup
\reuseMPgraphic{pauta}
  \stopstandardmakeup
\stopdocument
%%

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

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


“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-cont

[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: Modernizing Parametric type design A case study of Nupuram Malayalam typeface

2023-11-04 Thread BPJ
I have created fonts for my "fictional scripts"[1] using MF[2] and
"converted" them to TTF by importing the bitmap font into the background
layer in Fontforge and tracing it with potrace. It was a long time ago, I
used little metaness beyond setting weight through pen/path width and/or a
general slant trough `currenttransform := identity slanted ...`[3] and/or
modifying heights, and the conversion method may be less sophisticated
(though it avoided needing to remove overlaps!) but still! I have often
thought about doing a more ambitious project using more metaness and maybe
MP. I have experimented a bit playing with `superellipse`, `superhalf` and
my own `super_iii_q` (super-three-quarters), directions[4] and defining
different serifs or lack of them through macros but it never got anywhere.

IIRC Johan Winge used MF for his Tengwar Annatar font for Tolkien's Elvish
script, but AFAIK he has never revealed which conversion method he used.

[1]: As in "scripts used for conlangs used in fiction". The languages do
exist in a more or less rudimentary form and the scripts definitely exist.
I have used some of them to write English or Swedish on occasion.

[2]: I have cerebral palsy so I definitely am not god with GUIs.
Unfortunately I also have mild dyscalculia which makes math hard, but not
as hard as GUIs!

[3]: This seems not to work in MP. I wonder why.

[4]: I defined N, NNW, NW, WNW, W, WSW, SW, SSW, S, SSE ... as synonyms of
up, down etc. and intermediate points between each other, so not very
sophisticated! Also top_lft, top_rt, bot_lft, bot_rt, set to different
values to get/not get Fraktur-like counters.

Den lör 4 nov. 2023 10:38Hans Hagen  skrev:

> On 11/4/2023 9:33 AM, luigi scarso wrote:
> >
> > https://typoday.in/spk_papers/Santhosh_Thottingal_Typoday2023.pdf
> > 
> > and
> > https://twitter.com/santhoshtr/status/1577596445917470722
> > 
> >
> > Long live to metapost &  metafont
> > (& mflua :-) :-) :-) )
> when the font was released we (MS & HH) played a bit with it and
> wondered about making a math companion ...
>
> 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
>
> ___
>
___
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: Modernizing Parametric type design A case study of Nupuram Malayalam typeface

2023-11-04 Thread Hans Hagen

On 11/4/2023 9:33 AM, luigi scarso wrote:


https://typoday.in/spk_papers/Santhosh_Thottingal_Typoday2023.pdf 


and
https://twitter.com/santhoshtr/status/1577596445917470722 



Long live to metapost &  metafont
(& mflua :-) :-) :-) )
when the font was released we (MS & HH) played a bit with it and 
wondered about making a math companion ...


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] Modernizing Parametric type design A case study of Nupuram Malayalam typeface

2023-11-04 Thread luigi scarso
https://typoday.in/spk_papers/Santhosh_Thottingal_Typoday2023.pdf
and
https://twitter.com/santhoshtr/status/1577596445917470722

Long live to metapost &  metafont
(& mflua :-) :-) :-) )

--
luigi
___
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-02 Thread Vincent Hennebert

On 01/11/2023 12:36, Hans Hagen via ntg-context wrote:

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


Interesting. I’ll try and extend it to include the sans and mono styles. 
I’m not sure which version will be more readable in the end. My Lua 
function to determine the font file name is a bit convoluted indeed.



- 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


Ok. But then that means that the designsizes table will be used all the 
time, including when design sizes are disabled, right? Which would mean 
that I _must_ define the regular size as a fallback.



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 think I see your point. I think we can still talk about design sizes 
but, instead of thinking in absolute sizes, we would want to think in 
sizes relative to the font setup.


That is, instead of saying ‘Caption shall be used for sizes 6.5pt and 
below, SmText for 9.5pt and below etc.’, we would want to say ‘Caption 
shall be used for 50% of the body font size and below, SmText for 75% 
and below, etc.’


This way, design sizes would be used ‘harmoniously’ no matter the 
scaling. A poster, for instance, would usually be viewed at such a 
distance that the apparent size of small text (typeset at, say, 25pt 
when the main text is at 50pt, therefore using Caption) would match the 
apparent size of caption text in a regular document typeset at 12pt and 
read from a normal distance.


Make sense?

As a corollary: Does the design sizes mechanism used in goodies file 
allow to use relative sizes?




(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

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

2023-10-31 Thread Vincent Hennebert

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 Questions For the Experts further down...)


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\starttypescriptcollection[adobesource]

  \startluacode
  require("adobesource")
  \stopluacode

  \starttypescript[serif,sans,mono]
[
  adobesource-extralight,
  adobesource-light,
  adobesource,
  adobesource-regular,
  adobesource-medium,
  adobesource-semibold,
  adobesource-bold,
  adobesource-black,
  adobesource-nodesignsize-extralight,
  adobesource-nodesignsize-light,
  adobesource-nodesignsize,
  adobesource-nodesignsize-regular,
  adobesource-nodesignsize-medium,
  adobesource-nodesignsize-semibold,
  adobesource-nodesignsize-bold,
  adobesource-nodesignsize-black,
]
[name]
\setups[font:fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}]   [\ctxlua{context(userdata.adobesource.getfontname("\typescriptone", "\typescripttwo", false, false))}] [features=default]
\definefontsynonym [\t

[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 Pablo Rodriguez
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.

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.

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

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.

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

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

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

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

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

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.

I know Acrobat contains errors (deviations from the specification), but
this is not very relevant now (since not even Adobe claims that Acrobat
implementation of the PDF spec is fully conformant with the it).

For example, MuPDF, SumatraPDF and Chrome/Edge don’t care about
/EmbeddedFiles or annotation borders.

MuPDF may access to the embedded file only to save its contents from
/FileAttachment. Again, it has to be saved first, to be opened and
displayed then. No matter whether the file is actually a PDF document.

SumatraPDF follows the same path, but it doesn’t seem to enable saving
attachments in its latest stable release.

I know there is no way to have it all. But at least in the case of
attachments, I think it is clear that (what to some viewers seeems to
be) new functionality has to be implemented.

As for the users, sorry to disagree with you, Hans, we need a decent
viewer (and I’m not an Acrobat user at home). I mean, a viewer that
implements the required features (by the document creator or their
recipients).

That being said, if different annotation border colors (/C value in
/Annot) is not an option in ConTeXt, a single annotation border color
will be a “must have”.

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

Many thanks for your help again.

I’m afraid for the reasons explained above, this cannot be my way.

> […]
> which already might help you. To make it easier I'll add \namedgoto do
> that one can say:
> […]
> I'll also add \outline and \outlined
> […]
> which of course you the

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

2023-09-23 Thread Hamid,Idris

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

(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.
I remember the experimental uniscribe binding, don't recall that it was ever 
officially released. (Did Kai Bormann ever work with it?).

I hope that it still works or can be resurrected when the time comes for 
testing -)


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

The metrics should be dimensionless and most Arabic fonts do that, but Lotus 
Linotype gives them width (one wonders why).

Perhaps the Lotus designers thought that giving them width makes them easier to 
edit, which is indeed the case. And perhaps they were satisfied that 
Word/InDesign would be able, as needed, to toggle the metrics on and off as 
well as the shape. That WYSIWYG-DTP curse again..

\setcharacterstripping[1] gives the right results with Lotus (at least so far) 
-- see attached. Was pleasantly surprised that the spurious width was also 
suppressed.

\setcharacterstripping[0] toggles back -- another pleasant result -)


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

I'm in the process of switching from Multiple Masters sources to variable, so 
will surely encounter it soon.

Unfortunately there is indeed a frustrating gray area in this arena between 
knowing where the standards end and where the diktats of corporations (or even 
free-software consortiums like HB) begin, as we've discussed in the past. With 
variable fonts, one has to add some degree of arbitrariness..


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 far \setcharacterstripping[1] is giving the right results. If the relevant 
trackers are available, could add them to the attached test. But presumably you 
know how and why it works even for a non-dimensionless glyph.


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

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

2023-09-18 Thread Michael Loescher

Am 18.09.2023 um 16:20 schrieb Hans Hagen:

On 9/18/2023 3:58 PM, Michael Loescher wrote:

There seems to be something wrong with the \type command.

MWE:
\starttext
\type{hello}
\stoptext

gives an error:
tex error   > tex error on line 2 in file Z:/test.tex: Control sequence 
expected instead of undefined

what platform?


I run the latest win64 build.

Michael
___
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 Mikael Sundqvist
Hi,

works as expected here, with the latest.

/Mikael

On Mon, Sep 18, 2023 at 4:04 PM Michael Loescher  wrote:
>
> There seems to be something wrong with the \type command.
>
> MWE:
> \starttext
> \type{hello}
> \stoptext
>
> gives an error:
> tex error   > tex error on line 2 in file Z:/test.tex: Control sequence
> expected instead of undefined
>
>  \buff_verbatim_type_normal
>  #1->\buff_verbatim_initialize_type_two \dostarttaggedchained \t!verbatim
> \currenttype \??type \clf_type data{\protecteddetokenize
>  {#1}}tab{\typeparameter \c!tab }method{\p_buff_option
> }compact{\typeparameter \c!compact }escape{\typeparameter \c!escap
> 
>  \type{hello}
>
> 1 \starttext
> 2 >>  \type{hello}
> 3 \stoptext
> You injected something that confused the parser, maybe by using some Lua call.
> mtx-context | fatal error: return code: 1
>
> Michael
>
> Am 17.09.2023 um 10:01 schrieb Cron Daemon:
> > receiving incremental file list
> >   ./
> >   ctan.lsr
> >   document-2.htm
> >   download-1.htm
> >   download-2.htm
> >   logo-ade.png
> >   logo-cts.png
> >   logo-pod.png
> >   rss.xml
> >   show-fil.pdf
> >   context/latest/
> >   context/latest/cont-lmt.zip
> >   context/latest/cont-mpd.zip
> >   context/latest/cont-ppc.zip
> >   context/latest/cont-sci.zip
> >   context/latest/cont-tmf.zip
> >   context/latest/cont-tst.7z
> >   context/latest/cont-tst.tar.xz
> >   context/latest/cont-tst.zip
> >   general/manuals/
> >   general/manuals/luametatex.pdf
> >   general/manuals/primitives.pdf
> >
> >   sent 185,495 bytes  received 41,503,755 bytes  3,335,140.00 bytes/sec
> >   total size is 562,644,378  speedup is 13.50
> >
> >
> > Running archiver:
> >
> > New dir: /var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10
> > 232388526 
> > /var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10/latest
> > 126745317 
> > /var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10/current
> > 359137939 
> > /var/www/aanhet.net/context//htdocs/archives/context-2023-09-17.10
> > 359137939 total
> > ___
> > If your question is of interest to others as well, please add an entry to 
> > the Wiki!
> >
> > maillist : ntg-context@ntg.nl / 
> > https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> > ___
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___
___
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 Hans Hagen

On 9/18/2023 3:58 PM, Michael Loescher wrote:

There seems to be something wrong with the \type command.

MWE:
\starttext
\type{hello}
\stoptext

gives an error:
tex error   > tex error on line 2 in file Z:/test.tex: Control 
sequence expected instead of undefined

what platform?

looks like a mismatch in binary (you can compile luametatex yourself and 
then update the bin if ther eis some platform issue)


the compile farm is down (Mojca has to replace the machine) so I can't 
check 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 / 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 Michael Loescher

There seems to be something wrong with the \type command.

MWE:
\starttext
\type{hello}
\stoptext

gives an error:
tex error   > tex error on line 2 in file Z:/test.tex: Control sequence 
expected instead of undefined


 \buff_verbatim_type_normal
#1->\buff_verbatim_initialize_type_two \dostarttaggedchained \t!verbatim 
\currenttype \??type \clf_type data{\protecteddetokenize
{#1}}tab{\typeparameter \c!tab }method{\p_buff_option 
}compact{\typeparameter \c!compact }escape{\typeparameter \c!escap


    \type{hello}

1 \starttext
2 >>  \type{hello}
3 \stoptext
You injected something that confused the parser, maybe by using some Lua call.
mtx-context | fatal error: return code: 1

Michael

Am 17.09.2023 um 10:01 schrieb Cron Daemon:

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

  total size is 562,644,378  speedup is 13.50


Running archiver:

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

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

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

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


[NTG-context] 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] Fwd: Kerning feature not working

2023-08-30 Thread Hans Hagen




 Forwarded Message 
Subject: Re: [NTG-context] Kerning feature not working
Date: Wed, 30 Aug 2023 22:17:43 +0200
From: Hans Hagen 
To: Marcus Vinicius Mesquita 

On 8/30/2023 9:37 PM, Marcus Vinicius Mesquita wrote:

Dear List

In the MWE below, the kerning feature works OK for ebgaramonditalic
but not for ebgaramondregular.
How do I fix it?

I'm using ConTeXt version: 2023.08.27 13:48


\startluacode
 fonts.handlers.otf.addfeature {
 name = "kernit",
     type = "kern",
nocheck = true,
 data = {
   [0x27E8] = { ["f"] = 300, ["fi"] = 300, ["fl"] = 300 }
 }
 }
\stopluacode


you need to know the code points and eb garamond is not so predictable 
(welcome to fonts ...)


\startluacode
fonts.handlers.otf.addfeature {
name = "kernit",
type = "kern",
 nocheck = true,
data = {
  [0x27E8] = {
["f"]= 300,
["f_l"]  = 300,
["f_i"]  = 300,
[0xFB01] = 300,
[0xFB02] = 300,
}
}
}
\stopluacode


\definefontfeature[kernit][mode=node,kernit=yes]

\starttext
\definedfont[name:ebgaramondregular*default,kernit]

⟨f ile

⟨f lame

⟨file

⟨flame

\definedfont[name:ebgaramonditalic*default,kernit]

⟨f ile

⟨f lame

⟨file

⟨flame

\stoptext
but easier is this (an old mechanism, maybe time for an upgrade with 
merged vectors)


\definecharacterspacing [myspacing]

\setupcharacterspacing [myspacing] ["27E8] [right=0.25,alternative=1]
\setupcharacterspacing [myspacing] ["27E9] [left=0.25,alternative=1]

and then

\setcharacterspacing[myspacing]


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
___

  1   2   3   4   5   6   7   8   9   10   >