Re: [NTG-context] About macro numberstriped ()

2022-10-01 Thread Fabrice Couvreur via ntg-context
Hi Hans,
When the rectangles are not identical, how to have the same type of
hatching in both ?
Thanks.
Fabrice


\starttext
 \startlinecorrection[blank]
  \startmidaligned
\switchtobodyfont[9pt]
\startMPcode
  path p, q, r, b ;
  p  := unitsquare xyscaled (4cm,4cm) ;
  z[0] = (2cm,0cm) ;
  z[1] = (2cm,4cm) ;
  z[2] = (0cm,2cm) ;
  q := llcorner p--z[0]--z[1]--z[2]--cycle ;
  r := unitsquare xyscaled (1cm,1cm) shifted(0,3cm) ;
  b := unitsquare xyscaled (3cm,3cm) shifted(1cm,0) ;

  draw r
 withpattern image (
 draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
 % how to get the corner dots
   )
   withpatternscale 1/8
   withpen pencircle scaled 1pt
   withcolor cyan;
   ;
 draw b
   withpattern image (
 draw (llcorner unitsquare -- urcorner unitsquare) scaled 5mm ;
 % how to get the corner dots
   )
   withpatternscale 1/16
   withpen pencircle scaled 1pt
   withcolor cyan;
   ;

   draw p;
   draw b;
   draw r;

 label.llft("D", p) ;
 label.lrt("C", p) ;
 label.ulft("A", p) ;
 label.urt("B", p) ;
 label.urt("P", lrcorner r) ;
 label.lft("Q", llcorner r) ;
label.top("M", urcorner r) ;

  \stopMPcode
  \stopmidaligned
\stoplinecorrection
\stoptext



Le mer. 28 sept. 2022 à 21:05, Henning Hraban Ramm via ntg-context <
ntg-context@ntg.nl> a écrit :

> Am 28.09.22 um 15:29 schrieb Hans Hagen via ntg-context:
> > On 9/28/2022 3:11 PM, Fabrice Couvreur via ntg-context wrote:
> >> PS : What is the exact meaning of the word "blobs" because my English
> >> is average ?
> > in order to get 'lines' you need to fill the two opposing corners with
> > "blobs of ink"
>
> Otherwise, a BLOB is a “binary large object”, e.g. if you save image
> data to a database.
>
> Hraban
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] lmtx status

2022-09-27 Thread Hans Hagen via ntg-context

Hi,

At the ctx meeting we released luametatex, that is, the source code is 
now in the context zip (so it grew a few MB). At the same time Mojca set 
up some contextgarden repositories on github. We're working on a setup 
for users to generate older snapshots, if needed (for instance because 
there are platform changes). She's also working on cmake based 
installation helpers.


One of the things we did was pruning the fonts that are part of the 
installation. With a few exceptions the type one fonts were dropped, 
which is most noticeable for math. There is no need for px and tx fonts, 
they served their puspose in the transition from old style t1 fonts to 
opentype math (when we started with mkiv; we could have dropped them 
already).


We're looking into antykwa math as well as in alternative script and 
calligraphic math alphabets so eventually virtual math from t1 
construction can be dropped completely (in principle if can be 
integrated in the tweak mechanisms) because it is not wirth the effort 
to make them better. That means that we will ship some additional 
companion fonts.


There are math times fonts but they are currently not free and there is 
some effort going on to turn them opentype so we can ditch their setups 
too (we can't test anyway; to some extend that is also true for minion 
math).


High on the agenda is euler (in combination with pagella). This also 
relates to upgraded mixed script and calligraphic support in math. It 
actually means that enabling alternative alphabets will happen a bit 
differently (more naturally integrated as we introduced dedicated ranges 
of slots). Again a side effect is that we have more granular math glyph 
properties (opentype math is too limited but basically frozen so we have 
to get over that and move on). We (Mikael and me) also try to compensate 
for the ommissions and weird things in unicode math but it will take 
some time before we have that all documented.


One of the next uploads will have the pruned / upgraded texmf tree (one 
can always install more in the local tree of course). At some point 
installing from the garden (or from a git clone) will also be supported 
(basically anyone can host a lmtx install).


For the next texlive we hope to switch to lmtx as default and that also 
means that luametatex is the runner then. One can (as currently in lmtx) 
always run luatex with "--luatex".


Als-in-all it's a lot of work but we're getting there.

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
___


Re: [NTG-context] Missing letters and numbers in printout

2022-09-26 Thread Angel M Alganza via ntg-context

On Mon, Sep 26, 2022 at 07:10:40PM +0200, Pablo Rodriguez via ntg-context wrote:


BTW, is TeX Gyre Heros the font with missing chars in the printed
version of your PDF document?


It doesn't seem to be that:

$ pdffonts a6.pdf
name type  encoding emb sub 
uni object ID
 -  --- --- 
--- -
KBVQDT+LMRoman8-Regular  CID Type 0C   Identity-H   yes yes 
yes  2  0
PISBZT+LMRoman6-Regular  CID Type 0C   Identity-H   yes yes 
yes  3  0
VGDDRM+LMRoman12-Regular CID Type 0C   Identity-H   yes yes 
yes  9  0
BBBAHN+LMMono8-Regular   CID Type 0C   Identity-H   yes yes 
yes 10  0


There might be a workaround (or a way of testing this), compiling the
PDF document with LuaTeX instead of with LuaMetaTeX.


It seems it is compiled with LuaTeX:

$ pdfinfo a6.pdf
Title:  a6
Creator:LuaMetaTeX 2.09 20220429 + ConTeXt LMTX 2022.05.11 11:36
Producer:   LuaMetaTeX-2.09
CreationDate:   Tue Sep 20 07:19:29 2022 CEST
ModDate:Tue Sep 20 07:19:29 2022 CEST
Tagged: no
UserProperties: no
Suspects:   no
Form:   none
JavaScript: no
Pages:  1
Encrypted:  no
Page size:  595.276 x 841.89 pts (A4)
Page rot:   0
File size:  25630 bytes
Optimized:  no
PDF version:1.7


If you compile it invoking "context source.tex", use "context --luatex
source.tex".


When I try that I get:

$ context --luatex a6lua.tex 
mtx-context | redirect luametatex -> luatex: luatex --luaonly "/mnt/tex/tex/texmf-linux-64/bin/mtxrun.lua" --script mtx-context --luatex a6lua.tex --redirected

mtxrun  | unknown script 'mtx-context.lua' or 'mtx-mtx-context.lua'


But the way to know for sure which tools generated your PDF document and
whether fonts are embedded, "pdfinfo your-file.pdf" and "pdffonts
your-file.pdf" are your friends.


I didn't know any of the poppler-utils, thank you!


Otherwise, the only option about your documents is guessing.


I guess.  :-)

Ángel
___
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
___


Re: [NTG-context] Missing letters and numbers in printout

2022-09-26 Thread Pablo Rodriguez via ntg-context
On 9/26/22 16:06, Angel M Alganza via ntg-context wrote:
> Hello,

Hi Ángel,

> [...]
> I tried printing the same file (from the same USB drive) into a
> different printer, this time connected to a computer, and sending the
> file from it, which worked just fine.  My guess is that the first
> printer in missing the font the document uses, whereas the second
> printer received the font from the computer (Devuan Linux), which has
> the appropriate font.  Could that be correct?

From my experience, this is possible, but maybe not highly probable.

By default, ConTeXt includes fonts by default, as far as I can remember
(I have been using it for over a decade).

> In all previous ocasions I used the version of ConTeXt included in
> Texlive on Devuan, but a few months ago I decided to install ConTeXt
> using the official distribution instead.  Could that explain the change
> in behaviour I'm seeing?  Could it be that the previous versions I used
> somehow embeded the fonts into the PDF file but the current one doesn't?

Again, I’d very surprised if that were the case.

BTW, is TeX Gyre Heros the font with missing chars in the printed
version of your PDF document?

I think that your printer is having issues with the embedded font in
your PDF document.

There might be a workaround (or a way of testing this), compiling the
PDF document with LuaTeX instead of with LuaMetaTeX.

If you compile it invoking "context source.tex", use "context --luatex
source.tex".

It might be that your printer has problems with the way LuaMetaTeX
embeds the fonts in the PDF (while it has none with LuaTeX).

But the way to know for sure which tools generated your PDF document and
whether fonts are embedded, "pdfinfo your-file.pdf" and "pdffonts
your-file.pdf" are your friends.

Both infos for the following source:

  \setupbodyfont[helvetica]
  \starttext
  \input zapf
  \stoptext

$ pdffonts a.pdf
name  type encoding emb sub uni object ID
-----   --- --- --- -
TeXGyreHeros-Regular  CID Type 0C  Identity-H   yes yes yes  1  0

$ pdfinfo a.pdf
Title:  a
Creator:LuaMetaTeX 2.10 20220918 + ConTeXt LMTX 2022.09.11 20:44
Producer:   LuaMetaTeX-2.10
CreationDate:   Mon Sep 26 18:29:02 2022 CEST
ModDate:Mon Sep 26 18:29:02 2022 CEST
Tagged: no
UserProperties: no
Suspects:   no
Form:   none
JavaScript: no
Pages:  1
Encrypted:  no
Page size:  595.276 x 841.89 pts (A4)
Page rot:   0
File size:  7531 bytes
Optimized:  no
PDF version:1.7

Otherwise, the only option about your documents is guessing.

Just in case it might help,

Pablo



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

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


Re: [NTG-context] IBM Plex updates

2022-09-26 Thread BPJ via ntg-context
Den mån 26 sep. 2022 09:11Henning Hraban Ramm via ntg-context <
ntg-context@ntg.nl> skrev:

> Hi, just for information:
> There were new releases of the IBM Plex fonts recently:
> https://github.com/IBM/plex/releases
>
> They’re now at version 2.3. Some faces were annoyingly renamed (Semi
> Bold and Medium to SmBld and Medm).
>
> Hraban
>

Thank you for bringing this interesting type family to my attention!

/bpj

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


Re: [NTG-context] Math alignment question

2022-09-23 Thread Mikael Sundqvist via ntg-context
On Fri, Sep 23, 2022 at 8:46 PM Aditya Mahajan via ntg-context
 wrote:
>
> On Thu, 22 Sep 2022, Jeong Dal via ntg-context wrote:
>
> > Dear Mikael and Hans,
> >
> > Recently, you introdued the new command “\alignhere, \breakhere, \skiphere” 
> > which works fine.
> >
> > Since I usually use the following code that is adopted from My 
> > Way(Mathalign.pdf), I’d like to know that there is a way to use 
> > “\alignhere, \breakhere, \skiphere”  for the case below?
> >
> > \startformula\startalign
> > \NC A \NC = 3 \NR
> > \NC B \NC = 5 \NR
> > \stopalign\stopformula
>
> The way I see it is that the current implementation is that it is way to 
> break a _single_ long equation to multiple lines. For multiple equations, you 
> still need to use the \startalign method.
>

Indeed, that is the case. These formulas are done for single chain
equations. The example given above consists of two formulas, and the
new broken formula type simply does not fit. You can play with more
than one \alignhere, but they will only set new align points. I think
\startalign ... \stopalign is the way to go there. If it is cumbersome
to type all the \NC and \NR one could in principle thing of similar
input as for the simple matrices. Your example then would become

\startalign
A, = 3;
B, = 5;
\stopalign

/Mikael
___
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] Lato typescripts (MKIV/LMTX)

2022-09-17 Thread Adam Reviczky via ntg-context
Hi,

With the latest upload (2022-09-16 14:41) I wanted to compare some older
projects that I've used with MKIV to the LMTX 2.10.00.

In one of which I am using the Lato 2.0 font (
https://packages.debian.org/sid/fonts-lato).
With MKIV I get the correct output but LMTX complains about not being able
to find the font.

There seems to be an issue with the typescript file type-imp-lato.mkiv.

MWE:
\setupbodyfont[lato,12pt]
\starttext
Hello World!
\stoptext

---
ConTeXt  ver: 2022.09.11 20:44 MKIV - luatex version: 1.1501, functionality
level: 7539:

mtxrun --script fonts --list --all --pattern=*lato*
identifier   familyname   fontname filename
 subfont   instances

latoblacklato latoblackLato-Bla.ttf
latoblackitalic  lato latoblackitalic  Lato-BlackItalic.ttf
latobold lato latobold Lato-Bol.ttf
latobolditalic   lato latobolditalic   Lato-BoldItalic.ttf
latoextraboldlato latoheavyLato-Heavy.ttf
latoextralight   lato latothin Lato-Thin.ttf
latohairline lato latohairline Lato-Hai.ttf
latohairlineitalic   lato latohairlineitalic   Lato-HaiIta.ttf
latoheavylato latoheavyLato-Heavy.ttf
latoheavyitalic  lato latoheavyitalic  Lato-HeavyItalic.ttf
latoitalic   lato latoitalic   Lato-Italic.ttf
latolightlato latolightLato-Lig.ttf
latolightitalic  lato latolightitalic  Lato-LightItalic.ttf
latomedium   lato latomedium   Lato-Medium.ttf
latomediumitalic lato latomediumitalic Lato-MediumItalic.ttf
latonormal   lato latohairline Lato-Hai.ttf
latoregular  lato latoregular  Lato-Reg.ttf
latosemibold lato latosemibold Lato-Semibold.ttf
latosemibolditalic   lato latosemibolditalic
Lato-SemiboldItalic.ttf
latothin lato latothin Lato-Thin.ttf
latothinitalic   lato latothinitalic   Lato-ThinItalic.ttf

fonts   > otf loading > loading
'/usr/share/texlive/texmf-dist/fonts/truetype/typoland/lato/Lato-Regular.ttf',
hash 'lato-regular'

mkiv lua stats  > loaded fonts: 3 files: xitsmath-bold.otf,
xitsmath-regular.otf, lato-regular.ttf
---
ConTeXt  ver: 2022.09.11 20:44 LMTX - luametatex version: 2.1,
functionality level: 20220918:

mtxrun --script fonts --list --all --pattern=*lato*
identifier   familyname   fontname filename
 subfont   instances

latoblacklato latoblackLato-Bla.ttf
latoblackitalic  lato latoblackitalic  Lato-BlackItalic.ttf
latobold lato latobold Lato-Bol.ttf
latobolditalic   lato latobolditalic   Lato-BoldItalic.ttf
latoextraboldlato latoheavyLato-Heavy.ttf
latoextralight   lato latothin Lato-Thin.ttf
latohairline lato latohairline Lato-Hai.ttf
latohairlineitalic   lato latohairlineitalic   Lato-HaiIta.ttf
latoheavylato latoheavyLato-Heavy.ttf
latoheavyitalic  lato latoheavyitalic  Lato-HeavyItalic.ttf
latoitalic   lato latoitalic   Lato-Italic.ttf
latolightlato latolightLato-Lig.ttf
latolightitalic  lato latolightitalic  Lato-LightItalic.ttf
latomedium   lato latomedium   Lato-Medium.ttf
latomediumitalic lato latomediumitalic Lato-MediumItalic.ttf
latonormal   lato latohairline Lato-Hai.ttf
latoregular  lato latoregular  Lato-Reg.ttf
latosemibold lato latosemibold Lato-Semibold.ttf
latosemibolditalic   lato latosemibolditalic
Lato-SemiboldItalic.ttf
latothin lato latothin Lato-Thin.ttf
latothinitalic   lato latothinitalic   Lato-ThinItalic.ttf

close source> level 2, order 6, name
'/usr/share/texmf/tex/context/fonts/mkiv/type-imp-lato.mkiv'
fonts   > defining > font with asked name 'lato-regular' is not
found using lookup 'file'
fonts   > defining > unable to define 'lato-regular' as
'lato-12pt-ss-tf-0--0'
---

If I change the file: reference I get it working with both MKIV/LMTX:

\starttypescript [\s!sans] [lato] [\s!name]
\setups[\s!font:\s!fallback:\s!sans]
% \definefontsynonym [\s!Sans]   [\s!file:lato-regular]
 [\s!features=\s!default]
% \definefontsynonym [\s!SansBold]   [\s!file:lato-bold]
[\s!features=\s!default]
\definefontsynonym [\s!Sans]   [\s!file:lato-r

Re: [NTG-context] Can't no break between a close punctuation and a open punctuation

2022-09-02 Thread 黄复雄 via ntg-context
> > doc for example:
> >
> > ```lmtx
> > \setscript[hanzi]
> > \usetypescriptfile[mscore]
> > \usebodyfont   [mschinese,20pt]
>
> can you upgrade the chiese section in that file for windows 10+ as the
> old fonts are gone
>
> (i tested with \definedfont[file:mingliu.ttc*chinese @ 10pt])

I adapted type-imp-mscore.mkiv to the situation of the fonts in Win10,
and made type-imp-notocjksc.mkiv  according to the Notocjksc fonts.

I refer to type-imp-ipaex.mkiv, and I don't know if the method in it
is outdated. At least, the test results are fine,
though the resulting PDF is a bit too large to be included in this email.
 
___
 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
 
___


font_testing.lmtx
Description: Binary data


type-imp-notocjksc.mkiv
Description: Binary data


type-imp-mscore.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://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
___


Re: [NTG-context] setupexternalfigures and resoĺution

2022-09-02 Thread Henning Hraban Ramm via ntg-context

Am 02.09.22 um 10:39 schrieb Keith McKay via ntg-context:
Thanks for this code Hraban. I tried this last night and it worked 
really well. I did have one stumbling block when I noticed that those 
image files with a space in their names were not found, however 
renaming  without a space solved the problem. Is this a bug or a feature?


The call to gm convert was lacking quoting of the file names. Fixed in 
attachment.


While the code does some downsampling, the calculation is not always 
right, because it doesn’t consider scaling (or something like that).


Hraban
if not modules then modules = { } end modules ['grph-downsample'] = {
  version   = 1.101,
  comment   = "companion to grph-inc.mkiv",
  author= "Peter Münster", -- adapted to LMTX by Hraban
  copyright = "PRAGMA ADE / ConTeXt Development Team",
  license   = "see context related readme files"
}

assert(not figures.getinfo2)

figures.getinfo2 = function(name, page) -- [ [NTG-context] Pdf info with 
Lua/Ctx API ]
 if type(name) == "string" then
   name = { name = name, page = page }
 end

 if name.name then
   local data = figures.push(name)
   local info = figures.identify()

   if info.status.status ~= 0 then
 figures.check() -- !Counts pages here!
   end

   figures.pop()

   return --data
  info
 end
end


local format = string.format
-- figures.cachepaths.path = "cache" -- should be setup-option
local function sample_down(oldname, newname, resolution)
  print("DOWNSAMPLE sample_down " .. oldname .. " to " .. newname)
  local request = figures.current().request
  local width = request.width
  local height = request.height
  if resolution == "" then -- or (not width and not height) then
print(format("DOWNSAMPLE Nothing to do: %s, %s, %s dpi, %s x %s px", 
oldname, newname, resolution, width, height))
return
  end
  local TEXpt = 65536
  local inch = 72.27

  -- MkIV:
  -- local image = img.scan{filename = oldname}

  -- LMTX:
  local image = figures.getinfo(oldname,1)
  image = image.status.private

  local xy = image.xsize / image.ysize
  if (not width and not height) then
-- no size requested? use default width
width = 300 * TEXpt
  end
  if not width then
height = height / TEXpt
width = height * xy
  end
  if not height then
width = width / TEXpt
height = width / xy
  end
  width = math.floor(width)
  height = math.floor(height)
  print(format("DOWNSAMPLE image size %dx%dpx. requested %dx%d?", image.xsize, 
image.ysize, width, height))
  local xsize = math.floor(resolution * width / inch)
  local ysize = math.floor(resolution * height / inch)
  print(format("DOWNSAMPLE size %d x %d to %d x %d", image.xsize, image.ysize, 
xsize, ysize))
  if xsize < image.xsize or ysize < image.ysize then
local s = format("gm convert -resize %dx%d -resample %dx%d \"%s\" \"%s\"",
 xsize, ysize, resolution, resolution, oldname, newname)
print("DOWNSAMPLE Conversion: " .. s)
os.execute(s)
  else
print(format("DOWNSAMPLE Nothing to do: %s, %s, %s dpi, %d x %d px", 
oldname, newname, resolution, width, height))
print(format("DOWNSAMPLE xsize = %d, ysize = %d", xsize, ysize))
  end
end

local formats = {"png", "jpg", "gif"}

for _, s in ipairs(formats) do
  figures.converters[s] = figures.converters[s] or {}
  figures.converters[s]["lowres." .. s] = sample_down
end
___
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
___


Re: [NTG-context] setupexternalfigures and resoĺution

2022-09-01 Thread Henning Hraban Ramm via ntg-context

Am 01.09.22 um 10:44 schrieb juh+ntg-context--- via ntg-context:


Hi,

what is resolution meant to do?

Whatever I insert as resolution, I get no change.

\setupexternalfigure[location={default,local},resolution=30]
\starttext
\externalfigure[hacker]
\stoptext

What am I missing?


The resolution parameter is still not used by default ConTeXt, sorry.

But you can use it with the attached lua file like:


\loadluafile[grph-downsample]
\doifmodeelse{print}{%
\def\Resolution{300}
}{%
\def\Resolution{96}
}%

\setupexternalfigures[
  %directory={./Logos,img},
  conversion=lowres.jpg,
  resolution=\Resolution,
]


Hraban
if not modules then modules = { } end modules ['grph-downsample'] = {
  version   = 1.100,
  comment   = "companion to grph-inc.mkiv",
  author= "Peter Münster", -- adapted to LMTX by Hraban
  copyright = "PRAGMA ADE / ConTeXt Development Team",
  license   = "see context related readme files"
}

assert(not figures.getinfo2)

figures.getinfo2 = function(name, page) -- [ [NTG-context] Pdf info with 
Lua/Ctx API ]
 if type(name) == "string" then
   name = { name = name, page = page }
 end

 if name.name then
   local data = figures.push(name)
   local info = figures.identify()

   if info.status.status ~= 0 then
 figures.check() -- !Counts pages here!
   end

   figures.pop()

   return --data
  info
 end
end


local format = string.format
-- figures.cachepaths.path = "cache" -- should be setup-option
local function sample_down(oldname, newname, resolution)
  print("DOWNSAMPLE sample_down " .. oldname .. " to " .. newname)
  local request = figures.current().request
  local width = request.width
  local height = request.height
  if resolution == "" then -- or (not width and not height) then
print(format("DOWNSAMPLE Nothing to do: %s, %s, %s dpi, %s x %s px", 
oldname, newname, resolution, width, height))
return
  end
  local TEXpt = 65536
  local inch = 72.27

  -- MkIV:
  -- local image = img.scan{filename = oldname}

  -- LMTX:
  local image = figures.getinfo(oldname,1)
  image = image.status.private

  local xy = image.xsize / image.ysize
  if (not width and not height) then
-- no size requested? use default width
width = 300 * TEXpt
  end
  if not width then
height = height / TEXpt
width = height * xy
  end
  if not height then
width = width / TEXpt
height = width / xy
  end
  width = math.floor(width)
  height = math.floor(height)
  print(format("DOWNSAMPLE image size %dx%dpx. requested %dx%d?", image.xsize, 
image.ysize, width, height))
  local xsize = math.floor(resolution * width / inch)
  local ysize = math.floor(resolution * height / inch)
  print(format("DOWNSAMPLE size %d x %d to %d x %d", image.xsize, image.ysize, 
xsize, ysize))
  if xsize < image.xsize or ysize < image.ysize then
local s = format("gm convert -resize %dx%d -resample %dx%d %s %s",
 xsize, ysize, resolution, resolution, oldname, newname)
print("DOWNSAMPLE Conversion: " .. s)
os.execute(s)
  else
print(format("DOWNSAMPLE Nothing to do: %s, %s, %s dpi, %d x %d px", 
oldname, newname, resolution, width, height))
print(format("DOWNSAMPLE xsize = %d, ysize = %d", xsize, ysize))
  end
end

local formats = {"png", "jpg", "gif"}

for _, s in ipairs(formats) do
  figures.converters[s] = figures.converters[s] or {}
  figures.converters[s]["lowres." .. s] = sample_down
end
___
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
___


Re: [NTG-context] String substitution using regular expressions and backreferences

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

On 8/25/2022 9:44 PM, Thangalin via ntg-context wrote:

I've attempted to apply Wolfgang's subtle suggestion of using Lua to parse
the input document using a regular expression via lpeg.replacer. The
replacement itself works fine; however, in doing so the XML document
structure is converted to text, which means that it is no longer possible
to "flush" the XML for further processing as XML. The result is that any
unresolved XML tags are written verbatim to the PDF:

https://i.stack.imgur.com/9ZFND.png

There are two other issues with this approach. First is efficiency. Second
is that the processing function would have to be called for every XML
element to capture the replacement.

My original post asked about applying regex word substitution in a ConTeXt
way, such as:

\definereplacement[SubstMac][ match={Mc([A-Z].*)}, replace={\Mac \\1} ]
\definereplacement[SubstPostmeridian][ match={[Pp]\\.[Mm]\\.},
replace={\cap{pm}} ]

That seems like the cleanest approach because it would work on top of XML
or any other source document. Nevertheless, here is what I tried, which
partially works:

\startbuffer[main]

   “Mr. McAnulty, I presume?”
   Regular text. Irregular text.
\stopbuffer
\startxmlsetups xml:xhtml
   \xmlsetsetup{\xmldocument}{*}{-}
   \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}\stopxmlsetups
\startxmlsetups xml:html
   \startdocument
 \xmlflush{#1}
   \stopdocument\stopxmlsetups
% Paragraphs are followed by a paragraph break, but only if not
nested.\startxmlsetups xml:p
   \xmlfunction{#1}{p}
   \par\stopxmlsetups
\startxmlsetups xml:em
   \dontleavehmode{\em\xmlflush{#1}}\stopxmlsetups
\startluacode
function xml.functions.p( t )
   rep = { [1] = { "McAnulty", "\\Mac Anulty" } }
   x = lpeg.replacer( rep ):match( tostring( xml.text( t ) ) )

   buffers.assign( "p", context( x ) )
   context.getbuffer{ "p" }
end\stopluacode
\xmlregistersetup{xml:xhtml}
\def\Mac{%
   % Determine the sizes of 'M' and 'c'.
   \newbox\MacMBox%
   \setbox\MacMBox\hbox{M}%
   \newbox\MacCBox%
   \setbox\MacCBox\hbox{c}%
   %
   % Cheat to dynamically derive the kerning size by putting Mc in a box.
   %
   \newbox\MacKernBox%
   \setbox\MacKernBox\hbox{\inframed[offset=\zeropoint, width=fit]{Mc}}%
   \def\MacDelta{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
   \def\MacUWidth{\dimexpr\wd\MacCBox-.75\MacDelta\relax}%
   \def\MacRule{\vrule width \MacUWidth height .04em depth \zeropoint \relax}%
   \def\MacKern{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
   \def\MacHeight{\dimexpr\ht\MacMBox-\ht\MacCBox\relax}%
   %
   % Write Mc, where c has a macron, to the document.
   %
   M{%
 \dontleavehmode{\raisebox{\MacHeight}\hbox{c}}%
 \kern-1.04\MacUWidth
 \MacRule
 \kern.08\MacUWidth
   }%
}%
\xmlprocessbuffer{main}{main}{}

As shown in the screen shot, this doesn't correctly handle nested XML
elements.

Any ideas on what approach to take to perform a string replacement in
ConTeXt?

Best stay at the xml end ...

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}
\stopxmlsetups

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

\startxmlsetups xml:p
\xmlfunction{#1}{p}
\xmlcontext{#1}
\par
\stopxmlsetups

\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}
\stopxmlsetups

\startluacode
local rep = lpeg.replacer { [1] = { "McAnulty", "\\Mac Anulty" } }
function xml.functions.p(t)
local dt = t.dt
for i=1,#dt do
local di = dt[i]
if type(di) == "string" then
dt[i] = lpeg.match(rep,di)
end
end
end
\stopluacode

\xmlregistersetup{xml:xhtml}

\startdocument
\xmlprocessbuffer{main}{main}{}
\stopdocument

But this is more fun and probably also more reliable:

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}
\stopxmlsetups

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

\startxmlsetups xml:p
\xmlcontext{#1}
\par
\stopxmlsetups

\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

\usemodule[gimmicks] % in latest uploads

\chardef\MacAnulty = \getprivateglyphslot{MacAnulty}

\startsetups [box:mcanulty:\number\MacAnulty]
\Mac Anulty
\stopsetups

\registerboxglyph category {mcanulty} unicode \MacAnulty \relax

\startluacode
fonts.handlers.otf.addfeature {
name= "mcanulty",
type= "ligature",
nocheck = true,
data= {
[fonts.constructors.privateslots.MacAnulty] = {
"M", "c",

Re: [NTG-context] Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?

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

On 8/22/2022 7:21 AM, 黄复雄 via ntg-context wrote:

Dear Hans.
Thank you very much for so many examples and guidance.

In fact, I have read one of the examples in the followingup.pdf,
and the https://github.com/Fusyong/vertical-typesetting module I made
is based on the example.

The examples all worked after I changed the font settings according to
my Win10 OS;
and surprisingly, the ruby module also worked with \setscript[hanzi]
  (they don't work together in the example Mr. Wolfgang provided).


I noticed an issu ewith multiple glyphs but am not sure why ... (so we 
need very small examples to figure it out).



The only problem is that the offsets of glyphs are a bit inaccurate,
which may be related to the font,
and I will look into it further.


in the vertical feature one can tune a bit.


The examples I have adjusted are attached,
and the output PDF of them is not attached for being too big to the
limit of 100 KB.
(Just now I received a reply from the mailing list system asking to
adjust a over-length email,
I mistakenly thought it was about the one to Mr. Wolfgang, so that one
was duplicated and submitted,
please deal with it.)


there are indeed limits


By the way, I've finished checking and adjusting type-imp-mscore.mkiv,
scrp-cjk.lua, and char-scr.lua so far,
but the changes are a bit much (or maybe you can say a bit reckless),
so I'm hesitant to get back to you in order to minimize your troubles.
And as mentioned partly in an earlier email, I've made 3 modules that
support Chinese
(about vertical-typesetting,  Jiazhu or inline cutting note and punctuation)
and I'd be happy to contribute them to the ConTeXt project repository
when they're ripe,
if that's in line with the project policy. Your comments and guidance
are very welcome.


hm, i can have a look at it but we shouldn't break japanese and korean

once you finished all we can see how it can either be integrated or 
become some third party module (has to do with maintainance)


can you also make a noto typescript for the different chinese setups 
(for some reason the CJK noto's failed so i used the non CJK ones as i 
couldn't locate the right files; one cannot longher download al-of-noto 
in one zip )


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
___


Re: [NTG-context] Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?

2022-08-21 Thread 黄复雄 via ntg-context
Dear Hans.
Thank you very much for so many examples and guidance.

In fact, I have read one of the examples in the followingup.pdf,
and the https://github.com/Fusyong/vertical-typesetting module I made
is based on the example.

The examples all worked after I changed the font settings according to
my Win10 OS;
and surprisingly, the ruby module also worked with \setscript[hanzi]
 (they don't work together in the example Mr. Wolfgang provided).
The only problem is that the offsets of glyphs are a bit inaccurate,
which may be related to the font,
and I will look into it further.
The examples I have adjusted are attached,
and the output PDF of them is not attached for being too big to the
limit of 100 KB.
(Just now I received a reply from the mailing list system asking to
adjust a over-length email,
I mistakenly thought it was about the one to Mr. Wolfgang, so that one
was duplicated and submitted,
please deal with it.)

By the way, I've finished checking and adjusting type-imp-mscore.mkiv,
scrp-cjk.lua, and char-scr.lua so far,
but the changes are a bit much (or maybe you can say a bit reckless),
so I'm hesitant to get back to you in order to minimize your troubles.
And as mentioned partly in an earlier email, I've made 3 modules that
support Chinese
(about vertical-typesetting,  Jiazhu or inline cutting note and punctuation)
and I'd be happy to contribute them to the ConTeXt project repository
when they're ripe,
if that's in line with the project policy. Your comments and guidance
are very welcome.

Best regards,
 Huang Fusyong(黄复雄)

Hans Hagen via ntg-context  于2022年8月22日周一 00:20写道:
>
> On 8/21/2022 12:10 PM, Wolfgang Schuster via ntg-context wrote:
> > 黄复雄 via ntg-context schrieb am 21.08.2022 um 10:24:
> >> Currently, the ruby module does not seem to support cjk fonts? I have
> >> a preliminary implementation of furigana(pinyin in Chinese) as:
> attached a variant (no pdf attached) using wolfgangs font definition
> plus some more
>
> -
>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
> ___


test-directions-006.lmtx
Description: Binary data


test-directions-005.lmtx
Description: Binary data


test-directions-008.lmtx
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://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
___


Re: [NTG-context] Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?

2022-08-21 Thread 黄复雄 via ntg-context
Dear Wolfgang,
thank you very much for your guidance.
After changing the font settings according to my computer Win10 OS,
the ruby module worked.
But there is another problem, when I use `\setscript[hanzi]`, as follows

%%%begin example
\setscript[hanzi]

\usetypescriptfile[mscore]
\usebodyfont   [mschinese,20pt]
\definefont[pinyinfont][name:ahpinying*default at 9pt]
\setupruby[color=darkgray, style=\pinyinfont]

\starttext
\ruby{寖備}{jìn bèi} \ss \ruby{寖備}{jìn bèi} % \tt \ruby{寖備}{jìn bèi}
\stoptext
%%%end example

ruby errors out as follows(that's why I didn't succeed with ruby before):

%%%begin error
resolvers   | formats | executing runner 'run luametatex format':
D:/venvs/context-win64/tex/texmf-win64/bin/luametatex
--jobname="d:/ah21/TEX/vertical-and-ruby-examples/ruby.lmtx"
--fmt=D:/venvs/context-win64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
--lua=D:/venvs/context-win64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
 --c:currentrun=1
--c:fulljobname="d:/ah21/TEX/vertical-and-ruby-examples/ruby.lmtx"
--c:input="d:/ah21/TEX/vertical-and-ruby-examples/ruby.lmtx"
--c:kindofrun=1 --c:maxnofruns=9
--c:texmfbinpath="D:/venvs/context-win64/tex/texmf-win64/bin"
system  >
system  > ConTeXt  ver: 2022.07.27 17:56 LMTX  fmt: 2022.8.22
int: english/english
system  >
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name
'D:/venvs/context-win64/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
'D:/venvs/context-win64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname
'd:/ah21/TEX/vertical-and-ruby-examples/ruby', input
'd:/ah21/TEX/vertical-and-ruby-examples/ruby.lmtx', result
'd:/ah21/TEX/vertical-and-ruby-examples/ruby'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name
'd:/ah21/TEX/vertical-and-ruby-examples/ruby.lmtx'
fonts   > bodyfont '20pt' is defined (can better be done global)
fonts   > bodyfont '24pt' is defined (can better be done global)
fonts   > bodyfont '16pt' is defined (can better be done global)
open source > level 2, order 3, name
'D:/venvs/context-win64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-mscore.mkiv'
close source> level 2, order 3, name
'D:/venvs/context-win64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-mscore.mkiv'
open source > level 2, order 4, name
'D:/venvs/context-win64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-cambria.mkiv'
open source > level 3, order 5, name
'D:/venvs/context-win64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv'
close source> level 3, order 5, name
'D:/venvs/context-win64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv'
close source> level 2, order 5, name
'D:/venvs/context-win64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-cambria.mkiv'
tex error   > tex error on line 1 in file
d:/ah21/TEX/vertical-and-ruby-examples/ruby.lmtx:

lua error:

registered function call [209]:
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:268:
attempt to index a nil value (local 'ruby')
stack traceback:
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:268:
in upvalue 'whatever'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:370:
in upvalue 'attach'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:363:
in upvalue 'whatever'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:370:
in upvalue 'attach'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:363:
in upvalue 'whatever'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:370:
in upvalue 'attach'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:363:
in upvalue 'whatever'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:370:
in upvalue 'attach'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:363:
in upvalue 'whatever'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:370:
in upvalue 'attach'
... (skipping 14 levels)
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:370:
in upvalue 'attach'
...n64/tex/texmf-context/tex/context/base/mkxl/typo-rub.lmt:363:
in upvalue &#x

Re: [NTG-context] Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?

2022-08-21 Thread 黄复雄 via ntg-context
Currently, the ruby module does not seem to support cjk fonts? I have
a preliminary implementation of furigana(pinyin in Chinese) as:

```lmtx
% define the pinyin font
\definefont[pinyinfont][name:ahpinying*default at 9pt]
% define the pinyin command
\define[2]\pinyin{%
\setbox1 = \hbox{#1}%
\setbox2 = \hbox{\darkgray \pinyinfont #2}%
\newdimen\maxwd%
\ifdim \wd1>\wd2 \maxwd=\wd1 \else \maxwd=\wd2 \fi%
\setbox1 = \hbox to \maxwd{\hfill \box1 \hfill}%
\setbox2 = \hbox to \maxwd{\hfill \box2 \hfill}%
\hskip0pt plus5pt\vbox{\setupinterlinespace[line=0.5em]\box2\box1}%
above line
% \hskip0pt
plus5pt\vtop{\setupinterlinespace[line=0.5em]\box1\box2}% under line
}
```
usage as follows:

```lmtx
\pinyin{寖備}{jìn bèi}
```

BTW, I hav made a vertical typesetting module for Chinese in ConTeXt LMTX,
vertical_typeset.lua in https://github.com/Fusyong/vertical-typesetting

You should modify the set for Japanese characters and punctuations here:

```lua
local function chars_to_vertical(c)
return c >= 0x04E00 and c <= 0x09FFF
end

local puncs_to_rotate = {
[0x3001] = true, -- 、
[0xFF0C] = true, -- ,
[0x3002] = true, -- 。
[0xFF0E] = true, -- .
[0xFF1F] = true, -- ?
[0xFF01] = true, -- !
[0xFF1A] = true, -- :
[0xFF1B] = true, -- ;
}
```

and there is a doc for example, 大学章句.lmtx, in https://github.com/Fusyong/jiazhu,
and jiazhu.lua in same place is a module of Jiazhu (or 夹注, 割注) in ConTeXt LMTX.

But all the comments are in Chinese.


amano.kenji via ntg-context  于2022年8月16日周二 19:34写道:
>
> At least, furigana seems covered.
>
> How do I know which document to consult? There are many PDF files that come 
> with ConTeXt.
>
> --- Original Message ---
> On Monday, August 15th, 2022 at 3:39 PM, Wolfgang Schuster via ntg-context 
>  wrote:
>
>
> > amano.kenji via ntg-context schrieb am 15.08.2022 um 14:00:
> >
> > > Is there any documentation about \ruby?
> >
> >
> > You can see all available parameters in setup-en.pdf, the example below
> > shows a few of them:
> >
> >  begin example
> > \setupinterlinespace[line=4ex]
> >
> > \setuptype[style=\ttx]
> >
> > \starttext
> >
> > \start
> > x \ruby{aaa}{bbb} x
> > \stop
> >
> > \start \setupruby[location=left]
> > \type{\setupruby[location=left]}\quad x \ruby{aaa}{bbb} x
> > \stop
> >
> > \start \setupruby[location=right]
> > \type{\setupruby[location=right]}\quad x \ruby{aaa}{bbb} x
> > \stop
> >
> > \start \setupruby[location=right,left={[},right={]}]
> > \type{\setupruby[left={[},right={]}]}\quad x \ruby{aaa}{bbb}
> > x
> > \stop
> >
> > \start \setupruby[align=flushleft]
> > \type{\setupruby[align=flushleft]}\quad x \ruby{aa}{bbb}
> > x
> > \stop
> >
> > \start \setupruby[align=flushright]
> > \type{\setupruby[align=flushright]}\quad x \ruby{aa}{bbb}
> > x
> > \stop
> >
> > \start \setupruby[style=\itxx]
> > \type{\setupruby[style=\itxx]}\quad x \ruby{aaa}{bbb} x
> > \stop
> >
> > \start \setupruby[color=blue]
> > \type{\setupruby[color=blue]}\quad x \ruby{aaa}{bbb} x
> > \stop
> >
> > \start \setupruby[voffset=-1.2ex]
> > \type{\setupruby[voffset=-1.2ex]}\quad x \ruby{aaa}{bbb} x
> > \stop
> >
> > \stoptext
> >  end example
> >
> > > What about vertical text?
> >
> >
> > ConTeXt has a mechanism to produce vertical text but there is nothing
> > yet which can
> > be used out of the box to produce a complete document with vertical
> > paragraphs.
> >
> > Wolfgang
> >
> > ___
> > If your question is of interest to others as well, please add an entry to 
> > the Wiki!
> >
> > maillist : ntg-context@ntg.nl / 
> > https://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage : https://www.pragma-ade.nl / http://context.aanhet.net
> > archive : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : https://contextgarden.net
> > ___
> ___
> 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

Re: [NTG-context] Using MathTime Pro 2 fonts in ConTeXt

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

On 8/18/2022 12:51 AM, Sebastian Leonardo Molina Diaz via ntg-context wrote:

Any hints on how to do it?

you can look into

mathtimes-math.lfg
type-imp-mathtimes.mkiv

to see how to turn t2 fonts into virtual ot fonts but one never knopws 
how well that works (depends on the fonts)


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
___


Re: [NTG-context] Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?

2022-08-16 Thread amano.kenji via ntg-context
At least, furigana seems covered.

How do I know which document to consult? There are many PDF files that come 
with ConTeXt.

--- Original Message ---
On Monday, August 15th, 2022 at 3:39 PM, Wolfgang Schuster via ntg-context 
 wrote:


> amano.kenji via ntg-context schrieb am 15.08.2022 um 14:00:
>
> > Is there any documentation about \ruby?
>
>
> You can see all available parameters in setup-en.pdf, the example below
> shows a few of them:
>
>  begin example
> \setupinterlinespace[line=4ex]
>
> \setuptype[style=\ttx]
>
> \starttext
>
> \start
> x \ruby{aaa}{bbb} x
> \stop
>
> \start \setupruby[location=left]
> \type{\setupruby[location=left]}\quad x \ruby{aaa}{bbb} x
> \stop
>
> \start \setupruby[location=right]
> \type{\setupruby[location=right]}\quad x \ruby{aaa}{bbb} x
> \stop
>
> \start \setupruby[location=right,left={[},right={]}]
> \type{\setupruby[left={[},right={]}]}\quad xxxxx \ruby{aaa}{bbb}
> x
> \stop
>
> \start \setupruby[align=flushleft]
> \type{\setupruby[align=flushleft]}\quad x \ruby{aa}{bbb}
> x
> \stop
>
> \start \setupruby[align=flushright]
> \type{\setupruby[align=flushright]}\quad x \ruby{aa}{bbb}
> x
> \stop
>
> \start \setupruby[style=\itxx]
> \type{\setupruby[style=\itxx]}\quad x \ruby{aaa}{bbb} x
> \stop
>
> \start \setupruby[color=blue]
> \type{\setupruby[color=blue]}\quad x \ruby{aaa}{bbb} x
> \stop
>
> \start \setupruby[voffset=-1.2ex]
> \type{\setupruby[voffset=-1.2ex]}\quad x \ruby{aaa}{bbb} x
> \stop
>
> \stoptext
>  end example
>
> > What about vertical text?
>
>
> ConTeXt has a mechanism to produce vertical text but there is nothing
> yet which can
> be used out of the box to produce a complete document with vertical
> paragraphs.
>
> Wolfgang
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : https://www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___
___
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
___


Re: [NTG-context] How can I make a Gentoo Linux package for ConTeXt LMTX?

2022-08-16 Thread amano.kenji via ntg-context
http://lmtx.pragma-ade.nl/install-lmtx/texmf-context.zip is not versioned.

If the file changes later, linux distributions refuse to use the file.

I wish ConTeXt and LuaMetaTex were versioned and provided `offline` build 
instructions. The vast majority of programs are versioned and can be built 
easily offline. Even if they were distributed as binary files, if they are 
versioned, I can still make linux packages out of them.

--- Original Message ---
On Monday, August 15th, 2022 at 9:56 PM, Max Chernoff  wrote:


> Okay, I'm seeing a few separate issues here.
>
> 1. Gentoo expects to compile everything from source.
>
> This isn't an option here since LuaMetaTeX doesn't have any source
> available (yet). So for the time being, you'll need to use the provided
> binaries. These support pretty much every architecture, so this
> shouldn't really be a problem.
>
> 2. You want to install ConTeXt LMTX system-wide.
>
> This is doable with the standard Linux installer script. Just make sure
> to run the script as root and install the files in /opt/context. This is
> what I've done on my system, and it works quite well.
>
> $ ls -l $(type -p context)
> lrwxrwxrwx. 1 root root 10 Jul 28 00:33 
> /opt/context/tex/texmf-linux-64/bin/context -> luametatex*
>
>
> 3. You want to install ConTeXt without any network access.
>
> The easiest way to do this would be to install on a system with
> internet, then just copy over the files.
>
> If you want to use the "original" installer files, it shouldn't be
> impossible, but probably not too easy either. (All steps below are
> untested)
>
> The platform-independent stuff is all in one big zip, located at:
>
> http://lmtx.pragma-ade.nl/install-lmtx/texmf-context.zip
>
> Unzip this file as "/tex/texmf-context/".
>
>
> Then you also need to download all of the binaries. You will need to
> download all of the paths listed in this file:
>
> http://lmtx.pragma-ade.nl/install-lmtx/tex/texmf-linux-64.tma
>
> All of those files need to be placed in "/tex/texmf-linux-
>
> 64/bin".
>
> Then to finish installing you'll need to run "mtxrun --generate" and
> "context --make". There are probably a bunch of other steps that I'm
> missing, but this should get you close.
>
> Again, probably easier to just use the regular installer.
>
> 4. ConTeXt is really picky about texmfcnf stuff.
>
> This is an issue that I've had too:
>
> https://github.com/latex3/l3build/issues/232
>
> Pretty much any modification of anything texmfcnf-related with ConTeXt
> will completely prevent it from running. There's a thread discussing the
> problem (but with no real solutions) here:
>
> https://tug.org/pipermail/tex-live/2020-September/046099.html
>
> And a Wiki page here:
>
> https://wiki.contextgarden.net/Custom_Configuration
>
> I agree that this texmfcnf stuff makes it really difficult to install or
> use ConTeXt with any kind of custom paths. Does anyone know how to
> properly configure a texmfcnf with custom paths?
>
> Hopefully this is of some help.
> -- Max
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Accessing inserts from Lua in LuaMetaTeX

2022-08-15 Thread Max Chernoff via ntg-context

Hi Hans,

> > First, how do I get an insert's class/type from the "insert" nodes on
> > the page? With LuaTeX, the insert's class/type is the same as the
> > subtype of the "ins" nodes, but the subtype of the "insert" nodes is
> > always zero in LuaMetaTeX, so I'm not sure how to get the class/type.

After playing around, I found that this is stored in ".index". I'm able to write to this value just fine, but whenever I
read it I get an error.

This minimal example:

   \starttext
   \setbox999=\vbox{\hrule width 10pt height 10pt}
   
   \startluacode
   local insert = node.new("insert")
   local rule = tex.box[999].list
   insert.list = rule
   insert.index = 4
   
   node.write(insert)
   \stopluacode
   \stoptext
   
works perfectly, but this example:

   \startluacode
   local insert = node.new "insert"
   insert.index = 4
   print(insert.index)
   \stopluacode
   
gives this error message:

   In \insertmode 2 you can't use zero as index.
   
I suspect that this is a bug, but I may just be doing something wrong.

> Indeed, we don't use these boxes and registers because we run in 
> \insertmode=2. This gives us more state info (i kept the old method 
> around for now).

Inserts always felt a little hacky in TeX, so I think that the new
methods are a huge improvement.

> > Second, how do I get the head of the insert box from Lua? With LuaTeX,
> > from TeX you would use "\box" and from Lua you can use
> > "tex.box[]". With LuaMetaTeX, you use "\insertbox" from
> > TeX, but I'm not sure how to get at the insert box from Lua.
> 
> tex.getinsertdistance
> tex.getinsertmultiplier
> tex.getinsertlimit
> tex.getinsertheight
> tex.getinsertdepth
> tex.getinsertwidth
> tex.getinsertcontent
> tex.setinsertdistance
> tex.setinsertmultiplier
> tex.setinsertlimit
> tex.setinsertcontent

Perfect! "tex.getinsertcontent" does exactly what I need.

Really minor, but I would expect that

   tex.insertcontent[4] = 
= tex.insertcontent[4]
   
would be exist and be equivalent to

= tex.getinsertcontent(4)
   tex.setinsertcontent(4, )

> The insert (etc) handler is more clever and flexible. So, for instance
> we can bubble up inserts. I think you do a preroll so in that case you
> can set the migrations related parameter to not bubble up.
> 
> \starttext
> 
> \holdingmigrations\numexpr1+2+4\relax
> 
> \setbox0\hbox{test \footnote{test} test}
> 
> \setbox2\vbox{\unhcopy0}
> 
> \holdingmigrations0
> 
> \setbox4\vbox{\unhcopy0}
> 
> \unhbox0
> 
> \unvbox2
> 
> \unvbox4
> 
> \stoptext
> 
> But I have no clue how all that will work out with (lua) code that 
> manipulates these things. In list nodes you can consult the pre and post 
> fields to what got migrated.

I don't think that that will work in this case. I'm doing most of the
work in "pre_output_filter", which is after all of the insert nodes have
been removed from the page and put into their respective boxes. And I
can't postpone setting any inserts until then because TeX needs to know
their height for when it breaks the page. I don't really like how I have
to move the footnotes, but I can't find any better way of doing things.

If you're curious, most of the insert code is in these two functions:

   
   
https://github.com/gucci-on-fleek/lua-widow-control/blob/2bca90/source/lua-widow-control.lua#L612-L669
   
https://github.com/gucci-on-fleek/lua-widow-control/blob/2bca90/source/lua-widow-control.lua#L843-L924

Thanks,
-- Max

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

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


Re: [NTG-context] How can I make a Gentoo Linux package for ConTeXt LMTX?

2022-08-15 Thread Max Chernoff via ntg-context
Okay, I'm seeing a few separate issues here.

1. Gentoo expects to compile everything from source.

   This isn't an option here since LuaMetaTeX doesn't have any source
   available (yet). So for the time being, you'll need to use the provided
   binaries. These support pretty much every architecture, so this
   shouldn't really be a problem.

2. You want to install ConTeXt LMTX system-wide.

   This is doable with the standard Linux installer script. Just make sure
   to run the script as root and install the files in /opt/context. This is
   what I've done on my system, and it works quite well. 
   
  $ ls -l $(type -p context)
  lrwxrwxrwx. 1 root root 10 Jul 28 00:33 
/opt/context/tex/texmf-linux-64/bin/context -> luametatex*
  
3. You want to install ConTeXt without any network access.

   The easiest way to do this would be to install on a system with
   internet, then just copy over the files. 
   
   If you want to use the "original" installer files, it shouldn't be
   impossible, but probably not too easy either. (All steps below are
   untested)
   
   The platform-independent stuff is all in one big zip, located at:
   
  http://lmtx.pragma-ade.nl/install-lmtx/texmf-context.zip
  
   Unzip this file as "/tex/texmf-context/".
  
   Then you also need to download all of the binaries. You will need to
   download all of the paths listed in this file:
   
  http://lmtx.pragma-ade.nl/install-lmtx/tex/texmf-linux-64.tma
  
   All of those files need to be placed in "/tex/texmf-linux-
   64/bin".
   
   Then to finish installing you'll need to run "mtxrun --generate" and
   "context --make". There are probably a bunch of other steps that I'm
   missing, but this should get you close.
   
   Again, probably easier to just use the regular installer.

4. ConTeXt is really picky about texmfcnf stuff.

   This is an issue that I've had too:
   
  https://github.com/latex3/l3build/issues/232
   
   Pretty much any modification of anything texmfcnf-related with ConTeXt
   will completely prevent it from running. There's a thread discussing the
   problem (but with no real solutions) here:
   
  https://tug.org/pipermail/tex-live/2020-September/046099.html
  
   And a Wiki page here:
   
  https://wiki.contextgarden.net/Custom_Configuration
  
   I agree that this texmfcnf stuff makes it really difficult to install or
   use ConTeXt with any kind of custom paths. Does anyone know how to
   properly configure a texmfcnf with custom paths?
   
Hopefully this is of some help.
-- Max
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Is rendering furigana over horizontal or vertical japanese text doable in ConTeXt?

2022-08-15 Thread Wolfgang Schuster via ntg-context

amano.kenji via ntg-context schrieb am 15.08.2022 um 14:00:

Is there any documentation about \ruby?


You can see all available parameters in setup-en.pdf, the example below 
shows a few of them:


 begin example
\setupinterlinespace[line=4ex]

\setuptype[style=\ttx]

\starttext

\start
x \ruby{aaa}{bbb} x
\stop

\start \setupruby[location=left]
\type{\setupruby[location=left]}\quad x \ruby{aaa}{bbb} x
\stop

\start \setupruby[location=right]
\type{\setupruby[location=right]}\quad x \ruby{aaa}{bbb} x
\stop

\start \setupruby[location=right,left={[},right={]}]
\type{\setupruby[left={[},right={]}]}\quad x \ruby{aaa}{bbb} 
x

\stop

\start \setupruby[align=flushleft]
\type{\setupruby[align=flushleft]}\quad x \ruby{aa}{bbb} 
x

\stop

\start \setupruby[align=flushright]
\type{\setupruby[align=flushright]}\quad x \ruby{aa}{bbb} 
x

\stop

\start \setupruby[style=\itxx]
\type{\setupruby[style=\itxx]}\quad x \ruby{aaa}{bbb} x
\stop

\start \setupruby[color=blue]
\type{\setupruby[color=blue]}\quad x \ruby{aaa}{bbb} x
\stop

\start \setupruby[voffset=-1.2ex]
\type{\setupruby[voffset=-1.2ex]}\quad x \ruby{aaa}{bbb} x
\stop

\stoptext
 end example


What about vertical text?


ConTeXt has a mechanism to produce vertical text but there is nothing 
yet which can
be used out of the box to produce a complete document with vertical 
paragraphs.


Wolfgang

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

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


Re: [NTG-context] Accessing inserts from Lua in LuaMetaTeX

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

On 8/15/2022 8:18 AM, Max Chernoff via ntg-context wrote:

Hi all,

I'm trying to manipulate some inserts from Lua in LuaMetaTeX, and I'm
having some problems that I'm not having with LuaTeX.

First, how do I get an insert's class/type from the "insert" nodes on
the page? With LuaTeX, the insert's class/type is the same as the
subtype of the "ins" nodes, but the subtype of the "insert" nodes is
always zero in LuaMetaTeX, so I'm not sure how to get the class/type.


Indeed, we don't use these boxes and registers because we run in 
\insertmode=2. This gives us more state info (i kept the old method 
around for now).



Second, how do I get the head of the insert box from Lua? With LuaTeX,
from TeX you would use "\box" and from Lua you can use
"tex.box[]". With LuaMetaTeX, you use "\insertbox" from
TeX, but I'm not sure how to get at the insert box from Lua.


tex.getinsertdistance
tex.getinsertmultiplier
tex.getinsertlimit
tex.getinsertheight
tex.getinsertdepth
tex.getinsertwidth
tex.getinsertcontent
tex.setinsertdistance
tex.setinsertmultiplier
tex.setinsertlimit
tex.setinsertcontent


The context for both of these is that my module lua-widow-control
sometimes moves a line containing footnotes to the next page, so I need
to do some surgery to make sure that the "footnote marks" stay with the
"footnote text". This is tricky but doable with LuaTeX, but I can't seem
to get it to work with the new inserts in LuaMetaTeX, hence the above
questions.
The insert (etc) handler is more clever and flexible. So, for instance 
we can bubble up inserts. I think you do a preroll so in that case you 
can set the migrations related parameter to not bubble up.


\starttext

\holdingmigrations\numexpr1+2+4\relax

\setbox0\hbox{test \footnote{test} test}

\setbox2\vbox{\unhcopy0}

\holdingmigrations0

\setbox4\vbox{\unhcopy0}

\unhbox0

\unvbox2

\unvbox4

\stoptext

But I have no clue how all that will work out with (lua) code that 
manipulates these things. In list nodes you can consult the pre and post 
fields to what got migrated.


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] Accessing inserts from Lua in LuaMetaTeX

2022-08-14 Thread Max Chernoff via ntg-context
Hi all,

I'm trying to manipulate some inserts from Lua in LuaMetaTeX, and I'm
having some problems that I'm not having with LuaTeX. 

First, how do I get an insert's class/type from the "insert" nodes on
the page? With LuaTeX, the insert's class/type is the same as the
subtype of the "ins" nodes, but the subtype of the "insert" nodes is
always zero in LuaMetaTeX, so I'm not sure how to get the class/type.

Second, how do I get the head of the insert box from Lua? With LuaTeX,
from TeX you would use "\box" and from Lua you can use
"tex.box[]". With LuaMetaTeX, you use "\insertbox" from
TeX, but I'm not sure how to get at the insert box from Lua.

The context for both of these is that my module lua-widow-control
sometimes moves a line containing footnotes to the next page, so I need
to do some surgery to make sure that the "footnote marks" stay with the
"footnote text". This is tricky but doable with LuaTeX, but I can't seem
to get it to work with the new inserts in LuaMetaTeX, hence the above
questions.

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

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


[NTG-context] How to do code listings & sections from XML (AsciiDoc)

2022-08-12 Thread Mojca Miklavec via ntg-context
Hi,

Hans helped me out with some asciidoc processing a while ago.

I played a bit further, but I'm currently facing two minor issues:

(a) I don't know how to turn program listing (verbatim code) from xml
to (perhaps, vim-based) syntax highlighting (but most importantly, to
make sure that line breaks work properly)

(b) some section titles are missing


Ad (a). The source that looks similar to this:


int main()
{
return 0;
}


should be converted into some kind of equivalent of

% on top
\usemodule[vim]
\definevimtyping [CPP] [syntax=cpp]

\startCPP
int main()
{
return 0;
}
\stopCPP

In the attachment I have the source document (test.adoc), the
generated docbook xml that should be further processed, and test.tex
that one processes to get the final pdf.

Any hints would be greatly appreciated.

Mojca


test.tex
Description: Binary data


test.adoc
Description: Binary data



http://docbook.org/ns/docbook"; xmlns:xl="http://www.w3.org/1999/xlink"; version="5.0" xml:lang="en">

Document title (completely missing)
2022-08-12


This title seems to be missing
Hello code …​

How it works
// test.cpp:

halfword tex_copy_node(halfword p)
{
/*tex
We really need a stub for copying because mem might move in the meantime due to resizing!
*/
if (p < 0 || p >= lmt_node_memory_state.nodes_data.allocated) {
return tex_formatted_error("nodes", "attempt to copy an impossible node %d", (int) p);
} else if (p > lmt_node_memory_state.reserved && lmt_node_memory_state.nodesizes[p] == 0) {
return tex_formatted_error("nodes", "attempt to copy a free %s node %d", get_node_name(node_type(p)), (int) p);
} else {
/*tex type of node */
halfword t = node_type(p);
int i = get_node_size(t);
/*tex current node being fabricated for new list */
halfword r = tex_get_node(i);
/*tex this saves work */
memcpy((void *) (lmt_node_memory_state.nodes + r), (void *) (lmt_node_memory_state.nodes + p), (sizeof(memoryword) * (unsigned) i));
if (tex_nodetype_is_complex(i)) {
 // halfword copy_stub;
if (tex_nodetype_has_attributes(t)) {
add_attribute_reference(node_attr(p));
node_prev(r) = null;
lmt_properties_copy(lmt_lua_state.lua_instance, r, p);
}
node_next(r) = null;
switch (t) {
case glue_node:
copy_sub_list(glue_leader_ptr(r), glue_leader_ptr(p));
break;




m-asciidoc-manual.tex
Description: Binary data
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://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
___


Re: [NTG-context] Can't no break between a close punctuation and a open punctuation

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

On 8/2/2022 4:08 PM, 黄复雄 via ntg-context wrote:

Sorry, when you say ` that file for windows 10+`, which one are you 
referring to? to scrp-cjk.lua?( yes, I will upgrade it.) or to my lmtx 

the chinese font .. as defined in type-imp-mscore

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


Re: [NTG-context] Can't no break between a close punctuation and a open punctuation

2022-08-02 Thread 黄复雄 via ntg-context
>
> > Dear Hans,
> >
> > I found that ConTeXt injected two infinity penalties between a close
> > punctuation and a open punctuation, for example between `”` and `“`, or
> > between `:` and `“`, so can not break at these places, as showed in
> > following doc. But actually, we may sometimes need to do so. Please note
> > that there is no space around full width punctuations in Chinese
> document.
>
> you can try this in scrp-cjk.lua (remake the format)
>
> local chinese_8 = {
>  jami_initial = nobreak_shrink_break_stretch,
>  korean   = nobreak_autoshrink_break_stretch,
>  chinese  = stretch_break, -- nobreak_autoshrink_break_stretch,
>  hiragana = stretch_break, -- nobreak_autoshrink_break_stretch,
>  katakana = stretch_break, -- nobreak_autoshrink_break_stretch,
>  half_width_open  =
> nobreak_autoshrink_break_stretch_nobreak_autoshrink,
> half_width_open  = stretch_break,
>  half_width_close = nobreak_autoshrink_nobreak_stretch,
>  full_width_open  = nobreak_autoshrink_break_stretch_nobreak_shrink,
>  full_width_close = nobreak_autoshrink_nobreak_stretch,
>  full_width_punct = nobreak_autoshrink_nobreak_stretch,
>  hyphen   = nobreak_autoshrink_break_stretch,
>  non_starter  = nobreak_autoshrink_break_stretch,
>  other= nobreak_autoshrink_break_stretch,
> }
>
>
Thanks to your guidance, I solved the problem. And I would like to look
into some other related issues that I have doubts about and get back to you
together. So I need some more time.


> > doc for example:
> >
> > ```lmtx
> > \setscript[hanzi]
> > \usetypescriptfile[mscore]
> > \usebodyfont   [mschinese,20pt]
>
> can you upgrade the chiese section in that file for windows 10+ as the
> old fonts are gone
>
> (i tested with \definedfont[file:mingliu.ttc*chinese @ 10pt])
>

Sorry, when you say ` that file for windows 10+`, which one are you
referring to? to scrp-cjk.lua?( yes, I will upgrade it.) or to my lmtx doc
for testing?(It work fine in my Windows 10.) or to type-imp-mscore.mkiv?
(It work fine in my Windows 10, and no mingliu.ttc in it.)

Thanks.

  Huang Fusyong(黄复雄)
---
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
___


Re: [NTG-context] font fallbacks

2022-08-01 Thread Denis Maier via ntg-context
Hi,
I have used more than one fallback, but each fallback is for a different 
character range
Denis

Von: ntg-context  im Auftrag von Henning Hraban 
Ramm via ntg-context 
Gesendet: Montag, 1. August 2022 19:42:51
An: Henning Hraban Ramm via ntg-context
Cc: Henning Hraban Ramm
Betreff: Re: [NTG-context] font fallbacks

Nobody?
I couldn’t find an example of more than one fallback, so I guess that’s
not supported?

Hraban

Am 30.07.22 um 15:51 schrieb Henning Hraban Ramm via ntg-context:
> Hi,
> I thought I could use more than one fallback font, but as soon as I list
> fallbacks, they stop working.
>
> In my example, I’d like to take all missing glyphs from Segoe UI
> Symbols, and what’s still missing (emojis) from EmojiOneColor,
> preferably without specifying the exact range.
>
> Additionally, I want to replace the tilde ~ of LM Modern:
>
> """
> \definefontfallback[seguiFB]
>[file:seguisym.ttf]
>[0x0-0xF]
>[check=yes,force=no]
>
> \definefontfallback[emoneFB]
>[name:EmojiOneColor]
>[0x0-0xF]
>[check=yes,force=no]
>
> % replace tilde in LM
> \definefontfallback[tildeFB]
>[file:seguisym.ttf]
>[0x0007E-0x0007E]
>[force=yes]
>
>
> \starttypescript [start]
>\definetypeface [start] [rm] [serif] [cambria]
> [default][fallbacks={seguiFB,emoneFB}]
>\definetypeface [start] [ss] [sans]  [modern]
> [default][fallbacks={seguiFB,emoneFB}]
>\definetypeface [start] [tt] [mono]  [modern]
> [default][fallbacks={seguiFB,tildeFB,emoneFB}]
>\definetypeface [start] [mm] [math]  [modern]
> [default][fallbacks={seguiFB,emoneFB}]
> \stoptypescript
>
>
> \setupbodyfont[start,rm,12pt]
>
> \starttext
>
> \Omega\ (Omega) and \aleph\ (Aleph)
>
> \startbuffer[example]
> start missing characters: lmmono10-regular.otf
> 7  U+00327  ̧  COMBINING CEDILLA
> 7  U+00335  ̵  COMBINING SHORT STROKE OVERLAY
>14  U+003B7  η  GREEK SMALL LETTER ETA
> 7  U+021A9  ↩  LEFTWARDS ARROW WITH HOOK
>   350  U+02500  ─  BOX DRAWINGS LIGHT HORIZONTAL
>98  U+02502  │  BOX DRAWINGS LIGHT VERTICAL
>42  U+02514  └  BOX DRAWINGS LIGHT UP AND RIGHT
>   133  U+0251C  ├  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
>   154  U+02772  ❲  LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT
>   154  U+02773  ❳  LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT
>14  U+0278A  ➊  DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
> stop missing characters
> start missing characters: cambria.ttc
> 9  U+0278A  ➊  DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
> 9  U+0FFFD  �  REPLACEMENT CHARACTER
> stop missing characters
> start missing characters: cambriai.ttf
>   266  U+0276C  ❬  MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT
>   266  U+0276D  ❭  MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT
> stop missing characters
> \stopbuffer
>
> \typebuffer[example]
>
> \startlines
> \getbuffer[example]
>
> {\ss\getbuffer[example]}
> \stoplines
>
> \tex{abra}\arg{...}
> \type{kadabra} \type{~~~}
>
> \stoptext
> """
>
> What’s wrong?
>
> Hraban
> ___
> If your question is of interest to others as well, please add an entry
> to the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

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

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


Re: [NTG-context] font fallbacks

2022-08-01 Thread Henning Hraban Ramm via ntg-context

Nobody?
I couldn’t find an example of more than one fallback, so I guess that’s 
not supported?


Hraban

Am 30.07.22 um 15:51 schrieb Henning Hraban Ramm via ntg-context:

Hi,
I thought I could use more than one fallback font, but as soon as I list 
fallbacks, they stop working.


In my example, I’d like to take all missing glyphs from Segoe UI 
Symbols, and what’s still missing (emojis) from EmojiOneColor, 
preferably without specifying the exact range.


Additionally, I want to replace the tilde ~ of LM Modern:

"""
\definefontfallback[seguiFB]
   [file:seguisym.ttf]
   [0x0-0xF]
   [check=yes,force=no]

\definefontfallback[emoneFB]
   [name:EmojiOneColor]
   [0x0-0xF]
   [check=yes,force=no]

% replace tilde in LM
\definefontfallback[tildeFB]
   [file:seguisym.ttf]
   [0x0007E-0x0007E]
   [force=yes]


\starttypescript [start]
   \definetypeface [start] [rm] [serif] [cambria] 
[default][fallbacks={seguiFB,emoneFB}]
   \definetypeface [start] [ss] [sans]  [modern] 
[default][fallbacks={seguiFB,emoneFB}]
   \definetypeface [start] [tt] [mono]  [modern] 
[default][fallbacks={seguiFB,tildeFB,emoneFB}]
   \definetypeface [start] [mm] [math]  [modern] 
[default][fallbacks={seguiFB,emoneFB}]

\stoptypescript


\setupbodyfont[start,rm,12pt]

\starttext

\Omega\ (Omega) and \aleph\ (Aleph)

\startbuffer[example]
start missing characters: lmmono10-regular.otf
    7  U+00327  ̧  COMBINING CEDILLA
    7  U+00335  ̵  COMBINING SHORT STROKE OVERLAY
   14  U+003B7  η  GREEK SMALL LETTER ETA
    7  U+021A9  ↩  LEFTWARDS ARROW WITH HOOK
  350  U+02500  ─  BOX DRAWINGS LIGHT HORIZONTAL
   98  U+02502  │  BOX DRAWINGS LIGHT VERTICAL
   42  U+02514  └  BOX DRAWINGS LIGHT UP AND RIGHT
  133  U+0251C  ├  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
  154  U+02772  ❲  LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT
  154  U+02773  ❳  LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT
   14  U+0278A  ➊  DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
stop missing characters
start missing characters: cambria.ttc
    9  U+0278A  ➊  DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
    9  U+0FFFD  �  REPLACEMENT CHARACTER
stop missing characters
start missing characters: cambriai.ttf
  266  U+0276C  ❬  MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT
  266  U+0276D  ❭  MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT
stop missing characters
\stopbuffer

\typebuffer[example]

\startlines
\getbuffer[example]

{\ss\getbuffer[example]}
\stoplines

\tex{abra}\arg{...}
\type{kadabra} \type{~~~}

\stoptext
"""

What’s wrong?

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


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

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


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

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


Re: [NTG-context] Set up external figure for particular image type

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

On 8/1/2022 2:29 AM, Thangalin via ntg-context wrote:

Got it working. Complete solution:

|\setupexternalfigures[ location={local,global,default}, 
width=\textwidth ] \defineexternalfigure[svg][width=1cm] 
\defineexternalfigure[jpg][width=2cm] 
\defineexternalfigure[png][width=4cm] % Won't be applied because there's 
no process action. % Default (\textwidth) is used, as defined above. 
\defineexternalfigure[pdf][width=6cm] \starttexdefinition 
includegraphics #1 \splitfilename{#1} \processaction[\splitofftype][ 
jpg=>{\externalfigure[#1][jpg]}, png=>{\externalfigure[#1][png]}, 
svg=>{\externalfigure[#1][svg][conversion=mp]}, 
default=>{\externalfigure[#1]}, unknown=>{\externalfigure[#1]} ] 
\stoptexdefinition \starttext \includegraphics{kitten.jpg} 
\includegraphics{mill.png} \includegraphics{cow.pdf} 
\includegraphics{tiger.svg} \stoptext |

I've added:

\setfigureconversion[svg][mp]

So that this works:

\starttext
  \externalfigure[kitten.jpg][width=2cm]
  \externalfigure[mill.png]  [width=4cm]
  \externalfigure[cow.pdf]   [width=6cm]
  \externalfigure[tiger.svg] [width=1cm]
\stoptext

But after we release you need to wikify 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
___


Re: [NTG-context] Set up external figure for particular image type

2022-07-31 Thread Thangalin via ntg-context
Got it working. Complete solution:

\setupexternalfigures[
  location={local,global,default},
  width=\textwidth
]\defineexternalfigure[svg][width=1cm]\defineexternalfigure[jpg][width=2cm]\defineexternalfigure[png][width=4cm]
% Won't be applied because there's no process action.% Default
(\textwidth) is used, as defined
above.\defineexternalfigure[pdf][width=6cm]
\starttexdefinition includegraphics #1
  \splitfilename{#1}

  \processaction[\splitofftype][
jpg=>{\externalfigure[#1][jpg]},
png=>{\externalfigure[#1][png]},
svg=>{\externalfigure[#1][svg][conversion=mp]},
default=>{\externalfigure[#1]},
unknown=>{\externalfigure[#1]}
  ]\stoptexdefinition
\starttext
  \includegraphics{kitten.jpg}
  \includegraphics{mill.png}
  \includegraphics{cow.pdf}
  \includegraphics{tiger.svg}\stoptext

Image files attached.
Thanks again!
<>
___
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] font fallbacks

2022-07-30 Thread Henning Hraban Ramm via ntg-context

Hi,
I thought I could use more than one fallback font, but as soon as I list 
fallbacks, they stop working.


In my example, I’d like to take all missing glyphs from Segoe UI 
Symbols, and what’s still missing (emojis) from EmojiOneColor, 
preferably without specifying the exact range.


Additionally, I want to replace the tilde ~ of LM Modern:

"""
\definefontfallback[seguiFB]
  [file:seguisym.ttf]
  [0x0-0xF]
  [check=yes,force=no]

\definefontfallback[emoneFB]
  [name:EmojiOneColor]
  [0x0-0xF]
  [check=yes,force=no]

% replace tilde in LM
\definefontfallback[tildeFB]
  [file:seguisym.ttf]
  [0x0007E-0x0007E]
  [force=yes]


\starttypescript [start]
  \definetypeface [start] [rm] [serif] [cambria] 
[default][fallbacks={seguiFB,emoneFB}]
  \definetypeface [start] [ss] [sans]  [modern] 
[default][fallbacks={seguiFB,emoneFB}]
  \definetypeface [start] [tt] [mono]  [modern] 
[default][fallbacks={seguiFB,tildeFB,emoneFB}]
  \definetypeface [start] [mm] [math]  [modern] 
[default][fallbacks={seguiFB,emoneFB}]

\stoptypescript


\setupbodyfont[start,rm,12pt]

\starttext

\Omega\ (Omega) and \aleph\ (Aleph)

\startbuffer[example]
start missing characters: lmmono10-regular.otf
   7  U+00327  ̧  COMBINING CEDILLA
   7  U+00335  ̵  COMBINING SHORT STROKE OVERLAY
  14  U+003B7  η  GREEK SMALL LETTER ETA
   7  U+021A9  ↩  LEFTWARDS ARROW WITH HOOK
 350  U+02500  ─  BOX DRAWINGS LIGHT HORIZONTAL
  98  U+02502  │  BOX DRAWINGS LIGHT VERTICAL
  42  U+02514  └  BOX DRAWINGS LIGHT UP AND RIGHT
 133  U+0251C  ├  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
 154  U+02772  ❲  LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT
 154  U+02773  ❳  LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT
  14  U+0278A  ➊  DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
stop missing characters
start missing characters: cambria.ttc
   9  U+0278A  ➊  DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
   9  U+0FFFD  �  REPLACEMENT CHARACTER
stop missing characters
start missing characters: cambriai.ttf
 266  U+0276C  ❬  MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT
 266  U+0276D  ❭  MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT
stop missing characters
\stopbuffer

\typebuffer[example]

\startlines
\getbuffer[example]

{\ss\getbuffer[example]}
\stoplines

\tex{abra}\arg{...}
\type{kadabra} \type{~~~}

\stoptext
"""

What’s wrong?

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

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


Re: [NTG-context] debugging lmtx and firefox (was: TeXGyre Heros on Firefox)

2022-07-22 Thread Max Chernoff via ntg-context


> the firefox pdf viewer has problems with at least two sans serif
> fonts.
> 
> Using this mwe I get a bad display in ff with Gyre font and Alegreya
> Font.
> 

What do you mean by "bad display"? Are the fonts blurry, or are the
shapes all slightly distorted? Your test file displays fine on my
system.

> But there are many Firefox users out there who never use a real 
> pdf-viewer. I would like to show them a good result.

I've been using Firefox (and pdf.js) as my PDF viewer almost exclusively
for the past ~2 years, and I've been using ConTeXt LMTX for about the
same amount of time. I haven't noticed any font issues, so I suspect
that this issue is system-dependant. I've mostly been on Windows for the
past few years, but I'm now on Linux, and I haven't noticed any issues
with either.

> I have no idea if the difference is the cause of the bad display.
> 
> Luckily chrome based browsers shows the fonts without any flaws.

Ok, random guess time (so I may be waay off here):

I think that this is a hinting problem. The TeX Gyre fonts are all
professionally hinted, so what might be happening be that when ConTeXt
is subsetting the fonts, it is removing all of the hinting information,
while LibreOffice is keeping all of the hints. I've opened PDFs from
ConTeXt and LibreOffice in FontForge and the hints are still there, so I
don't think that this is the case, but maybe? The hinting format is also
wildly different between Type 1 and CFF/OTF, so maybe there is just a
bug in one of the font renderers. 

Chrome uses an internal backend to render all of its text, but Firefox
uses system-dependant backends (I think). Most renderers these days will
autohint unhinted fonts using an embedded FreeType so that they still
display somewhat-well. You can adjust the "hinting strength" in
FreeType, which I would guess would usually be set to the maximum. So
LibreOffice includes the font hints and things display fine, and Chrome
uses a bundled FreeType with maximum hinting so things display fine.

Firefox on Windows would need to bundle its own FreeType since there
isn't a system one, and it renders fine in my experience. But Firefox on
Linux would just use the system FreeType. I think that you are on Linux
(?) and the default in Linux is for minimal/no hinting. Now, I've
specifically enabled maximum hinting on my system, and I'm not seeing
any problems with rendering. If you're using Gnome, can you try enabling
"full" hinting in Gnome Tweaks, reboot, then test again? No idea how to
configure this with other DEs, but I'm sure that it's possible. 

Another related guess is that older versions of FreeType maybe had a bug
with parsing/displaying hints. I think that Chrome bundles its own
FreeType which would be recent, but if you're using Firefox on Linux, it
is probably using the system FreeType library. If you're on an older LTS
distro, then the system FreeType may be really old and buggy.

If you're using macOS, I can't really help you too much except for to
say that text rendering on macOS is usually pretty bad unless you have a
really high resolution screen.

So those are my random guesses. Maybe one of them is helpful somehow.

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

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


Re: [NTG-context] debugging lmtx and firefox (was: TeXGyre Heros on Firefox)

2022-07-22 Thread Pablo Rodriguez via ntg-context
On 7/22/22 12:37, juh+ntg-context--- via ntg-context wrote:
> Dear all,
>
> the firefox pdf viewer has problems with at least two sans serif fonts.
> [...]
>
> Where Libreoffice has type "Type 1", lmtx has "CID Type 0C".
>
> Where Libreoffice has encoding "Builtin", lmtx has "Identity-H".
>
> I have no idea if the difference is the cause of the bad display.

Dear Jan Ulrich,

it may be the font type, the enconding (or who knows what).

> Any ideas how I can achieve this?

I’d rather report the issue (attaching both PDF documents and both
outputs from pdffonts) at https://github.com/mozilla/pdf.js/issues/new.

I reported an issue with PDF.js not displaying the cover of
http://www.pragma-ade.com/general/manuals/xml-mkiv.pdf.

The day after my report the fix was merged.

Just in case it may help,

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

maillist : ntg-context@ntg.nl / https://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] debugging lmtx and firefox (was: TeXGyre Heros on Firefox)

2022-07-22 Thread juh+ntg-context--- via ntg-context

Dear all,

the firefox pdf viewer has problems with at least two sans serif fonts.

Using this mwe I get a bad display in ff with Gyre font and Alegreya Font.

%\definefontfamily[mainfont][sans][AlegreyaSans]
\definefontfamily[mainfont][sans][texgyreheros]
\setupbodyfont  [mainfont,12pt]
\startdocument
  \starttext
  \input lorem
\stoptext
\stopdocument

When I create a pdf from LibreOffice with these fonts I have a good display.

pdffonts shows different font inclusion:


pdffonts libreoffice.pdf
name type  encoding 
emb sub uni object ID
 -  
--- --- --- -
BA+TeXGyreHeros-Regular  Type 1Builtin 
yes yes yes  9  0


pdffonts mwe.pdf
name type  encoding 
emb sub uni object ID
 -  
--- --- --- -
SOVKKO+TeXGyreHeros-Regular  CID Type 0C   Identity-H 
yes yes yes  1  0



Where Libreoffice has type "Type 1", lmtx has "CID Type 0C".

Where Libreoffice has encoding "Builtin", lmtx has "Identity-H".

I have no idea if the difference is the cause of the bad display.

Luckily chrome based browsers shows the fonts without any flaws.

But there are many Firefox users out there who never use a real 
pdf-viewer. I would like to show them a good result.


Any ideas how I can achieve this?

juh

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


Re: [NTG-context] If a Font Has Ligature Glyphs But No Feature?

2022-07-21 Thread Hans Hagen via ntg-context

On 7/20/2022 9:40 PM, Bruce Horrocks via ntg-context wrote:




On 20 Jul 2022, at 05:31, Michael Urban via ntg-context  
wrote:

Aside from purchasing a real font product from Linotype at enormous expense and 
hoping it is better equipped, is there a way to coerce ConTeXt into using the 
ligature glyphs for fi and fl?


Yes - I had to do the same for a font called Venetian 301 for which I found 
these 4 files:

FilenameName as it appears to MacOS
--
Venetian301BT-Roman.otf Venetian 301 Regular
Venetian301BT-Italic.otfVenetian 301 Italic
Venetian301BT-Bold.otf  Venetian 301 Bold
venetian-301-demi-bt.ttfVenetian Dm BT Demi

They each had the fi and fl ligatures, but at different character positions 
depending on which file, and they weren't recognised by default. So I used the 
following code to add them (and add en and em dash substitution as well).

%%  start
\startluacode
 fonts.handlers.otf.addfeature {
 name = "v1", -- these character substitutions will be applied to 
venetian-301-demi-bt
 type = "ligature",
 data = {
 [0xF001] = { "f", "i" },
 [0xF002] = { "f", "l" },
 }
 }
 fonts.handlers.otf.addfeature {
 name = "v2", -- these character substitutions will be applied to 
Venetian301BT
 type = "ligature",
 data = {
 [0xFB01] = { "f", "i" },
 [0xFB02] = { "f", "l" },
 }
 }
 fonts.handlers.otf.addfeature {
 name = "v3", -- these character substitutions will be applied to both
 type = "ligature",
 data = {
 [0x2013] = { "-", "-" },  -- en dash
 [0x2014] = { "-", "-", "-" }, -- em dash
 }
 }
\stopluacode
\definefontfeature [venetian-301-demi-ligatures] [v1=yes,v3=yes]
\definefontfeature [venetian-301-BT-ligatures]   [v2=yes,v3=yes]

\starttypescript [serif] [myBookFont]
   \definefontsynonym [Serif]   [file:venetian-301-demi-bt] 
[features=venetian-301-demi-ligatures]
   \definefontsynonym [SerifBold]   [file:Venetian301BT-Bold]   
[features=venetian-301-BT-ligatures]
   \definefontsynonym [SerifItalic] [file:Venetian301BT-Italic] 
[features=venetian-301-BT-ligatures]
\stoptypescript
%%  end

Note that the names v1, v2 and v3 are entirely arbitrary. Also, the 
\starttypescript section sets the font features to be just those I've defined - 
potentially losing whatever 'default' would provide. But since the font doesn't 
seem to have a lot of features in the first place I've so far not noticed any 
problems. I'm sure a real expert could tell you how to retain 'default' and add 
the ligatures, if needed.

just name them 'liga' and default will then do them


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


Re: [NTG-context] If a Font Has Ligature Glyphs But No Feature?

2022-07-20 Thread Bruce Horrocks via ntg-context


> On 20 Jul 2022, at 05:31, Michael Urban via ntg-context  
> wrote:
> 
> Aside from purchasing a real font product from Linotype at enormous expense 
> and hoping it is better equipped, is there a way to coerce ConTeXt into using 
> the ligature glyphs for fi and fl?

Yes - I had to do the same for a font called Venetian 301 for which I found 
these 4 files:

FilenameName as it appears to MacOS
--
Venetian301BT-Roman.otf Venetian 301 Regular
Venetian301BT-Italic.otfVenetian 301 Italic
Venetian301BT-Bold.otf  Venetian 301 Bold
venetian-301-demi-bt.ttfVenetian Dm BT Demi

They each had the fi and fl ligatures, but at different character positions 
depending on which file, and they weren't recognised by default. So I used the 
following code to add them (and add en and em dash substitution as well).

%%  start
\startluacode
fonts.handlers.otf.addfeature {
name = "v1",-- these character substitutions will be applied to 
venetian-301-demi-bt
type = "ligature",
data = {
[0xF001] = { "f", "i" },
[0xF002] = { "f", "l" },
}
}
fonts.handlers.otf.addfeature {
name = "v2",-- these character substitutions will be applied to 
Venetian301BT
type = "ligature",
data = {
[0xFB01] = { "f", "i" },
[0xFB02] = { "f", "l" },
    }
}
fonts.handlers.otf.addfeature {
name = "v3",-- these character substitutions will be applied to both
type = "ligature",
data = {
[0x2013] = { "-", "-" },  -- en dash
[0x2014] = { "-", "-", "-" }, -- em dash
}
}
\stopluacode
\definefontfeature [venetian-301-demi-ligatures] [v1=yes,v3=yes]
\definefontfeature [venetian-301-BT-ligatures]   [v2=yes,v3=yes]

\starttypescript [serif] [myBookFont]
  \definefontsynonym [Serif]   [file:venetian-301-demi-bt] 
[features=venetian-301-demi-ligatures]
  \definefontsynonym [SerifBold]   [file:Venetian301BT-Bold]   
[features=venetian-301-BT-ligatures]
  \definefontsynonym [SerifItalic] [file:Venetian301BT-Italic] 
[features=venetian-301-BT-ligatures]
\stoptypescript
%%  end

Note that the names v1, v2 and v3 are entirely arbitrary. Also, the 
\starttypescript section sets the font features to be just those I've defined - 
potentially losing whatever 'default' would provide. But since the font doesn't 
seem to have a lot of features in the first place I've so far not noticed any 
problems. I'm sure a real expert could tell you how to retain 'default' and add 
the ligatures, if needed.

Regards,
—
Bruce Horrocks
Hampshire, UK

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

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


Re: [NTG-context] Set up external figure for particular image type

2022-07-18 Thread Wolfgang Schuster via ntg-context

Thangalin via ntg-context schrieb am 18.07.2022 um 19:10:

Thank you, Wolfgang.

That looks promising.

SVG files are converted using MetaPost. I thought the following would 
work:


svg=>{\externalfigure[#1][svg][conversion=mp]}


You can probably remove the second argument ([svg]) which was used in my 
example to pass the default values with \defineexternalfigure. Just 
using \externalfigure[#1][conversion=mp] where you pass the default 
values with the second argument is enough.


Wolfgang

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

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


Re: [NTG-context] Set up external figure for particular image type

2022-07-18 Thread Thangalin via ntg-context
Thank you, Wolfgang.

That looks promising.

SVG files are converted using MetaPost. I thought the following would work:

svg=>{\externalfigure[#1][svg][conversion=mp]}

Is there anything else that needs to happen to ensure SVG files are piped
through MetaPost?

Thanks again!



> \setupexternalfigures [location={local,global,default}]
>
> \defineexternalfigure [jpg] [width=4cm]
> \defineexternalfigure [png] [width=8cm]
>
> \starttexdefinition includegraphics #1
>
> \splitfilename{#1}
>
> \processaction
> [\splitofftype]
> [jpg=>{\externalfigure[#1][jpg]},
>  png=>{\externalfigure[#1][png]},
>  default=>{\externalfigure[#1]},
>  unknown=>{\externalfigure[#1]}]
>
> \stoptexdefinition
>
> \starttext
>
> \includegraphics{hacker.jpg}
>
> \includegraphics{mill.png}
>
> \includegraphics{cow.pdf}
>
> \stoptext
>
>
___
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
___


Re: [NTG-context] Set up external figure for particular image type

2022-07-18 Thread Thangalin via ntg-context
Of course, you could also use pandoc to go directly to ConTeXt; that is
> currently my preferred way of producing PDF from Markdown.
>

Thanks Albert!

I'm going to stick with my desktop text editor, KeenWrite
, rather than use shell scripts
 and
pandoc.

Cheers!
___
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
___


Re: [NTG-context] Set up external figure for particular image type

2022-07-18 Thread Thangalin via ntg-context
Thanks, Rik.

Not using Pandoc. I was using Pandoc up until 2020:

https://dave.autonoma.ca/blog/2019/05/22/typesetting-markdown-part-1/

I've since authored KeenWrite ,
which uses flexmark-java  to
generate XHTML documents from Markdown. The only additions I've made to the
library is to add support for Pandoc's annotation syntax (:::).

That said, I'm also a firm believer in not duplicating information. The
information (file name extension) is already available in the documents, so
adding a classification on top of the extension feels redundant.

Thanks for the suggestion!

On Tue, Jul 12, 2022 at 12:18 PM Rik Kabel via ntg-context <
ntg-context@ntg.nl> wrote:

>
> On 2022-07-12 14:11, Thangalin via ntg-context wrote:
>
> Thank you for the suggestion Hraban.
>
> The source comes from Markdown, which is converted to XML, then typeset
> using ConTeXt. There's no Markdown-specific mechanism to relate images to a
> particular external figure definition, unfortunately. All images use the
> same syntax and are treated the same way. The only part that differs is the
> file name extension (and header within the file).
>
> One possibility would be something like:
>
> \setupexternalfigure[
> width=1em,
> height=1em,
> order={svg,pdf,png,jpg},
> location={local,default,global},
> ]
> \defineexternalfigure[png][
> width=\textwidth,
> height=\textheight,
> ]
> \unprotect
> \let\old_externalfigure=\externalfigure
> \tolerant\def\externalfigure[#1]#,[#2]#,[#3]{%
> \doifelseinstring{.png}{#1}{%
> \old_externalfigure[#1][png][#2]%
> }{%
> \doifelsefileexists{#1.png}{%
> \old_externalfigure[#1.png][png][#2]%
> }{%
> \old_externalfigure[#1][#2][#3]%
> }%
> }%
> }\protect
>
> See: https://tex.stackexchange.com/a/650221/2148
>
> I was wondering if there was a simpler or a solution that's more the
> ConTeXt-way?
>
> Thanks again!
>
>
> Assuming that Pandoc markdown is being used, you should be able to set
> class attributes on each image. You can then associate external figure
> definitions with specific classes, and process each individually. (Pandoc
> user guide, link_attributes
> )
>
> --
> Rik
>
>
> ___
> 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] New math additional requirement for font definitions

2022-07-13 Thread Alexandre Christe via ntg-context
Dear list,

I've come across that the new math (which by the way looks really nice)
requires some additional properties to be set in the font definition.

If I take the example file provided by Mikael and add the following lines

\usetypescriptfile[alegreya]
\setupbodyfont[alegreya,11pt]

It fails with the following error message:
"tex error on line 16 in file /Users/aleks/Desktop/Test
Context/someformulas.tex: Math error: parameter 'limitbelowbgap' with id 36
in style 0 is not set"

Libertinus works fine by adding the following two lines

\usetypescriptfile[libertinus]
\setupbodyfont[libertinus,11pt]

Could someone enlighten me?

The font definition file is attached.

BR,
Alex


type-imp-alegreya.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://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
___


Re: [NTG-context] Set up external figure for particular image type

2022-07-12 Thread Albert Krewinkel via ntg-context

Thangalin via ntg-context  writes:

> The source comes from Markdown, which is converted to XML, then typeset
> using ConTeXt. There's no Markdown-specific mechanism to relate images
> to a particular external figure definition, unfortunately. All images
> use the same syntax and are treated the same way. The only part that
> differs is the file name extension (and header within the file).

The below is likely overkill and a good bit of work to setup, but it is
also very flexible. Maybe it suits your needs.

The Markdown-to-XML conversion can be tuned to include all the relevant
information. E.g., you could use pandoc with a custom writer to produce
the XML format of your choice. The link below is an example XML writer
that can be tuned as needed.
<https://gist.github.com/tarleb/634b409be0af62ca210cc9e96d41ca8c>

With that setup, one can modify the `Image` function to produce the
output you need. E.g., match on the file name extension use the library
function `pandoc.path.split_extension` and then change the element type
depending on the extension.

This way you'd have all the important information in your XML.
More info: <https://pandoc.org/custom-writers> and
<https://pandoc.org/lua-filters>.

Of course, you could also use pandoc to go directly to ConTeXt; that is
currently my preferred way of producing PDF from Markdown.

Cheers,
Albert

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
___
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] fullhz, kerning and glue

2022-07-12 Thread Henning Hraban Ramm via ntg-context

Hi,
I just added an explanation of "fullhz" to the options in 
https://wiki.contextgarden.net/Command/setupalign.

but I’m actually unsure if it’s right.

In the sources I found:
https://source.contextgarden.net/tex/context/base/mkxl/hand-ini.mkxl

%D At some point we can introduce extreme expansion, i.e. \type 
{\normaladjustspacing\plustwo}.

56
57% 0 = disabled
58% 1 = notused  (thesis)
59% 2 = glyph + kern
60% 3 = glyph only   (default)
61
62\def\font_expansion_enable  {\normaladjustspacing\plusthree}
63\def\font_expansion_enable_k{\normaladjustspacing\plustwo}
64%def\font_expansion_enable_n{\normaladjustspacing\plusone}
65\def\font_expansion_disable {\normaladjustspacing\zerocount}

And "fullhz" in spac-ali.mkxl calls \font_expansion_enable_k.

So, apparently fullhz enables stretching of *kerning* – that sounds to 
me like letterspacing.


OTOH in my notes (and thus in my book) I have the information that 
fullhz enables stretching of *glue*, and I thought that would mean 
whitespace outside of words.


Please enlighten me?

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

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


Re: [NTG-context] Set up external figure for particular image type

2022-07-12 Thread Rik Kabel via ntg-context


On 2022-07-12 14:11, Thangalin via ntg-context wrote:

Thank you for the suggestion Hraban.

The source comes from Markdown, which is converted to XML, then 
typeset using ConTeXt. There's no Markdown-specific mechanism to 
relate images to a particular external figure definition, 
unfortunately. All images use the same syntax and are treated the same 
way. The only part that differs is the file name extension (and header 
within the file).


One possibility would be something like:
|\setupexternalfigure[ width=1em, height=1em, order={svg,pdf,png,jpg}, 
location={local,default,global}, ] \defineexternalfigure[png][ 
width=\textwidth, height=\textheight, ] \unprotect 
\let\old_externalfigure=\externalfigure 
\tolerant\def\externalfigure[#1]#,[#2]#,[#3]{% 
\doifelseinstring{.png}{#1}{% \old_externalfigure[#1][png][#2]% }{% 
\doifelsefileexists{#1.png}{% \old_externalfigure[#1.png][png][#2]% 
}{% \old_externalfigure[#1][#2][#3]% }% }% } \protect |

See: https://tex.stackexchange.com/a/650221/2148

I was wondering if there was a simpler or a solution that's more the 
ConTeXt-way?


Thanks again!


Assuming that Pandoc markdown is being used, you should be able to set 
class attributes on each image. You can then associate external figure 
definitions with specific classes, and process each individually. 
(Pandoc user guide, link_attributes 
)


--
Rik

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


Re: [NTG-context] Set up external figure for particular image type

2022-07-12 Thread Wolfgang Schuster via ntg-context

Thangalin via ntg-context schrieb am 12.07.2022 um 20:11:

Thank you for the suggestion Hraban.

The source comes from Markdown, which is converted to XML, then 
typeset using ConTeXt. There's no Markdown-specific mechanism to 
relate images to a particular external figure definition, 
unfortunately. All images use the same syntax and are treated the same 
way. The only part that differs is the file name extension (and header 
within the file).


One possibility would be something like:
|\setupexternalfigure[ width=1em, height=1em, order={svg,pdf,png,jpg}, 
location={local,default,global}, ] \defineexternalfigure[png][ 
width=\textwidth, height=\textheight, ] \unprotect 
\let\old_externalfigure=\externalfigure 
\tolerant\def\externalfigure[#1]#,[#2]#,[#3]{% 
\doifelseinstring{.png}{#1}{% \old_externalfigure[#1][png][#2]% }{% 
\doifelsefileexists{#1.png}{% \old_externalfigure[#1.png][png][#2]% 
}{% \old_externalfigure[#1][#2][#3]% }% }% } \protect |

See: https://tex.stackexchange.com/a/650221/2148

I was wondering if there was a simpler or a solution that's more the 
ConTeXt-way?


When you use XML as input you can add additional code to the setups block
which uses \externalfigure to load the image.


\setupexternalfigures [location={local,global,default}]

\defineexternalfigure [jpg] [width=4cm]
\defineexternalfigure [png] [width=8cm]

\starttexdefinition includegraphics #1

    \splitfilename{#1}

    \processaction
    [\splitofftype]
    [    jpg=>{\externalfigure[#1][jpg]},
 png=>{\externalfigure[#1][png]},
 default=>{\externalfigure[#1]},
 unknown=>{\externalfigure[#1]}]

\stoptexdefinition

%\starttexdefinition includegraphics #1
%
%    \getfiguredimensions[#1]
%
%    \processaction
%    [\figurefiletype]
%    [    jpg=>{\externalfigure[#1][jpg]},
% png=>{\externalfigure[#1][png]},
% default=>{\externalfigure[#1]},
% unknown=>{\externalfigure[#1]}]
%
%\stoptexdefinition

\starttext

\includegraphics{hacker.jpg}

\includegraphics{mill.png}

\includegraphics{cow.pdf}

\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://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
___


Re: [NTG-context] Set up external figure for particular image type

2022-07-12 Thread Thangalin via ntg-context
Thank you for the suggestion Hraban.

The source comes from Markdown, which is converted to XML, then typeset
using ConTeXt. There's no Markdown-specific mechanism to relate images to a
particular external figure definition, unfortunately. All images use the
same syntax and are treated the same way. The only part that differs is the
file name extension (and header within the file).

One possibility would be something like:

\setupexternalfigure[
width=1em,
height=1em,
order={svg,pdf,png,jpg},
location={local,default,global},
]
\defineexternalfigure[png][
width=\textwidth,
height=\textheight,
]
\unprotect
\let\old_externalfigure=\externalfigure
\tolerant\def\externalfigure[#1]#,[#2]#,[#3]{%
\doifelseinstring{.png}{#1}{%
\old_externalfigure[#1][png][#2]%
}{%
\doifelsefileexists{#1.png}{%
\old_externalfigure[#1.png][png][#2]%
}{%
\old_externalfigure[#1][#2][#3]%
}%
}%
}\protect

See: https://tex.stackexchange.com/a/650221/2148

I was wondering if there was a simpler or a solution that's more the
ConTeXt-way?

Thanks again!
___
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
___


Re: [NTG-context] upload

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

On 7/9/2022 12:40 AM, Otared Kavian via ntg-context wrote:

I just found that \choose has been replaced with \binom (binomial coefficient):

\starttext
\meaning\choose

\meaning\binom

$\binom{n}{k}$
\stoptext

Sorry for complaining… :-)
no problem ... maybe we should have a wiki page for 'use this instead of 
that'


as you're playing with it ... there is a lot we haven't yet introduced 
but we will do that stepwise .. here's one


inline formulas like $(x + a + 2)$ will break across lines but 
traditionally \left( .. \right) doesn't which is why these \bigg things 
are there : manual solution for breaking inline math


however, in lmtx these do break across lines but there are of course 
still cases where the penalties injected will discourage it; there is 
agranular penalty system in place but current it is configured as 
traditional tex


now, when a formula doesn't break and is somehow wrapped it doesn't play 
that well with linebreaks but you can cheat: formulas can becoem liek 
glue where the inter atom stretch and shrink can play a more prominent 
role ... here's a test:


% turning small inline formulas into leaders to that we don't get overflows
% or excessive spacing

\continuewhenlmtxmode

\startbuffer[threshold-none]
\setupbodyfont[modern]
\setuppapersize[A5]
\setuplayout[tight]
\setupmathematics[threshold=none]
\dorecurse {950} {
test $\darkblue \showboxes x + #1$
test $\darkred  \showboxes x + #1 + z$
}
\stopbuffer

\startbuffer[threshold-small]
\setupbodyfont[modern]
\setuppapersize[A5]
\setuplayout[tight]
\setupmathematics[threshold=small]
\dorecurse {950} {
test $\darkblue \showboxes x + #1$
test $\darkred  \showboxes x + #1 + z$
}
\stopbuffer

\startbuffer[threshold-medium]
\setupbodyfont[modern]
\setuppapersize[A5]
\setuplayout[tight]
\setupmathematics[threshold=medium]
\dorecurse {950} {
test $\darkblue \showboxes x + #1$
test $\darkred  \showboxes x + #1 + z$
}
\stopbuffer

\startbuffer[threshold-big]
\setupbodyfont[modern]
\setuppapersize[A5]
\setuplayout[tight]
\setupmathematics[threshold=big]
\dorecurse {950} {
test $\darkblue \showboxes x + #1$
test $\darkred  \showboxes x + #1 + z$
}
\stopbuffer

\starttext
\dorecurse {10} {
\startcombination[2*2]
{\hbox to .45\textwidth{\typesetbuffer[threshold-none] 
[frame=on,width=.45\textwidth,page=#1]\hss}} {\type {threshold=none}}
{\hbox to .45\textwidth{\typesetbuffer[threshold-small] 
[frame=on,width=.45\textwidth,page=#1]\hss}} {\type {threshold=small}}
{\hbox to 
.45\textwidth{\typesetbuffer[threshold-medium][frame=on,width=.45\textwidth,page=#1]\hss}} 
{\type {threshold=medium}}
{\hbox to .45\textwidth{\typesetbuffer[threshold-big] 
[frame=on,width=.45\textwidth,page=#1]\hss}} {\type {threshold=big}}

\stopcombination
}
\stoptext

There is also a system like widows and orphans in the sense that one can 
set forward and backward penalties, as in:


\setuplayout[width=11cm]

\startbuffer
\dorecurse {50} {
test $\darkblue   a + #1 + b > 2$ %
test $\darkreda + b + #1 + c + d > 2$ %
test $\darkgreen  a + b + c + #1 + d + e + f > 2$ %
}
\stopbuffer

\setuptolerance[verytolerant,stretch]

\starttext
\start
\mathforwardpenalties  0
\mathbackwardpenalties 0
\getbuffer
\par
\stop
\page
\start
\mathforwardpenalties  2 -200 -100
\mathbackwardpenalties 2 -100  -50
\getbuffer
\par
\stop
\page
\start
\mathforwardpenalties  2  200 100
\mathbackwardpenalties 2  100  50
\getbuffer
\par
\stop
\page
\stoptext

but we currently don't have a high level interface for that; it will be 
part of the more general math penalties setup.


These are just a few of the things to play with.

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
___


Re: [NTG-context] Set up external figure for particular image type

2022-07-08 Thread Henning Hraban Ramm via ntg-context

Am 08.07.22 um 17:46 schrieb Thangalin via ntg-context:

I'd like to change the `maxheight` option for only PNG images, such as:


Define your own figure class with \definexternalfigure:
https://wiki.contextgarden.net/Command/defineexternalfigure

It won’t automatically chose the file format (or maybe it works with 
"order"), but you don’t need to repeat the setting for each instance.


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

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


[NTG-context] Set up external figure for particular image type

2022-07-08 Thread Thangalin via ntg-context
A document has a mix of SVG and PNG images. Changing the parameters for
`\setupexternalfigure` affects both SVG and PNG images. Consider the
following code:

\setupexternalfigures[
  order={svg,pdf,png,jpg},
  location={local,default,global},
  directory={images},
  maxwidth=\textwidth,
  maxheight=0.4\textheight
]

I'd like to change the `maxheight` option for only PNG images, such as:

\setupexternalfigure[
  method=png,
  maxwidth=\textwidth,
  maxheight=\textheight,
]

However, this affects SVG images as well.

How do you apply different external figure setups based on image type?

Thank you!
___
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
___


Re: [NTG-context] upload

2022-07-07 Thread Hans Hagen via ntg-context

On 7/7/2022 3:15 AM, Max Chernoff via ntg-context wrote:

Hi,

With the latest upload, "tex.linebreak" doesn't return an "info" table.

When running this code:

     \startluacode
     function test(head)
     local new_head, info = tex.linebreak(node.copylist(head))

     print(head, type(head), info, type(info))

     if info == nil then
     print "!!! info is nil !!!"
     end

     return head
     end

     nodes.tasks.appendaction("processors", "after", "test")
     \stopluacode

     \starttext
     Hello!
     \stoptext

with the latest upload I get (also note the small typo in "rigthfill"):

     luatex warning  > linebreak: no [ leftinit | rightinit | leftfill | 
rigthfill] expected
        2353 : par vmodepar>  
userdata    nil nil

     !!! info is nil !!!
        2299 : glue userskip> 
userdata    nil nil

     !!! info is nil !!!

but with live.contextgarden.net I get:

     luatex warning  > tex: left parfill skip is gone
     Underfull \hbox (badness 1) in paragraph at lines 20--1
         929 : par vmode_par>    userdata
table: 0x39a050f7000    table
        1561 : glue userskip>    userdata
nil    nil

     !!! info is nil !!!


This is because you need to pass a list that conforms to what the 
builder expects and the callback that you use doesn't do that for you 
(after all, it also gets hbox content).


There is no 'callback sequence handler' for the par builder (currently i 
see no need for it, also given the extra overhead involved) but this 
what what you can do:


\startluacode
function builders.paragraphs.constructors.methods.preroll_a(head)
local result, info = tex.linebreak(head)
tex.prevdepth = info.prevdepth
tex.prevgraf = info.prevgraf
return result
end
function builders.paragraphs.constructors.methods.preroll_b(head)
local result, info = tex.linebreak(nodes.nuts.copylist(head))
inspect(info)
return true
end
\stopluacode

\defineparbuilder[preroll_a]
\defineparbuilder[preroll_b]

\starttext
\setmainparbuilder[default]   \input tufte \par \input tufte \page
\setmainparbuilder[preroll_a] \input tufte \par \input tufte \page
\setmainparbuilder[preroll_b] \input tufte \par \input tufte \page
\stoptext

The tex.linebreak function gets the properly prepared paragraph and can 
handle it then. On the to do is a to add a 'prepare' helper that adds 
the mandate nodes (par fillers etc) but even then one has to be careful 
where linebreak hackery is applied.


Hans




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

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


Re: [NTG-context] upload

2022-07-06 Thread Max Chernoff via ntg-context

Hi,

With the latest upload, "tex.linebreak" doesn't return an "info" table.

When running this code:

\startluacode
function test(head)
local new_head, info = tex.linebreak(node.copylist(head))

    print(head, type(head), info, type(info))

if info == nil then
print "!!! info is nil !!!"
end

return head
end

nodes.tasks.appendaction("processors", "after", "test")
\stopluacode

\starttext
Hello!
\stoptext

with the latest upload I get (also note the small typo in "rigthfill"):

luatex warning  > linebreak: no [ leftinit | rightinit | leftfill | 
rigthfill] expected
   2353 : par vmodepar>  userdatanil 
nil
!!! info is nil !!!
   2299 : glue userskip> userdatanil 
nil
!!! info is nil !!!

but with live.contextgarden.net I get:

luatex warning  > tex: left parfill skip is gone
Underfull \hbox (badness 1) in paragraph at lines 20--1
929 : par vmode_par> userdata
table: 0x39a050f7000table
   1561 : glue userskip> userdatanil 
nil
!!! info is nil !!!

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

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


Re: [NTG-context] Using alegreya typescript

2022-07-06 Thread Hans Hagen via ntg-context


\usetypescriptfile[alegreya]

\usebodyfont[alegreya-light]
\usebodyfont[alegreya-medium]

\setupbodyfont[alegreya]

\setuplayout[tight]

\starttext
\switchtobodyfont[alegreya-light]\input tufte \par
\switchtobodyfont[alegreya]  \input tufte \par
\switchtobodyfont[alegreya-medium]   \input tufte \par
\switchtobodyfont[alegreya-light,sans]   \input tufte \par
\switchtobodyfont[alegreya,sans] \input tufte \par
\switchtobodyfont[alegreya-medium,sans]  \input tufte \par
\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-%D \module
%D   [   file=type-imp-dejavu,
%Dversion=2010.06.21,
%D  title=\CONTEXT\ Typescript Macros,
%D   subtitle=Alegreya fonts,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D This is cleaned up ersion of thwe one on the wiki. The font can be fetched 
from:
%D
%D \type {https://www.huertatipografica.com/en/fonts/alegreya-ht-pro}

% \usetypescriptfile[alegreya]
%
% \usebodyfont[alegreya-light]
% \usebodyfont[alegreya-medium]
%
% \setupbodyfont[alegreya]
%
% \setuplayout[tight]
%
% \starttext
% \switchtobodyfont[alegreya-light]\input tufte \par
% \switchtobodyfont[alegreya]  \input tufte \par
% \switchtobodyfont[alegreya-medium]   \input tufte \par
% \switchtobodyfont[alegreya-light,sans]   \input tufte \par
% \switchtobodyfont[alegreya,sans] \input tufte \par
% \switchtobodyfont[alegreya-medium,sans]  \input tufte \par
% \stoptext

\starttypescriptcollection[alegreya]

\usetypescriptfile
  [imp-gentium]

\definefontfallback
  [alegreyagentium-fallback]
  [name:gentium]
  [greekandcoptic,greekextended]

\starttypescript [serif] 
[alegreya-serif,alegreya-light-serif,alegreya-medium-serif] [name]
\setups[font:fallback:serif]
\definefontsynonym[Serif]   [name:alegreyaregular]
[features=default,fallbacks=alegreya-gentium-fallback]
\definefontsynonym[SerifItalic] [name:alegreyaitalic] 
[features=default,fallbacks=alegreya-gentium-fallback]
\definefontsynonym[SerifBold]   [name:alegreyabold]   
[features=default,fallbacks=alegreya-gentium-fallback]
\definefontsynonym[SerifBoldItalic] [name:alegreyabolditalic] 
[features=default,fallbacks=alegreya-gentium-fallback]
\stoptypescript

\starttypescript [sans] [alegreya-sans] [name]
\setups[font:fallback:sans]
\definefontsynonym [Sans]   [name:alegreyasansregular]
[features=default]
\definefontsynonym [SansItalic] [name:alegreyasansitalic] 
[features=default]
\definefontsynonym [SansBold]   [name:alegreyasansbold]   
[features=default]
\definefontsynonym [SansBoldItalic] [name:alegreyasansbolditalic] 
[features=default]
\stoptypescript

\starttypescript [sans] [alegreya-light-sans] [name]
\setups[font:fallback:sans]
\definefontsynonym [Sans]   [name:alegreyasanslight]
[features=default]
\definefontsynonym [SansItalic] [name:alegreyasanslightitalic]  
[features=default]
\definefontsynonym [SansBold]   [name:alegreyasansmedium]   
[features=default]
\definefontsynonym [SansBoldItalic] [name:alegreyasansmediumitalic] 
[features=default]
\stoptypescript

\starttypescript [sans] [alegreya-medium-sans] [name]
\setups[font:fallback:sans]
\definefontsynonym [Sans]   [name:alegreyasansmedium]  
[features=default]
\definefontsynonym [SansItalic] [name:alegreyasansmediumitalic]
[features=default]
\definefontsynonym [SansBold]   [name:alegreyasansextrabold]   
[features=default]
\definefontsynonym [SansBoldItalic] [name:alegreyasansextrabolditalic] 
[features=default]
\stoptypescript

\starttypescript [alegreya,alegreya-light,alegreya-medium]

\definefallbackfamily[alegreya][serif][gentium][range={greekandcoptic,greekextended}]
\definetypeface [\typescriptone] [rm] [serif] [\typescriptone-serif] 
[default]
\definetypeface [\typescriptone] [ss] [sans]  [\typescriptone-sans]  
[default]
\definetypeface [\typescriptone] [tt] [mono]  [modern]   
[default]
\definetypeface [\typescriptone] [mm] [math]  [default]  
[default]
\stoptypescript

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo

Re: [NTG-context] Odd behaviour with Plex typescript

2022-06-30 Thread Hans Hagen via ntg-context

On 6/30/2022 10:36 AM, Max Chernoff via ntg-context wrote:

If you load the Plex typescript, a spurious space is added on the first
switch to another font, messing up any alignment. This doesn't happen
with any other fonts; only with Plex.

MWE:

     \setuphead[section][style={\switchtobodyfont[modern]}]
     \setupbodyfont[plex]

     \starttext
     \section{A}
     A
     \stoptext

I was able to fix this by removing the space immediately before the "%"
on line 136 of "type-imp-plex.mkiv", changing it from this (original):

 
\definefontfeature[plexwideneddefault][default][extend=\luaexpr{1/0.85}] 
% An odd floating point number to correct monospace.


to this (fixed):

 
\definefontfeature[plexwideneddefault][default][extend=\luaexpr{1/0.85}]% An 
odd floating point number to correct monospace.


I'm pretty sure that TeX is ignoring spaces at this point, so I have no
idea why this issue exists or why the fix works.
when you trigger modern it will also process a typescript and that can 
itself have spaces introduced


just preload it, as in:

\usebodyfont[modern]

\setupbodyfont[plex]

\setuphead
  [section]
  [style={\switchtobodyfont[modern]}]

\starttext
\section{A}
A
\stoptext



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

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


[NTG-context] Odd behaviour with Plex typescript

2022-06-30 Thread Max Chernoff via ntg-context

If you load the Plex typescript, a spurious space is added on the first
switch to another font, messing up any alignment. This doesn't happen
with any other fonts; only with Plex.

MWE:

\setuphead[section][style={\switchtobodyfont[modern]}]
\setupbodyfont[plex]

\starttext
\section{A}
A
\stoptext

I was able to fix this by removing the space immediately before the "%"
on line 136 of "type-imp-plex.mkiv", changing it from this (original):


\definefontfeature[plexwideneddefault][default][extend=\luaexpr{1/0.85}] % An 
odd floating point number to correct monospace.

to this (fixed):


\definefontfeature[plexwideneddefault][default][extend=\luaexpr{1/0.85}]% An 
odd floating point number to correct monospace.

I'm pretty sure that TeX is ignoring spaces at this point, so I have no
idea why this issue exists or why the fix works.

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

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


Re: [NTG-context] Count (and limit) glyphs per line?

2022-06-25 Thread Benjamin Buchmuller via ntg-context
Dear list,

A brief follow-up for (1) itemizations [resolved; but question on ConTeXt hsize 
defaults] and (2) hyphenation [troubles].

(1) To deal with itemizations and other situation where texts are indented such 
as:

   \setuppapersize[landscape,letter]
   \showframe

   \starttext

   \samplefile{knuth}

   \ctxlua{context(tex.dimen["textwidth"])} % 37213340

   \ctxlua{context(tex.dimen["localhsize"])} % 0

   \startitemize[width=5em]

   \item \samplefile{knuth}

   \ctxlua{context(tex.dimen["textwidth"])} % 37213340

   \ctxlua{context(tex.dimen["localhsize"])} % 33283340

   \stopitemize
   
   \stoptext

The following part in the script must be adapted to the local horizontal size, 
I guess: 

if chars >= max_length or width > tex.hsize then

However, tex.localhsize (or tex.dimen["localhsize"]) is 0 when the document is 
initialized. (Maybe a more sensible default would be textwidth rather than 0?)

So, I added:

local localhsize = tex.dimen["textwidth"]
   
if tex.dimen["localhsize"] > 0 then
localhsize = tex.dimen["localhsize"]
end

if chars >= max_length or width > localhsize then

Maybe someone finds this useful in the future.

(2) I'm (now?) running into trouble with hyphenation. With the example above, I 
get

"
The separation of any of these four components would have hurt TEX 
significantly. If I had not partic­-
i-
pated fully in all these activities, literally hundreds of improvements would 
never have been made,
"

In my own document, I also get lines with only a single character or hboxed 
group. I assume, this is because the hyphen is not counted and pushes the 
remainder to a new line where the intended breakpoint again starts another one.

Unfortunately, I don't know what to change; I know a bit about "glyph" and 
"glue", but what is "disc" and would it help here?

Thank you!


Benjamin


> On Jun 25, 2022, at 11:38, Benjamin Buchmuller 
>  wrote:
> 
> Wow, that works like a charm! Thank you, Max! 
> 
> It's also a very insightful example of how to use and inject Lua code in the 
> TeX output routine. Do you mind if I add it to the wiki? (Probably under 
> "Wrapping".)
> 
> Many thanks again!
> 
> 
> Benjamin
> 
>> On Jun 24, 2022, at 01:44, Max Chernoff  wrote:
>> 
>>> I've been confronted with the following 'intriguing' formatting requirement 
>>> for a document:
>> 
>> "Intriguing" is definitely right here. I suspect these guidelines were made 
>> for typewriters and haven't been updated since.
>> 
>>> to limit the number of glyphs per line to 112. 
>> 
>> 112 characters per line sounds much too long anyways.
>> 
>> From "The Elements of Typographic Style":
>>> Anything from 45 to 75 characters is widely regarded as a satisfactory
>>> length of line for a single-column page set in a serifed text face
>>> in a text size. The 66-character line (counting both letters and
>>> spaces) is widely regarded as ideal. For multiple-column work, a
>>> better average is 40 to 50 characters.
>>> 
>>> If the type is well set and printed, lines of 85 or 90 characters
>>> will pose no problem in discontinuous texts, such as bibliographies,
>>> or, with generous leading, in footnotes. But even with generous
>>> leading, a line that averages more than 75 or so characters is likely
>>> to be too long for continuous reading.
>> 
>> If you use something like
>> 
>>   \setuplayout[width=80\averagecharwidth]
>> 
>> then your lines will for sure have fewer than 112 characters and will 
>> probably be more readable too.
>> 
>>> I'm nevertheless curious if there is a Lua/TeX solution to this "problem"?
>> 
>> Option 1: Use a monospaced font. Then 112 characters per line <=> page width 
>> = 112em.
>> 
>> Option 2: A hacky Lua solution
>> 
>>   \startluacode
>>   local max_length = 112
>> 
>>   local glyph_id = node.id "glyph"
>>   local disc_id = node.id "disc"
>>   local glue_id = node.id "glue"
>> 
>>   function userdata.limiter(head)
>>   language.hyphenate(head)
>> 
>>   local chars = 0
>>   local width = 0
>>   local n = head
>>   while n do
>>   if n.id == glyph_id or n.id == glue_id then
>>

Re: [NTG-context] Count (and limit) glyphs per line?

2022-06-25 Thread Benjamin Buchmuller via ntg-context
Wow, that works like a charm! Thank you, Max! 

It's also a very insightful example of how to use and inject Lua code in the 
TeX output routine. Do you mind if I add it to the wiki? (Probably under 
"Wrapping".)

Many thanks again!


Benjamin

> On Jun 24, 2022, at 01:44, Max Chernoff  wrote:
> 
>> I've been confronted with the following 'intriguing' formatting requirement 
>> for a document:
> 
> "Intriguing" is definitely right here. I suspect these guidelines were made 
> for typewriters and haven't been updated since.
> 
>> to limit the number of glyphs per line to 112. 
> 
> 112 characters per line sounds much too long anyways.
> 
> From "The Elements of Typographic Style":
> > Anything from 45 to 75 characters is widely regarded as a satisfactory
> > length of line for a single-column page set in a serifed text face
> > in a text size. The 66-character line (counting both letters and
> > spaces) is widely regarded as ideal. For multiple-column work, a
> > better average is 40 to 50 characters.
> >
> > If the type is well set and printed, lines of 85 or 90 characters
> > will pose no problem in discontinuous texts, such as bibliographies,
> > or, with generous leading, in footnotes. But even with generous
> > leading, a line that averages more than 75 or so characters is likely
> > to be too long for continuous reading.
> 
> If you use something like
> 
>\setuplayout[width=80\averagecharwidth]
> 
> then your lines will for sure have fewer than 112 characters and will 
> probably be more readable too.
> 
>> I'm nevertheless curious if there is a Lua/TeX solution to this "problem"?
> 
> Option 1: Use a monospaced font. Then 112 characters per line <=> page width 
> = 112em.
> 
> Option 2: A hacky Lua solution
> 
>\startluacode
>local max_length = 112
> 
>local glyph_id = node.id "glyph"
>local disc_id = node.id "disc"
>local glue_id = node.id "glue"
> 
>function userdata.limiter(head)
>language.hyphenate(head)
> 
>local chars = 0
>local width = 0
>local n = head
>while n do
>if n.id == glyph_id or n.id == glue_id then
>chars = chars + 1
>width = width + n.width - (n.shrink or 0)
>end
> 
>if chars >= max_length or width > tex.hsize then
>local back_chars = 0
>local end_disc = nil
> 
>while n do
>if n.id == glue_id then
>local penalty = node.new "penalty"
>penalty.penalty = -1
>node.insertbefore(head, n, penalty)
>break
>end
> 
>if not end_disc and n.id == disc_id then
>end_disc = n
>end
> 
>if end_disc and back_chars >= 5 then
>end_disc.penalty = -1
>break
>end
> 
>if n.id == glyph_id then
>back_chars = back_chars + 1
>end
> 
>n = n.prev
>end
> 
>width = 0
>chars = 0
>end
> 
>n = n.next
>end
> 
>return head
>end
> 
>nodes.tasks.appendaction(
>"processors",
>"before",
>"userdata.limiter"
>)
>\stopluacode
> 
>\setuppapersize[landscape,letter]
>\showframe
> 
>\starttext
>\setupalign[flushleft]
> 
>\setupbodyfont[14pt]
>\samplefile{knuth}
> 
>\setupbodyfont[12pt]
>\samplefile{knuth}
> 
>\setupbodyfont[10pt]
>\samplefile{knuth}
> 
>\page
>\setupalign[normal]
> 
>\setupbodyfont[14pt]
>\samplefile{knuth}
> 
>\setupbodyfont[12pt]
>\samplefile{knuth}
> 
>\setupbodyfont[10pt]
>\samplefile{knuth}
>\stoptext
> 
> This code will ensure that no line ever exceeds "max_length" characters. It 
> uses a greedy algorithm instead of the standard TeX algorithm for line 
> breaking, but it still produces mostly decent results.
> 
> -- Max

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

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


Re: [NTG-context] Count (and limit) glyphs per line?

2022-06-24 Thread Hans Hagen via ntg-context

On 6/24/2022 5:15 AM, Benjamin Buchmuller via ntg-context wrote:

Dear list,

I've been confronted with the following 'intriguing' formatting requirement for 
a document:

"
• Type density:  Must be no more than 15 characters per linear inch (including 
characters and spaces).
• Line spacing: Must be no more than six lines per vertical inch.
"

While the line spacing resolves in ConTeXt to

\setupinterlinespace[line=\dimexpr(1in / 6)]

I was wondering if one can limit "type density" as the number of glyphs per 
inch in TeX too? I thought, it is more convenient to rephrase this request (for a 7 in 
textwidth) to limit the number of glyphs per line to 112. (Font must be sans or serif, of 
course ...)

I've tried

\setuplayout[width=112\averagecharwidth]

which, however, results in ~120–130 characters and spaces per line. Pragmatically, I'm 
narrowing the text width to empirically match the requirement, but I'm nevertheless 
curious if there is a Lua/TeX solution to this "problem"?

Just assume the worst case and take the narrowest character:

\showframe

\setupbodyfont[modern] % we need to set the font

\normalexpanded {
\setuplayout
   [textwidth=\the\dimexpr112\fontcharwd\font`.\relax]
}

\starttext
\input tufte
\stoptext



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

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


Re: [NTG-context] Detailed citation of reference

2022-06-24 Thread Johann Birnick via ntg-context
Works, thanks!

On Fri, 2022-06-24 at 12:44 +0200, Wolfgang Schuster via ntg-context wrote:
> Johann Birnick via ntg-context schrieb am 24.06.2022 um 11:59:
> > Thanks! However, if I type \cite[righttext={, section 2.1}] is doesn't work
> > anymore. Any ideas?
> 
> What happens with
> 
>  \cite[righttext={{, section 2.1}}]
> 
> or
> 
>  \cite[righttext={\textcomma\ section 2.1}]
> 
> Wolfgang
> 
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Detailed citation of reference

2022-06-24 Thread Wolfgang Schuster via ntg-context

Johann Birnick via ntg-context schrieb am 24.06.2022 um 11:59:

Thanks! However, if I type \cite[righttext={, section 2.1}] is doesn't work
anymore. Any ideas?


What happens with

    \cite[righttext={{, section 2.1}}]

or

    \cite[righttext={\textcomma\ section 2.1}]

Wolfgang

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

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


Re: [NTG-context] Detailed citation of reference

2022-06-24 Thread Johann Birnick via ntg-context
Thanks! However, if I type \cite[righttext={, section 2.1}] is doesn't work
anymore. Any ideas?

Johann

On Fri, 2022-06-24 at 09:24 +0200, Henning Hraban Ramm via ntg-context wrote:
> Am 24.06.22 um 02:09 schrieb Johann Birnick via ntg-context:
> > Hi there,
> > 
> > using \cite[myreference] I will get a result like "[1]", or I could also
> > change
> > the "1" into some more detailed information such as a tag.
> > 
> > However, I want to obtain something like "[1, section 2.1]".
> > 
> > How can I achieve this?
> 
> \cite[righttext={section 2.1}][myreference]
> 
> Hraban
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Count (and limit) glyphs per line?

2022-06-24 Thread Henning Hraban Ramm via ntg-context

Am 24.06.22 um 05:15 schrieb Benjamin Buchmuller via ntg-context:

• Type density:  Must be no more than 15 characters per linear inch (including 
characters and spaces).


This talks about "type density", not characters per line. This depends 
mostly on the font (and letterspacing). I.e. you should not use a narrow 
font.


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

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


Re: [NTG-context] Count (and limit) glyphs per line?

2022-06-23 Thread Max Chernoff via ntg-context

I've been confronted with the following 'intriguing' formatting requirement for 
a document:


"Intriguing" is definitely right here. I suspect these guidelines were 
made for typewriters and haven't been updated since.


to limit the number of glyphs per line to 112. 


112 characters per line sounds much too long anyways.

From "The Elements of Typographic Style":
> Anything from 45 to 75 characters is widely regarded as a satisfactory
> length of line for a single-column page set in a serifed text face
> in a text size. The 66-character line (counting both letters and
> spaces) is widely regarded as ideal. For multiple-column work, a
> better average is 40 to 50 characters.
>
> If the type is well set and printed, lines of 85 or 90 characters
> will pose no problem in discontinuous texts, such as bibliographies,
> or, with generous leading, in footnotes. But even with generous
> leading, a line that averages more than 75 or so characters is likely
> to be too long for continuous reading.

If you use something like

\setuplayout[width=80\averagecharwidth]

then your lines will for sure have fewer than 112 characters and will 
probably be more readable too.



I'm nevertheless curious if there is a Lua/TeX solution to this "problem"?


Option 1: Use a monospaced font. Then 112 characters per line <=> page 
width = 112em.


Option 2: A hacky Lua solution

\startluacode
local max_length = 112

local glyph_id = node.id "glyph"
local disc_id = node.id "disc"
local glue_id = node.id "glue"

function userdata.limiter(head)
language.hyphenate(head)

local chars = 0
local width = 0
local n = head
while n do
if n.id == glyph_id or n.id == glue_id then
chars = chars + 1
width = width + n.width - (n.shrink or 0)
end

if chars >= max_length or width > tex.hsize then
local back_chars = 0
local end_disc = nil

while n do
if n.id == glue_id then
local penalty = node.new "penalty"
penalty.penalty = -1
node.insertbefore(head, n, penalty)
break
end

if not end_disc and n.id == disc_id then
end_disc = n
end

if end_disc and back_chars >= 5 then
end_disc.penalty = -1
break
end

if n.id == glyph_id then
back_chars = back_chars + 1
end

n = n.prev
end

width = 0
chars = 0
end

n = n.next
end

return head
end

nodes.tasks.appendaction(
"processors",
"before",
"userdata.limiter"
)
\stopluacode

\setuppapersize[landscape,letter]
\showframe

\starttext
\setupalign[flushleft]

\setupbodyfont[14pt]
\samplefile{knuth}

\setupbodyfont[12pt]
\samplefile{knuth}

\setupbodyfont[10pt]
\samplefile{knuth}

\page
\setupalign[normal]

\setupbodyfont[14pt]
\samplefile{knuth}

\setupbodyfont[12pt]
\samplefile{knuth}

\setupbodyfont[10pt]
\samplefile{knuth}
\stoptext

This code will ensure that no line ever exceeds "max_length" characters. 
It uses a greedy algorithm instead of the standard TeX algorithm for 
line breaking, but it still produces mostly decent results.


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

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


[NTG-context] Count (and limit) glyphs per line?

2022-06-23 Thread Benjamin Buchmuller via ntg-context
Dear list,

I've been confronted with the following 'intriguing' formatting requirement for 
a document:

"
• Type density:  Must be no more than 15 characters per linear inch (including 
characters and spaces).
• Line spacing: Must be no more than six lines per vertical inch.
"

While the line spacing resolves in ConTeXt to

\setupinterlinespace[line=\dimexpr(1in / 6)]

I was wondering if one can limit "type density" as the number of glyphs per 
inch in TeX too? I thought, it is more convenient to rephrase this request (for 
a 7 in textwidth) to limit the number of glyphs per line to 112. (Font must be 
sans or serif, of course ...)

I've tried

\setuplayout[width=112\averagecharwidth] 

which, however, results in ~120–130 characters and spaces per line. 
Pragmatically, I'm narrowing the text width to empirically match the 
requirement, but I'm nevertheless curious if there is a Lua/TeX solution to 
this "problem"?

Thank you!


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

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


Re: [NTG-context] colors and contours in luametafun

2022-06-23 Thread Hans Hagen via ntg-context

On 6/20/2022 6:29 PM, Jacob Kauffmann via ntg-context wrote:

Dear list,


Am 01.09.2021 um 09:54 schrieb Jacob Kauffmann via ntg-context 
:
- color by value in lmt_surface
We want to show a surface plot of a function where the color indicates the 
function value (instead, or in addition to a light source).
The easiest would be to have variable cf for the brightness factor (as it is), 
and in addition variables such as zt, minz, maxz, akin to the color formatter 
for lmt_contour.
This becomes handy when colors are to be aligned with function values (e.g. 
negative = blue, zero = white, positive = red, see MWE attached).


I managed to achieve this by tweaking f_color and mp.lmt_surface_do in 
mlib-cnt.lmt in
ConTeXt  ver: 2022.05.11 11:36 LMTX  fmt: 2022.6.20
a bit.
Please find the diff and a MWE attached.


in next version (next time just send me the file, easier than a diff)


Cheers,
Jacob Kauffmann

--- context/tex/texmf-context/tex/context/base/mkxl/mlib-cnt.lmt   2022-06-20 
18:11:51.0 +0200
+++ mlib-cnt.lmt2022-06-20 18:26:22.0 +0200
@@ -1839,7 +1839,29 @@

  local f_color = formatters [ [[
  local math = math
-return function(f)
+local min  = math.min
+local max  = math.max
+local abs  = math.abs
+local minz = %s
+local maxz = %s
+
+local color_value = 0
+local color_step  = mp.lmt_color_functions.step
+local color_shade = mp.lmt_color_functions.shade
+
+local function step(...)
+return color_step(color_value,n,...)
+end
+local function shade(...)
+return color_shade(color_value,n,...)
+end
+-- local function lin(l)
+-- return l/n
+-- end
+%s
+return function(z, f)
+function_value = z
+brightness_factor = f
  return %s
  end
  ]] ]
@@ -1898,7 +1920,7 @@
  local dy   = (ymax - ymin) / ny
  local xt   = xmin
  --
-local minf, maxf
+local minf, maxf, minz, maxz
  --
  -- similar as contours but no data loop here
  --
@@ -1908,12 +1930,6 @@
  return false -- fatal error
  end
  --
-local ccode = load(f_color(colorcode))
-local color = type(ccode) == "function" and ccode()
-    if type(color) ~= "function" then
-return false -- fatal error
-end
---
  for i=0,nx do
  local yt = ymin
  for j=0,ny do
@@ -1946,7 +1962,16 @@
  maxf = fac
  end
  --
-data[i][j] = { x, y, fac }
+if not minz then
+   minz = z
+   maxz = z
+elseif z < minz then
+   minz = z
+elseif z > maxz then
+   maxz = z
+end
+--
+data[i][j] = { x, y, fac, z }
  --
  yt = yt + dy
  end
@@ -1957,6 +1982,16 @@
  local range   = maxf - minf
  local cl  = linecolor or 1
  local enforce = attributes.colors.model == "cmyk"
+--
+-- local ccode = load(f_color(colorcode))
+report("minz, maxz is (%s,%s)",minz,maxz)
+report("colorcode is %s", colorcode)
+local ccode = load(f_color(minz, maxz, preamble, colorcode))
+local color = type(ccode) == "function" and ccode()
+if type(color) ~= "function" then
+return false -- fatal error
+end
+--
  for i=0,nx-1 do
  for j=0,ny-1 do
  -- points
@@ -1985,12 +2020,13 @@
  local z32 = z3[2]
  local z41 = z4[1]
  local z42 = z4[2]
+local zout = z1[4]
   -- if lines then
   -- -- fill first and draw then, previous shapes can be covered
   -- else
   -- -- fill and draw in one go to prevent artifacts
   -- end
-local cr, cg, cb = color(cf)
+local cr, cg, cb = color(zout, cf)
  if not cr then cr = 0 end
  if not cg then cg = 0 end
  if not cb then cb = 0 end




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

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



--

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

Re: [NTG-context] colors and contours in luametafun

2022-06-20 Thread Jacob Kauffmann via ntg-context
Dear list,

> Am 01.09.2021 um 09:54 schrieb Jacob Kauffmann via ntg-context 
> :
> - color by value in lmt_surface
> We want to show a surface plot of a function where the color indicates the 
> function value (instead, or in addition to a light source).
> The easiest would be to have variable cf for the brightness factor (as it 
> is), and in addition variables such as zt, minz, maxz, akin to the color 
> formatter for lmt_contour.
> This becomes handy when colors are to be aligned with function values (e.g. 
> negative = blue, zero = white, positive = red, see MWE attached).

I managed to achieve this by tweaking f_color and mp.lmt_surface_do in 
mlib-cnt.lmt in
ConTeXt  ver: 2022.05.11 11:36 LMTX  fmt: 2022.6.20
a bit.
Please find the diff and a MWE attached.

Cheers,
Jacob Kauffmann

--- context/tex/texmf-context/tex/context/base/mkxl/mlib-cnt.lmt   2022-06-20 
18:11:51.0 +0200
+++ mlib-cnt.lmt2022-06-20 18:26:22.0 +0200
@@ -1839,7 +1839,29 @@

 local f_color = formatters [ [[
 local math = math
-return function(f)
+local min  = math.min
+local max  = math.max
+local abs  = math.abs
+local minz = %s
+local maxz = %s
+
+local color_value = 0
+local color_step  = mp.lmt_color_functions.step
+local color_shade = mp.lmt_color_functions.shade
+
+local function step(...)
+return color_step(color_value,n,...)
+end
+local function shade(...)
+return color_shade(color_value,n,...)
+end
+-- local function lin(l)
+-- return l/n
+-- end
+%s
+return function(z, f)
+function_value = z
+brightness_factor = f
 return %s
 end
 ]] ]
@@ -1898,7 +1920,7 @@
 local dy   = (ymax - ymin) / ny
 local xt   = xmin
 --
-local minf, maxf
+local minf, maxf, minz, maxz
 --
 -- similar as contours but no data loop here
 --
@@ -1908,12 +1930,6 @@
 return false -- fatal error
 end
 --
-local ccode = load(f_color(colorcode))
-local color = type(ccode) == "function" and ccode()
-if type(color) ~= "function" then
-return false -- fatal error
-end
---
 for i=0,nx do
 local yt = ymin
 for j=0,ny do
@@ -1946,7 +1962,16 @@
 maxf = fac
 end
 --
-data[i][j] = { x, y, fac }
+if not minz then
+   minz = z
+   maxz = z
+elseif z < minz then
+   minz = z
+elseif z > maxz then
+   maxz = z
+end
+--
+data[i][j] = { x, y, fac, z }
 --
 yt = yt + dy
 end
@@ -1957,6 +1982,16 @@
 local range   = maxf - minf
 local cl  = linecolor or 1
 local enforce = attributes.colors.model == "cmyk"
+--
+-- local ccode = load(f_color(colorcode))
+report("minz, maxz is (%s,%s)",minz,maxz)
+report("colorcode is %s", colorcode)
+    local ccode = load(f_color(minz, maxz, preamble, colorcode))
+local color = type(ccode) == "function" and ccode()
+if type(color) ~= "function" then
+return false -- fatal error
+end
+--
 for i=0,nx-1 do
 for j=0,ny-1 do
 -- points
@@ -1985,12 +2020,13 @@
 local z32 = z3[2]
 local z41 = z4[1]
 local z42 = z4[2]
+local zout = z1[4]
  -- if lines then
  -- -- fill first and draw then, previous shapes can be covered
  -- else
  -- -- fill and draw in one go to prevent artifacts
  -- end
-local cr, cg, cb = color(cf)
+local cr, cg, cb = color(zout, cf)
 if not cr then cr = 0 end
 if not cg then cg = 0 end
 if not cb then cb = 0 end



colors_and_surface_in_luametafun.pdf
Description: Adobe PDF document



colors_and_surface_in_luametafun.tex
Description: Binary data


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

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


[NTG-context] Problems with MetaFun Transparency Groups

2022-06-13 Thread Stefan Haller via ntg-context
Hi everyone!

I have a question regarding transparency groups in MetaFun. As a toy example, I
want to draw a grid of lines where the whole grid should have an opacity of 25%.

If I draw intersecting lines individually with `withtransparency(1, .25)` the
overlapping parts will have a total opacity of 50%. However, I want to draw the
whole grid as one group and then blend it as a whole so that the whole grid is
evenly colored when blended. According to the MetaFun manual we should be able
to get the desired effect with the `asgroup` operator applied to a picture.
(Actually, the manual says the operator is called `grouped` but the source code
of the graphics above uses the `asgroup` operator [1].)

The `asgroup` does in fact insert a transparency group into the PDF output:

> << /Type /XObject /Subtype /Form /FormType 1 /Group << /S /Transparency /I 
> false /K false

However, the group does not seem to be blended as one group and we can still
see that the overlapping parts are darker than the other parts of the line.
Something seems to be off. Looking at the compiled manual also shows that the
transparency groups are not working (both parts of the arrow, the head and the
tail, are blended independently and not as a group).

When I recreate the graphics in Tikz/PGF everything works. The resulting PDF
output looks similar, at least with my limited understanding of PDF format I am
unable to understand the differences.

The full example is attached below the text of my mail. The Tikz example on the
fifth page shows the desired result.

Do I misunderstand the syntax of transparency groups in MetaFun? Or is there
some other problem? Maybe someone can point me in the right direction.

Thanks in advance!
Stefan Haller

[1]: 
https://source.contextgarden.net/doc/context/sources/general/manuals/metafun/metafun-effects.tex?search=asgroup&docs=yes#l2543



\nopdfcompression
\usemodule[tikz]

\starttext
\startMPdefinitions
  vardef draw_grid =
def withmycolor = withcolor red withtransparency(normaltransparent, .25) 
enddef;
linecap := butt;
u := 10mm;
n := 20;
pickup pencircle scaled 7mm;
for i = 1 upto n:
  draw (0, i) * u -- (n+1, i) * u withmycolor;
  draw (i, 0) * u -- (i, n+1) * u withmycolor;
endfor;
  enddef;
\stopMPdefinitions
\startMPpage
  draw image( draw_grid ) asgroup "";
  addbackground withcolor yellow;
\stopMPpage
\startMPpage
  draw image( draw_grid ) asgroup "isolated";
  addbackground withcolor yellow;
\stopMPpage
\startMPpage
  draw image( draw_grid ) asgroup "knockout";
  addbackground withcolor yellow;
\stopMPpage
\startMPpage
  draw image( draw_grid ) asgroup "isolated,knockout";
  addbackground withcolor yellow;
\stopMPpage
\startTEXpage
\starttikzpicture
  \fill[yellow] (-0.35cm, -0.35cm) rectangle (21.35cm, 21.35cm);
  \startscope[opacity=.25, transparency group]
\startscope[x=10mm, y=10mm, every path/.style={line width=7mm}]
  \foreach \i in {1,...,20}{
\draw[red] (0, \i) -- (21, \i);
\draw[red] (\i, 0) -- (\i, 21);
  };
\stopscope
  \stopscope
\stoptikzpicture
\stopTEXpage
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Problem loading font in LMTX

2022-06-11 Thread Stefan Nedeljkovic via ntg-context
 1  1500
system  >   min 15   1000 15 15100100100  1500   1000  2 10250250 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  1250250 50 25
system  > 
system  >   mem 15 879059 15   100100100  1500   1000  2  1   2920 96   1200320
system  >   all240 879059240   900800100 32  16000  48000  8 16   2920 96  28800  10240
system  > 
system  >   ini2142543 858129  0  45373  0 496387   0  
system  >   ptr  46535  9182  46517521493  0  0  0  0  0  0  4  0  0  7
system  >   top  46536740050 131074   4067 529077209 27  5 12 27378250250 50 10
system  >   ---
system  > 
system  >   current input type: initial
system  > 
system  >   approximate memory: 26048523 (24 MB)
system  > 
system  >   expansion depth   : min: 1, max: 100, set: 1, top: 5
system  > 
system  >   luabytecode registers : 1002
system  >   luabytecode bytes : 16048 (0 MB)
system  >   luastate bytes now: 49785277 (47 MB)
system  >   luastate bytes max: 49785277 (47 MB)
system  > 
system  >   file callbacks: 68
system  >   saved callbacks   : 373
system  >   direct callbacks  : 2
system  >   function callbacks: 1137
system  >   value callbacks   : 1
system  >   message callbacks : 0
system  >   bytecode callbacks: 600
system  > 
system  >   mp instances  : 0
system  >   mp estimated memory   : 0 (0 MB)
system  >   mp file callbacks : 0
system  >   mp text callbacks : 0
system  >   mp script callbacks   : 0
system  >   mp log callbacks  : 0
system  > 
system  >   total callbacks   : 2181
system  >   mp total callbacks: 0
system  >   backend callbacks : 0
system  > 
mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: /home/stefan/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, 6 found files, scanned paths: 
mkiv lua stats  > stored bytecode data: 502 modules (0.161 sec), 98 tables (0.009 sec), 600 chunks (0.170 sec)
mkiv lua stats  > traced context: maxstack: 1616, freed: 0, unreachable: 1616
mkiv lua stats  > cleaned up reserved nodes: 71 nodes, 9 lists of 435
mkiv lua stats  > node memory usage: 15 attribute, 3 glue, 58 glue_spec, 3 kern, 4 penalty, 2 temp
mkiv lua stats  > node list callback tasks: 12 unique task lists, 8 instances (re)created, 51 calls
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: file: 68, saved: 373, direct: 2, function: 1137, value: 1, message: 0, bytecode: 600, late 0, total: 2181 (2181 per page)
mkiv lua stats  > randomizer: resumed with value 0.92460604724911
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > font engine: otf 3.119, afm 1.513, tfm 1.000
mkiv lua stats  > body font sizes: defined: 10pt 11pt 12pt 14.4pt 17.3pt 20.7pt 4pt 5pt 6pt 7pt 8pt 9pt, undefined: 28.8pt 36pt 43.2pt
mkiv lua stats  > result saved in file: serbia_map_adresses_text.pdf, compresslevel 1, objectcompresslevel 3
mkiv lua stats  > positions: 4 collected, 0 deltas, 0 shared partials, 0 partial entries
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree: texmf-linux-64
mkiv lua stats  > used engine: luametatex version: 2.0936, functionality level: 20221202, format id: 616, compiler: gcc
mkiv lua stats  > tex properties: 740050 hash slots used of 2097152, 46517 control sequences, approximate memory usage: 24 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 49 MB, ctx: 47 MB, max: 47 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.214 seconds, 1 processed pages, 1 shipped pages, 4.666 pages/second
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Workshop at FrOSCon

2022-06-09 Thread a badin via ntg-context
> From: juh+ntg-cont...@mailbox.org

> My main problem is that I never used Windows in my life and have no idea
> how to help people with installing lmtx on this platform.
>
> juh

I'm a beginner in context (and not a programmer by profession) and
installing lmtx on windows was very easy for me. the steps are on the
wiki https://wiki.contextgarden.net/Installation and it is as easy as
it is written there. I've been using context thanks to these
installation steps on win 7 and win 10. I'm not sure what the
targetgroup at the conference is, but if the people there ever used a
commandline, they should be good to go. once you install, you open the
commandline using Win+R and then type "cmd". Once in the cmd, you only
need to know the command "cd" (change directory) to navigate to the
folder where the .tex source is, so e.g. "cd c:\users\x\documents\"
and then run "context test.tex". That is the manual way.

I use sublimetext as text editor and made a new build for it, that
when I press Ctrl+B saves all changes in the open file/folder and runs
context on the open file and previews the pdf in mupdf that is zoomed
to be 1:1 paper:print on my dpi. It's a bit like TeXworks, just press
button and see the pdf, because mupdf automatically overwrites the
open pdf without asking.

It's 4 hours by train for me to Bonn and I'm not sure whether I'm a
good candidate to teach people context due to my low skill, but I can
surely teach you how to install lmtx on windows if you like (we could
call or sth).

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

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


Re: [NTG-context] issue with scite module

2022-06-02 Thread Max Chernoff via ntg-context

For the sake of consistency (with buff-imp-xml.lua), I think the patch
should read

> [...]

+local alsoname = lpatterns.utf8two + lpatterns.utf8three +
lpatterns.utf8four


I think that that pattern is a little too broad, since it will match any 
non-ASCII Unicode character. Things like U+202E (xkcd.com/1137), U+00A0 
(no-break space), etc are valid UTF-8 characters, but not valid XML tag 
names. Neither of these two characters are matched by the TeX catcode 
check. This doesn't make any real difference for a syntax highlighter 
though.



+local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1


There's a doubled plus in the middle there. The patch works when I 
remove it.



But I’m afraid I cannot make it work on my computer (Linux64).

On another Win64 computer, both patches worked perfectly fine.


Hmm, that's really weird. Both patches work for me on my main Win64 
computer (after I fixed the extra plus). I also pulled the 
"contextgarden/context:lmtx" Docker image (Debian sid), and both patches 
worked there too. I get this from inside the container:


root@e8d29a32595c:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/";
SUPPORT_URL="https://www.debian.org/support";
BUG_REPORT_URL="https://bugs.debian.org/";

root@e8d29a32595c:~# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

root@e8d29a32595c:~# xxd test.tex
: 5c75 7365 6d6f 6475 6c65 5b73 6369 7465  \usemodule[scite
0010: 5d0a 5c73 7461 7274 7465 7874 0a5c 7374  ].\starttext.\st
0020: 6172 7454 4558 7061 6765 5b6f  7365  artTEXpage[offse
0030: 743d 3165 785d 0a5c 7479 7065 5b6f 7074  t=1ex].\type[opt
0040: 696f 6e3d 786d 6c5d 7b3c 616e 732f 3e7d  ion=xml]{}
0050: 0a5c 7479 7065 5b6f 7074 696f 6e3d 786d  .\type[option=xm
0060: 6c5d 7b3c c3a1 c3b1 c39f 2f3e 7d0a 5c73  l]{<../>}.\s
0070: 746f 7054 4558 7061 6765 0a5c 7374 6f70  topTEXpage.\stop
0080: 7465 7874 0a text

root@e8d29a32595c:~# context --version
mtx-context | ConTeXt Process Management 1.04
    mtx-context |
mtx-context | main context file: [snip]
mtx-context | current version: 2022.05.11 11:36
mtx-context | main context file: [snip]
mtx-context | current version: 2022.05.11 11:36

ldd "$(type -p luametatex)"
linux-vdso.so.1 (0x7ffdbe9a5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7f4b034d4000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x7f4b034b3000)

libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x7f4b0336f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f4b03196000)
/lib64/ld-linux-x86-64.so.2 (0x7f4b03a55000)

Is this perhaps a weird locale or encoding issue? Maybe try compiling with:

LC_ALL=C.UTF-8 LANG=C.UTF-8 context test.tex

or

LC_ALL=POSIX LANG=POSIX context test.tex

I'm surprised Linux is the one not working here, since it's usually 
Windows that has text encoding issues with its weird hybrid of DOS 
codepages and UTF-16+BOM.


The only other thing that I can think of is a weird library issue with 
your distro, but LuaMetaTeX is statically linked. Not sure what else to 
check here.


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

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


Re: [NTG-context] issue with scite module

2022-06-02 Thread Pablo Rodriguez via ntg-context
On 6/1/22 23:58, Max Chernoff via ntg-context wrote:
>> Now, I still don’t understand LPEG and don’t know if there’s a general
>> “character” class that doesn’t need a list...

Many thanks for your reply, Hraban.

> The easiest way that I found was to just cheat and use everything with
> a TeX catcode 11 ("letters"):
>
>   local name = (R("az","AZ","09") + S("_-.") + 
> lpeg.utfchartabletopattern(characters.csletters))^1

Many thanks for your reply, Max,

I’m afraid I cannot make your proposed fix work.

For the sake of consistency (with buff-imp-xml.lua), I think the patch
should read (also attached to the message to avoid wrong line breaking):

--- scite-context-lexer-xml.lua 2022-06-01 17:24:38.625976000 +0200
+++
context/tex/texmf-context/context/data/scite/context/lexers/scite-context-lexer-xml.lua
2022-06-02 16:37:30.112824947 +0200
@@ -13,7 +13,7 @@
 -- todo: parse entities in attributes

 local global, string, table, lpeg = _G, string, table, lpeg
-local P, R, S, C, Cmt, Cp = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt,
lpeg.Cp
+local P, R, S, C, Cmt, Cp, lpatterns = lpeg.P, lpeg.R, lpeg.S, lpeg.C,
lpeg.Cmt, lpeg.Cp, lpeg.patterns
 local type = type
 local match, find = string.match, string.find

@@ -41,7 +41,8 @@
 local equal= P("=")
 local ampersand= P("&")

-local name = (R("az","AZ","09") + S("_-."))^1
+local alsoname = lpatterns.utf8two + lpatterns.utf8three +
lpatterns.utf8four
+local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1
 local openbegin= P("<")
 local openend  = P("") + P(">")

But I’m afraid I cannot make it work on my computer (Linux64).

On another Win64 computer, both patches worked perfectly fine.

Both machines run LMTX current latest. So I have an issue on my
installation that I have to fix first.

Many thanks for your help,

Pablo
--- scite-context-lexer-xml.lua	2022-06-01 17:24:38.625976000 +0200
+++ context/tex/texmf-context/context/data/scite/context/lexers/scite-context-lexer-xml.lua	2022-06-02 16:37:30.112824947 +0200
@@ -13,7 +13,7 @@
 -- todo: parse entities in attributes
 
 local global, string, table, lpeg = _G, string, table, lpeg
-local P, R, S, C, Cmt, Cp = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt, lpeg.Cp
+local P, R, S, C, Cmt, Cp, lpatterns = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cmt, lpeg.Cp, lpeg.patterns
 local type = type
 local match, find = string.match, string.find
 
@@ -41,7 +41,8 @@
 local equal= P("=")
 local ampersand= P("&")
 
-local name = (R("az","AZ","09") + S("_-."))^1
+local alsoname = lpatterns.utf8two + lpatterns.utf8three + lpatterns.utf8four
+local name = (R("az","AZ","09") + S("_-.") + + alsoname)^1
 local openbegin= P("<")
 local openend  = P("") + P(">")
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] issue with scite module

2022-06-01 Thread Henning Hraban Ramm via ntg-context

Am 01.06.22 um 18:47 schrieb Pablo Rodriguez via ntg-context:

Dear list,

I have the following sample:

   \usemodule[scite]
   \starttext
   \startTEXpage[offset=1ex]
   \type[option=xml]{}
   \type[option=xml]{<áñß/>}
   \stopTEXpage
   \stoptext

Using scite, I don’t get the second element right.

Without scite, both elements are displayed right.

In both Geany and Notepad++ (which use Scintilla internally), the two
elements are displayed right.

Could anyone confirm the issue?


Hi Pablo,

with LMTX version 2022.05.11, both elements are displayed, but the first 
in blue, the second in red. Apparently the scite highlighter doesn’t 
like non-ASCII characters in elements.


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

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


[NTG-context] issue with scite module

2022-06-01 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \usemodule[scite]
  \starttext
  \startTEXpage[offset=1ex]
  \type[option=xml]{}
  \type[option=xml]{<áñß/>}
  \stopTEXpage
  \stoptext

Using scite, I don’t get the second element right.

Without scite, both elements are displayed right.

In both Geany and Notepad++ (which use Scintilla internally), the two
elements are displayed right.

Could anyone confirm the issue?

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


Re: [NTG-context] Callbacks (and nodes) in LuaMetaTeX

2022-05-25 Thread Max Chernoff via ntg-context

Hi list,

I haven't had any luck solving any of the issues from my previous email:

[NTG-context] Callbacks in LuaMetaTeX
https://mailman.ntg.nl/pipermail/ntg-context/2022/105566.html

Admittedly, my problems are fairly obscure (and likely self-inflicted), 
but any suggestions would be greatly appreciated. I've updated my 
ConTeXt installation to the latest version (mkxl 2022.05.11 11:36), but 
this doesn't seem to have changed anything.


Further to the previous email, I have one (semi-related) additional 
question:


6. The LuaTeX manual says that the subtype of "ins" nodes is a number
   corresponding to the insert class. This appears to work correctly.
   The LuaMetaTeX manual says the same thing about "insert" nodes;
   however, the subtype of "insert" nodes appears to always be zero.

   Using this code:

   \startluacode
   local traverse_id = node.traverse_id or node.traverseid
   local insert = node.id"insert" or node.id"ins"

   function test(head)
   for n in traverse_id(insert, head) do
   inspect(n)
   print(n.subtype)
   end

   return head
   end

   nodes.tasks.appendaction("finalizers", "after", "test")
   \stopluacode

   \starttext
   One \footnote{Two} \insert123{Three} Four.
   \stoptext

   In MkIV I get:

  1917 : ins 132>={
["attr"]="",
["cost"]=0,
["depth"]=221327,
["head"]="",
["height"]=790454,
["next"]="nil : ins 123>",
["prev"]="   1842 : hlist 1>",
["subtype"]=132,
["type"]="ins",
   }
   132
   nil : ins 123>={
["attr"]="",
["cost"]=0,
["depth"]=1073741823,
["head"]="",
["height"]=553344,
["prev"]="   1923 : glue 13>",
["subtype"]=123,
["type"]="ins",
   }
   123

   but in MkXL I get:

  3385 : insert 0>={
["attr"]="",
["depth"]=221327,
["height"]=790454,
["id"]="insert",
["list"]="nil : hlist line>",
["next"]="",
   }
   0
   nil : insert 0>={
["attr"]="",
["height"]=553344,
["id"]="insert",
["list"]="nil : hlist line>",
   }
   0

   Is there any way to get an insert's class from its node in MkXL?

Please let me know if you have any ideas for this or any of the earlier 
questions.


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

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


Re: [NTG-context] Issue with interactive checkboxes[solved]

2022-05-24 Thread Jan-Erik Hägglöf via ntg-context
I’ve tested on my Mac OS Monterey 12.3.1 and the same phenomena as firefox it 
also is on google chrome.



> 24 maj 2022 kl. 10:18 skrev Jan-Erik Hägglöf :
> 
> HI Again!
> 
> I discovered what went wrong, such a silly syntax error, here comes a working 
> code:
> 
> \setupinteraction[state=start]
> 
> \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
> \definesymbol[no][]
> 
> \newcount\chk
> \def\checkmark{%
> \global\advance\chk by 1
> \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, 
> corner=round, framecolor=red]%
> \definefield[checkme\the\chk][check][setup1][yes,no][no]%
> \field[checkme\the\chk]%
> }
> 
> \starttext
> 
> \checkmark\
> 
> \checkmark\
> 
> \checkmark\
> 
> \stoptext
> 
> Sorry to bother the list but maybe it is helpful for someone.
> 
> Regards
> 
> /Jan-Erik
> 
>> 24 maj 2022 kl. 08:08 skrev Jan-Erik Hägglöf > <mailto:skrantajanne...@gmail.com>>:
>> 
>> I’ve tried this
>> 
>> \setupinteraction[state=start]
>> 
>> \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
>> \definesymbol[no][]
>> 
>> \newcount\chk
>> \def\chk{%
>> \global \advance \chk by 1
>> \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, 
>> corner=round, framecolor=red]%
>> \definefield[checkme\the\chk][check][setup1][yes,no][no]%
>> \field[checkme\the\chk]%
>> }
>> 
>> \starttext
>> 
>> \chk
>> 
>> \chk
>> 
>> \chk
>> 
>> \stoptext
>> 
>> But it gives the error ” You can’t use \global after \advance”
>> 
>> But this example works fine
>> 
>> \setupinteraction[state=start]
>> 
>> \newcount\clozecount
>> \def\mycloze{%
>>   \global \advance \clozecount by 1
>>   \definefield[uniqcloze\the\clozecount][line]%
>>   \field[uniqcloze\the\clozecount]%
>> }
>> 
>> \starttext
>> 
>> Frogs have four \mycloze\ and two eyes.
>> Frogs have four \mycloze\ and two eyes.
>> Frogs have four \mycloze\ and two eyes.
>> Frogs have four \mycloze\ and two eyes.
>> 
>> \stoptext
>> 
>> From 
>> 
>> https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in
>>  
>> <https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in>
>> 
>>> 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf >> <mailto:skrantajanne...@gmail.com>>:
>>> 
>>> Thank you, unfortunately it has no effect. Even if I make a macro, still it 
>>> is the same field.
>>> 
>>>> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context 
>>>> mailto:ntg-context@ntg.nl>>:
>>>> 
>>>> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
>>>>> HI!
>>>>> 
>>>>> Tried to make a checklist in an interactive document.
>>>>> 
>>>>> The problem seems to be that all checks/uncecks in same click, not each
>>>>> individually.
>>>>> 
>>>>> Is there something wrong with my code?
>>>> 
>>>> Hi Jan-Erik,
>>>> 
>>>> you basically put the same field twice.
>>>> 
>>>> Add something like:
>>>> 
>>>> \definefield [check-you] [check] [setup 3] [yes,no] [no]
>>>> 
>>>> \define\chka{\field[check-you]}
>>>> 
>>>> \chka
>>>> 
>>>> Checks will be different then.
>>>> 
>>>> I hope it helps,
>>>> 
>>>> Pablo
>>>> ___
>>>> If your question is of interest to others as well, please add an entry to 
>>>> the Wiki!
>>>> 
>>>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>>>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>>>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>>>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>>>> http://context.aanhet.net <http://context.aanhet.net/>
>>>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>>>> <https://bitbucket.org/phg/context-mirror/commits/>
>>>> wiki : http://contextgarden.net <http://contextgarden.net/>
>>>> ___
>>> 
>> 
> 

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

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


Re: [NTG-context] Issue with interactive checkboxes[solved]

2022-05-24 Thread Jan-Erik Hägglöf via ntg-context
HI Again!

I discovered what went wrong, such a silly syntax error, here comes a working 
code:

\setupinteraction[state=start]

\definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
\definesymbol[no][]

\newcount\chk
\def\checkmark{%
\global\advance\chk by 1
\setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, 
framecolor=red]%
\definefield[checkme\the\chk][check][setup1][yes,no][no]%
\field[checkme\the\chk]%
}

\starttext

\checkmark\

\checkmark\

\checkmark\

\stoptext

Sorry to bother the list but maybe it is helpful for someone.

Regards

/Jan-Erik

> 24 maj 2022 kl. 08:08 skrev Jan-Erik Hägglöf :
> 
> I’ve tried this
> 
> \setupinteraction[state=start]
> 
> \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
> \definesymbol[no][]
> 
> \newcount\chk
> \def\chk{%
> \global \advance \chk by 1
> \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, 
> corner=round, framecolor=red]%
> \definefield[checkme\the\chk][check][setup1][yes,no][no]%
> \field[checkme\the\chk]%
> }
> 
> \starttext
> 
> \chk
> 
> \chk
> 
> \chk
> 
> \stoptext
> 
> But it gives the error ” You can’t use \global after \advance”
> 
> But this example works fine
> 
> \setupinteraction[state=start]
> 
> \newcount\clozecount
> \def\mycloze{%
>   \global \advance \clozecount by 1
>   \definefield[uniqcloze\the\clozecount][line]%
>   \field[uniqcloze\the\clozecount]%
> }
> 
> \starttext
> 
> Frogs have four \mycloze\ and two eyes.
> Frogs have four \mycloze\ and two eyes.
> Frogs have four \mycloze\ and two eyes.
> Frogs have four \mycloze\ and two eyes.
> 
> \stoptext
> 
> From 
> 
> https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in
>  
> <https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in>
> 
>> 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf > <mailto:skrantajanne...@gmail.com>>:
>> 
>> Thank you, unfortunately it has no effect. Even if I make a macro, still it 
>> is the same field.
>> 
>>> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context 
>>> mailto:ntg-context@ntg.nl>>:
>>> 
>>> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
>>>> HI!
>>>> 
>>>> Tried to make a checklist in an interactive document.
>>>> 
>>>> The problem seems to be that all checks/uncecks in same click, not each
>>>> individually.
>>>> 
>>>> Is there something wrong with my code?
>>> 
>>> Hi Jan-Erik,
>>> 
>>> you basically put the same field twice.
>>> 
>>> Add something like:
>>> 
>>> \definefield [check-you] [check] [setup 3] [yes,no] [no]
>>> 
>>> \define\chka{\field[check-you]}
>>> 
>>> \chka
>>> 
>>> Checks will be different then.
>>> 
>>> I hope it helps,
>>> 
>>> Pablo
>>> ___
>>> If your question is of interest to others as well, please add an entry to 
>>> the Wiki!
>>> 
>>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>>> http://www.ntg.nl/mailman/listinfo/ntg-context 
>>> <http://www.ntg.nl/mailman/listinfo/ntg-context>
>>> webpage  : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / 
>>> http://context.aanhet.net <http://context.aanhet.net/>
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/ 
>>> <https://bitbucket.org/phg/context-mirror/commits/>
>>> wiki : http://contextgarden.net <http://contextgarden.net/>
>>> ___
>> 
> 

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

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


Re: [NTG-context] Issue with interactive checkboxes

2022-05-23 Thread Jan-Erik Hägglöf via ntg-context
I’ve tried this

\setupinteraction[state=start]

\definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}]
\definesymbol[no][]

\newcount\chk
\def\chk{%
\global \advance \chk by 1
\setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, 
framecolor=red]%
\definefield[checkme\the\chk][check][setup1][yes,no][no]%
\field[checkme\the\chk]%
}

\starttext

\chk

\chk

\chk

\stoptext

But it gives the error ” You can’t use \global after \advance”

But this example works fine

\setupinteraction[state=start]

\newcount\clozecount
\def\mycloze{%
  \global \advance \clozecount by 1
  \definefield[uniqcloze\the\clozecount][line]%
  \field[uniqcloze\the\clozecount]%
}

\starttext

Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.
Frogs have four \mycloze\ and two eyes.

\stoptext

From 

https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-in-context-in-a-pdf-that-users-can-type-in

> 24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf :
> 
> Thank you, unfortunately it has no effect. Even if I make a macro, still it 
> is the same field.
> 
>> 23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context 
>> :
>> 
>> On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
>>> HI!
>>> 
>>> Tried to make a checklist in an interactive document.
>>> 
>>> The problem seems to be that all checks/uncecks in same click, not each
>>> individually.
>>> 
>>> Is there something wrong with my code?
>> 
>> Hi Jan-Erik,
>> 
>> you basically put the same field twice.
>> 
>> Add something like:
>> 
>> \definefield [check-you] [check] [setup 3] [yes,no] [no]
>> 
>> \define\chka{\field[check-you]}
>> 
>> \chka
>> 
>> Checks will be different then.
>> 
>> I hope it helps,
>> 
>> Pablo
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / 
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
> 

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

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


[NTG-context] PDF/A-3, XMP and Factur-X

2022-05-18 Thread Henning Hraban Ramm via ntg-context

Hi again,

I’m looking into extending my ConTeXt-made invoices with embedded XML 
data according to the DE/FR Factur-X standard (in Germany also known as 
ZUGFeRD).


Does anyone have some experience with that?

For that, I need PDF/A-3(a) compliant documents – current documentation 
is only on PDF/A-1(a), but that doesn’t seem to be the problem.


Now I’m supposed to put additional information into the XMP metadata.
I found lpdf-xmp.lua; but it seems like I can’t just use

\startluacode
lpdf.addtoinfo("TEST","Hraban was here!")
lpdf.addxmpinfo("UStID","123456")
\stopluacode

Would I need to add my tags to the mapping table of lpdf-xmp.lua?

Or circumvent it after a look at the function concerned:

function lpdf.addxmpinfo(tag,value,check)
local pattern = permitdetail(tag)
if type(pattern) == "string" then
xmlfillin(xmp or valid_xmp(),pattern,value,check)
end
end

If I try to use xml.fillin, I apparently need the name of the current 
xml file, but valid_xmp is a local function. If just use the default...


xml.fillin("lpdf-pdx.xml","metadata","UStID","123456")

... at least I find no traces of that key in the extended metadata 
dialog of Acrobat Pro 9. I also tried different values like "xmp" 
instead of metadata. Clearly I don’t understand what I’m doing here ;)


Is there a check against some schema involved?

It looks like I should include an additional XMP schema for Factur-X 
with the URI "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#", 
prefix "fx". How can I do that?


This is the example from the docs:


INVOICE
factur-x.xml
1.0
EXTENDED


Then I’d use \attachment to include my "factur-x.xml" invoice (that I 
must generate from my Lua invoice code), but that’s a task for another 
day ;)


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

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


Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
I found a way to wrap everything before \startdocument, so I think this
looks like a template more or less:

In case anyone is interested, here's the MWE:

\definenote[address]
\setupnote[address][rule=off,location=text]


\setupnotation[footnote][numberconversion=numerals]

\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote][footnote]
\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]

\newif\ifnoteintitle
\newtoks\titlefootnotes

\titlefootnotes\emptytoks


\def\thanks#1{\noteintitletrue\putjustmark{#1}\doglobal\appendtoks
\putjustnote{#1} \to \titlefootnotes}
\def\email#1{\noteintitletrue\putjustmark{#1}\doglobal\appendtoks
\putjustnote{#1} \to \titlefootnotes}

\def\unskipfunnylines{\ifnoteintitle\endgraf\kern-2\lineheight\fi}


\definenamespace
   [addr]
   [type=module,
name=address,
command=yes,
setup=list,
parent=addr,
  ]

\define[1]\useaddress
{\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}



\setupaddress[style=italic]
\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, City,
Country}]
\defineaddress[thd][name={Name of Third Institute or Affiliation, City,
Country}]

\processcommacommand[fst,snd,thd]\useaddress



\startsetups [document:start]
The Title\dorecurse{10}{\expanded{\thanks{Work supported by fund
\recurselevel.}}}
\endgraf

Me\dorecurse{10}{\expanded{\email{\tt my.name@mailbox.\recurselevel.com
}}\high{,}}\note[address][fst]\high{,}\note[address][snd]\high{,}\note[address][thd]
\endgraf

\placenotes[address]

\blank[medium]
  \startcolumns\hyphenpenalty1000

  \the\titlefootnotes\relax

  \setcounter[footnote][0]

  \unskipfunnylines

\stopsetups

\startsetups [document:stop]
  \stopcolumns
\stopsetups



\startdocument


test\footnote{test}

\input knuth

\input knuth

\input knuth

\input knuth

\stopdocument



On Wed, May 18, 2022 at 10:02 PM Ross  wrote:

> After some visualisations, I found that my token \titlefootnotes will
> ALWAYS generate two lines if there is/are any non-zero number of footnotes
> there. Interesting. So I need a \newif that each time a \thanks or \email
> is invoked, it'll set to true and I'll unskip the 2\lineheight afterwards.
>
> I still don't know why this \kern macro won't have any effect if it's
> inside a token or a \startsetup.
>
> On Wed, May 18, 2022 at 4:56 PM Ross  wrote:
>
>> Hi Massi,
>>
>> You are a champion!
>>
>> On Wed, May 18, 2022 at 4:41 PM mf  wrote:
>>
>>> I hope I got the point now:
>>>
>>> ...
>>> \startcolumns
>>>
>>> \the\titlefootnotes
>>>
>>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>>
>>> test\footnote{test}
>>>
>>> \input knuth
>>>
>>> \stopcolumns
>>> ...
>>>
>>> Massi
>>>
>>> Il 18/05/22 10:07, Ross ha scritto:
>>> > Dear Massi,
>>> >
>>> > Thanks for your solution. But the thing may be related to the
>>> > \appendtoks macro. It doesn't work to put just \setnotetext there.
>>> > \note works fine, so that's the reason I need the "full functional
>>> macro".
>>> >
>>> > Maybe I didn't get the point, so if it's not too much to ask, could
>>> you
>>> > do it on my MWE?
>>> >
>>> > PS: sorry I have to use another email account because my institute
>>> > mailbox took forever to get the message before my government (China)
>>> > finishes auditing it.
>>> >
>>> > Best wishes,
>>> > Zhichu
>>> >
>>> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context >> > <mailto:ntg-context@ntg.nl>> wrote:
>>> >
>>> > Is this what you mean?
>>> >
>>> > \starttext
>>> > Hello\footnotetext{Footnote without mark}.
>>> > \stoptext
>>> >
>>> > Kind regards,
>>> > Massi
>>> >
>>> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
>>> >  > Hi everybody,
>>> >  >
>>> >  >
>>> >  > After some attempts to put footnotes in a mixed 1&2 columns
>>> > layout, I
>>> >  > decide to put marks in the one-column environment and flush them
>>> > when
>>> >  > entering the two-column environment.
>>> >  >
>>> &

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
After some visualisations, I found that my token \titlefootnotes will
ALWAYS generate two lines if there is/are any non-zero number of footnotes
there. Interesting. So I need a \newif that each time a \thanks or \email
is invoked, it'll set to true and I'll unskip the 2\lineheight afterwards.

I still don't know why this \kern macro won't have any effect if it's
inside a token or a \startsetup.

On Wed, May 18, 2022 at 4:56 PM Ross  wrote:

> Hi Massi,
>
> You are a champion!
>
> On Wed, May 18, 2022 at 4:41 PM mf  wrote:
>
>> I hope I got the point now:
>>
>> ...
>> \startcolumns
>>
>> \the\titlefootnotes
>>
>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>
>> test\footnote{test}
>>
>> \input knuth
>>
>> \stopcolumns
>> ...
>>
>> Massi
>>
>> Il 18/05/22 10:07, Ross ha scritto:
>> > Dear Massi,
>> >
>> > Thanks for your solution. But the thing may be related to the
>> > \appendtoks macro. It doesn't work to put just \setnotetext there.
>> > \note works fine, so that's the reason I need the "full functional
>> macro".
>> >
>> > Maybe I didn't get the point, so if it's not too much to ask, could you
>> > do it on my MWE?
>> >
>> > PS: sorry I have to use another email account because my institute
>> > mailbox took forever to get the message before my government (China)
>> > finishes auditing it.
>> >
>> > Best wishes,
>> > Zhichu
>> >
>> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context > > <mailto:ntg-context@ntg.nl>> wrote:
>> >
>> > Is this what you mean?
>> >
>> > \starttext
>> > Hello\footnotetext{Footnote without mark}.
>> > \stoptext
>> >
>> > Kind regards,
>> > Massi
>> >
>> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
>> >  > Hi everybody,
>> >  >
>> >  >
>> >  > After some attempts to put footnotes in a mixed 1&2 columns
>> > layout, I
>> >  > decide to put marks in the one-column environment and flush them
>> > when
>> >  > entering the two-column environment.
>> >  >
>> >  >
>> >  > The code is ugly but the result is acceptable. Except that the
>> > invisible
>> >  > footnote marks do generate something in the main text, so
>> there's a
>> >  > blank line for each footnote.
>> >  >
>> >  >
>> >  > Here's an MWE:
>> >  >
>> >  >
>> >  > =
>> >  >
>> >  > \definenote[address]
>> >  > \setupnote[address][rule=off,location=text]
>> >  >
>> >  >
>> >  >
>> >  > \definenote[putjustmark]
>> >  > \setupnote[putjustmark][location=none]
>> >  > \setupnotation[putjustmark][numberconversion=set 2]
>> >  >
>> >  >
>> >  > \definenote[putjustnote]%[footnote] % if footnotes need to be
>> > grouped,
>> >  > uncomment the second argument and the line after
>> \the\titlefootnotes
>> >  > \setupnote[putjustnote][textcommand=\gobbleoneargument]
>> >  > \setupnotation[putjustnote][numberconversion=set 2]
>> >  >
>> >  >
>> >  > \newtoks\titlefootnotes
>> >  >
>> >  >
>> >  > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
>> >  > \titlefootnotes}
>> >  > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
>> >  > \titlefootnotes}
>> >  >
>> >  >
>> >  > \appendtoks
>> >  >\setcounter[footnote][0] % this looks stupid because it has no
>> > effect
>> >  >%\setupnotation[footnote][numberconversion=numerals]
>> >  > \to \titlefootnotes
>> >  >
>> >  > \definenamespace
>> >  > [addr]
>> >  > [type=module,
>> >  >  name=address,
>> >  >  command=yes,
>> >  >  setup=list,
>> >  >  parent=addr,
>> >  >]
>>

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
Hi Massi,

You are a champion!

On Wed, May 18, 2022 at 4:41 PM mf  wrote:

> I hope I got the point now:
>
> ...
> \startcolumns
>
> \the\titlefootnotes
>
> \kern-\rawcountervalue[address]\lineheight % dirty trick
>
> test\footnote{test}
>
> \input knuth
>
> \stopcolumns
> ...
>
> Massi
>
> Il 18/05/22 10:07, Ross ha scritto:
> > Dear Massi,
> >
> > Thanks for your solution. But the thing may be related to the
> > \appendtoks macro. It doesn't work to put just \setnotetext there.
> > \note works fine, so that's the reason I need the "full functional
> macro".
> >
> > Maybe I didn't get the point, so if it's not too much to ask, could you
> > do it on my MWE?
> >
> > PS: sorry I have to use another email account because my institute
> > mailbox took forever to get the message before my government (China)
> > finishes auditing it.
> >
> > Best wishes,
> > Zhichu
> >
> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context  > <mailto:ntg-context@ntg.nl>> wrote:
> >
> > Is this what you mean?
> >
> > \starttext
> > Hello\footnotetext{Footnote without mark}.
> > \stoptext
> >
> > Kind regards,
> > Massi
> >
> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
> >  > Hi everybody,
> >  >
> >  >
> >  > After some attempts to put footnotes in a mixed 1&2 columns
> > layout, I
> >  > decide to put marks in the one-column environment and flush them
> > when
> >  > entering the two-column environment.
> >  >
> >  >
> >  > The code is ugly but the result is acceptable. Except that the
> > invisible
> >  > footnote marks do generate something in the main text, so there's
> a
> >  > blank line for each footnote.
> >  >
> >  >
> >  > Here's an MWE:
> >  >
> >  >
> >  > =
> >  >
> >  > \definenote[address]
> >  > \setupnote[address][rule=off,location=text]
> >  >
> >  >
> >  >
> >  > \definenote[putjustmark]
> >  > \setupnote[putjustmark][location=none]
> >  > \setupnotation[putjustmark][numberconversion=set 2]
> >  >
> >  >
> >  > \definenote[putjustnote]%[footnote] % if footnotes need to be
> > grouped,
> >  > uncomment the second argument and the line after
> \the\titlefootnotes
> >  > \setupnote[putjustnote][textcommand=\gobbleoneargument]
> >  > \setupnotation[putjustnote][numberconversion=set 2]
> >  >
> >  >
> >  > \newtoks\titlefootnotes
> >  >
> >  >
> >  > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> >  > \titlefootnotes}
> >  > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> >  > \titlefootnotes}
> >  >
> >  >
> >  > \appendtoks
> >  >\setcounter[footnote][0] % this looks stupid because it has no
> > effect
> >  >%\setupnotation[footnote][numberconversion=numerals]
> >  > \to \titlefootnotes
> >  >
> >  > \definenamespace
> >  > [addr]
> >  > [type=module,
> >  >  name=address,
> >  >  command=yes,
> >  >  setup=list,
> >  >  parent=addr,
> >  >]
> >  >
> >  > \define[1]\useaddress
> >  >  {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}
> >  >
> >  >
> >  > \starttext
> >  >
> >  >
> >  >
> >  > \defineaddress[fst][name={Name of Institute or Affiliation, City,
> > Country}]
> >  > \defineaddress[snd][name={Name of Secondary Institute or
> > Affiliation,
> >  > City, Country}]
> >  >
> >  > \processcommacommand[fst,snd]\useaddress
> >  >
> >  >
> >  > The Title\thanks{Work supported by somebody.}
> >  >
> >  >
> > Me\email{myemail@some.where
> }\high{,}\note[address][fst]\high{,}\note[address][snd]
> >
> >  >
> >  >
> >  >
> >  > \placenotes[address]
&

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
Dear Massi,

Thanks for your solution. But the thing may be related to the \appendtoks
macro. It doesn't work to put just \setnotetext there.
\note works fine, so that's the reason I need the "full functional macro".

Maybe I didn't get the point, so if it's not too much to ask, could you do
it on my MWE?

PS: sorry I have to use another email account because my institute mailbox
took forever to get the message before my government (China) finishes
auditing it.

Best wishes,
Zhichu

On Wed, May 18, 2022 at 3:36 PM mf via ntg-context 
wrote:

> Is this what you mean?
>
> \starttext
> Hello\footnotetext{Footnote without mark}.
> \stoptext
>
> Kind regards,
> Massi
>
> Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
> > Hi everybody,
> >
> >
> > After some attempts to put footnotes in a mixed 1&2 columns layout, I
> > decide to put marks in the one-column environment and flush them when
> > entering the two-column environment.
> >
> >
> > The code is ugly but the result is acceptable. Except that the invisible
> > footnote marks do generate something in the main text, so there's a
> > blank line for each footnote.
> >
> >
> > Here's an MWE:
> >
> >
> > =
> >
> > \definenote[address]
> > \setupnote[address][rule=off,location=text]
> >
> >
> >
> > \definenote[putjustmark]
> > \setupnote[putjustmark][location=none]
> > \setupnotation[putjustmark][numberconversion=set 2]
> >
> >
> > \definenote[putjustnote]%[footnote] % if footnotes need to be grouped,
> > uncomment the second argument and the line after \the\titlefootnotes
> > \setupnote[putjustnote][textcommand=\gobbleoneargument]
> > \setupnotation[putjustnote][numberconversion=set 2]
> >
> >
> > \newtoks\titlefootnotes
> >
> >
> > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> > \titlefootnotes}
> > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> > \titlefootnotes}
> >
> >
> > \appendtoks
> >\setcounter[footnote][0] % this looks stupid because it has no effect
> >%\setupnotation[footnote][numberconversion=numerals]
> > \to \titlefootnotes
> >
> > \definenamespace
> > [addr]
> > [type=module,
> >  name=address,
> >  command=yes,
> >  setup=list,
> >  parent=addr,
> >]
> >
> > \define[1]\useaddress
> >  {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}
> >
> >
> > \starttext
> >
> >
> >
> > \defineaddress[fst][name={Name of Institute or Affiliation, City,
> Country}]
> > \defineaddress[snd][name={Name of Secondary Institute or Affiliation,
> > City, Country}]
> >
> > \processcommacommand[fst,snd]\useaddress
> >
> >
> > The Title\thanks{Work supported by somebody.}
> >
> > Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd]
>
> >
> >
> >
> > \placenotes[address]
> >
> > \blank[medium]
> >
> > \startcolumns
> >
> >
> > \the\titlefootnotes
> >
> > %\setcounter[footnote][0] % why it's necessary to set the counter
> > outside the token if I define [putjustnote] as [footnote]?
> >
> >
> > test\footnote{test}
> >
> > \input knuth
> >
> >
> >
> > \stopcolumns
> >
> > \stoptext
> >
> > =
> >
> >
> ___
>
> >
> > If your question is of interest to others as well, please add an entry
> > to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> ___
>
> >
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


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

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


Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread mf via ntg-context

Is this what you mean?

\starttext
Hello\footnotetext{Footnote without mark}.
\stoptext

Kind regards,
Massi

Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:

Hi everybody,


After some attempts to put footnotes in a mixed 1&2 columns layout, I 
decide to put marks in the one-column environment and flush them when 
entering the two-column environment.



The code is ugly but the result is acceptable. Except that the invisible 
footnote marks do generate something in the main text, so there's a 
blank line for each footnote.



Here's an MWE:


=

\definenote[address]
\setupnote[address][rule=off,location=text]



\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote]%[footnote] % if footnotes need to be grouped, 
uncomment the second argument and the line after \the\titlefootnotes

\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]


\newtoks\titlefootnotes


\def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}
\def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}



\appendtoks
   \setcounter[footnote][0] % this looks stupid because it has no effect
   %\setupnotation[footnote][numberconversion=numerals]
\to \titlefootnotes

\definenamespace
    [addr]
    [type=module,
     name=address,
     command=yes,
     setup=list,
     parent=addr,
   ]

\define[1]\useaddress
     {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}


\starttext



\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, 
City, Country}]


\processcommacommand[fst,snd]\useaddress


The Title\thanks{Work supported by somebody.}

Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd] 




\placenotes[address]

\blank[medium]

\startcolumns


\the\titlefootnotes

%\setcounter[footnote][0] % why it's necessary to set the counter 
outside the token if I define [putjustnote] as [footnote]?



test\footnote{test}

\input knuth



\stopcolumns

\stoptext

=

___ 

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


maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context

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


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

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


[NTG-context] Can I just put a footnote without marking in the main text?

2022-05-17 Thread Zhichu Chen via ntg-context

Hi everybody,


After some attempts to put footnotes in a mixed 1&2 columns layout, I 
decide to put marks in the one-column environment and flush them when 
entering the two-column environment.



The code is ugly but the result is acceptable. Except that the invisible 
footnote marks do generate something in the main text, so there's a 
blank line for each footnote.



Here's an MWE:


=

\definenote[address]
\setupnote[address][rule=off,location=text]



\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote]%[footnote] % if footnotes need to be grouped, 
uncomment the second argument and the line after \the\titlefootnotes

\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]


\newtoks\titlefootnotes


\def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}
\def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to 
\titlefootnotes}



\appendtoks
  \setcounter[footnote][0] % this looks stupid because it has no effect
  %\setupnotation[footnote][numberconversion=numerals]
\to \titlefootnotes

\definenamespace
   [addr]
   [type=module,
    name=address,
    command=yes,
    setup=list,
    parent=addr,
  ]

\define[1]\useaddress
    {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}


\starttext



\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, 
City, Country}]


\processcommacommand[fst,snd]\useaddress


The Title\thanks{Work supported by somebody.}

Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd] 




\placenotes[address]

\blank[medium]

\startcolumns


\the\titlefootnotes

%\setcounter[footnote][0] % why it's necessary to set the counter 
outside the token if I define [putjustnote] as [footnote]?



test\footnote{test}

\input knuth



\stopcolumns

\stoptext

=

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

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


Re: [NTG-context] List of publications…

2022-05-17 Thread śrīrāma via ntg-context
On 5/18/22 12:02 AM Damien Thiriet via ntg-context wrote:
> Unfortunately, commenting out all occurrences of those two lines
> didn't make the job for me.
> And using lowercase characters is unfortunately a no-op as far as
> I'm concerned: my bib files have been filled with CamelCase for years,
> and are loaded by dozens of other files…
> 
> is there something I missed?
> current version: 2022.05.02 16:19

That's strange: I have LMTX 2022.05.11 11:36 and have no issues with this 
'patch'. I too have thousands of references across documents, so could not 
convert the tags to lowercase, and this patch works for me. 
I am attaching a diff here. I hope you made the format (context --make) after 
applying the changes.

  Sreeram--- publ-ini-1.lua	2022-05-04 08:07:01.410444702 +0530
+++ publ-ini.lua	2022-04-24 09:28:56.499009761 +0530
@@ -22,7 +22,7 @@
 -- gain is not that large anyway because not much publication stuff is flushed.
 
 local next, rawget, type, tostring, tonumber = next, rawget, type, tostring, tonumber
-local match, find, gsub, lower = string.match, string.find, string.gsub, string.lower
+local match, find, gsub = string.match, string.find, string.gsub
 local concat, sort, tohash = table.concat, table.sort, table.tohash
 local mod = math.mod
 local formatters = string.formatters
@@ -1316,12 +1316,6 @@
 local typesetters= { }
 publications.typesetters = typesetters
 
-local lowered = setmetatableindex(function(t,k)
-k = lower(k)
-t[k] = k
-return k
-end)
-
 local function defaulttypesetter(field,value,manipulator)
 if value and value ~= "" then
 value = tostring(value)
@@ -1428,8 +1422,6 @@
 local function get(dataset,tag,field,what,check,catspec) -- somewhat more extensive
 local current = rawget(datasets,dataset)
 if current then
-tag   = lowered[tag]
-field = lowered[field]
 local data = current.luadata[tag]
 if data then
 local category = data.category
@@ -1479,8 +1471,6 @@
 local function btxflush(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
 local manipulator, field = splitmanipulation(field)
@@ -1507,8 +1497,6 @@
 local function btxfield(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
 local category = fields.category
@@ -1534,8 +1522,6 @@
 local function btxdetail(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
 local details = dataset.details[tag]
@@ -1566,11 +1552,8 @@
 local function btxdirect(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
-field = lowered[field]
 local manipulator, field = splitmanipulation(field)
 local value = fields[field]
 if value then
@@ -1589,8 +1572,6 @@
 local function okay(name,tag,field)
 local dataset = rawget(datasets,name)
 if dataset then
-tag   = lowered[tag]
-field = lowered[field]
 local fields = dataset.luadata[tag]
 if fields then
 local category = fields.category
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] issue with two recently added PDF manuals

2022-05-15 Thread Günter Kolousek via ntg-context


Same here!

❯ qpdfview onandon.pdf 
documents/general/manuals

"Error: Couldn't find trailer dictionary"
"Error: Couldn't find trailer dictionary"
"Error: Couldn't read xref table"
❯


❯ qpdfview columnsets.pdf 
documents/general/manuals

"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
"Error (4194333): Illegal character '}'"
"Error (4194339): Illegal character '>'"
"Error: Kid object (page 38) is wrong type (null)"
No page 43 was found in document at "columnsets.pdf"
❯


Pablo Rodriguez via ntg-context @ 2022-05-15 10:36 +02:


Dear list,

I’m experiencing issues to open the following documents added in 
one of

the recent latests.

Now I’m on Linux 64bit with current latest (2022.05.11 11:36) 
and

mupdf-gl-1.20.0.rc1.

  $ mupdf-gl onandon.pdf
  error: cannot find startxref
  warning: trying to repair broken xref
  warning: repairing PDF document
  warning: object missing 'endobj' token
  error: cannot find page tree

  $ mupdf-gl columnsets.pdf
  error: expected object number
  warning: repairing PDF document
  error: object is not a stream
  warning: cannot load object (730 0 R) into cache
  error: cannot find XObject resource 'Im92'
  error: cannot find XObject resource 'Im93'
  error: cannot find XObject resource 'Im94'
  error: cannot find XObject resource 'Im95'
  error: cannot find XObject resource 'Im92'
  error: cannot find XObject resource 'Im93'
  error: cannot find XObject resource 'Im94'
  error: cannot find XObject resource 'Im95'
  warning: non-page object in page tree ()
  warning: ... repeated 11 times...
  warning: content stream is not a stream (1045 0 R)
  warning: ... repeated 2 times...
  warning: non-page object in page tree ()
  warning: ... repeated 2 times...
  warning: content stream is not a stream (1048 0 R)
  warning: ... repeated 2 times...
  warning: non-page object in page tree ()
  warning: ... repeated 2 times...
  warning: content stream is not a stream (1055 0 R)
  warning: ... repeated 2 times...
  warning: non-page object in page tree ()
  warning: ... repeated 6 times...

Latest Acrobat Reader DC in Windows isn’t able to open 
onandon.pdf and

it has problems to display all contents from columnsets.pdf.

Would anyone be so kind to confirm the issue?
___
If your question is of interest to others as well, please add an 
entry to the Wiki!


maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context

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

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

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


Re: [NTG-context] Table breaks incorrectly between pages

2022-05-15 Thread Bruce Horrocks via ntg-context
Too slow!!

I'd already added https://wiki.contextgarden.net/TABLE#Tables_in_page_headers.

> On 15 May 2022, at 12:00, śrīrāma via ntg-context  wrote:
> 
> On 5/15/22 2:20 PM Wolfgang Schuster via ntg-context wrote:
>> Use the TABLEnested environment in your document header which was added
>> to avoid problems like in your example.
>> 
>> \startsetups headertext
>> \bTABLEnested[setups=headertable,option=stretch]
>> ...
>> \eTABLEnested
>> \stopsetups
> 
> Splendid (as always)! Definitely a better solution for Stefan's document.
> 
> I added a section in the wiki making a note of this:
>  https://wiki.contextgarden.net/TABLE#Headers_with_TABLEs
> 
> Thanks Wolfgang! Until now, I did not even know of the 'nested' type for 
> TABLE.
> 
>  Sreeram
> 

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


Re: [NTG-context] Table breaks incorrectly between pages

2022-05-15 Thread śrīrāma via ntg-context
On 5/15/22 2:20 PM Wolfgang Schuster via ntg-context wrote:
> Use the TABLEnested environment in your document header which was added
> to avoid problems like in your example.
> 
> \startsetups headertext
> \bTABLEnested[setups=headertable,option=stretch]
> ...
> \eTABLEnested
> \stopsetups

Splendid (as always)! Definitely a better solution for Stefan's document.

I added a section in the wiki making a note of this:
  https://wiki.contextgarden.net/TABLE#Headers_with_TABLEs

Thanks Wolfgang! Until now, I did not even know of the 'nested' type for 
TABLE.

  Sreeram


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

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


Re: [NTG-context] Custom type-imp file creating empty lines

2022-05-11 Thread Alexandre Christe via ntg-context
Hi Pablo,

Thank you so much. That was indeed the issue!

Le mer. 11 mai 2022 à 19:14, Pablo Rodriguez via ntg-context <
ntg-context@ntg.nl> a écrit :

> On 5/11/22 18:42, Alexandre Christe via ntg-context wrote:
> > Dear list,
> >
> > I've played a bit with a custom type-imp file (partly inspired from the
> > wiki https://wiki.contextgarden.net/Alegreya_Typescript
> > <https://wiki.contextgarden.net/Alegreya_Typescript>). However, the file
> > I ended up with seems to create some empty lines at the beginning of the
> > document (if I use the default or another font this vanishes, so it
> > really comes from that file). Could anyone enlighten me?
>
> Hi Alex,
>
> you added an extra option group here:
>
>   \definefallbackfamily [alegreya] [math] [Alegreya]
> [superscriptsandsubscripts] [force=yes]
>
> I think this may read:
>
>   \definefallbackfamily [alegreya] [math] [Alegreya]
> [range=superscriptsandsubscripts, force=yes]
>
> 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 /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Custom type-imp file creating empty lines

2022-05-11 Thread Pablo Rodriguez via ntg-context
On 5/11/22 18:42, Alexandre Christe via ntg-context wrote:
> Dear list,
>
> I've played a bit with a custom type-imp file (partly inspired from the
> wiki https://wiki.contextgarden.net/Alegreya_Typescript
> <https://wiki.contextgarden.net/Alegreya_Typescript>). However, the file
> I ended up with seems to create some empty lines at the beginning of the
> document (if I use the default or another font this vanishes, so it
> really comes from that file). Could anyone enlighten me?

Hi Alex,

you added an extra option group here:

  \definefallbackfamily [alegreya] [math] [Alegreya]
[superscriptsandsubscripts] [force=yes]

I think this may read:

  \definefallbackfamily [alegreya] [math] [Alegreya]
[range=superscriptsandsubscripts, force=yes]

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


[NTG-context] Custom type-imp file creating empty lines

2022-05-11 Thread Alexandre Christe via ntg-context
Dear list,

I've played a bit with a custom type-imp file (partly inspired from the
wiki https://wiki.contextgarden.net/Alegreya_Typescript). However, the file
I ended up with seems to create some empty lines at the beginning of the
document (if I use the default or another font this vanishes, so it really
comes from that file). Could anyone enlighten me?

The file is attached.

BR,
Alex


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


[NTG-context] \placenotes ends up in wrong place when mixing one- and two- column layouts.

2022-05-10 Thread Zhichu Chen via ntg-context

Thanks Hans, works perfectly.


Sorry for the late reply. Still working on the template and got another 
one. Again, sorry.



The journal is in two-column form and the title, authors, and addresses 
are spanned to


the full width. Very common. But the title may acknowledge to some 
fund(s) and the


authors may have email addresses. If I use \note[thanks] and 
\note[email] to do that,


only the markers are shown. That's expected. So I tried to put 
\postponenotes before


the title and insert\placenotes[thanks] and \placenotes[email] after 
\startcolumns. The


notes did show up but in wrong position.


I hope there's another magic switch, or I have to put the marks in the 
title head and


put "real" but invisible notes in the two-column texts.



Thanks again, Hans.


Yours,

Zhichu


MWE (not that minimal):

===

\definenote[address]
\setupnote[address][rule=off,location=text]

\definenote[thanks]
\setupnote[thanks][location=firstcolumn]
\setupnotation[thanks][numberconversion=set 2]
\definenote[email][thanks]


\definenamespace
   [addr]
   [type=module,
    name=address,
    command=yes,
    setup=list,
    parent=addr,
  ]

\define[1]\useaddress
    {\edef\currentaddress{#1}%
 {\setnotetext[address][#1]{\addressparameter{name}}}%
    \endgraf
    }

\starttext


\setupaddress[style=italic]
\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, 
City, Country}]


\processcommacommand[fst,snd]\useaddress

\postponenotes

The Title\thanks{Work supported by somebody.}

%\startlocalnotes[address]
Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd]
%\placelocalnotes[address]
%\stoplocalnotes

\placenotes[address]

\startcolumns

\placenotes[thanks]
\placenotes[email]


\input knuth
\stopcolumns

\stoptext

===


On 5/8/22 17:20, Hans Hagen via ntg-context wrote:

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

Hi,

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


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

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

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

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

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

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

\starttext

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


    \setuphead[chapter][textstyle=\WORD]

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

\stoptext

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

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


maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context

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


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

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


Re: [NTG-context] how to choose a font variant "book" / LMTX

2022-05-04 Thread Heinrich Paeßens via ntg-context
Yes … that is embarrassing simple … and actually I do not need anything else 
(since no other family is involved)

Many thanks Mikael

Best regards,
Heinrich

> On 4. May 2022, at 19:16, Mikael Sundqvist via ntg-context 
>  wrote:
> 
> On Wed, May 4, 2022 at 6:44 PM Heinrich Paeßens via ntg-context
>  wrote:
>> 
>> Hi there
>> I have a quick question:
>> 
>> I was successful to install and use a new font in LMTX (New Computer 
>> Modern). All good except that I’d like to use the »Book« variant instead of 
>> the »Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). Trying many 
>> ways but the right one.
>> 
>> please advise,
>> can I define something similar like \bf for bold — maybe \bk for book?
>> 
>> … all I get is
>> 
>> hp@mbp16 ~ % pdffonts page1.pdf
>> name type  encoding emb 
>> sub uni object ID
>> ---- -  --- 
>> --- --- -
>> CRBMBE+NewCM10-Regular   CID Type 0C   Identity-H   yes 
>> yes yes  1  0
>> 
>> my definitions are:
>> 
>> \definefontfamily [newCM] [rm] [newcomputermodern10]
>> \definefontfamily [newCM] [ss] [newcomputermodernsans10]
>> \definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
>> features=none]
>> \definefontfamily [newCM] [mm] [newcomputermodernmath]
>> \setupbodyfont[newCM, rm, 10pt]
>> 
>> Many thanks
>> Heinrich
> 
> Hi!
> 
> \setupbodyfont[newcomputermodern-book,10pt]
> 
> works here.
> 
> /Mikael
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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


Re: [NTG-context] how to choose a font variant "book" / LMTX

2022-05-04 Thread Mikael Sundqvist via ntg-context
On Wed, May 4, 2022 at 6:44 PM Heinrich Paeßens via ntg-context
 wrote:
>
> Hi there
> I have a quick question:
>
> I was successful to install and use a new font in LMTX (New Computer Modern). 
> All good except that I’d like to use the »Book« variant instead of the 
> »Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). Trying many ways 
> but the right one.
>
> please advise,
> can I define something similar like \bf for bold — maybe \bk for book?
>
> … all I get is
>
> hp@mbp16 ~ % pdffonts page1.pdf
> name type  encoding emb 
> sub uni object ID
>  -  --- 
> --- --- -
> CRBMBE+NewCM10-Regular   CID Type 0C   Identity-H   yes 
> yes yes  1  0
>
> my definitions are:
>
> \definefontfamily [newCM] [rm] [newcomputermodern10]
> \definefontfamily [newCM] [ss] [newcomputermodernsans10]
> \definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
> features=none]
> \definefontfamily [newCM] [mm] [newcomputermodernmath]
> \setupbodyfont[newCM, rm, 10pt]
>
> Many thanks
> Heinrich

Hi!

\setupbodyfont[newcomputermodern-book,10pt]

works here.

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

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


Re: [NTG-context] how to choose a font variant "book" / LMTX

2022-05-04 Thread Heinrich Paeßens via ntg-context
'both' would be the way to go, how can I set this up?

I don’t use typescripts just the definefontfamily and I suppose the book 
variant belongs to the family but is maybe an unloved relative ...

> On 4. May 2022, at 18:51, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Do I understand correctly that you want the "Book" variant as regular? Or do 
> you need both?
> 
> Have a look into typescripts, e.g. 
> https://wiki.contextgarden.net/Alegreya_Typescript
> You probably won’t need the features.
> 
> Hraban
> 
> Am 04.05.22 um 18:44 schrieb Heinrich Paeßens via ntg-context:
>> Hi there
>> I have a quick question:
>> I was successful to install and use a new font in LMTX (New Computer 
>> Modern). All good except that I’d like to use the »Book« variant instead of 
>> the »Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). Trying many 
>> ways but the right one.
>> please advise,
>> can I define something similar like \bf for bold — maybe \bk for book?
>> … all I get is
>> hp@mbp16 ~ % pdffonts page1.pdf
>> name type  encoding emb 
>> sub uni object ID
>> ---- -  --- 
>> --- --- -
>> CRBMBE+NewCM10-Regular   CID Type 0C   Identity-H   yes 
>> yes yes  1  0
>> my definitions are:
>> \definefontfamily [newCM] [rm] [newcomputermodern10]
>> \definefontfamily [newCM] [ss] [newcomputermodernsans10]
>> \definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
>> features=none]
>> \definefontfamily [newCM] [mm] [newcomputermodernmath]
>> \setupbodyfont[newCM, rm, 10pt]
>> Many thanks
>> Heinrich
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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


Re: [NTG-context] how to choose a font variant "book" / LMTX

2022-05-04 Thread Henning Hraban Ramm via ntg-context
Do I understand correctly that you want the "Book" variant as regular? 
Or do you need both?


Have a look into typescripts, e.g. 
https://wiki.contextgarden.net/Alegreya_Typescript

You probably won’t need the features.

Hraban

Am 04.05.22 um 18:44 schrieb Heinrich Paeßens via ntg-context:

Hi there
I have a quick question:

I was successful to install and use a new font in LMTX (New Computer 
Modern). All good except that I’d like to use the »Book« variant instead 
of the »Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). 
Trying many ways but the right one.


please advise,
can I define something similar like \bf for bold — maybe \bk for book?

… all I get is

hp@mbp16 ~ % pdffonts page1.pdf
name                                 type              encoding 
emb sub uni object ID
 -  
--- --- --- -
CRBMBE+NewCM10-Regular               CID Type 0C       Identity-H   
yes yes yes      1  0


my definitions are:

\definefontfamily [newCM] [rm] [newcomputermodern10]
\definefontfamily [newCM] [ss] [newcomputermodernsans10]
\definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
features=none]

\definefontfamily [newCM] [mm] [newcomputermodernmath]
\setupbodyfont[newCM, rm, 10pt]

Many thanks
Heinrich

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

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


[NTG-context] how to choose a font variant "book" / LMTX

2022-05-04 Thread Heinrich Paeßens via ntg-context
Hi there 
I have a quick question: 

I was successful to install and use a new font in LMTX (New Computer Modern). 
All good except that I’d like to use the »Book« variant instead of the 
»Regular« variant (NewCM10-Book.otf vs NewCM10-Regular.otf). Trying many ways 
but the right one. 

please advise, 
can I define something similar like \bf for bold — maybe \bk for book?

… all I get is

hp@mbp16 ~ % pdffonts page1.pdf 
name type  encoding emb sub 
uni object ID
 -  --- --- 
--- -
CRBMBE+NewCM10-Regular   CID Type 0C   Identity-H   yes yes 
yes  1  0

my definitions are:

\definefontfamily [newCM] [rm] [newcomputermodern10]
\definefontfamily [newCM] [ss] [newcomputermodernsans10]
\definefontfamily [newCM] [tt] [newcomputermodernmono10] [scale=0.85, 
features=none]
\definefontfamily [newCM] [mm] [newcomputermodernmath]
\setupbodyfont[newCM, rm, 10pt]

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

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


[NTG-context] Issue in btx rendering

2022-05-04 Thread śrīrāma via ntg-context
Hi,

[my current version: 2022.05.02 16:19]
With the past two-or-so uploads, btx output seems to be broken in some cases. 
Compiling the below example

  \usebtxdataset[refs.bib]
  \usebtxdefinitions[aps]

  \starttext
  This reference has a tag which is in camel-case:
  \cite[Nielsen2011_ChernoffInformationExponentialFamilies]

  On the other hand this reference has a tag which is lower-case:
  \cite[vaart1998_asymptoticstatistics]

  \placelistofpublications
  \stoptext

along with the bibtex file (refs.bib attached here), only the second citation 
entry has a properly rendered bibliography entry while the first one does not. 
Notably, any bibtex entries whose tags are not all lowercase (ASCII) are not 
rendered correctly. Instead, in the log I get

publications > unknown tag 'nielsen2011_chernoffinformationexponentialfamilies' 
in dataset 'default'

Almost all my entries in bib files are in camel-case since I find that to be 
easier to read and it gives me a better clue of what the item is. With some 
recent uploads I noticed that in publ-ini.lua 'tag' and 'field' entries were 
string.lowered(). Upon removing those statements, I am able to get the proper 
output.

I also have certain bib files where the entries are not at all in ASCII (so I 
am not sure what the code might do there, I did not check in detail). I hope I 
can continue to use camel case for the tags (if its not too much to ask): is 
there some additional setting that I should change to allow this so that the 
output is rendered correctly?

Thanks,
  Sreeram@article{Nielsen2013_InformationGeometricCharacterizationChernoff,
	author= {Nielsen, Frank},
	doi   = {10.1109/LSP.2013.2243726},
	issn  = {1070-9908},
	journal   = {IEEE Signal Processing Letters},
	localfile = {Nielsen2013_InformationGeometricCharacterizationChernoff.pdf},
	month = {March},
	number= {3},
	pages = {269--272},
	title = {An Information-Geometric Characterization of Chernoff Information},
	volume= {20},
	year  = {2013},
}

@article{Nielsen2011_ChernoffInformationExponentialFamilies,
	author= {Nielsen, Frank},
	journal   = {CoRR},
	localfile = {Nielsen2011_ChernoffInformationExponentialFamilies.pdf},
	title = {Chernoff information of exponential families},
	url   = {http://arxiv.org/abs/1102.2684; https://dblp.org/rec/bib/journals/corr/abs-1102-2684},
	volume= {abs/1102.2684},
	year  = {2011},
}

@book{vaart1998_asymptoticstatistics,
	author = {Vaart, A. W. van der},
	collection = {Cambridge Series in Statistical and Probabilistic Mathematics},
	doi= {10.1017/CBO9780511802256},
	localfile  = {Vaart1998_AsymptoticStatistics.pdf},
	place  = {Cambridge},
	publisher  = {Cambridge University Press},
	series = {Cambridge Series in Statistical and Probabilistic Mathematics},
	title  = {Asymptotic Statistics},
	year   = {1998},
}

@article{Muller1997_IntegralProbabilityMetricsGeneratingClass,
	author  = {M{\"u}ller, Alfred},
	doi = {10.2307/1428011},
	issn= {0001-8678, 1475-6064},
	journal = {Advances in Applied Probability},
	month   = {Jun},
	number  = {2},
	pages   = {429--443},
	title   = {Integral Probability Metrics and Their Generating Classes of Functions},
	url = {https://www.cambridge.org/core/product/identifier/S000186780002807X/type/journal_article},
	volume  = {29},
	year= {1997},
}
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] process list items differently depending on position in list

2022-05-02 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Hans Hagen
> via ntg-context
> Gesendet: Montag, 2. Mai 2022 12:34
> An: Denis Maier via ntg-context 
> Cc: Hans Hagen 
> Betreff: Re: [NTG-context] process list items differently depending on
> position in list
> 
> On 5/2/2022 12:09 PM, Denis Maier via ntg-context wrote:
> 
> > But, it’d still love to hear whether there is a solution on the tex side.
> \processtokens {[before]} {[between]} {[after]} {[space]} {{one}{two}{three}}
> 
> \def\whatever{a,b,c,d}
> 
> \getcommacommandsize[\whatever]
> \scratchcounterone \zerocount
> \scratchcountertwo \commalistsize
> 
> \processcommacommand[\whatever]
>{\advance\scratchcounterone\plusone
> \ifnum\scratchcounterone=\scratchcountertwo
>   \space and\space
> \orelse\ifnum\scratchcounterone>\plusone
>   ,\space
> \fi
> \commalistelement}

Thanks.

> 
> but ... there's also:
> 
> \startlines
> \commalistsentence[aap,noot,mies]
> \commalistsentence[aap,noot]
> \commalistsentence[aap]
> \commalistsentence[a,b,c]
> \commalistsentence[a,b,c][{ \& },{ and }] \commalistsentence[a,b,c][+,-]
> \stoplines
> 
> which uses presets like
> 
> \setuplabeltext [nl] [and-1={{, }}, and-2={{ en }}]   % 1, 2 en 3
> \setuplabeltext [en] [and-1={{, }}, and-2={{, }}] % 1, 2, 3
> \setuplabeltext [de] [and-1={{, }}, and-2={{ und }}]  % 1, 2 und 3
> \setuplabeltext [hr] [and-1={{, }}, and-2={{ i }}]% 1, 2 i 3
> 
> maybe wikify

I've just checked, \commalistsentence is already on the wiki, but you have to 
know it exists. (I'll check whether I can link to that page from somewhere.)

But there's no (high-level) way to apply certain commands to this list 
elements, right? 
Background: My real use case is a bit more complex. I use comma separated lists 
to store author lists, but the authors themselves are saved in structured 
variables. So, I'll need to reassemble the different name parts first.
So, nothing like 
\commalistprocessandmakesentence[a,b,c]\commandforfirst\commandforinbetween\commandforlast
Probably to specific, right?


\startbuffer[test]


This is the title

Doe
John


Smith
Jane

This is a first sentence

\stopbuffer

\startxmlsetups xml:setup
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{document|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:setup}

\startxmlsetups xml:document
  \xmlfilter{#1}{/title/command(xml:title)}
  \xmlfilter{#1}{/author/command(xml:author)}
  \startdocument
  \xmlflush{#1}
  \stopdocument
\stopxmlsetups

\startxmlsetups xml:title
  \setupdocument[title={\xmlflush{#1}},author={\AuthorList}]
\stopxmlsetups

\startxmlsetups xml:author:family-name
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:author:given-name
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:author
  
\defineauthor[\xmlfilter{#1}{/family-name/command(xml:author:family-name)}\xmlfilter{#1}{/given-name/command(xml:author:given-name)}][family-name={\xmlfilter{#1}{/family-name/command(xml:author:family-name)}},given-name={\xmlfilter{#1}{/given-name/command(xml:author:given-name)}}]
  \addtocommalist 
{\xmlfilter{#1}{/family-name/command(xml:author:family-name)}\xmlfilter{#1}{/given-name/command(xml:author:given-name)}}
 \AuthorList
\stopxmlsetups

\startxmlsetups xml:p
  \xmlflush{#1}\par
\stopxmlsetups

\definenamespace
   [documentauthor] % name of internal varialbles
   [type=module,
name=author, 
command=yes, % Create \defineauthor
style=yes, % Create \useauthorstyleandcolor 
setup=list, % Create \setupauthor
parent=documentauthor,
  ]
  
\def\AuthorList{}

\define[1]\useauthor
{\edef\currentauthor{#1}%
{\authorparameter{given-name}
 \space
  \authorparameter{family-name}}}

\startsetups document:start
\documentvariable{title}\endgraf
\blank[medium]
\processcommacommand[\documentvariable{author}]\useauthor
\endgraf
\stopsetups

\xmlprocessbuffer{main}{test}{}




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

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


Re: [NTG-context] context module t-account in LMTX

2022-04-28 Thread Heinrich Paeßens via ntg-context
Many thanks Wolfgang, I can see the 'values' in a table like form, nothing but the values — how can I switch on the 'lines' of the table?Best regards, HeinrichI took your file t-taccount.mkxland——% !TEX program = lmtx\usemodule[t][taccount]\startTEXpage[offset=5pt]\starttaccount[title=Bilanz,lefttext=Aktiva,righttext=Passiva]    \startdebits        \debit{Gebäude}  {1.800}        \debit{Maschinen}{1.200}        \debit{Fuhrpark}   {500}        \debit{Rohstoffe}  {100}        \debittotal      {3.600}    \stopdebits    \startcredits        \credit{Eigenkapital}{1.400}        \credit{Schulden}    {2.200}        \credittotal         {3.600}    \stopcredits\stoptaccount\stopTEXpage——

tst-taccount.pdf
Description: Adobe PDF document
the log——resolvers       | formats | executing runner 'run luametatex format': /Users/hp/Library/context-osx-64/tex/texmf-osx-64/bin/luametatex --jobname="./tst-taccount.tex" --fmt=/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui  --c:autopdf --c:currentrun=1 --c:directives="system.showerror" --c:fulljobname="./tst-taccount.tex" --c:input="./tst-taccount.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall --c:texmfbinpath="/Users/hp/Library/context-osx-64/tex/texmf-osx-64/bin"system          > system          > ConTeXt  ver: 2022.04.15 20:20 LMTX  fmt: 2022.4.17  int: english/englishsystem          > system          > 'cont-new.mkxl' loadedopen source     > level 1, order 1, name '/Users/hp/Library/context-osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'system          > beware: some patches loaded from cont-new.mkivclose source    > level 1, order 1, name '/Users/hp/Library/context-osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'system          > files > jobname './tst-taccount', input './tst-taccount.tex', result './tst-taccount'fonts           > latin modern fonts are not preloadedlanguages       > language 'en' is activeopen source     > level 1, order 2, name './tst-taccount.tex'modules         > 'taccount' is loadedopen source     > level 2, order 3, name 't-taccount.mkxl'loading         > Context User Module / Miscellaneousclose source    > level 2, order 3, name 't-taccount.mkxl'system          > auto \starttext ... \stoptextfonts           > preloading latin modern fonts (second stage)fonts           > 'fallback modern-designsize rm 12pt' is loadedbackend         > xmp > using file '/Users/hp/Library/context-osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'pages           > flushing realpage 1, userpage 1, subpage 1close source    > level 1, order 3, name './tst-taccount.tex'mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.luamkiv lua stats  > used cache path: /Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32emkiv lua stats  > resource resolver: loadtime 0.010 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 10 found files, scanned paths: mkiv lua stats  > stored bytecode data: 504 modules (0.406 sec), 98 tables (0.020 sec), 602 chunks (0.426 sec)mkiv lua stats  > traced context: maxstack: 1627, freed: 0, unreachable: 1627mkiv lua stats  > cleaned up reserved nodes: 72 nodes, 11 lists of 439mkiv lua stats  > node memory usage: 15 attribute, 3 glue, 67 gluespec, 3 kern, 582 mathspec, 4 penalty, 2 tempmkiv lua stats  > node list callback tasks: 12 unique task lists, 9 instances (re)created, 59 callsmkiv lua stats  > used backend: pdfmkiv lua stats  > jobdata time: 0.002 seconds saving, 0.000 seconds loadingmkiv lua stats  > callbacks: file: 390, saved: 270, direct: 2, function: 1102, value: 2, message: 0, bytecode: 602, late 0, total: 2368 (0 per page)mkiv lua stats  > randomizer: initialized with value 0.56777543833852mkiv lua stats  > loaded tex modules: 1 requested, all found (t-taccount)mkiv lua stats  > loaded patterns: en::1, load time: 0.000mkiv lua stats  > loaded fonts: 2 files: latinmodern-math.otf, lmroman12-regular.otfmkiv lua stats  > font engine: otf 3.120, afm 1.513, tfm 1.000, 7 instances, 3 shared in backend, 3 common vectors, 0 common hashes, load time 0.237 seconds mkiv lua stats  > font embedding time: 0.004 seconds, 1 fontsmkiv lua stats  > result saved in file: tst-taccount.pdf, compresslevel 1, objectcompresslevel 3mkiv lua stats  > positions: 4 collected, 0 deltas, 0 shared partials, 0 partial entriesmkiv lua stats  > used platform: osx-64, type: unix,

[NTG-context] $\sin \theta$ behave differently in metafun

2022-04-15 Thread Jeong Dal via ntg-context
Dear all,

I use $\sin \theta$ and $\cos \theta$ behave differently in text and in metafun.
It works well sometime before but it doesn’t  in metafun now.
What is wrong in my example?

Thank you for reading.
Best regards,

Dalyoung

Here is a MWE.

\startbuffer[pointCircle]
numeric u; u:=1cm;
pair A,B,C;
draw fullcircle scaled 4u;
A := dir(25)*2u; 
label.top(textext("$P=(\cos\theta, \sin\theta)$"), A);
B := dir(-25)*2u;
label.bot(textext("$Q=(\cos(-\theta), \sin(-\theta))$"), B);
C := (xpart A, 0); label.lrt(textext("$A$"), C);
label(textext("$O$"), origin);
\stopbuffer
\starttext
I'd like use $\sin$ and $\cos$ in the metafun. But it shows strange text 
instead of $\sin$ and $\cos$. 

\processMPbuffer[pointCircle]

\stoptext


> 2022. 4. 13. 오전 11:09, ntg-context-requ...@ntg.nl 작성:
> 
> Send ntg-context mailing list submissions to
>   ntg-context@ntg.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   https://mailman.ntg.nl/mailman/listinfo/ntg-context
> or, via email, send a message with subject or body 'help' to
>   ntg-context-requ...@ntg.nl
> 
> You can reach the person managing the list at
>   ntg-context-ow...@ntg.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ntg-context digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Setting up zint on a mac with macOS Montery Version
>  12.3.1 (Keith McKay)
>   2. Re: fatal error in LMTX (Bruce Horrocks)
>   3. Re: Setting up zint on a mac with macOS Montery Version
>  12.3.1 (Bruce Horrocks)
>   4. Re: Proper formatting of itemized bullets in ConTeXt (śrīrāma)
>   5. Re: Proper formatting of itemized bullets in ConTeXt (śrīrāma)
> 
> 
> --
> 
> Message: 1
> Date: Tue, 12 Apr 2022 21:04:50 +0100
> From: Keith McKay 
> To: Bruce Horrocks , mailing list for ConTeXt users
>   , monty.l...@gmail.com
> Subject: Re: [NTG-context] Setting up zint on a mac with macOS Montery
>   Version 12.3.1
> Message-ID: <475d96e6-0905-7d2d-a51d-84b06d340...@gmail.com>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
> 
> Hi All
> 
> I created the symbolic link as suggested by Bruce and Luis and still got the 
> error message
> 
> optional> unable to locate library 'libzint'
> 
> in my text editor. I use TeXworks. However, I thought I would try running 
> from the Terminal app and it worked. It found libzint and output the pdf with 
> both barcodes and the qrcode. I have no idea why it works in the Terminal and 
> not TexWorks, I'm guessing I have a path issue which I need to investigate.
> 
> Notes
> 1) My machine is a mac-mini-M1 with macos Monterey and I'm running the latest 
> ConTeXt version
> 2) Bruce noted that my Homebrew was installed in a non-standard location so I 
> checked on the Hombrew website and it is installed in opt/homebrew for Apple 
> Silicon i.e the M1 chip. Maybe Bruce's homebrew was installed on an earlier 
> version.
> 
> Thanks to Luis and Bruce for their suggestions.
> Best Wishes
> Keith McKay
> 
> On 10/04/2022 22:26, Bruce Horrocks wrote:
>> Hi Keith,
>> 
>>> On 10 Apr 2022, at 14:49, Keith McKay via ntg-context  
>>> wrote:
>>> 
>>> Hi All
>>> 
>>> I have been struggling today trying to setup and use the Barcode module 
>>> zint in ConTeXt and failed. I have followed the instructions on the wiki 
>>> (https://wiki.contextgarden.net/Barcodes  ) but with some changes as 
>>> follows. Which maybe why I failed.
>>> 
>>> 1) I downloaded Zint using Homebrew since I'm using macOS, and installed it 
>>> according to the instructions.
>>> 
>>> 
>>> 2) Since I'm using LMTX I looked for the file libzint.dylib and found it in 
>>> /opt/homebrew/Cellar/zint/2.10.0/lib . This is different from the path 
>>> given on the wiki. The directory contained three files, two of which were 
>>> aliases,  libzint.2.10.dylib and libzint.dylib, and an exe file 
>>> libzint.2.10.0.0.dylib
>> You have Hombrew installed in a non-standard location. Mine is in 
>> /usr/local/Cellar with the executables linked into /usr/local/bin.
>> 
>> But, assuming other Homebrew commands work when run from Terminal then you 
>> might still be okay.
>> 
>>> 3) I created the path $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint and 
>>> copied libzint.2.10.0.0.dylib into but replaced dylib with 'so' as 
>>> suggested on the wiki inst

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