[NTG-context] Re: appendaction in "shipouts" "after" fails in the latest version

2024-09-21 Thread 黄复雄
Sorry for re-asking this question by replying to myself; after many
trials, I am sure this is a real problem.
Any hints are much appreciated.

Regards,
黄复雄(Huang Fusyong)

On Mon, Sep 16, 2024 at 11:52 AM 黄复雄  wrote:
>
> Hello, dear Hans.
>
> I have a Lua module that doesn't work in the latest version 2024.08.16
> 16:30. After investigation,
> I found that the errors first occurred in the appendaction. It could be 
> appended
> normally in the version 2024.04.01 08:59, but failed in the latest version. 
> So,
> I made a minimum runnable example for the appendaction problem,
> mini-try.lmtx, as
>
> ```ConTeXt
> \startluacode
> Moduledata = Moduledata or {}
> Moduledata.vtypeset = Moduledata.vtypeset or {}
>
> function Moduledata.vtypeset.rotate_all1(head)
> print(">>>>>> HERE IS ROTATE_ALL1")
> return head, done
> end
>
> function Moduledata.vtypeset.rotate_all2(head)
> print(">>>>>> HERE IS ROTATE_ALL2")
> return head, done
> end
>
> nodes.tasks.appendaction("processors", "after",
> "Moduledata.vtypeset.rotate_all1")
> nodes.tasks.appendaction("shipouts", "after",
> "Moduledata.vtypeset.rotate_all2") -- fails here
>
> \stopluacode
>
> \starttext
>
> try
>
> \stoptext
> ```
>
> Compiled the mini-try.lmtx and got outputs in terminal:
>
> ```text
> D:\ah21\TEX\vertical-typesetting>cd d:\ah21\TEX\vertical-typesetting &
> chcp 65001 & context d:\ah21\TEX\vertical-typesetting\mini-try.lmtx
> Active code page: 65001
>
> resolvers   | formats | executing runner 'run luametatex format':
> luametatex --jobname="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx"
> --socket --shell-escape
> --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-typesetting/mini-try.lmtx"
> --c:input="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx"
> --c:kindofrun=1 --c:maxnofruns=9
> --c:texmfbinpath="D:/venvs/context-win64/tex/texmf-win64/bin"
> system  >
> system  > ConTeXt  ver: 2024.08.16 16:30 LMTX  fmt: 2024.9.15
> 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-typesetting/mini-try', input
> 'd:/ah21/TEX/vertical-typesetting/mini-try.lmtx', result
> 'd:/ah21/TEX/vertical-typesetting/mini-try'
> fonts   > latin modern fonts are not preloaded
> languages   > language 'en' is active
> open source > level 1, order 2, name
> 'd:/ah21/TEX/vertical-typesetting/mini-try.lmtx'
> fonts   > preloading latin modern fonts (second stage)
> fonts   > 'fallback modern rm 12pt' is loaded
> >>>>>> HERE IS ROTATE_ALL1
> >>>>>> HERE IS ROTATE_ALL1
> lua error   > lua error on line 1 in file
> d:/ah21/TEX/vertical-typesetting/mini-try.lmtx:
>
> registered function call [254]:
> ...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328:
> attempt to call a nil value
> stack traceback:
> ...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328:
> in upvalue 'compile'
> ...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:231:
> in upvalue 'create'
> ...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:247:
> in upvalue 'actions'
> ...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:38:
> in function <...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:37>
> (...tail calls...)
>  1 >>  \startluacode
>  2 Moduledata = Moduledata or {}
>  3 Moduledata.vtypeset = Moduledata.vtypeset or {}
>  4
>  5 function Moduledata.vtypeset.rotate_all1(head)
>  6 print(">>>>>> HERE IS ROTATE_ALL1")
>  7 return head, done
>  8 end
>  9
> 10 function Moduledata.vtypeset.rotate_a

[NTG-context] Re: issue with "context --pages=reference"

2024-09-21 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 21.09.2024 um 16:59:

Dear list,

I have the following sample (sample.tex):

   \setuppagenumbering[alternative=doublesided]
   \setuphead[chapter][reference=ch\namedheadnumber{chapter}]
   \starttext
 \dorecurse{5}{%
   \startchapter[title={Chapter \namedheadnumber{chapter}}]
 \dorecurse{\randomnumber{10}{50}}
   {\input zapf\par}
   \stopchapter}
   \stoptext

I get no page numbers from:

   context --pages=ch3 sample.tex


Try this (without file extension): context --pages --list=ch3 sample

Wolfgang

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

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


[NTG-context] issue with "context --pages=reference"

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

I have the following sample (sample.tex):

  \setuppagenumbering[alternative=doublesided]
  \setuphead[chapter][reference=ch\namedheadnumber{chapter}]
  \starttext
\dorecurse{5}{%
  \startchapter[title={Chapter \namedheadnumber{chapter}}]
\dorecurse{\randomnumber{10}{50}}
  {\input zapf\par}
  \stopchapter}
  \stoptext

I get no page numbers from:

  context --pages=ch3 sample.tex

BTW, sample.tuc contains:

 {
  ["metadata"]=6,
  ["numberdata"]=10,
  ["references"]={
   ["block"]="bodypart",
   ["internal"]=4,
   ["realpage"]=29,
   ["reference"]="ch3",
   ["section"]=4,
  },

Which is the right way to invoke "context --pages=[reference]" or what
am I missing here?

Many thanks for your help,

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

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


[NTG-context] Re: Downsampling images (again)

2024-09-21 Thread Alan Braslau via ntg-context
Hraban,

I would first "fix" my image sources, individually, to contain missing
resolution information.

Alan

On Sat, 21 Sep 2024 13:21:08 +0200
Henning Hraban Ramm  wrote:

> This is lying around for years, let’s try to get it finally working.
> The code below works, but doesn’t do the right thing.
> 
> Since the original image doesn’t contain a resolution setting, gm 
> doesn’t do anything:
> “gm convert: image does not contain resolution”
> 
> It would be more reliable to use “gm convert -resize”, but for that
> we need to know the final pixel size.
> 
> How can a converter function access …
> – the final (scaled) size of a placed image
> – the original pixel size of an image
> ?
> With that information it would be easy to calculate the target pixel
> size.
> 
> And then it would be nice to hook this function into 
> \setupexternalfigure[conversion=]
> 
> 
> """
> \startluacode
> local function downsampler(oldname, newname, resolution)
>  if not resolution or resolution == "" then
>  resolution = 72
>  end
>  local cmd = string.format(
>[[gm convert -resample %ix%i "%s" "%s"]],
>resolution, resolution, oldname, newname)
>  logs.report("downsample", cmd)
>  os.execute(cmd)
> end
> 
> -- Set the PDF and default JPEG converters to the above function.
> figures.converters.jpg.pdf = downsampler
> figures.converters.jpg.default = downsampler
> \stopluacode
> 
> \setupexternalfigure[
>%conversion=downsampler,% not used
>resolution=10,
> ]
> 
> \starttext
> 
> \externalfigure[https://upload.wikimedia.org/wikipedia/commons/d/dd/Hermann_Zapf_signing.jpg][width=.5\textwidth]
> 
> \stoptext
> """
> 
> Hraban
> ___
> If your question is of interest to others as well, please add an
> entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl
> / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage  : 
> https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Downsampling images (again)

2024-09-21 Thread Henning Hraban Ramm

This is lying around for years, let’s try to get it finally working.
The code below works, but doesn’t do the right thing.

Since the original image doesn’t contain a resolution setting, gm 
doesn’t do anything:

“gm convert: image does not contain resolution”

It would be more reliable to use “gm convert -resize”, but for that we 
need to know the final pixel size.


How can a converter function access …
– the final (scaled) size of a placed image
– the original pixel size of an image
?
With that information it would be easy to calculate the target pixel size.

And then it would be nice to hook this function into 
\setupexternalfigure[conversion=]



"""
\startluacode
local function downsampler(oldname, newname, resolution)
if not resolution or resolution == "" then
resolution = 72
end
local cmd = string.format(
  [[gm convert -resample %ix%i "%s" "%s"]],
  resolution, resolution, oldname, newname)
logs.report("downsample", cmd)
os.execute(cmd)
end

-- Set the PDF and default JPEG converters to the above function.
figures.converters.jpg.pdf = downsampler
figures.converters.jpg.default = downsampler
\stopluacode

\setupexternalfigure[
  %conversion=downsampler,% not used
  resolution=10,
]

\starttext

\externalfigure[https://upload.wikimedia.org/wikipedia/commons/d/dd/Hermann_Zapf_signing.jpg][width=.5\textwidth]

\stoptext
"""

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

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


[NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?

2024-09-20 Thread Joel via ntg-context
 I am using Linux, so those tools are available, but Bruce's solution is 
working great! Just had to make tiny changes to the file.
I had no idea I could send an environment variable to ConTeXt...will be using 
that a lot from now! Thanks very much everyone for the help!

On Friday, September 20, 2024 at 11:04:47 AM MDT, Bruce Horrocks 
 wrote:  
 
 

> On 20 Sep 2024, at 03:57, Joel via ntg-context  wrote:
> 
> I have a document that's quite long. It uses a recurse function, a bit like 
> this:
> 
> \starttext
> 
>    \dostepwiserecurse{1}{180}{1}{%
> 
>        \input chapter\recurselevel
> 
> }
> 
> \stoptext
> 
> That produces 180  chapters of content.
> 
> Anyway, my boss is upset she has to use a table of contents to navigate to 
> the page she wants, and so wants me to split the file into 180  separate 
> files, which somehow is going to be easier to look at. Honestly, she probably 
> still won't ever actually look at it, but that's her requirement.

Since you’ve already got the chapter content split into separate \input files 
...

At the Unix level, use the following script to run Context 180 times specifying 
a different output file each time:

#! /bin/bash
for i in {1..180}
do
  context \
    --arguments="ChapNo=$i" test.tex \
    --result="chapter_$i.pdf”
done

And at the Context level, test.tex is simply:

\starttext
  \input chapter\env{ChapNo}
\stoptext


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


[NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?

2024-09-20 Thread Bruce Horrocks


> On 20 Sep 2024, at 03:57, Joel via ntg-context  wrote:
> 
> I have a document that's quite long. It uses a recurse function, a bit like 
> this:
> 
> \starttext
> 
> \dostepwiserecurse{1}{180}{1}{%
> 
>\input chapter\recurselevel
> 
> }
> 
> \stoptext
> 
> That produces 180  chapters of content.
> 
> Anyway, my boss is upset she has to use a table of contents to navigate to 
> the page she wants, and so wants me to split the file into 180  separate 
> files, which somehow is going to be easier to look at. Honestly, she probably 
> still won't ever actually look at it, but that's her requirement.

Since you’ve already got the chapter content split into separate \input files 
...

At the Unix level, use the following script to run Context 180 times specifying 
a different output file each time:

#! /bin/bash
for i in {1..180}
do
  context \
--arguments="ChapNo=$i" test.tex \
--result="chapter_$i.pdf”
done

And at the Context level, test.tex is simply:

\starttext
  \input chapter\env{ChapNo}
\stoptext


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


[NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?

2024-09-20 Thread Jim
On Fri, Sep 20, 2024 at 02:57 (+), Joel via ntg-context wrote:

> I have a document that's quite long. It uses a recurse function, a bit like 
> this:

> \starttext

>     \dostepwiserecurse{1}{180}{1}{%
>    \input chapter\recurselevel

> }
> \stoptext
> That produces 180  chapters of content.
> Anyway, my boss is upset she has to use a table of contents to navigate to 
> the page she wants, and so wants me to split the file into 180  separate 
> files, which somehow is going to be easier to look at. Honestly, she probably 
> still won't ever actually look at it, but that's her requirement.

> The problem is, I've been splitting the file by using Print --> PDF and 
> choosing a custom print range, and then saving it. If I ned to repeat that 
> 180 times, it not only will have errors, but probably take 5-10 hours.
> Is there something I can put, like \breakpdf or something that will tell it 
> to start a new PDF file? They can be named something like file1.pdf, 
> file2.pdf, etc.
> \starttext

>     \dostepwiserecurse{1}{136}{1}{%
>    \input chapter\recurselevel
> \breakpdf

> }
> \stoptext
> The perhaps "obvious" answer is just make 180  *.tex files, but since the 
> minimal example above is like 0.01% of the complexity of the real file, that 
> isn't so easy...

Joel,

others have suggested mutool and pdftk, which could be half the solution
for you.  (I use pdftk for things like this, but I assume mutool is just as
good.  Either are far less tedious than printing to file.)

If the information of the chapter boundaries is available in the log file,
a judicious use of grep and a few lines of shell script code might do the
trick.  Alternatively, you might be able to use a tool like pdfgrep to find
the page numbers from the PDF file, and then use a few lines of shell code.

If you are a Linux or Mac user, this should be "easy enough".  I don't do
windows, but now that there is (as I understand it) a bash shell available,
you might also be able to use grep and/or pdfgrep there as well.

If the log file isn't currently sufficiently helpful, could you add
something to your "start a new chapter" command to write a comment into the
log file giving you exactly the information you need?

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

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


[NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?

2024-09-20 Thread Pablo Rodriguez via ntg-context
On 9/20/24 04:57, Joel via ntg-context wrote:
> [...]
> The perhaps "obvious" answer is just make 180  *.tex files, but since
> the minimal example above is like 0.01% of the complexity of the real
> file, that isn't so easy...

Hi Joel,

I tried to recreate a document with chapters that contain a different
number of pages each:

\setuppagenumbering[alternative=doublesided]
\setuphead[chapter][reference=ch\the\numexpr\namedheadnumber{chapter}+1]
\starttext
  \dorecurse{180}{%
\startchapter[title={Chapter \namedheadnumber{chapter}}]
  \dorecurse{\randomnumber{10}{50}}
{\input zapf\par}
\stopchapter}
\stoptext

The key above is setting a reference for each chapter, so that they may
be retrieved later automatically.

Then you should have the pages for any chapter from its reference with
the following command:

  context --pages=ch100 main-file.tex

But I must confess, I cannot get this working. I don’t know what I miss.

If you are on Unix, generating a bash loop would be similar to (once
your main PDF document has been generated):

  for i in {1..180}; do mutool merge -o chapter-$i.pdf main-file\
  "$(context --pages=ch$i main-file)"

But for that, you need to know first how "--pages=[reference]" may work.

Just in case it might help,

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

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


[NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?

2024-09-20 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 20.09.2024 um 04:57:
I have a document that's quite long. It uses a recurse function, a bit 
like this:


\starttext

     \dostepwiserecurse{1}{180}{1}{%

    \input chapter\recurselevel

}

\stoptext

That produces 180  chapters of content.

Anyway, my boss is upset she has to use a table of contents to navigate 
to the page she wants, and so wants me to split the file into 180  
separate files, which somehow is going to be easier to look at. 
Honestly, she probably still won't ever actually look at it, but that's 
her requirement.


The problem is, I've been splitting the file by using Print --> PDF and 
choosing a custom print range, and then saving it. If I ned to repeat 
that 180 times, it not only will have errors, but probably take 5-10 hours.


Is there something I can put, like \breakpdf or something that will tell 
it to start a new PDF file? They can be named something like file1.pdf, 
file2.pdf, etc.


\starttext

     \dostepwiserecurse{1}{136}{1}{%

    \input chapter\recurselevel

\breakpdf

}

\stoptext

The perhaps "obvious" answer is just make 180  *.tex files, but since 
the minimal example above is like 0.01% of the complexity of the real 
file, that isn't so easy...


You can use the pdf script file but it's slower than mutool or pdftk.

mtxrun --script pdf --split file.pdf

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

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


[NTG-context] How to tell a single *.tex file to produce separate PDFs?

2024-09-19 Thread Joel via ntg-context
I have a document that's quite long. It uses a recurse function, a bit like 
this:

\starttext

    \dostepwiserecurse{1}{180}{1}{%
   \input chapter\recurselevel

}
\stoptext
That produces 180  chapters of content.
Anyway, my boss is upset she has to use a table of contents to navigate to the 
page she wants, and so wants me to split the file into 180  separate files, 
which somehow is going to be easier to look at. Honestly, she probably still 
won't ever actually look at it, but that's her requirement.

The problem is, I've been splitting the file by using Print --> PDF and 
choosing a custom print range, and then saving it. If I ned to repeat that 180 
times, it not only will have errors, but probably take 5-10 hours.
Is there something I can put, like \breakpdf or something that will tell it to 
start a new PDF file? They can be named something like file1.pdf, file2.pdf, 
etc.
\starttext

    \dostepwiserecurse{1}{136}{1}{%
   \input chapter\recurselevel
\breakpdf

}
\stoptext
The perhaps "obvious" answer is just make 180  *.tex files, but since the 
minimal example above is like 0.01% of the complexity of the real file, that 
isn't so easy...

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

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-19 Thread Gerion Entrup
Am Donnerstag, 19. September 2024, 09:35:49 MESZ schrieb Hans Hagen via 
ntg-context:
> On 9/19/2024 7:54 AM, Mikael Sundqvist wrote:
> > Hi,
> > 
> > On Thu, Sep 19, 2024 at 12:23 AM Gerion Entrup  
> > wrote:
> >>
> >> Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb Wolfgang Schuster:
> >>> Gerion Entrup schrieb am 18.09.2024 um 14:44:
> >>>> Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:
> >>>>> Hi,
> >>>>>
> >>>>> I want to typeset a table where some of the column headings are really 
> >>>>> long, while in the columns itself consists only of numbers.
> >>>>> Therefore, my idea was to rotate the column headings but not 90 degrees 
> >>>>> (I found some solutions for that) but 45 degree.
> >>>>>
> >>>>> It then would be beneficial to push together the rotated cells, so the 
> >>>>> text of one cell actually starts above the previous cell.
> >>>>> Do you know, how to achieve that?
> >>>>>
> >>>>> Here is a minimal example:
> >>>>> ```
> >>>>> \startsetups[table:rotated]
> >>>>> \setupTABLE[frame=off]
> >>>>> \setupTABLE[row][first][bottomframe=on, style=bf, align={center, 
> >>>>> low}]
> >>>>> \setupTABLE[row][2][align=flushright]
> >>>>> \stopsetups
> >>>>>
> >>>>> \starttext
> >>>>> \define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
> >>>>> \bTABLE[setups=table:rotated]
> >>>>> \bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
> >>>>> \tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European 
> >>>>> turtle dove} \eTD \eTR
> >>>>> \bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} 
> >>>>> \eTD \bTD \digits{2} \eTD \eTR
> >>>>> \eTABLE
> >>>>> \stoptext
> >>>>> ```
> >>>>> I would like to achieve that the text "Mexican redknee tarantula" is 
> >>>>> typeset right and above of "Water buffalo" so that the single columns 
> >>>>> have a width that is similar to the width of the single digit coming in 
> >>>>> the second row.
> >>>>
> >>>> To visualize this, I patched the PDF of the above example to the desired 
> >>>> result. See the attachment.
> >>>
> >>> You can use Metapost.
> >>
> >> Thanks for this solution. It, however, seems to fail with any other angle 
> >> than 315° (I tested 305, 325 and 314).
> > 
> > Try
> > 
> >
> > xyscaled(\the\struttotal,abs(sind(\MPvar{rotation}))*\the\widthofstring{\MPvar{text}});
> > 
> > with sind instead of sin. And maybe with abs around it, but one can
> > think of improvements for smaller angles. It all depends on what one
> > wants.
> 
> here is an alternative
> 
> \bTABLE[frame=off]
>\bTR[align={middle,low}]
>  \bTH \eTH
>  \bTH 
> \dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
> Water buffalo}\hss} \eTH
>  \bTH 
> \dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
> Mexican redknee tarantula}\hss} \eTH
>  \bTH 
> \dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
> European turtle dove}\hss} \eTH
>\eTR
>\bTR[frame=on,align=middle]
>  \bTD Amount of legs \eTD
>  \bTD[width=3em] 4 \eTD
>  \bTD[width=3em] 8 \eTD
>  \bTD[width=3em] 2 \eTD
>\eTR
> \eTABLE

What is the meaning of \hss here? It seems to work just fine without it.

Gerion



signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-19 Thread Hans Hagen via ntg-context

On 9/19/2024 7:54 AM, Mikael Sundqvist wrote:

Hi,

On Thu, Sep 19, 2024 at 12:23 AM Gerion Entrup  wrote:


Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 18.09.2024 um 14:44:

Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:

Hi,

I want to typeset a table where some of the column headings are really long, 
while in the columns itself consists only of numbers.
Therefore, my idea was to rotate the column headings but not 90 degrees (I 
found some solutions for that) but 45 degree.

It then would be beneficial to push together the rotated cells, so the text of 
one cell actually starts above the previous cell.
Do you know, how to achieve that?

Here is a minimal example:
```
\startsetups[table:rotated]
\setupTABLE[frame=off]
\setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}]
\setupTABLE[row][2][align=flushright]
\stopsetups

\starttext
\define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
\bTABLE[setups=table:rotated]
\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
\tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European turtle 
dove} \eTD \eTR
\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} \eTD 
\bTD \digits{2} \eTD \eTR
\eTABLE
\stoptext
```
I would like to achieve that the text "Mexican redknee tarantula" is typeset right and 
above of "Water buffalo" so that the single columns have a width that is similar to the 
width of the single digit coming in the second row.


To visualize this, I patched the PDF of the above example to the desired 
result. See the attachment.


You can use Metapost.


Thanks for this solution. It, however, seems to fail with any other angle than 
315° (I tested 305, 325 and 314).


Try

   
xyscaled(\the\struttotal,abs(sind(\MPvar{rotation}))*\the\widthofstring{\MPvar{text}});

with sind instead of sin. And maybe with abs around it, but one can
think of improvements for smaller angles. It all depends on what one
wants.


here is an alternative

\bTABLE[frame=off]
  \bTR[align={middle,low}]
\bTH \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
Water buffalo}\hss} \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
Mexican redknee tarantula}\hss} \eTH
\bTH 
\dontleavehmode\kern1.5em\llap{\rotate[rotation=315,frame=on]{\strut 
European turtle dove}\hss} \eTH

  \eTR
  \bTR[frame=on,align=middle]
\bTD Amount of legs \eTD
\bTD[width=3em] 4 \eTD
\bTD[width=3em] 8 \eTD
\bTD[width=3em] 2 \eTD
  \eTR
\eTABLE

and yes, i needed to trial and error a bit,

Hans

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

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Mikael Sundqvist
Hi,

On Thu, Sep 19, 2024 at 12:23 AM Gerion Entrup  wrote:
>
> Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb Wolfgang Schuster:
> > Gerion Entrup schrieb am 18.09.2024 um 14:44:
> > > Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:
> > >> Hi,
> > >>
> > >> I want to typeset a table where some of the column headings are really 
> > >> long, while in the columns itself consists only of numbers.
> > >> Therefore, my idea was to rotate the column headings but not 90 degrees 
> > >> (I found some solutions for that) but 45 degree.
> > >>
> > >> It then would be beneficial to push together the rotated cells, so the 
> > >> text of one cell actually starts above the previous cell.
> > >> Do you know, how to achieve that?
> > >>
> > >> Here is a minimal example:
> > >> ```
> > >> \startsetups[table:rotated]
> > >>\setupTABLE[frame=off]
> > >>\setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}]
> > >>\setupTABLE[row][2][align=flushright]
> > >> \stopsetups
> > >>
> > >> \starttext
> > >> \define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
> > >> \bTABLE[setups=table:rotated]
> > >>\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
> > >> \tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European 
> > >> turtle dove} \eTD \eTR
> > >>\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} 
> > >> \eTD \bTD \digits{2} \eTD \eTR
> > >> \eTABLE
> > >> \stoptext
> > >> ```
> > >> I would like to achieve that the text "Mexican redknee tarantula" is 
> > >> typeset right and above of "Water buffalo" so that the single columns 
> > >> have a width that is similar to the width of the single digit coming in 
> > >> the second row.
> > >
> > > To visualize this, I patched the PDF of the above example to the desired 
> > > result. See the attachment.
> >
> > You can use Metapost.
>
> Thanks for this solution. It, however, seems to fail with any other angle 
> than 315° (I tested 305, 325 and 314).

Try

  
xyscaled(\the\struttotal,abs(sind(\MPvar{rotation}))*\the\widthofstring{\MPvar{text}});

with sind instead of sin. And maybe with abs around it, but one can
think of improvements for smaller angles. It all depends on what one
wants.

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

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Gerion Entrup
Am Mittwoch, 18. September 2024, 22:53:55 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 18.09.2024 um 14:44:
> > Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:
> >> Hi,
> >>
> >> I want to typeset a table where some of the column headings are really 
> >> long, while in the columns itself consists only of numbers.
> >> Therefore, my idea was to rotate the column headings but not 90 degrees (I 
> >> found some solutions for that) but 45 degree.
> >>
> >> It then would be beneficial to push together the rotated cells, so the 
> >> text of one cell actually starts above the previous cell.
> >> Do you know, how to achieve that?
> >>
> >> Here is a minimal example:
> >> ```
> >> \startsetups[table:rotated]
> >>\setupTABLE[frame=off]
> >>\setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}]
> >>\setupTABLE[row][2][align=flushright]
> >> \stopsetups
> >>
> >> \starttext
> >> \define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
> >> \bTABLE[setups=table:rotated]
> >>\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
> >> \tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European 
> >> turtle dove} \eTD \eTR
> >>\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} \eTD 
> >> \bTD \digits{2} \eTD \eTR
> >> \eTABLE
> >> \stoptext
> >> ```
> >> I would like to achieve that the text "Mexican redknee tarantula" is 
> >> typeset right and above of "Water buffalo" so that the single columns have 
> >> a width that is similar to the width of the single digit coming in the 
> >> second row.
> > 
> > To visualize this, I patched the PDF of the above example to the desired 
> > result. See the attachment.
> 
> You can use Metapost.

Thanks for this solution. It, however, seems to fail with any other angle than 
315° (I tested 305, 325 and 314).


> \startuseMPgraphic{tableheader}{text,rotation}
> 
>label.lft("\strut\bf\MPvar{text}",origin)
>  rotated \MPvar{rotation}
>  shifted (\the\strutht,0);

I guess, this one actually draws the text...


>setbounds currentpicture to unitsquare
>  
> xyscaled(\the\struttotal,sin(\MPvar{rotation})*\the\widthofstring{\MPvar{text}});

and this one calculates the faked width. Doesn't the sinus here calculate the 
height of the rotated text?

Beside from using Metapost (since I currently do not understand it and would 
only be able to copy paste your code), is there some kind of box construct 
which artificially reduces the width of the inner content?
I would have expected something like \fakewidth[width=1cm, 
align=flushright]{\rotate[rotation=-45, location=high]{A really long text, much 
longer than 1cm}}.
If I see it right, such a construct would also solve the problem, while less 
cleaner due to the fixed width.


Gerion




signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Hans Hagen

On 9/18/2024 10:53 PM, Wolfgang Schuster wrote:

Gerion Entrup schrieb am 18.09.2024 um 14:44:

Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:

Hi,

I want to typeset a table where some of the column headings are 
really long, while in the columns itself consists only of numbers.
Therefore, my idea was to rotate the column headings but not 90 
degrees (I found some solutions for that) but 45 degree.


It then would be beneficial to push together the rotated cells, so 
the text of one cell actually starts above the previous cell.

Do you know, how to achieve that?

Here is a minimal example:
```
\startsetups[table:rotated]
\setupTABLE[frame=off]
\setupTABLE[row][first][bottomframe=on, style=bf, align={center, 
low}]

\setupTABLE[row][2][align=flushright]
\stopsetups

\starttext
\define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
\bTABLE[setups=table:rotated]
\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
\tablerotate{Mexican redknee tarantula} \eTD \bTD 
\tablerotate{European turtle dove} \eTD \eTR
\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD 
\digits{8} \eTD \bTD \digits{2} \eTD \eTR

\eTABLE
\stoptext
```
I would like to achieve that the text "Mexican redknee tarantula" is 
typeset right and above of "Water buffalo" so that the single columns 
have a width that is similar to the width of the single digit coming 
in the second row.


To visualize this, I patched the PDF of the above example to the 
desired result. See the attachment.


You can use Metapost.

\startuseMPgraphic{tableheader}{text,rotation}

   label.lft("\strut\bf\MPvar{text}",origin)
     rotated \MPvar{rotation}
     shifted (\the\strutht,0);

   setbounds currentpicture to unitsquare

xyscaled(\the\struttotal,sin(\MPvar{rotation})*\the\widthofstring{\MPvar{text}});

\stopuseMPgraphic

\starttext

\bTABLE[frame=off]
   \bTR[align={middle,low}]
     \bTH \eTH
     \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader} 
{text=Water buffalo,rotation=315} \eTH
     \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader} 
{text=Mexican redknee tarantula,rotation=315} \eTH
     \bTH[width=3em] \dontleavehmode\useMPgraphic{tableheader} 
{text=European turtle dove,rotation=315} \eTH

   \eTR
   \bTR[topframe=on,align=middle]
     \bTD Amount of legs \eTD
     \bTD 4 \eTD
     \bTD 8 \eTD
     \bTD 2 \eTD
   \eTR
\eTABLE

\stoptext


Neat. Added to the test suite.

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

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Wolfgang Schuster

Gerion Entrup schrieb am 18.09.2024 um 14:44:

Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:

Hi,

I want to typeset a table where some of the column headings are really long, 
while in the columns itself consists only of numbers.
Therefore, my idea was to rotate the column headings but not 90 degrees (I 
found some solutions for that) but 45 degree.

It then would be beneficial to push together the rotated cells, so the text of 
one cell actually starts above the previous cell.
Do you know, how to achieve that?

Here is a minimal example:
```
\startsetups[table:rotated]
\setupTABLE[frame=off]
\setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}]
\setupTABLE[row][2][align=flushright]
\stopsetups

\starttext
\define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
\bTABLE[setups=table:rotated]
\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
\tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European turtle 
dove} \eTD \eTR
\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} \eTD 
\bTD \digits{2} \eTD \eTR
\eTABLE
\stoptext
```
I would like to achieve that the text "Mexican redknee tarantula" is typeset right and 
above of "Water buffalo" so that the single columns have a width that is similar to the 
width of the single digit coming in the second row.


To visualize this, I patched the PDF of the above example to the desired 
result. See the attachment.


You can use Metapost.

\startuseMPgraphic{tableheader}{text,rotation}

  label.lft("\strut\bf\MPvar{text}",origin)
rotated \MPvar{rotation}
shifted (\the\strutht,0);

  setbounds currentpicture to unitsquare

xyscaled(\the\struttotal,sin(\MPvar{rotation})*\the\widthofstring{\MPvar{text}});

\stopuseMPgraphic

\starttext

\bTABLE[frame=off]
  \bTR[align={middle,low}]
\bTH \eTH
\bTH[width=3em] 
\dontleavehmode\useMPgraphic{tableheader}{text=Water 
buffalo,rotation=315} \eTH
\bTH[width=3em] 
\dontleavehmode\useMPgraphic{tableheader}{text=Mexican redknee 
tarantula,rotation=315} \eTH
\bTH[width=3em] 
\dontleavehmode\useMPgraphic{tableheader}{text=European turtle 
dove,rotation=315} \eTH

  \eTR
  \bTR[topframe=on,align=middle]
\bTD Amount of legs \eTD
\bTD 4 \eTD
\bTD 8 \eTD
\bTD 2 \eTD
  \eTR
\eTABLE

\stoptext

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

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


[NTG-context] Re: Table and rotation: push together 45 degree rotated cells

2024-09-18 Thread Gerion Entrup
Am Dienstag, 17. September 2024, 20:36:23 MESZ schrieb Gerion Entrup:
> Hi,
> 
> I want to typeset a table where some of the column headings are really long, 
> while in the columns itself consists only of numbers.
> Therefore, my idea was to rotate the column headings but not 90 degrees (I 
> found some solutions for that) but 45 degree.
> 
> It then would be beneficial to push together the rotated cells, so the text 
> of one cell actually starts above the previous cell.
> Do you know, how to achieve that?
> 
> Here is a minimal example:
> ```
> \startsetups[table:rotated]
>   \setupTABLE[frame=off]
>   \setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}]
>   \setupTABLE[row][2][align=flushright]
> \stopsetups
> 
> \starttext
> \define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
> \bTABLE[setups=table:rotated]
>   \bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
> \tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European 
> turtle dove} \eTD \eTR
>   \bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} \eTD 
> \bTD \digits{2} \eTD \eTR
> \eTABLE
> \stoptext
> ```
> I would like to achieve that the text "Mexican redknee tarantula" is typeset 
> right and above of "Water buffalo" so that the single columns have a width 
> that is similar to the width of the single digit coming in the second row.

To visualize this, I patched the PDF of the above example to the desired 
result. See the attachment.


> Another question in this context: Is is possible to specify a \setupTABLE 
> command that works for column 2-4 starting from row 2?
> Something like \setupTABLE[row][2-][column][2,3,4][background=color, 
> backgroundcolor=red].
> In this example this would cover all numbers but nothing else.
> 
> Best
> Gerion



mwe.fixed.pdf
Description: Adobe PDF document


signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Inline equations and html export

2024-09-18 Thread Florent Michel
Hello,

Thanks Hans and everyone who has worked on it for the new upload!

I have noticed a change which seems to break XML/html export for inline
equations; although I don't know if the issue is with the new version or
with how I'm using it.

Minimal example:
```
\setupbackend[export=yes]
\setupexport[alternative=html]

\starttext
$1 + 1 = 2$
\stoptext
```
When compiling with ConTeXt 2024.09.17 and opening either the `.html` or
`.xhtml` file with Firefox or Chromium, the positions of the 2 and = sign
are reversed, while the equation is correctly rendered when using ConTeXt
2024.08.16.

The (I think) relevant part of the html code generated by ConTeXt
2024.09.17:
```

http://www.w3.org/1998/Math/MathML";>1+12=
```

Code generated by ConTeXt 2024.08.16:
```

http://www.w3.org/1998/Math/MathML
">1+1=2
```

Am I doing something wrong here, or is html export for inline equations not
currently supported?

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

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


[NTG-context] Table and rotation: push together 45 degree rotated cells

2024-09-17 Thread Gerion Entrup
Hi,

I want to typeset a table where some of the column headings are really long, 
while in the columns itself consists only of numbers.
Therefore, my idea was to rotate the column headings but not 90 degrees (I 
found some solutions for that) but 45 degree.

It then would be beneficial to push together the rotated cells, so the text of 
one cell actually starts above the previous cell.
Do you know, how to achieve that?

Here is a minimal example:
```
\startsetups[table:rotated]
\setupTABLE[frame=off]
\setupTABLE[row][first][bottomframe=on, style=bf, align={center, low}]
\setupTABLE[row][2][align=flushright]
\stopsetups

\starttext
\define\tablerotate{\dontleavehmode\rotate[rotation=-45, location=high]}
\bTABLE[setups=table:rotated]
\bTR \bTD \eTD \bTD \tablerotate{Water buffalo} \eTD \bTD 
\tablerotate{Mexican redknee tarantula} \eTD \bTD \tablerotate{European turtle 
dove} \eTD \eTR
\bTR \bTD Amount of legs \eTD \bTD \digits{4} \eTD \bTD \digits{8} \eTD 
\bTD \digits{2} \eTD \eTR
\eTABLE
\stoptext
```
I would like to achieve that the text "Mexican redknee tarantula" is typeset 
right and above of "Water buffalo" so that the single columns have a width that 
is similar to the width of the single digit coming in the second row.

Another question in this context: Is is possible to specify a \setupTABLE 
command that works for column 2-4 starting from row 2?
Something like \setupTABLE[row][2-][column][2,3,4][background=color, 
backgroundcolor=red].
In this example this would cover all numbers but nothing else.

Best
Gerion

signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: (ConTeXt LMTX 2.11.05) how do I make it so that sections, descriptions, and itemizations have just a space between some of the text that they produce

2024-09-16 Thread Wolfgang Schuster

Felix schrieb am 16.09.2024 um 16:24:

[...]

This code shows how I am getting the default spacing between the words from 
itemize, description, and the spacing between the roman numeral and the section 
title. I tried figuring out how to get the spacing for all of these to be set 
to a single space worth but it seems to not be possible with `distance`, 
because it asks for a dimension. How can I get a `\space`'s worth of spacing to 
be the default in descriptions, itemizations, and sections? for itemizations 
and descriptions the spacing seems to vary and I really don't like that. I 
would be thankful to know if there's a way to change the spacing.


Please remove everything from your examples which isn't necessary to 
show the problem, in your example you can get rid of


- the page layout,
- the font settings,
- the title page and
- all settings from \setupdescription and \setuphead unrelated to the 
space between number/title and the text.



The value you're looking for is \spaceamount which can be used with the 
distance-key to set the width of a space as separator.



For descriptions you have to set the value of the width to fit and use 
the distance key to set a fixed
value for the space between the title and following text, to ensure the 
space doesn't increase set

also the shrink and stretch values to 0.

 begin example
\definedescription
  [description]
  [alternative=serried,
   width=fit,
   distance=\spaceamount,
   stretch=0,
   shrink=0]

\starttext

\startdescription [title={I'm not a fan of the}]
default spacing
\stopdescription

\stoptext
 end example


For itemize you can use the fit keyword but be aware once you have more 
than 9 entries you get
a bigger space between the number and content because the environment 
set the width of all

entries to width of the widest number.

 begin example
\starttext

\startitemize[n,fit][distance=\spaceamount]
\startitem
I'm not a fan of the default spacing
\stopitem
\stopitemize

\stoptext
 end example


For section titles you just have to change the distance value.

 begin example
\setuphead
  [section]
  [distance=\spaceamount]

\starttext

\startsection[title={I'm not a fan of the}]

default spacing

\stopsection

\stoptext
 end example


Wolfgang

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

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


[NTG-context] Re: Margins using 2UP imposition schema

2024-09-16 Thread Willi Egger
Angel,

I used a lot of impositioning in the past. 

If you want to have small white space at the outer edge, then do not use 
width=fit. Control the inner whitespace with backspace=… Then calculate the 
width of the textarea you want and set this value in width=... There is no need 
to use cutspace in your approach.

Willi
> On 14 Sep 2024, at 19:08, Angel M Alganza  wrote:
> 
> Hello:
> 
> I'm composing an A5 booklet printed on an A4 paper using the 2UP imposition 
> schema.  I believe, in such case, margins should be controlled using 
> 'backspace' and 'cutspace' options of the \setuplayout command, but I'm 
> afraid I don't quite understand how to use those properl.  I want to make the 
> 'external' margin (right on odd pages and left on even pages) as small as 
> possible, and the 'internal' margin larger, so that I can hole punch the 
> booklet.
> 
> I believe, in such case, margins should be controlled using 'backspace' and 
> 'cutspace' options of the \setuplayout command, but I'm afraid I don't quite 
> understand how to use those properly.  Here's a minimal example:
> 
> \setuppapersize[A5][A4]
> \setuparranging[2UP,rotated]
> \setuplayout
> [topspace=13pt,
> backspace=30pt,
> cutspace=-20pt,
> width=fit,
> height=fit,
> header=0pt,
> footer=0pt]
> \setuppagenumbering[state=stop]
> \setupbodyfont[small]
> \starttext
> \dorecurse{20}{\input tufte \vskip 1em}
> \stoptext
> 
> I wonder how I could reduce the left margin and increase the left one on the 
> even pages.
> 
> Any pointers, please?
> 
> Thank you so much in advance.
> Ángel
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

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

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


[NTG-context] appendaction in "shipouts" "after" fails in the latest version

2024-09-15 Thread 黄复雄
Hello, dear Hans.

I have a Lua module that doesn't work in the latest version 2024.08.16
16:30. After investigation,
I found that the errors first occurred in the appendaction. It could be appended
normally in the version 2024.04.01 08:59, but failed in the latest version. So,
I made a minimum runnable example for the appendaction problem,
mini-try.lmtx, as

```ConTeXt
\startluacode
Moduledata = Moduledata or {}
Moduledata.vtypeset = Moduledata.vtypeset or {}

function Moduledata.vtypeset.rotate_all1(head)
print(">>>>>> HERE IS ROTATE_ALL1")
return head, done
end

function Moduledata.vtypeset.rotate_all2(head)
print(">>>>>> HERE IS ROTATE_ALL2")
return head, done
end

nodes.tasks.appendaction("processors", "after",
"Moduledata.vtypeset.rotate_all1")
nodes.tasks.appendaction("shipouts", "after",
"Moduledata.vtypeset.rotate_all2") -- fails here

\stopluacode

\starttext

try

\stoptext
```

Compiled the mini-try.lmtx and got outputs in terminal:

```text
D:\ah21\TEX\vertical-typesetting>cd d:\ah21\TEX\vertical-typesetting &
chcp 65001 & context d:\ah21\TEX\vertical-typesetting\mini-try.lmtx
Active code page: 65001

resolvers   | formats | executing runner 'run luametatex format':
luametatex --jobname="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx"
--socket --shell-escape
--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-typesetting/mini-try.lmtx"
--c:input="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx"
--c:kindofrun=1 --c:maxnofruns=9
--c:texmfbinpath="D:/venvs/context-win64/tex/texmf-win64/bin"
system  >
system  > ConTeXt  ver: 2024.08.16 16:30 LMTX  fmt: 2024.9.15
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-typesetting/mini-try', input
'd:/ah21/TEX/vertical-typesetting/mini-try.lmtx', result
'd:/ah21/TEX/vertical-typesetting/mini-try'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name
'd:/ah21/TEX/vertical-typesetting/mini-try.lmtx'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern rm 12pt' is loaded
>>>>>> HERE IS ROTATE_ALL1
>>>>>> HERE IS ROTATE_ALL1
lua error   > lua error on line 1 in file
d:/ah21/TEX/vertical-typesetting/mini-try.lmtx:

registered function call [254]:
...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328:
attempt to call a nil value
stack traceback:
...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328:
in upvalue 'compile'
...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:231:
in upvalue 'create'
...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:247:
in upvalue 'actions'
...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:38:
in function <...n64/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:37>
(...tail calls...)
 1 >>  \startluacode
 2 Moduledata = Moduledata or {}
 3 Moduledata.vtypeset = Moduledata.vtypeset or {}
 4
 5 function Moduledata.vtypeset.rotate_all1(head)
 6 print(">>>>>> HERE IS ROTATE_ALL1")
 7 return head, done
 8 end
 9
10 function Moduledata.vtypeset.rotate_all2(head)
11 print(">>>>>> HERE IS ROTATE_ALL2")
mtx-context | fatal error: return code: 1

D:\ah21\TEX\vertical-typesetting>
```

and got a mini-try-error.log:

```text
return {
 ["filename"]="d:/ah21/TEX/vertical-typesetting/mini-try.lmtx",
 ["lastcontext"]="",
 ["lastluaerror"]="registered function call [254]:
...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328:
attempt to call a nil value\nstack traceback:\n
...n64/tex/texmf-context/tex/context/base/mkiv/util-seq.lua:328: in
upvalue 'compile'\n
...n64/tex/texmf-context/tex/context/base/mkxl/node-tsk.lmt:231: in
upvalue 'create'\n
...n64/tex/texmf-con

[NTG-context] Re: Margins using 2UP imposition schema

2024-09-15 Thread Wolfgang Schuster

Angel M Alganza schrieb am 14.09.2024 um 19:08:

Hello:

I'm composing an A5 booklet printed on an A4 paper using the 2UP 
imposition schema.  I believe, in such case, margins should be 
controlled using 'backspace' and 'cutspace' options of the 
\setuplayout command, but I'm afraid I don't quite understand how to 
use those properl.  I want to make the 'external' margin (right on odd 
pages and left on even pages) as small as possible, and the 'internal' 
margin larger, so that I can hole punch the booklet.


I believe, in such case, margins should be controlled using 
'backspace' and 'cutspace' options of the \setuplayout command, but 
I'm afraid I don't quite understand how to use those properly.  Here's 
a minimal example:


\setuppapersize[A5][A4]
\setuparranging[2UP,rotated]
\setuplayout
[topspace=13pt,
backspace=30pt,
cutspace=-20pt,
width=fit,
height=fit,
header=0pt,
footer=0pt]
\setuppagenumbering[state=stop]
\setupbodyfont[small]
\starttext
\dorecurse{20}{\input tufte \vskip 1em}
\stoptext

I wonder how I could reduce the left margin and increase the left one 
on the even pages.


Any pointers, please?


Create a normal document without imposition in A5 and use afterwards the 
arrange extra to produce your booklet.


You can get a short information block with an example when you write

    context --extras=arrange

in the terminal.

Wolfgang

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

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


[NTG-context] Margins using 2UP imposition schema

2024-09-14 Thread Angel M Alganza

Hello:

I'm composing an A5 booklet printed on an A4 paper using the 2UP 
imposition schema.  I believe, in such case, margins should be 
controlled using 'backspace' and 'cutspace' options of the \setuplayout 
command, but I'm afraid I don't quite understand how to use those 
properl.  I want to make the 'external' margin (right on odd pages and 
left on even pages) as small as possible, and the 'internal' margin 
larger, so that I can hole punch the booklet.


I believe, in such case, margins should be controlled using 'backspace' 
and 'cutspace' options of the \setuplayout command, but I'm afraid I 
don't quite understand how to use those properly.  Here's a minimal 
example:


\setuppapersize[A5][A4]
\setuparranging[2UP,rotated]
\setuplayout
[topspace=13pt,
backspace=30pt,
cutspace=-20pt,
width=fit,
height=fit,
header=0pt,
footer=0pt]
\setuppagenumbering[state=stop]
\setupbodyfont[small]
\starttext
\dorecurse{20}{\input tufte \vskip 1em}
\stoptext

I wonder how I could reduce the left margin and increase the left one on 
the even pages.


Any pointers, please?

Thank you so much in advance.
Ángel
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Unexpected behaviour of apa-bibliography

2024-09-14 Thread M U via ntg-context
I do not know anything about the apa-standard, so I do not know if my rendering 
follows the standard. 

The first appearance of the author in the bibliography is marked with year-b 
(1847b), the second with year-a (1847a). I expected the first to be marked with 
year-a and the second with year-b.

Citing multiple references in one \cite[] only 2 out of 3 righttexts appear. 
When using 
\setupbtx[apa:cite][sorttype=none] 
all 3 righttexts appear but the characters after the year disappear.

Is there a way to fix that behaviour?

Thank you. Have a nice weekend.
Matthias

\startbuffer[bibliography]
@book{spratt_Travels2_1847,
title = {Travels},
volume = {2},
publisher = {Voorst},
author = {Spratt and Forbes},
year = {1847},
}
@book{spratt_Travels1_1847,
title = {Travels},
volume = {1},
publisher = {Voorst},
author = {Spratt and Forbes},
year = {1847},
}
@book{test,
title = {Title-Test},
publisher = {Publisher-Test},
author = {Author-Test},
year = {2000},
}
\stopbuffer

\definebtxdataset[asia] 
\usebtxdataset[asia][bibliography.buffer]

\setupbtx[
  dataset=asia, 
  specification=apa,
  ] 

\usebtxdefinitions[apa] 

\setupbtxrendering[asia][
  dataset=asia, 
  sorttype=authoryear, 
  ]

% \setupbtx[apa:cite][sorttype=none]

\starttext
single citing:\\
\cite[righttext={{text 1: Vol. 1}}][spratt_Travels1_1847] \\
\cite[righttext={{text 2: Vol. 2}}][spratt_Travels2_1847]\\ 
\cite[righttext={{text 3: Test}}][test]

multiple citing:\\
\cite[righttext={{text 1: Vol. 1},{text 2: Vol. 2},{text 3: 
Test}}][spratt_Travels1_1847,spratt_Travels2_1847,test]

\blank[2*line]
\placebtxrendering[asia][method=global]

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

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


[NTG-context] Re: (ConTeXt LMTX 2024, monospace font) Why does monospaced text go out of the margin for me? is this supposed to happen?

2024-09-14 Thread Wolfgang Schuster

Felix schrieb am 14.09.2024 um 06:40:

https://pastebin.com/2ce1xSYf

The code linked above has 3 paragraphs. One in TImes New Roman, the other in 
Aptos and the last in Aptos Mono.

The paragraph with \tt seems to go over my margin of .5 inches for the left and 
right side of my doc., but the serif and sans serif text doesn't. I can't seem 
to figure out why exactly this is.

Did I set up \setuplayout incorrectly? I wanted .5in margins but I kind of 
'hacked' the way I got things. Is there a better way that I could have gotten 
.5 inch margins and a.5in header/footer? I can't seem to understand why the 
output is what it is. I would greatly appreciate any help!

Feel free to switch out the fonts if you'd like


You're trying to justify a text with a fixed width font which fails 
because the often have a fixed width space. When you have a space a 
fixed width TeX can stretch or shrink the space between the word to 
align them with the right margin.


The best solution is to disable justification and use ragged text on the 
right side. An alternative is to allow bigger spaces between words but 
as you can see in the following example the gaps between words can be 
quite large.


 begin example
\showframe

\setupbodyfont[tt]

\starttext

\samplefile{zapf}

\blank

\start \setuptolerance[space]
\samplefile{zapf}
\par \stop

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: ConTeXt LMTX 2024, \setupalign: Is the "Nicer justification and microtypography" list of options listed in ConTeXt Garden now obselete?

2024-09-14 Thread Wolfgang Schuster

Felix schrieb am 14.09.2024 um 06:13:

When I try to use a combination (example =
\setupalign[normal,extremestretch,verytolerant,hangingboth,fullhz,hyphenated,]
)

and just normal

I seem to be getting the same result when I try to load in a big paragraph. 
However, there is an obvious difference between me entering (just) flushleft, 
normal, flushright.

Have those options become obsolete? how am I supposed to know?


Whether there is a difference or not depends on your text, when you have 
a wide

text block and short words TeX can produce good results without the need for
additional parameters but when you have a narrow text blocks (e.g. for 
text in

columns) or long words you need additional settings.

The example below shows how different options can result in different 
line breaks
but not all sample text produce the same effect, sometimes you get the 
same result

with and without verytolerant etc.

Don't forget to enable expansion and protrusion before you use the 
hanging and hz

options because they need these font features.

 begin example
\definefontfeature [default] [default] 
[expansion=quality,protrusion=quality]


\setuppapersize [A5]

\defineframed
  [Example]
  [width=max,
   offset=none,
   framecolor=lightgray]

\starttext

\startprocesscommalist[normal,{normal,verytolerant},{normal,stretch},{normal,hanging},{normal,hz}]
  \starttitle[title=\currentcommalistitem]
    \startframed[Example][align=\currentcommalistitem]
    \samplefile{tufte}
    \stopframed
  \stoptitle
\stopprocesscommalist

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: Validation of pdf/A-2a

2024-09-14 Thread Thomas Meyer

Hello Hans,

thanks for the detailed answer.  Now it works!

I didn't realise until now that pdf is also messy. In my job I have 
enough to do with the fact that some products never work as they should 
("Mr Gates has won and now we have to use his products.’ - said our 
former head of IT). I have nothing to do with IT, I am a scientist.


I am grateful for LaTeX, and of course I thank you, Hans, for ConTeXt!

I can only emphasise that I am just a user who keeps turning to lists 
for support.


Thank you for your time and patience.

Have a nice weekend
Thomas


Am 13.09.24 um 11:59 schrieb Hans Hagen via ntg-context:

On 9/13/2024 9:51 AM, Thomas Meyer wrote:
Oh, I'm afraid that my “I hope for the future.” has now led to a 
misunderstanding.


I would like to archive my documents as pdf/A-2a. As a reference to 
the German Bundesarchiv, which recommends pdf/A-2a in the first 
instance - and pdf/A-2u in the second.


I simply noticed that, as described in my initial email, the pdf/A-1a 
and pdf/A-2a variants do not pass the validation test with verapdf.


Since there seems to be no way around this, I will probably have to 
fall back on the second recommendation.


You cna try this:

\setupinteraction
  [title=TITLE,
   subtitle=SUBTITLE,
   author=AUTHOR,
   keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]

\setupbackend
  [format={pdf/a-2a},
   profile={default_cmyk.icc,default_rgb.icc,default_gray.icc}]

\setuptagging
  [state=start]

\enabledirectives
  [backend.usetags=mkiv]

\starttext

    \chapter[chap:testing]{Testing}

    \input knuth

    \input tufte

\stoptext

This validates in the verapdf that i have installed (1.25.271).

So, you choose some standard (which we try to accomodate as good as 
possible but who knows ... this one is a bloated one due to the icc 
profiles). As you want tags we enable that (no need for it as long as 
one is not finished with the document unless one wants to trace). We 
also load the the old school mkiv mapping.


You can define your own mappings if needed. After looking into the 
latest greatest volatile specifications Mikael and I decided that we 
don't want to be waste too much time on it (at least not now as we hav 
emore interestign thinsg to work on) and settled for what validates 
and let users themselves decide. We mostly aim(ed) at making the 
university enforced tools happy.


Structure in pdf is (to put it mildly) a mess, insufficient and never 
will be (conceptually) okay, which is probably why it keeps being 
adapted to what some applications can support or not. We don't want to 
cripple what structure in ConTeXt we have. For the long time 
accessibility tagging (there are other kinds of tagging being in use) 
has been around for a quite vwhile now it has been the domain of 
acrobat professional toolkit so in a broader context it is kind of 
useless anyeay.


(One can wonder what organizations demanding it really have in mind, 
given that older stuff doesn't validate and probably no one ever 
checked how useful it is. But that's often the case with standrads 
like this: some checkbox ticks so we're okay.)


So, the best we can do is to provide some flexibility, as usual in tex 
tools,


Hans


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

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


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

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

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

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


[NTG-context] Re: ConTeXt beginner, What should I enable within font features? And how do I see all the options possible?

2024-09-13 Thread Wolfgang Schuster

Felix schrieb am 13.09.2024 um 08:02:

Hello Wolfgang, so if I follow your code examp,e what if I were to edit my code 
to be like this:

\definefontfeature[generalfeatures][default][
 kern=yes, % enables kerning
 extrakerns=yes, % enables extra kerning
 trep=yes, % Enables single and double quotes to show up correctly in text, 
perhaps does more
 liga=yes, % Enables ligatures.
 itlc=yes, % Activates italic correction.
 mark=yes, % Used for positioning diacritical marks (accents, dots, etc.) 
relative to base characters.
 mkmk=yes, % positions diacritical marks relative to other marks
 locl=yes,
 ccmp=yes, % Composes multiple characters into a single glyph or breaks 
down ligatures.
 mode=node,
 protrusion=yes,
 expansion=yes,
 language=dflt,
]

\definefontfamily [myfonts] [rm][Times New Roman] 
[features=generalfeatures,dlig=yes,cpsp=yes,% dlig enables times new roman 
ligatures, and cpsp is used by tnr, not aptos]
\definefontfamily [myfonts] [ss][Aptos]   
[features=generalfeatures,]
\definetypeface   [myfonts] [mm] [math] [stixtwo] 
[features=generalfeatures,]

\setupbodyfont[myfonts,12pt]

do you think this code is flawed?


Stay with the following basic setups and add only expansion or 
protrusion when you use the features in your document, otherwise there 
is no need for them.


\definefontfeature [times] [default] [trep=yes,dlig=yes]
\definefontfeature [aptos] [default] [trep=yes]

\definefontfamily [myfonts] [rm]    [Times New Roman] [features=times]
\definefontfamily [myfonts] [ss]    [Aptos] [features=aptos]
\definefontfamily [myfonts] [tt]    [Aptos Mono] [features=none]
\definetypeface   [myfonts] [mm] [math] [stixtwo]

\setupbodyfont[myfonts,12pt]

\starttext
\samplefile{lorem}
\stoptext


Also, do you think you could explain how locl and extrakerns works? do I need 
to have kern=yes for it to enable? how can I test if extrakerns Is working? 
when I just have kern=yes enable, and then enable extra, a pdf that has a 
paragraph using both in code looks the same. locl is something I'm completely 
unsure about.


1. Many features above are part of the default set.

2. When you don't know what the effect of an opentype feature is (look 
at https://www.preusstype.com/techdata/features.php for a few examples) 
don't enable it because you can get an unexpected output in your 
document. It is also important to know what your font makes with the 
feature because like I previously mentioned Times New Roman uses dlig to 
produce standard ligatures which isn't what you expect here.


Wolfgang

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

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


[NTG-context] Re: Validation of pdf/A-2a

2024-09-13 Thread Hans Hagen via ntg-context

On 9/13/2024 9:51 AM, Thomas Meyer wrote:
Oh, I'm afraid that my “I hope for the future.” has now led to a 
misunderstanding.


I would like to archive my documents as pdf/A-2a. As a reference to the 
German Bundesarchiv, which recommends pdf/A-2a in the first instance - 
and pdf/A-2u in the second.


I simply noticed that, as described in my initial email, the pdf/A-1a 
and pdf/A-2a variants do not pass the validation test with verapdf.


Since there seems to be no way around this, I will probably have to fall 
back on the second recommendation.


You cna try this:

\setupinteraction
  [title=TITLE,
   subtitle=SUBTITLE,
   author=AUTHOR,
   keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]

\setupbackend
  [format={pdf/a-2a},
   profile={default_cmyk.icc,default_rgb.icc,default_gray.icc}]

\setuptagging
  [state=start]

\enabledirectives
  [backend.usetags=mkiv]

\starttext

\chapter[chap:testing]{Testing}

\input knuth

\input tufte

\stoptext

This validates in the verapdf that i have installed (1.25.271).

So, you choose some standard (which we try to accomodate as good as 
possible but who knows ... this one is a bloated one due to the icc 
profiles). As you want tags we enable that (no need for it as long as 
one is not finished with the document unless one wants to trace). We 
also load the the old school mkiv mapping.


You can define your own mappings if needed. After looking into the 
latest greatest volatile specifications Mikael and I decided that we 
don't want to be waste too much time on it (at least not now as we hav 
emore interestign thinsg to work on) and settled for what validates and 
let users themselves decide. We mostly aim(ed) at making the university 
enforced tools happy.


Structure in pdf is (to put it mildly) a mess, insufficient and never 
will be (conceptually) okay, which is probably why it keeps being 
adapted to what some applications can support or not. We don't want to 
cripple what structure in ConTeXt we have. For the long time 
accessibility tagging (there are other kinds of tagging being in use) 
has been around for a quite vwhile now it has been the domain of acrobat 
professional toolkit so in a broader context it is kind of useless anyeay.


(One can wonder what organizations demanding it really have in mind, 
given that older stuff doesn't validate and probably no one ever checked 
how useful it is. But that's often the case with standrads like this: 
some checkbox ticks so we're okay.)


So, the best we can do is to provide some flexibility, as usual in tex 
tools,


Hans


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

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


[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?

2024-09-11 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 11.09.2024 um 04:22:

Thank you for your careful and patient explanation.
I'll check my code again.
Because it's still very simple,
and some situations haven't been taken into account.
In particular, the condition judgment to split the part of the box.


I run your code and already found a few example where it fails, e.g.

- when you have a very short text it is spread over the while line and 
you get a line break at the end
- when you use it in the narrower environment you don't compensate the 
left/right indentations



Regarding the part about referencing commands,
I inadvertently forgot to delete it.

I have a question about the command "\warichuparameter\c!XXX" :
Why can we use "\warichuparameter\c!XXX" instead of "\warichuparameter{XXX}" in 
most cases,
but in some cases, it says that the command is not defined?
For example, \warichuparameter\c!pointstyle -->   Control sequence expected 
instead of undefined

I've used "\warichuparameter\c!XXX" before, but it causes the error
because there are some keys that are specifically named.
For the sake of stylistic consistency, I used "\warichuparameter{XXX}" for all 
command.

Maybe it's because I didn't define it? Should I define the following in advance?

%%%
\def\c!pointstyle{pointstyle}
%%%


Yes, these constants are predefined to have language dependent keys in 
the setup command, e.g.


    \setupitemize[width=1cm]

is written as

    \stelleaufzaehlungein[breite=1cm]

with the german interface.


To ensure you use the correct name for the key you use \c!width as 
argument for the \xxxparameter command.



While you can use \def\c!...{...}  to create a new constant the proper 
method is to use \setinterfaceconstant.



You can run the following example to get a list with a predefined 
constant. When you uncomment the first three lines you see the new entry 
also appears in the list.


 begin example
% \startinterface all
% \setinterfaceconstant {pointstyle} {pointstyle}
% \stopinterface

\setuplayout[tight]

\starttext

\startluacode
context.startcolumns({n=3})
for constant, _ in table.sortedpairs(interfaces.constants) do
  context.mono(constant)
  context.par()
end
context.stopcolumns()
\stopluacode

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Inmargin labels fail to be placed on makeup pages

2024-09-11 Thread Rik Kabel

Hello all,

As the subject says, labels (\definelabel) with alternative=inmargin are 
not placed on makeup pages. (Left and right placement works.) The 
following example demonstrates this. (ConTeXt  ver: 2024.08.16 15:49 
LMTX  fmt: 2024.8.16  int: english/english)


   \showframe
   \definemakeup  [epigraphs][pagestate=start]
   \definelabel   [ipe][alternative=inmargin]
   \definelabel   [epi][alternative=right]
   \starttext

   \epi[top]This is a numbered page.\ipe[TOP]

   \startmakeup[epigraphs]

   The thing about quotes on the internet is that you cannot confirm
   their validity.

   -- Abraham Lincoln\epi[epigraph]\ipe[EPIGRAPH]

   This page is numbered, but the number is not displayed.
   \stopmakeup

   Label TOP is on page \at[TOP].

   Label top is on page \at[top].

   Label epigraph is on page \at[epigraph].

   Label EPIGRAPH is on page \at[EPIGRAPH].

   \stoptext

Unfortunately, enumerations cannot take the place of labels for my use 
case, as discussed a number of years ago 
<https://www.mail-archive.com/ntg-context@ntg.nl/msg86880.html>.


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

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


[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?

2024-09-10 Thread Wolfgang Schuster

Bruce Horrocks schrieb am 09.09.2024 um 23:27:

On 9 Sep 2024, at 08:57, ai2472206...@yeah.net wrote:

As the title suggests, how do I get the correct page numbers?


There does seem to be an anomaly here. Simpler MWE:

\starttext
\dorecurse{15}{
\input knuth
%{\ssd\color[red]{\pagenumber}} % not as expected
{\color[red]{\pagenumber}}   % as expected
}
\stoptext

With the \ssd the first number at the top of the second and subsequent pages is 
one less than it should be. Without the \ssd then the numbers are as expected.

@Muyik: Are you able to use \pagenumber without using \ssd or similar to change 
the size? That might be a work-around for you. There is also \userpagenumber.


You can't use page counters in running text without problems because 
you're working against the way how TeX constructs pages.


The only reliable way are multipass solutions like the pagestate or 
reference mechanism.


Wolfgang

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

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


[NTG-context] Validation of pdf/A-2a

2024-09-10 Thread Thomas Meyer

Hello,

I would like to use pdf/A-2a for my documents and was wondering whether 
the documents will stand up to validation.

I used veraPDF for the validation check.

Unfortunately the a-variants (pdf/A1-a and pdf/A-2a) fail.
Here the Validation Information:


   Validation information

*Rule*  *Status*
Specification: ISO 19005-2:2011, Clause: 6.7.3.3, Test number: 1 
<https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Parts-2-and-3-rules#rule-6733-1> 
	
The logical structure of the conforming file shall be described by a 
structure hierarchy rooted in the StructTreeRoot entry of the document's 
Catalog dictionary, as described in ISO 32000-1:2008, 14.7 	**Failed**

1 occurrences   Hide
PDDocument  
StructTreeRoot_size == 1
root/document[0]
StructTreeRoot entry is not present in the document catalog


Specification: ISO 19005-2:2011, Clause: 6.7.2.2, Test number: 1 
<https://github.com/veraPDF/veraPDF-validation-profiles/wiki/PDFA-Parts-2-and-3-rules#rule-6722-1> 
	
The document catalog dictionary shall include a MarkInfo dictionary 
containing an entry, Marked, whose value shall be true 	**Failed**

1 occurrences   Hide
CosDocument 
Marked == true  
root
MarkInfo dictionary is not present in the document catalog, or Marked 
entry is set to false or is not present in the MarkInfo dictionary 
(MarkInfo = null, Marked = null)





See the (shortened) minimal example taken from the wiki below.

Does anyone have any experience or advice on how to make pdf/A-2a valid?

Greetings Thomas

\setupinteraction
  [title=TITLE,
   subtitle=SUBTITLE,
   author=AUTHOR,
   keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]

%% For PDF/A
\setupbackend[
format={pdf/a-2a},    validation fails
%format={pdf/a-2b},    validation passed
%format={pdf/a-2u},    validation passed
%format={pdf/a-1b:2005},    validation passed
%format={pdf/a-1a:2005),    validation fails
profile={default_cmyk.icc,default_rgb.icc,default_gray.icc},
intent=ISO coated v2 300\letterpercent\space (ECI)]


\starttext

\chapter[chap:testing]{Testing}

\input knuth

\input tufte

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

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


[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?

2024-09-10 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 10.09.2024 um 06:05:

1. The usage of the command  "\definepagestate " is what I searched for in 
previous posts and source files.
I don't know exactly how he used it. (╥﹏╥)

2. I've devised a command that needs to get the current page number to 
determine if it's an odd or even page.
This is then used to get a certain width to determine the width of the command 
on that line.
Below I designed the command. The code related to this issue is mainly


You have to differentiate between odd and even and right hand and left 
hand pages.


When you want to check whether you have an right hand or left hand page 
you can use the following method.
To get the correct result ensure you start a paragraph before you set 
the flag with \signalrightpage.


 begin example
%\setuppagenumbering[alternative=doublesided]
%\setuppagenumbering[alternative={singlesided,doublesided}]

\starttext

\dorecurse{20}
  {\dontleavehmode\signalrightpage\doifelserightpage{\bold{Right 
page}}{\bold{Left page}}

   \samplefile{lorem}}

\stoptext
 end example

To have a check which works for odd and even pages you have to use the 
pagestate mechanism.
Even in this case it is important to start a paragraph before save the 
current state, afterwards

you can check the stored pagenumber.

 begin example
\definepagestate[warichu]

\starttext

\dorecurse{20}
  {\dontleavehmode\autosetpagestate{warichu}%
   \ifodd0\autopagestaterealpage{warichu}%
 \bold{Odd page}
   \else
 \bold{Even page}
   \fi
   \samplefile{lorem}}

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?

2024-09-10 Thread vm via ntg-context




On 10/09/2024 06:32, ai2472206...@yeah.net wrote:

I changed the command, and now I get the correct page number with this command, 
\
but how should he do the calculation?



this gives an interesting result with a colorful mix of page numbers,
although it is not obvious to me as why.


\setupinterlinespace[18pt]
\definepagestate[test][delay=yes]
\starttext
\dorecurse{15}{
{\ssd\color[red]{\setpagestate[test]\pagestaterealpage{test}{#1}}}
\input knuth
{\ssd\color[green]{\setpagestate[test]\pagestaterealpage{test}{#1}}}
}
\stoptext



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

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


[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?

2024-09-09 Thread ai2472206007
I changed the command, and now I get the correct page number with this command, 
\
but how should he do the calculation?

\starttext
\definepagestate[test][delay=yes]
\dorecurse{10}{%
\input knuth %
{\ssd\color[red]{\setpagestate[test]\pagestaterealpage{test}{#1}}}
}
\stoptext

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

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


[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?

2024-09-09 Thread ai2472206007
1. The usage of the command  "\definepagestate " is what I searched for in 
previous posts and source files. 
I don't know exactly how he used it. (╥﹏╥)

2. I've devised a command that needs to get the current page number to 
determine if it's an odd or even page. 
This is then used to get a certain width to determine the width of the command 
on that line. 
Below I designed the command. The code related to this issue is mainly

%%% code related to this issue
\rest@linewidth=\dimexpr%
\ifdoublesided%   if singlesided restlinewidth = 
oddpos  - xpos
  \ifodd\pageno%  if doublesided
  \oddpos@warichu%   and if odd  restlinewidth = oddpos  - 
xpos
\else\evenpos@warichu\fi%and if even restlinewidth = evenpos - xpos
\else\oddpos@warichu \fi%
-\MPx\xpos@warichu\relax%
%%%

 main code
\unprotect
\installnamespace {warichu}
\installsimplecommandhandler \warichu {warichu} \warichu
\setupwarichu[style=\ssxx,
  voffset=-1.5pt,
  distance=\hskip1pt\relax,
  left={},right={},
  reference=,]
\newcount\cnt@warichu
\newdimen\rest@linewidth
\newdimen\oddpos@warichu 
\newdimen\evenpos@warichu
\oddpos@warichu =\dimexpr\backspace+\textwidth\relax
\evenpos@warichu=\dimexpr\paperwidth-\cutspace\relax
\def\get@split@box#1{%
\setbox\scratchboxone\hbox{%
\hsplit\scratchbox %
  to #1%
  shrinkcriterium 1%
\par\allowbreak}%
\box\scratchboxone}
\def\warichu{\dosingleempty\warichu@indeed}
\def\warichu@indeed[#1]#2{\begingroup%
\global\advance\cnt@warichu by 1\relax%
\iffirstargument\setupwarichu[#1]\fi%
\warichuparameter{distance}%
\warichuparameter{left}%
\pagereference[warichu:\number\cnt@warichu]% may be useful
\textreference[\warichuparameter{reference}]{\warichuparameter{reference}}%
\xypos{warichu:\number\cnt@warichu}%
\edef\xpos@warichu{warichu:\number\cnt@warichu}%
\rest@linewidth=\dimexpr%
\ifdoublesided%   if singlesided restlinewidth = 
oddpos  - xpos
  \ifodd\pageno%  if doublesided
  \oddpos@warichu%   and if odd  restlinewidth = oddpos  - 
xpos
\else\evenpos@warichu\fi%and if even restlinewidth = evenpos - xpos
\else\oddpos@warichu \fi%
-\MPx\xpos@warichu\relax%
\setbox\scratchbox\hbox{\usewarichustyleandcolor\c!style\c!color #2\relax}%
\raise\warichuparameter{voffset}\relax%
\vbox{\offinterlineskip%
\get@split@box{\the\rest@linewidth}%
\get@split@box{\the\rest@linewidth}}\allowbreak%
\doloop{%
\ifdim\wd\scratchbox>\dimexpr\textwidth*2\relax%
\raise\warichuparameter{voffset}%
\vbox{\offinterlineskip%
\get@split@box{\the\textwidth}%
\get@split@box{\the\textwidth}}\allowbreak%
\else%
\raise\warichuparameter{voffset}%
\vbox{\offinterlineskip%
\get@split@box{\dimexpr\wd\scratchbox/2+1pt\relax}%
\get@split@box{\dimexpr\wd\scratchbox+1pt\relax}}\allowbreak%
 \exitloop%
  \fi}%
\warichuparameter{right}%
\warichuparameter{distance}\endgroup}
\protect
\starttext
\section{}
\input darwin \warichu[reference=warichu:44]{\input darwin \input knuth }
\input knuthmath  \warichu{\input knuth } \input knuth
\stoptext

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

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


[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?

2024-09-09 Thread vm via ntg-context

this will go wrong as well:

\starttext
\dorecurse{15}{\ssd
\input knuth
{\color[red]{\pagenumber}}
}
\stoptext


and this as well:

\starttext
\dorecurse{15}{\tfb
\input knuth
{\color[red]{\pagenumber}}   % as expected
}
\stoptext


and so does this:

\setupinterlinespace[16pt]
\starttext
\dorecurse{15}{
\input knuth
{\color[red]{\pagenumber}}   % as expected
}
\stoptext



(and there is probably a valid reason to it ;-)


.F



On 09/09/2024 23:27, Bruce Horrocks wrote:

On 9 Sep 2024, at 08:57,ai2472206...@yeah.net wrote:

As the title suggests, how do I get the correct page numbers?


There does seem to be an anomaly here. Simpler MWE:

\starttext
\dorecurse{15}{
\input knuth
%{\ssd\color[red]{\pagenumber}} % not as expected
{\color[red]{\pagenumber}}   % as expected
}
\stoptext

With the \ssd the first number at the top of the second and subsequent pages is 
one less than it should be. Without the \ssd then the numbers are as expected.

@Muyik: Are you able to use \pagenumber without using \ssd or similar to change 
the size? That might be a work-around for you. There is also \userpagenumber.

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



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

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


[NTG-context] Re: how do I get the correct page numbers and do the calculations with it?

2024-09-09 Thread Bruce Horrocks
On 9 Sep 2024, at 08:57, ai2472206...@yeah.net wrote:
> 
> As the title suggests, how do I get the correct page numbers? 


There does seem to be an anomaly here. Simpler MWE:

\starttext
\dorecurse{15}{
\input knuth
%{\ssd\color[red]{\pagenumber}} % not as expected
{\color[red]{\pagenumber}}   % as expected
}
\stoptext

With the \ssd the first number at the top of the second and subsequent pages is 
one less than it should be. Without the \ssd then the numbers are as expected.

@Muyik: Are you able to use \pagenumber without using \ssd or similar to change 
the size? That might be a work-around for you. There is also \userpagenumber.

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


[NTG-context] how do I get the correct page numbers and do the calculations with it?

2024-09-09 Thread ai2472206007
Thank to all who answered my questions before. 
As the title suggests, how do I get the correct page numbers? 
For example, in the example below, 
the first line on the 2nd page, but the page number showed is 1,
In the meantime, I tried using \definepagestate, 
but it didn't seem to work either. 
What I can think of is to use citations to get the correct page number. 
But it seems that what is obtained is not a pure number, 
and it cannot do the calculations.

so ,how do I get the correct page numbers and do the calculations with it?

thanks.
%% start example
\starttext

%%% try page state
\definepagestate[test][delay=yes]
\newcount\test
\let\testfloatrealpage\realpageno
\def\testsavedata
  {\setpagestate[test][\number\test]}
\def\testloaddata % precedes save !
  {\global\advance\test\plusone
   \xdef\testfloatrealpage{\pagestaterealpage{test}{\number\test}}
   \ifx\testfloatrealpage\empty
\glet\testfloatrealpage\realpageno
   \fi}
\testsavedata%
%%%
\dorecurse{10}{%
\testloaddata%
\input knuth \pagereference[XX:#1]
{\ssd\color[red]{\the\pageno}}%   on page 2 and show page 1
{\ssd\color[red]{\the\testfloatrealpage}}%on page 2 and show page 1
{\ssd\color[red]{\ref[page][XX:#1]}}% on page 2 and show page 2
}
\stoptext
% stop example

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

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


[NTG-context] Re: Is \not still supported?

2024-09-08 Thread Wolfgang Schuster




Hans Hagen schrieb am 08.09.2024 um 20:21:

On 9/8/2024 5:19 PM, Wolfgang Schuster wrote:

Hi,

is the \not command still supported in math mode or should users 
replace it with the combined form, e.g. \notin instead of \not\in.


 begin example
\starttext

\im{x \in M}

\im{x \notin M}

\im{x \not\in M}

\stoptext
 end example

indeed, because old school \not was a symbols that got overlayed.

we could of course make some clever not but i hav eto discuss that 
with MS .. if there are \not cases at all


My main reason for the question was to get clarification about the 
status of the command.


Using the proper commands (e.g. \notin) was always the better choice 
because they produce better output than \not does.


Wolfgang

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

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


[NTG-context] Re: Is \not still supported?

2024-09-08 Thread Hans Hagen

On 9/8/2024 5:19 PM, Wolfgang Schuster wrote:

Hi,

is the \not command still supported in math mode or should users replace 
it with the combined form, e.g. \notin instead of \not\in.


 begin example
\starttext

\im{x \in M}

\im{x \notin M}

\im{x \not\in M}

\stoptext
 end example

indeed, because old school \not was a symbols that got overlayed.

we could of course make some clever not but i hav eto discuss that with 
MS .. if there are \not cases at all


Hans


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

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

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


[NTG-context] Is \not still supported?

2024-09-08 Thread Wolfgang Schuster

Hi,

is the \not command still supported in math mode or should users replace 
it with the combined form, e.g. \notin instead of \not\in.


 begin example
\starttext

\im{x \in M}

\im{x \notin M}

\im{x \not\in M}

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: ConTeXt beginner, What should I enable within font features? And how do I see all the options possible?

2024-09-07 Thread Wolfgang Schuster

Felix  schrieb am 05.09.2024 um 22:58:

https://pastebin.com/245uwYj4

I have this setup for my fonts, called myfonts.

I assume that `\definefontfeature [default] [default] 
[trep=yes,dlig=yes,itlc=yes]` will affect every single font that goes into my 
preamble (Forgive me if I seem incompetent, I am a beginner at ConTeXt)


It is applied to all fonts which use the "default" feature set and which 
enabled after you made the changes.


In the following example only pagella uses the "trep" feature because 
modern was loaded before the settings was added to the default feature set.


 begin example
\starttext

\setupbodyfont[modern]

a'b

\definefontfeature [default] [default] [trep=yes]

\setupbodyfont[pagella]

a'b

\stoptext
 end example

To be on the save side create custom feature set where you add 
additional settings and apply these to your fonts.


 begin example
\definefontfeature [MyFeatures] [default] [trep=yes]

\definefontfamily [OldTimes] [rm] [Times New Roman]
\definefontfamily [NewTimes] [rm] [Times New Roman] [features=MyFeatures]

\starttext

\setupbodyfont[OldTimes]

a'b

\setupbodyfont[NewTimes]

a'b

\stoptext
 end example


I have dlig and trep on so that works with single quotations like don't have a 
directional quote, and so that I get the Times New Roman ligatures via dlig and 
not just liga. itlc is enabled since I read some documentation and they 
sometimes mention enabling it


It shouldn't be necessary to add "itlc" anymore to get italic correction 
for \em etc.



is there some stuff like the extrafeatures option or anything that you would 
recommend i enable? might there be options for extrakerns that would be seen as 
something that one should enable?

also, how can I see all the options available? dlig is something I discovered 
by accident that was not in the options list in the documentation.


Unless you know the effect of a feature you shouldn't add or enable it.

You even have to know what is supported by the fonts in your document 
which can differ between certain versions of a font, take Times New 
Roman which is included with Windows as an example.


1. For a long time ligatures weren't supported by the font at all and 
the first mention of the support it is from 2022.


2. The font uses the "dlig" feature to enable the f ligatures even 
though the normal tag for it is "liga". My guess why they made this 
decision is backwards compatibility with existing document to avoid them 
from using these ligatures.


3. You shouldn't enable "dlig" by default for all fonts because the 
results of the feature can vastly for the fonts which provide it, take 
the following two fonts as example.


 begin example
\definefontfeature [discretionary-ligatures] [dlig=yes]

\starttext

\startbuffer[pagella]
\starttabulate[|||]
\NC \type{} \EQ  \NC\NR
\NC \type{--}   \EQ --   \NC\NR
\NC \type{!`}   \EQ !`   \NC\NR
\NC \type{!‘}   \EQ !‘   \NC\NR
\NC \type{?`}   \EQ ?`   \NC\NR
\NC \type{?‘}   \EQ ?‘   \NC\NR
\NC \type{,,}   \EQ ,,   \NC\NR
\NC \type{‘‘}   \EQ ‘‘   \NC\NR
\NC \type{’’}   \EQ ’’   \NC\NR
\NC \type{---}  \EQ ---  \NC\NR
\stoptabulate
\stopbuffer

\setupbodyfont[pagella]

\start \nohyphencollapsing
\getbuffer[pagella]
\stop

\start \nohyphencollapsing \feature[+][discretionary-ligatures]
\getbuffer[pagella]
\stop

\startbuffer[dejavuserif]
\starttabulate[|||]
\NC \type{ſt} \EQ ſt \NC\NR
\NC \type{st} \EQ st \NC\NR
\stoptabulate
\stopbuffer

\setupbodyfont[dejavu]

\start
\getbuffer[dejavuserif]
\stop

\start \feature[+][discretionary-ligatures]
\getbuffer[dejavuserif]
\stop

\stoptext
 end example

The only additional features which can be added without problems are 
"expansion" and "protrusion" because until you enable them with 
\setupalign nothing changes in your document.


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

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


[NTG-context] Re: \ldot and \ldotp not working

2024-09-04 Thread Aditya Mahajan
On Thu, 5 Sep 2024, Hans Hagen wrote:

> On 9/4/2024 8:53 PM, Wolfgang Schuster wrote:
> > Aditya Mahajan schrieb am 04.09.2024 um 05:58:
> >> Hi,
> >>
> >> With context 2024.08.16 the following gives an error:
> >>
> >> \starttext
> >> $A \ldot B$
> >> \stoptext
> >>
> >> tex error   > tex error on line 2 in file ./test.tex: Control sequence
> >> expected instead of undefined
> >>
> >> 
> >>  $A \ldot
> >>   B$
> >>
> >> Same error with `\ldotp`.
> >>
> >> However
> >>
> >> \starttext
> >> \show\ldot
> >> \show\ldotp
> >> \stoptext
> >>
> >> gives
> >>
> >>> \ldot=permanent \Umathchar"02"00"2E
> >>> \ldotp=permanent \Umathchar"06"00"2E
> >>
> >> which appears correct.
> >>
> >> So, not sure what is going on. Any ideas?
> > 
> > 
> > I have no idea what's the cause for the error but I can narrow it down.
> > 
> > When you replace \ldot with it's mathchar version you can reproduce the
> > error when there is *no* space at the end, \ldots on the other hand has no
> > problem without the space.
> > 
> > \starttext
> > 
> > No space at the end of \tex{Umathchar}:
> > $\Umathchar"19"00"002026\Umathchar"19"00"002026 $ % \ldots
> > 
> > Space at the end of \tex{Umathchar}:
> > $\Umathchar"19"00"002026 \Umathchar"19"00"002026 $ % \ldots
> > 
> > No space at the end of \tex{Umathchar}:
> > % $\Umathchar"02"00"2E\Umathchar"02"00"2E $ % \ldot
> > 
> > Space at the end of \tex{Umathchar}:
> > $\Umathchar"02"00"2E \Umathchar"02"00"2E $ % \ldot
> > 
> > \stoptext
> > 
> > Wolfgang
> good analysis ... quick hack to get Aditya going ...
> 
> \appendtoks
> \amcode\commaasciicode\zerocount
> \amcode\periodasciicode   \zerocount
> \amcode\semicolonasciicode\zerocount
> \to \everymathematics
> 

Thank you Wolfgang and Hans. My old documents compile now, so I can wait for a 
proper fix.

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

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


[NTG-context] Re: \ldot and \ldotp not working

2024-09-04 Thread Hans Hagen

On 9/4/2024 8:53 PM, Wolfgang Schuster wrote:

Aditya Mahajan schrieb am 04.09.2024 um 05:58:

Hi,

With context 2024.08.16 the following gives an error:

\starttext
$A \ldot B$
\stoptext

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



 $A \ldot
  B$

Same error with `\ldotp`.

However

\starttext
\show\ldot
\show\ldotp
\stoptext

gives


\ldot=permanent \Umathchar"02"00"2E
\ldotp=permanent \Umathchar"06"00"2E


which appears correct.

So, not sure what is going on. Any ideas?



I have no idea what's the cause for the error but I can narrow it down.

When you replace \ldot with it's mathchar version you can reproduce the 
error when there is *no* space at the end, \ldots on the other hand has 
no problem without the space.


\starttext

No space at the end of \tex{Umathchar}:
$\Umathchar"19"00"002026\Umathchar"19"00"002026 $ % \ldots

Space at the end of \tex{Umathchar}:
$\Umathchar"19"00"002026 \Umathchar"19"00"002026 $ % \ldots

No space at the end of \tex{Umathchar}:
% $\Umathchar"02"00"2E\Umathchar"02"00"2E $ % \ldot

Space at the end of \tex{Umathchar}:
$\Umathchar"02"00"2E \Umathchar"02"00"2E $ % \ldot

\stoptext

Wolfgang

good analysis ... quick hack to get Aditya going ...

\appendtoks
\amcode\commaasciicode\zerocount
\amcode\periodasciicode   \zerocount
\amcode\semicolonasciicode\zerocount
\to \everymathematics

i need to ponder this (too late now)

Hans


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

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

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


[NTG-context] Re: \ldot and \ldotp not working

2024-09-04 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 04.09.2024 um 05:58:

Hi,

With context 2024.08.16 the following gives an error:

\starttext
$A \ldot B$
\stoptext

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


 $A \ldot
  B$

Same error with `\ldotp`.

However

\starttext
\show\ldot
\show\ldotp
\stoptext

gives


\ldot=permanent \Umathchar"02"00"2E
\ldotp=permanent \Umathchar"06"00"2E


which appears correct.

So, not sure what is going on. Any ideas?



I have no idea what's the cause for the error but I can narrow it down.

When you replace \ldot with it's mathchar version you can reproduce the 
error when there is *no* space at the end, \ldots on the other hand has 
no problem without the space.


\starttext

No space at the end of \tex{Umathchar}:
$\Umathchar"19"00"002026\Umathchar"19"00"002026 $ % \ldots

Space at the end of \tex{Umathchar}:
$\Umathchar"19"00"002026 \Umathchar"19"00"002026 $ % \ldots

No space at the end of \tex{Umathchar}:
% $\Umathchar"02"00"2E\Umathchar"02"00"2E $ % \ldot

Space at the end of \tex{Umathchar}:
$\Umathchar"02"00"2E \Umathchar"02"00"2E $ % \ldot

\stoptext

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

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


[NTG-context] \ldot and \ldotp not working

2024-09-03 Thread Aditya Mahajan
Hi,

With context 2024.08.16 the following gives an error:

\starttext
$A \ldot B$
\stoptext

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


$A \ldot
 B$

Same error with `\ldotp`. 

However

\starttext
\show\ldot
\show\ldotp
\stoptext

gives

> \ldot=permanent \Umathchar"02"00"2E
> \ldotp=permanent \Umathchar"06"00"2E

which appears correct. 

So, not sure what is going on. Any ideas?

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

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


[NTG-context] Re: Is there an alternative to \reference[]{} that won't interfere with the document design?

2024-09-03 Thread Wolfgang Schuster

Jürgen Hanneder via ntg-context schrieb am 31.08.2024 um 17:27:


I recently learned not to leave a space before and after \reference , 
but have not seen
further complex problems as you describe so far. Can you give more 
specific examples for these,

I have to check, because I am also finalising a book at the moment.


References need an anchor to know on which page they end up because a 
page is finished you don't know the answer.


The following example sets three references, one and three marks the 
start of each paragraph but where should two end up?


 begin example
\usemodule[visual]

\setuppapersize[A6,landscape]

\setupwhitespace[line]

\starttext

\showmakeup[hbox]

\pagereference[one]\fakelines{10}{10}

\pagereference[two]

\pagereference[three]\fakelines{10}{10}

\page

\showmakeup[reset]

\starttabulate
\NC one   \NC \at[one]   \NC\NR
\NC two   \NC \at[two]   \NC\NR
\NC three \NC \at[three] \NC\NR
\stoptabulate

\stoptext
 end example

When you process the example you get page 1 as output, but why is this 
the case. Take a look the the tracing information and you can see a "H" 
at the left bottom on page 1 which is missing on page 2, this is where 
ConTeXt places reference two. You get this "H" mark because 
\pagereference starts a new paragraph to ensure the is a anchorpoint but 
as a side effect you can end up with unwanted empty lines in your 
document, to test this change the argument of the first \fakelines from 
10 to 12 and now the stray "H" appears at the top left on the second 
page but in addition you get 2 empty lines at the top (1 for the 
reference and another 1 for the parskip).


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

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


[NTG-context] Re: Inserting text between end notes

2024-09-03 Thread Rik Kabel

Thank you for that, Bruce.

While it is still a hack, as you note, it is less fraught since one does 
not have to keep track of the last end note in each chapter.


I would still like to see a real ability to add text to the note collection.

--
Rik

On 2024-09-01 14:31, Bruce Horrocks wrote:



On 1 Sep 2024, at 03:53, Rik Kabel wrote:

Hello all,
I am trying to implement some style-guide-defined (Chicago 17, and now, 18) 
requirements to the end notes in a book. The need is to insert non-end-note 
text into the list of end notes. But end notes are not a list (as far as I can 
see) and \writetolist and such are no help.
The text to be inserted is of two types. The first is the name of the chapter 
from which the following notes were generated. It would be nice to 
automatically generate these.
The second type is pseudo-end-notes crediting the book and chapter epigraphs, 
which should appear as unnumbered end notes (at the start of the note section 
and the start of each chapter's notes). Ideally these would be generated in the 
same way as regular end notes but will not increment the note numbers (and 
should not, at least in my use case, require cross-referencing or bookmarking).
I can hack the first requirement with:
\define[1]\EndNoteChapter{\testpage[3]
   \blank
   \midaligned{\tfa{Chapter #1}}
   \blank}
in the environment and
\EndNoteChapter{6 How I Saved the World}
at the end of the last end note in the preceding chapter, but this is obviously 
prone to mistakes. I would rather integrate the handling into the chapter 
heading environment.
I suppose that this hack might be extended to handle the epigraph notes as 
well, but it is just a hack.
Has anyone successfully dealt with this before? If not, is there the 
possibility of adding similar functionality to \writetolist and such for end 
note structures?

Here’s a bit of a hack for the chapter splitting and might also enable the 
epigraphs for you as well (not quite sure what these should look like from your 
description.)

\definenote[mynote]
\setupnote[mynote][location=text]
\setupnotation[mynote][]

\definenote[chapone][mynote]
\definenote[chaptwo][mynote]
\definenote[chapthree][mynote] % etc

\starttext

\startchapter[title={AAA}]
\def\note#1{\chapone{#1}}
\dorecurse{15}
{ See my note at \note{something important}. }
\stopchapter

\startchapter[title={BBB}]
\def\note#1{\chaptwo{#1}}
\dorecurse{5}
{ See my note at \note{something important}. }
\stopchapter

\title{Endnotes}
Chapter 1 notes
\placenotes[chapone]
\blank[2*line]

Chapter 2 notes
\placenotes[chaptwo]

\stoptext


—
Bruce Horrocks
Hampshire, UK

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

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

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


[NTG-context] Combining styles (especially bold and italic)

2024-09-03 Thread Gerion Entrup
Hi,

I have the situation that I want to typeset a special formatted name within a 
section heading.
The name contains an italic part while the heading is bold, but both styles are 
defined at another place.
Is there a way to tell ConTeXt to combine them, so that it is bold _and_ italic?

Here is a minimal example:
```
\define\somename{HX\style[italic]{print}\autoinsertnextspace}

\setuphead[section, subject][style={\bfc}]

\starttext
\startsection[title=The \somename name]
\somename is a strange written name.
\stopsection
\stoptext
```

In the normal text, HXprint is written correctly, in the section heading 
"print" is italic but not bold.

Best
Gerion

signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Placement of floats with an "anchor"

2024-09-03 Thread Gerion Entrup
Hi,

in my document, I recently left a TODO note that said:
"This floating graphic needs to be on the same page than this formula at the 
end."

My floating graphic currently uses:
\startplacefigure[title={bla}, location=top, reference=fig:bla]
...
\stopplacefigure

The graphic should be at the top of the page where the formulas are typeset at 
the end.
Normally, I would do that manually, when all other text is finished.

Can I somehow automate this in ConTeXt? So defining a (non visible) "anchor" at 
a random place within the normal text and then tell ConTeXt to place the float 
at the same page (if possible)?

Here is a minimal example to play around (the float is placed on page 1, while 
the "anchor" is on page 2).

```
\starttext

\input{knuth}
\input{knuth}
\input{knuth}
% anchorto is made up to demonstrate the problem
\startplacefigure[title={A figure explaining the formula.}, location=top, 
reference=some, anchorto={eq:important}]
\startalign[center]
\style[sans]{This is a figure that explains the formula.}
\stopalign
\stopplacefigure

It is explained with these equations (see also figure \in[some]):
\startformula[reference=eq:important]
\startalign
\NC a \NC = b \NR
\NC a \NC = b \NR
\NC a \NC = b \NR
\NC a \NC = b \NR
\NC a \NC = b \NR
\NC a \NC = b \NR
\NC a \NC = b \NR
\NC a \NC = b \NR
\NC a \NC = b \NR
\stopalign
\stopformula
\input{knuth}
\input{knuth}
\input{ward}

\stoptext
```

Best
Gerion

signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: (ConTeXt LMTX) How do I fix the centering and setting up width in xtables?

2024-09-02 Thread Wolfgang Schuster

Felix schrieb am 01.09.2024 um 20:54:

https://pastebin.com/TQdzmxeP

I am trying to make a resume in ConTeXt (to see how well my skills have gotten, 
I am still quite a beginner) and Iw as able to produce what is in Pastebin.

Though, I am having trouble with the table that goes over the big sized text 
that would be my name. It has  an email, a phone number, and an address but 
they are all aligned very weirdly. I want them to be centered. Though, the 
phone number has some sort of problem with alignment, and I don;t know fi the 
other ones are causing it or are also aligned wrong.

I also wanted to make this code:

\startxcell[topframe=on,bottomframe=on,align=flushright]
 Ability to communicate strongly and effectively, being a reliable team 
member, supporting a team whenever needed, and the desire to help everyone
\stopxcell

has it so that it doesn't take up so much horizontal space (Ideally it is 
taking up 1/3 of the width I am allowing for since there are three rows in 
total) , but when I add width={some value} into the square brackets, it will 
add a blank line after all the text, and this is not what I want.


You have to add "option=fixed" to the cell with the width setting.

 begin example
\starttext

\startxtable[option=stretch]
  \startxrow
    \startxcell
  text text
    \stopxcell
    \startxcell[width=8cm]
  \samplefile{ward}
    \stopxcell
  \stopxrow
\stopxtable

\startxtable[option=stretch]
  \startxrow
    \startxcell
  text text
    \stopxcell
    \startxcell[option=fixed,width=8cm]
  \samplefile{ward}
    \stopxcell
  \stopxrow
\stopxtable

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: (ConTeXt LMTX) How do I fix the centering and setting up width in xtables?

2024-09-01 Thread Wolfgang Schuster

Felix schrieb am 01.09.2024 um 20:54:

https://pastebin.com/TQdzmxeP

I am trying to make a resume in ConTeXt (to see how well my skills have gotten, 
I am still quite a beginner) and Iw as able to produce what is in Pastebin.
Your next lesson is to learn how to create a minimal example which 
contains only the necessary information needed to show the problem.

Though, I am having trouble with the table that goes over the big sized text 
that would be my name. It has  an email, a phone number, and an address but 
they are all aligned very weirdly. I want them to be centered. Though, the 
phone number has some sort of problem with alignment, and I don;t know fi the 
other ones are causing it or are also aligned wrong.

I also wanted to make this code:

\startxcell[topframe=on,bottomframe=on,align=flushright]
 Ability to communicate strongly and effectively, being a reliable team 
member, supporting a team whenever needed, and the desire to help everyone
\stopxcell

has it so that it doesn't take up so much horizontal space (Ideally it is 
taking up 1/3 of the width I am allowing for since there are three rows in 
total) , but when I add width={some value} into the square brackets, it will 
add a blank line after all the text, and this is not what I want.

is there a way to fix what I am experiencing? I would also not mind if I could 
be told how to improve my code, whether it be by adding startxrowgroup, 
startxcellgroup, or head and footer sections., or other options. Thank you for 
reading.


Your problem the usage of "option=stretch" to add filler space in the 
table cells.


To calculate the space which is added in each cell context takes the 
widest text in each column
to calculate the current width of the table and when table is narrower 
then the page it distributes
the reaming spaces equally to all rows. This results in a different 
width for each row but another
problem in your case is that context takes the long text in the first 
row (even though it spans

three column) as value to compute the reaming space in the table.

The fix for your case is to set a fixed width for all three column which 
ensures the text
in the second column is centered. You can also simplify your setup by 
moving all settings
at the start of the table and the only local change is needed for the 
merged cells.


 begin example
\starttext

% width=.33tw

\startxtable[frame=off,topframe=on,bottomframe=on,width=.33tw,align=middle]
  \startxrow
    \startxcell[nx=3]
  contact information
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell
  email
    \stopxcell
    \startxcell
  phone
    \stopxcell
    \startxcell
  address
    \stopxcell
  \stopxrow
\stopxtable

% option=stretch

\startxtable[frame=off,topframe=on,bottomframe=on,option=stretch,align=middle]
  \startxrow
    \startxcell[nx=3]
  contact information
    \stopxcell
  \stopxrow
  \startxrow
    \startxcell
  email
    \stopxcell
    \startxcell
  phone
    \stopxcell
    \startxcell
  address
    \stopxcell
  \stopxrow
\stopxtable

\stoptext
 end example

Wolfgang

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

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


[NTG-context] Re: Inserting text between end notes

2024-09-01 Thread Bruce Horrocks


> On 1 Sep 2024, at 03:53, Rik Kabel  wrote:
> 
> Hello all,
> I am trying to implement some style-guide-defined (Chicago 17, and now, 18) 
> requirements to the end notes in a book. The need is to insert non-end-note 
> text into the list of end notes. But end notes are not a list (as far as I 
> can see) and \writetolist and such are no help.
> The text to be inserted is of two types. The first is the name of the chapter 
> from which the following notes were generated. It would be nice to 
> automatically generate these.
> The second type is pseudo-end-notes crediting the book and chapter epigraphs, 
> which should appear as unnumbered end notes (at the start of the note section 
> and the start of each chapter's notes). Ideally these would be generated in 
> the same way as regular end notes but will not increment the note numbers 
> (and should not, at least in my use case, require cross-referencing or 
> bookmarking).
> I can hack the first requirement with:
> \define[1]\EndNoteChapter{\testpage[3]
>   \blank
>   \midaligned{\tfa{Chapter #1}}
>   \blank}
> in the environment and
> \EndNoteChapter{6 How I Saved the World}
> at the end of the last end note in the preceding chapter, but this is 
> obviously prone to mistakes. I would rather integrate the handling into the 
> chapter heading environment.
> I suppose that this hack might be extended to handle the epigraph notes as 
> well, but it is just a hack.
> Has anyone successfully dealt with this before? If not, is there the 
> possibility of adding similar functionality to \writetolist and such for end 
> note structures?

Here’s a bit of a hack for the chapter splitting and might also enable the 
epigraphs for you as well (not quite sure what these should look like from your 
description.)

\definenote[mynote]
\setupnote[mynote][location=text]
\setupnotation[mynote][]

\definenote[chapone][mynote]
\definenote[chaptwo][mynote]
\definenote[chapthree][mynote] % etc

\starttext

\startchapter[title={AAA}]
\def\note#1{\chapone{#1}}
\dorecurse{15}
{ See my note at \note{something important}. }
\stopchapter

\startchapter[title={BBB}]
\def\note#1{\chaptwo{#1}}
\dorecurse{5}
{ See my note at \note{something important}. }
\stopchapter

\title{Endnotes}
Chapter 1 notes
\placenotes[chapone]
\blank[2*line]

Chapter 2 notes
\placenotes[chaptwo]

\stoptext


—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] Problem with end note processing

2024-08-31 Thread Rik Kabel

Hello all,

I am working through some issues with end notes, and came across a what 
appears to be a bug as demonstrated in the following MWE.


ConTeXt  ver: 2024.08.16 15:49 LMTX  fmt: 2024.8.16  int: english/english

   \setupnote [endnote][location=none]
   \setupnotation [endnote][]
   \starttext
   text\endnote[-]{end note}
   text\endnote{end note}
   %text\endnote[-]{end note}
   \placenotes[end note]
   \stoptext

When run as shown, both end notes get indices, but the first should not. 
When the commented line is enabled, none of the three end notes gets an 
index, but the second should. It seems that the last end note determines 
the display for all end notes.


I have other questions about end notes that I will submit separately.

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

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


[NTG-context] Re: Is there an alternative to \reference[]{} that won't interfere with the document design?

2024-08-31 Thread Jürgen Hanneder via ntg-context


I recently learned not to leave a space before and after \reference ,  
but have not seen
further complex problems as you describe so far. Can you give more  
specific examples for these,

I have to check, because I am also finalising a book at the moment.

Best wishes,
Jürgen

- Nachricht von Bruce Horrocks  -
 Datum: Sat, 31 Aug 2024 16:06:41 +0100
   Von: Bruce Horrocks 
Antwort an: mailing list for ConTeXt users 
   Betreff: [NTG-context] Re: Is there an alternative to  
\reference[]{} that won't interfere with the document design?

An: ntg-context mailing list 



On 31 Aug 2024, at 15:37, Joel via ntg-context  wrote:

I've found just placing \reference[]{} anywhere on a page will  
create extra blank spaces,


In the following MWE you should get two spaces, no spaces and one  
space respectively. If you get spaces with some other combination  
then please try and produce a short example.


\starttext
This is my text \reference[a]{} and more following.

This is my text\reference[b]{}and more following.

This is my text\reference[c]{} and more following.

\stoptext

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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl

webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___



- Ende der Nachricht von Bruce Horrocks  -



---

Prof. Dr. Juergen Hanneder
Philipps-Universitaet Marburg
FG Indologie u. Tibetologie
Deutschhausstr.12
35032 Marburg
Germany
Tel. 0049-6421-28-24930
hanne...@staff.uni-marburg.de

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

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


[NTG-context] Re: Is there an alternative to \reference[]{} that won't interfere with the document design?

2024-08-31 Thread Bruce Horrocks


> On 31 Aug 2024, at 15:37, Joel via ntg-context  wrote:
> 
> I've found just placing \reference[]{} anywhere on a page will create extra 
> blank spaces,

In the following MWE you should get two spaces, no spaces and one space 
respectively. If you get spaces with some other combination then please try and 
produce a short example.

\starttext
This is my text \reference[a]{} and more following.

This is my text\reference[b]{}and more following.

This is my text\reference[c]{} and more following.

\stoptext

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


[NTG-context] Re: registers in footnotes as page glossaries

2024-08-31 Thread M U via ntg-context
Pablo Rodriguez wrote:
> Hans,
> 
> I wonder whether MkXL may have page registers for footnotes.
> 
> This would be great to have page glossaries, such as in
> https://geoffreysteadman.com/wp-content/uploads/2017/08/lysiascrito-24aug17w...
> (first apparatus).
> 
> To be fair, I have asked that a while ago (with MkIV).
> 
> It would be great to have these page glossaries as language aids.
> 
> Right now, they need to be composed manually (using a word processor, no
> TeX).
> 
> Many thanks for your help,
> 
> Pablo

Perhaps a feaseble workaround:
• place a section index after the content of the page

The cons:
• pagebreaking by sectioning manually the content of a page 


\setuppapersize[A5]

\startbuffer[buf:dict:achilles]
  He was a hero.
\stopbuffer

\startbuffer[buf:dict:divine]
  Has something to do with gods and godesses.
\stopbuffer

\startbuffer[buf:dict:xxx]
  The same information used multiple times.
\stopbuffer

\defineprocessor[proc:achilles][right={ \ss \inlinebuffer[buf:dict:achilles]}]
\defineprocessor[proc:divine][right={ \ss \inlinebuffer[buf:dict:divine]}]
\defineprocessor[proc:xxx][right={ \it \inlinebuffer[buf:dict:xxx]}]

\setupsection[section][placehead=hidden,aftersection=\pagebreak]

\definelinenumbering[Poem][step=5,continue=yes]

\defineregister[Dict][pagenumber=no,indicator=no,n=2,criterium=section,before=,textcommand=\bf]


\starttext

\startsection[title=pageA]
\startlines
\startlinenumbering[Poem]

\Dict{proc:achilles->Achilles}Achilles sing, O \Dict{proc:xxx->Goddess}Goddess! 
Peleus’ son;
His wrath pernicious, who ten thousand woes
Caused to \Dict{proc:xxx->Achaia}Achaia’s host, sent many a soul
Illustrious into Ades premature,
And Heroes gave (so stood the will of Jove)
To dogs and to all ravening fowls a prey,
When fierce dispute had separated once
The noble Chief \Dict{proc:achilles->Achilles}Achilles from the son
Of Atreus, \Dict{proc:xxx->Agamemnon}Agamemnon, King of men.

\stoplinenumbering
\stoplines

\hl[20]

\placeregister[Dict]

\stopsection


\startsection[title=pageB]
\startlines
\startlinenumbering[Poem]

Who them to strife impell’d? What power \Dict{proc:divine->divine}divine?
Latona’s son and Jove’s. For he, incensed
Against the \Dict{proc:xxx->King}King, a foul 
\Dict{proc:xxx->contagion}contagion raised
In all the host, and multitudes destroy’d,
For that the son of \Dict{proc:xxx->Atreus}Atreus had his priest
Dishonored, \Dict{proc:xxx->Chryses}Chryses. To the fleet he came
Bearing rich ransom glorious to redeem
His daughter, and his hands charged with the wreath
And golden sceptre of the God shaft-arm’d.

\stoplinenumbering
\stoplines

\hl[20]

\placeregister[Dict]

\stopsection

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

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


[NTG-context] Re: for loop not working in metapost

2024-08-30 Thread Mikael Sundqvist
Hi,

try "dashed evenly" instead of just "dashed".

/Mikael (did not test...)

On Fri, Aug 30, 2024 at 1:24 PM Shiv Shankar Dayal
 wrote:
>
> Hi,
>
> I have plotted a log function and I want to draw an xy axis grid.
> Below is the code
>
> \starttext
> \startMPcode
> draw function(1,"x", "log(x)", .1, 10, .01) scaled 1cm;
> for i = 0 upto 10:
>draw (i*cm, -5cm) -- (i*cm, 5cm) dashed;
> endfor;
> for i = -5 upto 5:
>draw (0, i*cm) -- (10cm, i*cm) dashed;
> endfor;
> \stopMPcode
> \stoptext
>
> My first for loop draws lines but the second gives me an error. Please help.
> --
> Respect,
> Shiv Shankar Dayal
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] for loop not working in metapost

2024-08-30 Thread Shiv Shankar Dayal
Hi,

I have plotted a log function and I want to draw an xy axis grid.
Below is the code

\starttext
\startMPcode
draw function(1,"x", "log(x)", .1, 10, .01) scaled 1cm;
for i = 0 upto 10:
   draw (i*cm, -5cm) -- (i*cm, 5cm) dashed;
endfor;
for i = -5 upto 5:
   draw (0, i*cm) -- (10cm, i*cm) dashed;
endfor;
\stopMPcode
\stoptext

My first for loop draws lines but the second gives me an error. Please help.
-- 
Respect,
Shiv Shankar Dayal
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Defining mathsymbols from unicode char

2024-08-29 Thread Wolfgang Schuster

Jethro Djan schrieb am 29.08.2024 um 21:27:

Dear all,

1. I am trying to define the "pitchfork" unicode 
character(https://unicodeplus.com/U+22D4) to use in ConTeXt as stated on 
page 387 of new math manual authored by Hans and Mikael:

\definemathsymbol[pitchfork][relation]["22D4]

It works with some unicode characters and not others (like this 
character). What can I do to make it work?


1. You forgot to provide a minimal example to reproduce the problem.

2. You need a math which contains the symbol because you can't expect to 
get each symbol with all of them.


You can run the following sample to see which font contains \pitchfork.

 begin example
\starttext

\doloopoverlist
  {antykwa,
   antykwa-light,
   antykwa-cond,
   bonum,
   cambria,
   concrete,
   dejavu,
   ebgaramond,
   erewhon,
   iwona,
   iwona-light,
   koeieletters,
   kpfonts,
   kurier,
   kurier-light,
   libertinus,
   lucida,
   modern,
   pagella,
   schola,
   stixtwo,
   termes,
   xcharter}
  {\mono{\recursestring:} \begingroup
 \switchtobodyfont[\recursestring]
 \im{\pitchfork}
   \endgroup \par}

\stoptext
 end example

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

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


[NTG-context] Re: Steps to become a ConTeXt developer

2024-08-28 Thread Mojca Miklavec
On Wed, 28 Aug 2024 at 12:03, Shiv Shankar Dayal wrote:
>
> I have two specific interests. I want to make asymptote work with ConTeXt
> but I can live with including generated images and use PDFs.

This is a much better specified question.

It would ideally require some work both on the Asymptote side, as well
as some work on the ConTeXt side.

Asymptote is in fact written in C++, so it might be a lot closer to
your particular expertise.

I would say that what's most needed is someone with a great passion to
get this complete, and some clear communication pathway between the
two projects.

Asymptote is very LaTeX-centric and should ideally be ConTeXt-ilized
to simplify some operations. I would start by playing with a super
simple minimum example written in plain asymptote. Figure out how to
compile Asymptote on your computer and try to process the asy file
into a ConTeXt file. This conversion then needs to be tweaked in order
to produce two different results:
- A standalone file that could be processed directly by ConTeXt.
- A minimalistic file that could be included from another ConTeXt
source to generate the final document.

Check the file that you get right now, figure out what goes wrong,
what could be improved ...
If you have a simple file that no longer needs asymptote processing,
you can check on the ConTeXt list what could still be improved, and
then you can go and start fiddling with Asymptote source code (with
help of Asy developers) until the files get progressively better.

Iterate between the Asymptote and ConTeXt developers until the results
are fully satisfactory.

It has been a while since I touched any asymptote, but I suspect that
what you want to achieve is something like

\starttext
\startasymptote
some graphics
\stopasymptote

\placefigure[label]{really nice 3D model}{%
\startasymptote
another 3D graphics
\stopasymptote}
\stoptext

where ConTeXt would process this file, prepare some input to
asymptote, and then asymptote would have to be called just once to
generate all the required graphics at once, and ConTeXt would
eventually include them, properly scaled etc.

Start with graphics, continue with simple text labels ... progress
towards proper interactive 3D models ...

> The second interest is in Aditya Mahajan's syntax highlighting module.
> It is very nice but it invokes VI making the entire thing slow. I understand
> the advantage of using VI is that we do not have to implement anything
> when a new language comes. VI will have syntax highlighting and it will
> be automatically done for us.

ConTeXt does support native syntax highlighting. You can try to create
some new grammars to extend language coverage (Hans only made sure
that TeX, lua, metapost etc. work correctly). Or you can try to start
brainstorming whether some existing OpenSource grammars could be
integrated to do syntax highlighting using Lua.

Vi was a shortcut to get the syntax highlighting done in some way at all.

In either case start a separate thread covering exactly that one topic.

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

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


[NTG-context] Re: Help with Metapopst code

2024-08-28 Thread Wolfgang Schuster

Shiv Shankar Dayal schrieb am 28.08.2024 um 12:23:

I don't know where you found the code, but the answer to "What is (0,
r) rotated (a *i) doing?" is that it takes the point (0,r) and rotates
it a*i degrees.


I do not understand the concept of rotating a point. It is rotated with respect
to what reference?


You rotate around a point with the x and y coordinates 0.

The blue dot shows the point with the coordinates 0. The green dot is 
rotated around this point.


\starttext

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
drawdot (1.5cm,0) withpen pencircle scaled 5mm withcolor green;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
drawdot (1.5cm,0) rotated (30) withpen pencircle scaled 5mm withcolor green;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
drawdot (1.5cm,0) rotated (60) withpen pencircle scaled 5mm withcolor green;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\startMPcode
drawdot (0,0) withpen pencircle scaled 5mm withcolor blue;
drawdot (1.5cm,0) rotated (90) withpen pencircle scaled 5mm withcolor green;
draw fullsquare scaled (4cm) withcolor red;
\stopMPcode

\stoptext

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

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


[NTG-context] Re: Is there a way to apply withpattern to text, like fillcolor in lmt_outline[].

2024-08-28 Thread Hans Hagen via ntg-context

On 8/28/2024 10:05 AM, ai2472206...@yeah.net wrote:

hi ,
Is there a way to apply withpattern to text, like fillcolor in lmt_outline[].

what I envisaged:
https://imgse.com/i/pAAkfjf

I've found someone who has asked a similar question,
just a combination of the two functions : lmt_outline[] and  lmt_shade[] in 
that question.

question from
https://mailman.ntg.nl/archives/list/ntg-context@ntg.nl/thread/D5GBGF3RXN75UGZVHX6LDY7LXGGZKMHR/#7JS33W44JDJM355TDDPY5L4R7FJQ6QLZ

However, this example didn't work successfully on the Mac,
it just showed a background color block.

\starttext

\startMPpage
 path tt ; tt := lmt_outline [
 kind = "outline",
 text = "\definedfont[name:texgyrepagellabold*default]foo f o o",
 ] xsized 12cm ;

  %  fill tt
  % withshademethod "linear"
  % withshadedirection down
  % withshadecolors (red, blue) ;

 draw tt
withpattern image (fill fullcircle scaled 5mm withcolor 
"darkgreen" ;)

withpatternscale (1/200,1/40) ;

\stopMPpage

\stoptext


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

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

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


[NTG-context] Re: Questions regarding fonts: obliques (fake italics), ligatures and kerning

2024-08-27 Thread Gerion Entrup
Hi,

thank you, that answers all my questions!

Gerion

Am Mittwoch, 28. August 2024, 00:03:34 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 27.08.2024 um 23:29:
> > Am Dienstag, 27. August 2024, 22:30:16 MESZ schrieb Wolfgang Schuster:
> >> Gerion Entrup schrieb am 27.08.2024 um 21:28:
> >>> Hi,
> >>>
> >>> I played around with different fonts, especially Bitstream XCharter and 
> >>> Overpass (http://overpassfont.org/) and wanted to combine them.
> >>> However, I see some issues regarding ligatures, kerning and 
> >>> obliques/italics.
> >>>
> >>> Here is a minimal example:
> >>> ```
> >>> \definefontfeature[default][mode=node, kern=yes, liga=yes]
> >>> % more features
> >>> % [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, 
> >>> language=dflt, protrusion=quality, expansion=quality]
> >> There is no need to set default features like ligatures and kerning, the
> >> better alternative here is to use
> >>
> >>   \definefontfeature [default] [default] [protrusion=quality,...]
> >>
> >> which adds additional settings to the default set.
> >>
> >>> \definefontfamily [myfont][roman][xcharter]
> >>> \definefontfamily [myfont][sansserif][overpass][rscale=0.93]
> >>> \definefontfamily [myfont][teletype][overpass][rscale=0.93]
> >>> \definefontfamily [myfont][mono][overpassmono][rscale=0.93]
> >>> \definetypeface   [myfont][mathematics][math] [xcharter]
> >>>
> >>> \setupbodyfont[myfont, 11pt]
> >>>
> >>> \startTEXpage
> >>>
> >>> \showfontkerns
> >>>
> >>>Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
> >>> abcdel™}, \slanted{effi abcdel™}\\
> >>> \style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
> >>> abcdel™}, \slanted{effi abcdel™}}\\
> >>> \style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
> >>> abcdel™}, \slanted{effi abcdel™}}\\
> >>>
> >>> \showbodyfont[myfont]
> >>>
> >>> \stopTEXpage
> >>> ```
> >>> It produces the PDF in the attachment. I'm struggling with several things:
> >>> - xcharter seems to have no kerning applied. It is listed as font 
> >>> feature, though. Is it correct to have no kerning at all for that font?
> >> The font has kerning information but none for characters in the ASCII 
> >> range.
> > Good to know. Especially for the "Va" in "Vase", I expected kerning (it 
> > looks not equally spaced currently).
> >
> >
> >>> - xcharter also have no ligatures (at least it doesn't look like that). 
> >>> That is listed as font feature, too, although only for italic and 
> >>> slanted. According to https://tug.org/FontCatalogue/xcharter/ there are 
> >>> ligatures in the font.
> >> There are ligatures for ff[il].
> > They are defined in the font, but they are not used in the PDF output, 
> > aren't they? For example in the "ffi" in "Effizient" the "f" is not 
> > connected with the "i", while the ligature glyph has a connection there.
> 
> You have to change the value of the script tag because the don't set 
> them for the dflt script.
> 
> \definefontfeature[default][default][script=latn]
> 
> \definefontfamily[myfont][rm][xcharter]
> 
> \setupbodyfont[myfont]
> 
> \showmakeup[glyph]
> 
> \starttext
> 
> ff fi fl ffi ffl fb fh fk
> 
> \feature[-][ligatures]
> 
> ff fi fl ffi ffl fb fh fk
> 
> \stoptext
> 
> > I attached a screenshot for comparison. The ligature was generated with 
> > "\ShowCompleteFont{name:xcharter*default}{11pt}{1}" (with the fnt-10 
> > module).
> > It is, however, noticeable that the whole xcharter font is thicker in the 
> > output of \ShowCompleteFont. Is this part of the reason?
> 
> When you load a font by name use one which is listed in the table you 
> get with "mtxrun --script fonts --list --all  --pattern=xcharter*". In 
> this case the table is
> 
> identifierfamilyname fontname 
> filename   subfont   instances
> 
> xcharterbold  xcharter   xcharterbold XCharter-Bold.otf
> xcharterbolditalicxcharter   xcharterbolditalic 
> XCharter-BoldItalic.otf
> xcharterboldslanted   xcharter   xcharterboldslanted 
> XCh

[NTG-context] Re: Questions regarding fonts: obliques (fake italics), ligatures and kerning

2024-08-27 Thread Wolfgang Schuster

Gerion Entrup schrieb am 27.08.2024 um 23:29:

Am Dienstag, 27. August 2024, 22:30:16 MESZ schrieb Wolfgang Schuster:

Gerion Entrup schrieb am 27.08.2024 um 21:28:

Hi,

I played around with different fonts, especially Bitstream XCharter and 
Overpass (http://overpassfont.org/) and wanted to combine them.
However, I see some issues regarding ligatures, kerning and obliques/italics.

Here is a minimal example:
```
\definefontfeature[default][mode=node, kern=yes, liga=yes]
% more features
% [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, 
protrusion=quality, expansion=quality]

There is no need to set default features like ligatures and kerning, the
better alternative here is to use

  \definefontfeature [default] [default] [protrusion=quality,...]

which adds additional settings to the default set.


\definefontfamily [myfont][roman][xcharter]
\definefontfamily [myfont][sansserif][overpass][rscale=0.93]
\definefontfamily [myfont][teletype][overpass][rscale=0.93]
\definefontfamily [myfont][mono][overpassmono][rscale=0.93]
\definetypeface   [myfont][mathematics][math] [xcharter]

\setupbodyfont[myfont, 11pt]

\startTEXpage

\showfontkerns

   Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}\\
\style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}}\\
\style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi 
abcdel™}, \slanted{effi abcdel™}}\\

\showbodyfont[myfont]

\stopTEXpage
```
It produces the PDF in the attachment. I'm struggling with several things:
- xcharter seems to have no kerning applied. It is listed as font feature, 
though. Is it correct to have no kerning at all for that font?

The font has kerning information but none for characters in the ASCII range.

Good to know. Especially for the "Va" in "Vase", I expected kerning (it looks 
not equally spaced currently).



- xcharter also have no ligatures (at least it doesn't look like that). That is 
listed as font feature, too, although only for italic and slanted. According to 
https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font.

There are ligatures for ff[il].

They are defined in the font, but they are not used in the PDF output, aren't they? For example in the "ffi" 
in "Effizient" the "f" is not connected with the "i", while the ligature glyph has a 
connection there.


You have to change the value of the script tag because the don't set 
them for the dflt script.


\definefontfeature[default][default][script=latn]

\definefontfamily[myfont][rm][xcharter]

\setupbodyfont[myfont]

\showmakeup[glyph]

\starttext

ff fi fl ffi ffl fb fh fk

\feature[-][ligatures]

ff fi fl ffi ffl fb fh fk

\stoptext


I attached a screenshot for comparison. The ligature was generated with 
"\ShowCompleteFont{name:xcharter*default}{11pt}{1}" (with the fnt-10 module).
It is, however, noticeable that the whole xcharter font is thicker in the 
output of \ShowCompleteFont. Is this part of the reason?


When you load a font by name use one which is listed in the table you 
get with "mtxrun --script fonts --list --all  --pattern=xcharter*". In 
this case the table is


identifier    familyname fontname 
filename   subfont   instances


xcharterbold  xcharter   xcharterbold XCharter-Bold.otf
xcharterbolditalic    xcharter   xcharterbolditalic 
XCharter-BoldItalic.otf
xcharterboldslanted   xcharter   xcharterboldslanted 
XCharter-BoldSlanted.otf

xcharteritalic    xcharter   xcharteritalic XCharter-Italic.otf
xchartermath  xchartermath   xchartermath XCharter-Math.otf
xchartermathbold  xchartermathbold   xchartermathbold 
XCharter-Math-Bold.otf

xchartermathmedium    xchartermath   xchartermath XCharter-Math.otf
xchartermathregular   xchartermath   xchartermath XCharter-Math.otf
xcharternormal    xcharter   xcharteritalic XCharter-Italic.otf
xcharterregular   xcharter   xcharterroman XCharter-Roman.otf
xcharterroman xcharter   xcharterroman XCharter-Roman.otf
xcharterslanted   xcharter   xcharterslanted 
XCharter-Slanted.otf


and as you can see there is no entry "xcharter". In your case context 
loaded the bold version of the font but when you use "xcharterroman" as 
name the document shows the normal upright version.



- Overpass has a glyph for the ae ligature. Is it normal that it is not used as 
a ligature for ae?

This seems to be a stupid decision to replace ae by default with a
ligature, maybe dependent on the language but not for all of them.

Ok, I've seen it here as (somewhat) common ligature: 
https://en.wikipedia.org/wiki/Ligature_(writing)#Computer_typesetting
But there is also mentioned that TeX just has ff, fi

[NTG-context] BUG REPORT: Italic Correction in ConTeXt LMTX

2024-08-26 Thread contact
Hello,

I started using ConTeXt LMTX 2 days ago and after some initial testing I 
noticed an unexpected behavior regarding italic correction.

In short, I cannot seem to produce italic correction like I could in plain TeX 
or even LaTeX.

I've asked the question on TeX StackExchange and another user confirmed the 
suspicion in his answer. I would suggest you take a look at it because the 
formatting of the question and the answer is prettier than in this plain text 
email. Furthermore, a person who provided the answer already did some research. 
See the question here:

https://tex.stackexchange.com/questions/724568/how-to-invoke-italic-correction-in-context-lmtx

Here is what I observed:

Compare the kerning produced in between 'r' and 'p' in the word "airport" when 
italic correction is applied in plain TeX (compiled with `pdftex`) and in 
ConTeXt LMTX (compiled with `luametatex`). Here are the minimal working 
examples.

Plain TeX

```
airport (regular font)

{\it air\/}port (italic correction applied)

{\it air}port (no italic correction applied)
\bye
```

ConTeXt LMTX

```
\starttext
airport (regular font)

{\it air\/}port (italic correction applied)

{\it air}port (no italic correction applied)
\stoptext
```

Please confirm if this, in fact, is the issue/bug or if I am not approaching 
this correctly. I am brand new to ConTeXt, so it could be me. Thank you in 
advance!

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

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


[NTG-context] Re: chapter counter?

2024-08-26 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 26.08.2024 um 20:14:

Am 26.08.24 um 17:57 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 26.08.2024 um 17:41:

Hi,
I’d like to check the chapter number like

\ifodd\rawcountervalue[chapter]
What an odd chapter!
\fi

but apparently the counter isn’t called "chapter", or I’m doing it 
wrong otherwise.

Could you enlighten me?


\namedheadnumber{chapter}


Thank you, but it doesn’t work in my setup where I’m trying to change a 
background image depending on the chapter number:


\defineoverlay[BG][\start
\ifodd\namedheadnumber{chapter}\relax
\externalfigure[bgimage][height=\overlayheight]
\else
\mirror{\externalfigure[bgimage][height=\overlayheight]}
\fi
\stop]

This is then used with

\setlayerframed[papier][background=BG]

I guess it’s expanded only once.

But it was a bad idea anyway, I wanted more than two variants and now 
just set them as a uservariable.


Without more information there is no way to provide a solution but for 
the archive there is below a solution to get mirrored images for even 
chapters. The background has also a check an image before the start of 
the first chapter.


\setupexternalfigure[location=default]

\defineoverlay
  [BackGround]
  [\ifzeronum\namedheadnumber{chapter}\relax
 %
   \orelse\ifodd\namedheadnumber{chapter}\relax
 \externalfigure[mill][factor=min]%
   \else
 \mirror{\externalfigure[mill][factor=min]}%
   \fi]

\setupbackgrounds[page][background=BackGround]

\starttext

FooBar

\chapter{Foo}

\chapter{Bar}

\stoptext

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

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


[NTG-context] Re: chapter counter?

2024-08-26 Thread Aditya Mahajan
On Mon, 26 Aug 2024, Henning Hraban Ramm wrote:

> Hi,
> I’d like to check the chapter number like
> 
> \ifodd\rawcountervalue[chapter]
> What an odd chapter!
> \fi
> 
> but apparently the counter isn’t called "chapter", or I’m doing it wrong
> otherwise.
> Could you enlighten me?

You need: \somenamedheadnumber{chapter}{current}


\starttext

\startsection[title=First]
This is: \somenamedheadnumber{section}{current}

\ifodd\somenamedheadnumber{section}{current}\relax
  This is odd
\else
  This is even
\fi
  
\stopsection

\startsection[title=Second]
This is: \somenamedheadnumber{section}{current}

\ifodd\somenamedheadnumber{section}{current}\relax
  This is odd
\else
  This is even
\fi
  
\stopsection


\stoptext


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

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


[NTG-context] Re: understanding units / dimensions

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

On 8/25/2024 2:15 PM, Wolfgang Schuster wrote:


How differs "1" from "2"?
* em fs


\startbuffer[dimensions]
\starttabulate
\NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth
\NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize
\stoptabulate
\stopbuffer

\starttext

\getbuffer[dimensions]

\setupbodyfont[14.4pt]

\getbuffer[dimensions]

\stoptext
Often they are the same (basically font units) but there can be some 
rounding going on; also bodyfont sizes are clipped


\starttext
\the\numexpr(\dimexpr1fs\relax/65536)*100\relax\par
\the\numexpr(\dimexpr1em\relax/65536)*100\relax

\the\dimexpr1fs\relax\par
\the\dimexpr1em\relax
\stoptext

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

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

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


[NTG-context] index entry with sorting and processor

2024-08-25 Thread Henning Hraban Ramm

Hi again,

the page number of register entries from a glossary should have a 
different color:


\defineprocessor[glossar][color=green]
\define[1]\GlIndex{\index[glossar->]{#1}}

This works, but I’d like to apply a macro to the text, and then I need 
to set the sort order:


\define[1]\GlIndex{\index[glossar->#1]{\Word{#1}}}

This also works, but I get separate index entries from
\index{Something}
and
\GlIndex{something}

Glossary entries may be lowercase, but in the index I’d like to 
normalize to uppercase initials. (The index command is part of a lemma 
setup.)


How can I combine the entries?

I also tried \setregisterentry but didn’t find out how to use a 
processor for the page number. In the wiki, the (generally working) 
processor option is undocumented, so if there’s another option, it’s 
also missing.
In the source, I found processors for entry & page, but not how to 
address the latter.


MWE:
"""
\defineprocessor[glossar][color=green]
\define[1]\GlIndex{\index[glossar->#1]{\Word{#1}}}

\starttext

\samplefile{ward}
\index{something}
\index{anything}
\page

\samplefile{tufte}
\GlIndex{something}
\GlIndex{anything}

\page
\placeindex
\stoptext

"""

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

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


[NTG-context] Re: [ how to remove speae before (and after) \startitemize ?

2024-08-25 Thread Wolfgang Schuster

vm via ntg-context schrieb am 25.08.2024 um 14:36:

Any hint as how to remove the automatic default space before and after
\startitemize and have equal line spacing between all text lines?


\starttext
one two three
\startitemize[packed]


\startitemize[packed,joinedup]

or

\startitemize[packed][before=,after=]

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

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


[NTG-context] Is there a short-cut to adding sub-categories for index entries?

2024-08-25 Thread Joel via ntg-context
 
I have a document with thousands of index entries. Here’s a samplecode:




\starttext

 Some people livedin \index{cliff-dwelling}cliff-dwellings, while others lived 
in\index{lean-to}lean-tos.




\placeindex

\stoptext




This produces anindex like this:







c

cliff-dwelling 1







 l

 lean-to 1




I’d like to createan index with much more sub-categories to find the same 
entries, forinstance, a category of “dwellings”:




c

cliff-dwelling 1







d

dwellings

 cliff-dwelling 1

 lean-to 1




 l

 lean-to 1




As I’m aware, theway to code this is as follows:

\starttext

 Some people 
livedin\index{cliff-dwelling}\index{dwellings+cliff-dwelling}cliff-dwellings,while
 others lived in\index{lean-to}\index{dwellings+lean-to}lean-tos.




\placeindex

\stoptext



I’m wondering ifthere is a short-cut means to set this up, such that if I can 
tellthe document that any time it sees “cliff-dwellings” in an index,it will 
also add its page numbers to under “dwellings+cliff-dwelling”? In other words, 
is there an easierway to add these categories, then to go through the entire 
documentand mark them? I already have a list of all the words. 
For instance, in my above code, I must find every \index{cliff-dwelling} entry 
and add a \index{dwellings+cliff-dwelling} next to it...which would take 
hundreds of hours if I did that for every word. Is there a quicker way to tell 
it always also add it under "dwellings" too?




--Joel

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

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


[NTG-context] [ how to remove speae before (and after) \startitemize ?

2024-08-25 Thread vm via ntg-context

Any hint as how to remove the automatic default space before and after
\startitemize and have equal line spacing between all text lines?


\starttext
one two three
\startitemize[packed]
\item one
\item two
\item three
\stopitemize
four five six
\stoptext



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

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


[NTG-context] Re: understanding units / dimensions

2024-08-25 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 25.08.2024 um 13:45:
At the meeting I noted a few units that I didn’t know about, while I 
already knew many.


* general units: in, m, cm, mm (ft?)
* typographical units: pt, dd, bp, pc, cc, sp
* font related: em, ex, fs, fa, fd, fc, ch
* layout related: pw, ph, tw, th, cw, cd, lw, hs, vh
* frame related: fw, fh, fo
* funits: dk, es, tv, eu

Are there even more?


Yes, there are more of them.

Look into the lowlevel-registers document which describes how they are
created and also how you can define your own identifiers with \newuserunit.


Questions:

How differs "1" from "2"?
* em fs


\startbuffer[dimensions]
\starttabulate
\NC em \EQ \the\dimexpr1em\relax \NC\NR % \emwidth
\NC fs \EQ \the\dimexpr1fs\relax \NC\NR % \globalbodyfontsize
\stoptabulate
\stopbuffer

\starttext

\getbuffer[dimensions]

\setupbodyfont[14.4pt]

\getbuffer[dimensions]

\stoptext



* lw hs


lw stands for \linewidth which is the default value for rulethickness in 
\framed etc.


hs is just \hsize.


* ph vh


ph is \paperheight.

vh doesn't exist.


Wolfgang

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

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


[NTG-context] Re: Any way to forbid boldface for a section of text?

2024-08-25 Thread Wolfgang Schuster

Wolfgang Schuster schrieb am 24.08.2024 um 17:49:

Denis Maier via ntg-context schrieb am 24.08.2024 um 08:25:
You could define a specific typescript for that without a definition 
for bold.


Below is an implementation of your suggestion which gets rid of all font 
styles for serif, sans serif and monospace fonts.


\starttypescript [serif,sans,mono] [uprightonly]
     \definefontsynonym [\typescriptprefix\typescriptone Italic] 
[\typescriptprefix\typescriptone]
     \definefontsynonym [\typescriptprefix\typescriptone Slanted] 
[\typescriptprefix\typescriptone]
     \definefontsynonym [\typescriptprefix\typescriptone Bold] 
[\typescriptprefix\typescriptone]
     \definefontsynonym [\typescriptprefix\typescriptone BoldItalic] 
[\typescriptprefix\typescriptone]
     \definefontsynonym [\typescriptprefix\typescriptone BoldSlanted] 
[\typescriptprefix\typescriptone]

\stoptypescript

\starttypescript [uprightonly]
     \definetypeface [\typescriptone] [rm] [serif] [\typescriptone]
     \definetypeface [\typescriptone] [ss] [sans]  [\typescriptone]
     \definetypeface [\typescriptone] [tt] [mono]  [\typescriptone]
\stoptypescript

\setupbodyfont[pagella]

\starttext

xxx {\bf yyy} xxx {\it zzz} xxx

\start \switchtobodyfont[uprightonly]
xxx {\bf yyy} xxx {\it zzz} xxx
\stop

xxx {\bf yyy} xxx {\it zzz} xxx

\stoptext


In the next release you don't have to create the typescript anymore 
because Hans is including it with the other typescripts and in addition 
it will also support math input.


The new complete minimal example is now:

\usetypescriptfile[uprightonly]

\starttext

xxx {\bf yyy} xxx {\it zzz} xxx

\start \switchtobodyfont[uprightonly]
xxx {\bf yyy} xxx {\it zzz} xxx
\stop

xxx {\bf yyy} xxx {\it zzz} xxx

\stoptext

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

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


[NTG-context] Re: Any way to forbid boldface for a section of text?

2024-08-24 Thread Wolfgang Schuster

Denis Maier via ntg-context schrieb am 24.08.2024 um 08:25:
You could define a specific typescript for that without a definition for 
bold.


Below is an implementation of your suggestion which gets rid of all font 
styles for serif, sans serif and monospace fonts.


\starttypescript [serif,sans,mono] [uprightonly]
\definefontsynonym [\typescriptprefix\typescriptone Italic] 
[\typescriptprefix\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone Slanted] 
[\typescriptprefix\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone Bold] 
[\typescriptprefix\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone BoldItalic] 
[\typescriptprefix\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone BoldSlanted] 
[\typescriptprefix\typescriptone]

\stoptypescript

\starttypescript [uprightonly]
\definetypeface [\typescriptone] [rm] [serif] [\typescriptone]
\definetypeface [\typescriptone] [ss] [sans]  [\typescriptone]
\definetypeface [\typescriptone] [tt] [mono]  [\typescriptone]
\stoptypescript

\setupbodyfont[pagella]

\starttext

xxx {\bf yyy} xxx {\it zzz} xxx

\start \switchtobodyfont[uprightonly]
xxx {\bf yyy} xxx {\it zzz} xxx
\stop

xxx {\bf yyy} xxx {\it zzz} xxx

\stoptext

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

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


[NTG-context] Re: Any way to forbid boldface for a section of text?

2024-08-23 Thread Denis Maier via ntg-context


 
 
  
   You could define a specific typescript for that without a definition for bold.
   
   
   
Joel via ntg-context  hat am 24.08.2024 03:09 CEST geschrieben:

   
 

   
 



 If there any way to forbid boldface text for a section, e.g.:
 

  
 

 \starttext
 

  
 

 \stopboldface
 

 \input file
 

 \startboldface
 

  
 

 \stoptext
 

  
 

 Assume file.tex includes some boldface commands there, how to tell it to just ignore them temporarily, then resume normal behavior latter?
 

  
 

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

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

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


[NTG-context] Any way to forbid boldface for a section of text?

2024-08-23 Thread Joel via ntg-context
If there any way to forbid boldface text for a section, e.g.:
\starttext
\stopboldface\input file\startboldface

\stoptext
Assume file.tex includes some boldface commands there, how to tell it to just 
ignore them temporarily, then resume normal behavior latter?
--Joel
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Probably a very simple question, but how do I get a page number to be centered, at the bottom and vertically in the middle whilst having my doc margins?

2024-08-19 Thread Pablo Rodriguez via ntg-context
On 8/19/24 17:11, Felix wrote:
> Hello mikail, I would send a picture to be more clear with what I
> want but it seems to not be possible
Hi Felix,

attachments to the list should be less than 100kb.

If you generate your image as a PNG file, it should fit in that file size.

I attach sample image (from the next minimal sample).

> what adding the footer=.5in code does is simply take away .5in from
> the bottom margin, what I mean is that The bottom margin really just
> becomes 1in because the footer takes up .5in from the margin setting,

Well, the extra half inch is taken from the text body, not from the
bottom margin.

I mean, when you set up topspace and height to mmiddle, bottomspace will
have the same value as topspace.

Here you have a stupid sample:

  \showframe\showgrid
  \setuppapersize
 [letter]
  \setuplayout[
   backspace=0.5in,
   topspace=\topspace,
   header=0in, % No headers
   footer=5in, % Space for the footer
   width=middle,
   height=middle,
  ]

  \starttext
  \null
  \stoptext

Now some comments (just for your info):

> \setuppapersize
>[letter]
>[letter]

When both papersizes are the same, I’d say the second one is redundant.

> \setupbodyfont [TimesNewRoman,12pt]

The default value for font size is 12pt, so this isn’t really required.

> \mainlanguage[en-us]

The default language is US English, so this isn’t really required.

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


[NTG-context] Re: Why are some external PDF figures leading to a stack overflow error?

2024-08-18 Thread Mikael Sundqvist
The unknownpicture was there to hint that you did not give an example
showing the problem. The compact= was an initial guess by an anonymous
participant at the meeting.

Den sön 18 aug. 2024 17:20Joel via ntg-context  skrev:

> The file compiles and just has a grey empty box saying "name:
> unknownpicture".
>
> If I replace xmap1.pdf with a JPG named xmap1.jpg and don't change the
> document otherwise, my document compiles just fine. The problem is I need
> high quality files, not a blurry JPG.
>
> --Joel
>
> On Sunday, August 18, 2024 at 09:14:37 AM MDT, Mikael Sundqvist <
> mic...@gmail.com> wrote:
>
>
> Hi,
>
> From the meeting: What happens if you do
>
> \externalfigure
>   [unknownpicture]
>   [compact=]
>
> ?
>
> On Sun, Aug 18, 2024 at 4:53 PM Joel via ntg-context 
> wrote:
> >
> > I am making a book that includes a series of maps which I created in
> LibreOffice Draw, but exported as a lossless PDF. After recently making
> some improvements to the map files, but not the ConTeXt documents, I was
> surprised my document wouldn't compile anymore...I couldn't find any code
> errors and even reverted to older code from the day before that compiled
> fine yesterday. It seemed the PDFs themselves were making the errors, but
> the errors were inconsistent.. I deleted my ConTeXt install and downloaded
> the latest version of standalone, it still won't compile, but the errors
> are completely different. After a few tests I came up with this minimal
> code which throws the error:
> >
> > \starttext
> >
> >\externalfigure[xmap1]
> >
> > \stoptext
> >
> > If I compile this, and xmap1.pdf is a PDF file in the same path, it
> outputs this error:
> >
> > lua error  > lua error on line 4 in file ./test.tex:
> >
> > registered function call [1606]:
> ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: stack
> overflow
> > stack traceback:
> >...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175:
> in function
> <...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:167>
> >(...tail calls...)
> >...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:667:
> in for iterator 'for iterator'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:96:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...(skipping 99976 levels)
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in upvalue 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97:
> in local 'strip'
> >...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:108:
> in upvalue 'document_pdf_strip_page'
> >[string "local lpdf_epdf_contentplugin = lpdf.epdf.con..."]:7: in
> local 'runner'
> >...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-fix.lmt:136:
> in field 'pageplugin'
> >...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:1401:
> in upvalue 'copypage'
> >...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:126:
> in function
> <...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:111>
> >...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1696:
> in function
> <...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1681>
> >(...tail calls...)
> > 1\starttext
> > 2
> > 3  \externalfigure[xmap1]
> > 4 >>
&g

[NTG-context] Re: Why are some external PDF figures leading to a stack overflow error?

2024-08-18 Thread Joel via ntg-context
 If I add [compact=] it seems to be rendering the PDF. What does [compact=] do?

On Sunday, August 18, 2024 at 09:14:37 AM MDT, Mikael Sundqvist 
 wrote:  
 
 Hi,

>From the meeting: What happens if you do

\externalfigure
  [unknownpicture]
  [compact=]

?

On Sun, Aug 18, 2024 at 4:53 PM Joel via ntg-context  wrote:
>
> I am making a book that includes a series of maps which I created in 
> LibreOffice Draw, but exported as a lossless PDF. After recently making some 
> improvements to the map files, but not the ConTeXt documents, I was surprised 
> my document wouldn't compile anymore...I couldn't find any code errors and 
> even reverted to older code from the day before that compiled fine yesterday. 
> It seemed the PDFs themselves were making the errors, but the errors were 
> inconsistent.. I deleted my ConTeXt install and downloaded the latest version 
> of standalone, it still won't compile, but the errors are completely 
> different. After a few tests I came up with this minimal code which throws 
> the error:
>
> \starttext
>
>    \externalfigure[xmap1]
>
> \stoptext
>
> If I compile this, and xmap1.pdf is a PDF file in the same path, it outputs 
> this error:
>
> lua error      > lua error on line 4 in file ./test.tex:
>
> registered function call [1606]: 
> ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: stack 
> overflow
> stack traceback:
>        ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: in 
>function <...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:167>
>        (...tail calls...)
>        ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:667: in 
>for iterator 'for iterator'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:96: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...    (skipping 99976 levels)
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>local 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:108: in 
>upvalue 'document_pdf_strip_page'
>        [string "local lpdf_epdf_contentplugin = lpdf.epdf.con..."]:7: in 
>local 'runner'
>        ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-fix.lmt:136: in 
>field 'pageplugin'
>        ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:1401: in 
>upvalue 'copypage'
>        ...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:126: in 
>function <...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:111>
>        ...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1696: in 
>function <...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1681>
>        (...tail calls...)
> 1    \starttext
> 2
> 3      \externalfigure[xmap1]
> 4 >>
> 5    \stoptext
> 6
> mtx-context    | fatal error: return code: 1
>
> This error isn't occurring for every PDF, some of them are rendering with no 
> such error. I tried different export settings in LibreOffice Draw, but that 
> seemed to have no impact. Some files render in ConTeXt and some throw this 
> error.
>
> What is happening?
>
> --Joel
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : htt

[NTG-context] Re: Why are some external PDF figures leading to a stack overflow error?

2024-08-18 Thread Joel via ntg-context
 The file compiles and just has a grey empty box saying "name: unknownpicture".
If I replace xmap1.pdf with a JPG named xmap1.jpg and don't change the document 
otherwise, my document compiles just fine. The problem is I need high quality 
files, not a blurry JPG.
--Joel

On Sunday, August 18, 2024 at 09:14:37 AM MDT, Mikael Sundqvist 
 wrote:  
 
 Hi,

>From the meeting: What happens if you do

\externalfigure
  [unknownpicture]
  [compact=]

?

On Sun, Aug 18, 2024 at 4:53 PM Joel via ntg-context  wrote:
>
> I am making a book that includes a series of maps which I created in 
> LibreOffice Draw, but exported as a lossless PDF. After recently making some 
> improvements to the map files, but not the ConTeXt documents, I was surprised 
> my document wouldn't compile anymore...I couldn't find any code errors and 
> even reverted to older code from the day before that compiled fine yesterday. 
> It seemed the PDFs themselves were making the errors, but the errors were 
> inconsistent.. I deleted my ConTeXt install and downloaded the latest version 
> of standalone, it still won't compile, but the errors are completely 
> different. After a few tests I came up with this minimal code which throws 
> the error:
>
> \starttext
>
>    \externalfigure[xmap1]
>
> \stoptext
>
> If I compile this, and xmap1.pdf is a PDF file in the same path, it outputs 
> this error:
>
> lua error      > lua error on line 4 in file ./test.tex:
>
> registered function call [1606]: 
> ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: stack 
> overflow
> stack traceback:
>        ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: in 
>function <...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:167>
>        (...tail calls...)
>        ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:667: in 
>for iterator 'for iterator'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:96: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...    (skipping 99976 levels)
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>upvalue 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
>local 'strip'
>        ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:108: in 
>upvalue 'document_pdf_strip_page'
>        [string "local lpdf_epdf_contentplugin = lpdf.epdf.con..."]:7: in 
>local 'runner'
>        ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-fix.lmt:136: in 
>field 'pageplugin'
>        ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:1401: in 
>upvalue 'copypage'
>        ...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:126: in 
>function <...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:111>
>        ...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1696: in 
>function <...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1681>
>        (...tail calls...)
> 1    \starttext
> 2
> 3      \externalfigure[xmap1]
> 4 >>
> 5    \stoptext
> 6
> mtx-context    | fatal error: return code: 1
>
> This error isn't occurring for every PDF, some of them are rendering with no 
> such error. I tried different export settings in LibreOffice Draw, but that 
> seemed to have no impact. Some files render in ConTeXt and some throw this 
> error.
>
> What is happening?
>
> --Joel
>
> ___
> If your question is of interest to others as well, please add an entry to the 
>

[NTG-context] Re: Why are some external PDF figures leading to a stack overflow error?

2024-08-18 Thread Mikael Sundqvist
Hi,

From the meeting: What happens if you do

\externalfigure
  [unknownpicture]
  [compact=]

?

On Sun, Aug 18, 2024 at 4:53 PM Joel via ntg-context  wrote:
>
> I am making a book that includes a series of maps which I created in 
> LibreOffice Draw, but exported as a lossless PDF. After recently making some 
> improvements to the map files, but not the ConTeXt documents, I was surprised 
> my document wouldn't compile anymore...I couldn't find any code errors and 
> even reverted to older code from the day before that compiled fine yesterday. 
> It seemed the PDFs themselves were making the errors, but the errors were 
> inconsistent.. I deleted my ConTeXt install and downloaded the latest version 
> of standalone, it still won't compile, but the errors are completely 
> different. After a few tests I came up with this minimal code which throws 
> the error:
>
> \starttext
>
> \externalfigure[xmap1]
>
> \stoptext
>
> If I compile this, and xmap1.pdf is a PDF file in the same path, it outputs 
> this error:
>
> lua error   > lua error on line 4 in file ./test.tex:
>
> registered function call [1606]: 
> ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: stack 
> overflow
> stack traceback:
> ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: in 
> function <...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:167>
> (...tail calls...)
> ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:667: in 
> for iterator 'for iterator'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:96: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ... (skipping 99976 levels)
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> upvalue 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
> local 'strip'
> ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:108: in 
> upvalue 'document_pdf_strip_page'
> [string "local lpdf_epdf_contentplugin = lpdf.epdf.con..."]:7: in 
> local 'runner'
> ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-fix.lmt:136: in 
> field 'pageplugin'
> ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:1401: in 
> upvalue 'copypage'
> ...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:126: in 
> function <...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:111>
> ...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1696: in 
> function <...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1681>
> (...tail calls...)
> 1 \starttext
> 2
> 3   \externalfigure[xmap1]
> 4 >>
> 5 \stoptext
> 6
> mtx-context | fatal error: return code: 1
>
> This error isn't occurring for every PDF, some of them are rendering with no 
> such error. I tried different export settings in LibreOffice Draw, but that 
> seemed to have no impact. Some files render in ConTeXt and some throw this 
> error.
>
> What is happening?
>
> --Joel
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Why are some external PDF figures leading to a stack overflow error?

2024-08-18 Thread Joel via ntg-context
I am making a book that includes a series of maps which I created in 
LibreOffice Draw, but exported as a lossless PDF. After recently making some 
improvements to the map files, but not the ConTeXt documents, I was surprised 
my document wouldn't compile anymore...I couldn't find any code errors and even 
reverted to older code from the day before that compiled fine yesterday. It 
seemed the PDFs themselves were making the errors, but the errors were 
inconsistent.. I deleted my ConTeXt install and downloaded the latest version 
of standalone, it still won't compile, but the errors are completely different. 
After a few tests I came up with this minimal code which throws the error:

\starttext
    \externalfigure[xmap1]

\stoptext
If I compile this, and xmap1.pdf is a PDF file in the same path, it outputs 
this error:
lua error   > lua error on line 4 in file ./test.tex:
registered function call [1606]: 
...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: stack overflow
stack traceback:
    ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:175: in 
function <...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:167>
    (...tail calls...)
    ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:667: in for 
iterator 'for iterator'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:96: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ... (skipping 99976 levels)
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
upvalue 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:97: in 
local 'strip'
    ...-context/tex/context/base/mkxl/lpdf-fix-imp-contents.lmt:108: in 
upvalue 'document_pdf_strip_page'
    [string "local lpdf_epdf_contentplugin = lpdf.epdf.con..."]:7: in local 
'runner'
    ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-fix.lmt:136: in 
field 'pageplugin'
    ...ext/tex/texmf-context/tex/context/base/mkxl/lpdf-pde.lmt:1401: in 
upvalue 'copypage'
    ...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:126: in 
function <...ext/tex/texmf-context/tex/context/base/mkiv/grph-chk.lua:111>
    ...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1696: in 
function <...ext/tex/texmf-context/tex/context/base/mkxl/grph-inc.lmt:1681>
    (...tail calls...)
1 \starttext
2     
3   \externalfigure[xmap1]
4 >>  
5 \stoptext
6     
mtx-context | fatal error: return code: 1
This error isn't occurring for every PDF, some of them are rendering with no 
such error. I tried different export settings in LibreOffice Draw, but that 
seemed to have no impact. Some files render in ConTeXt and some throw this 
error.
What is happening?

--Joel

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

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


[NTG-context] Bug Regarding IIalic Correction in ConTeXt LMTX

2024-08-17 Thread Vladimir Grbić
Hello,

I started using ConTeXt LMTX 2 days ago and after some initial testing I 
noticed an unexpected behavior regarding italic correction.

In short, I cannot seem to produce italic correction like I could in plain TeX 
or even LaTeX.

I've asked the question on TeX StackExchange and another user confirmed the 
suspicion in his answer. I would suggest you take a look at it because the 
formatting of the question and the answer is prettier than in this plain text 
email. Furthermore, a person who provided the answer already did some research. 
See the question here:

https://tex.stackexchange.com/questions/724568/how-to-invoke-italic-correction-in-context-lmtx

Here is what I observed:

Compare the kerning produced in between 'r' and 'p' in the word "airport" when 
italic correction is applied in plain TeX (compiled with `pdftex`) and in 
ConTeXt LMTX (compiled with `luametatex`). Here are the minimal working 
examples.

Plain TeX

```
airport (regular font)

{\it air\/}port (italic correction applied)

{\it air}port (no italic correction applied)
\bye
```

ConTeXt LMTX

```
\starttext
airport (regular font)

{\it air\/}port (italic correction applied)

{\it air}port (no italic correction applied)
\stoptext
```

Please confirm if this, in fact, is the issue/bug or if I am not approaching 
this correctly. I am brand new to ConTeXt, so it could be me. Thank you in 
advance!

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

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


[NTG-context] Re: Problem with Cambria

2024-08-16 Thread Lutz Haseloff
I get NO.
(With Version 2024.07.31 19:43 LMTX I get NO too)

Lutz

Am 16. August 2024 10:43:12 MESZ schrieb Wolfgang Schuster 
:
>Lutz Haseloff schrieb am 16.08.2024 um 09:47:
>> Hi Hans, hi all,
>> 
>> the latest ConTeXt lmtx seems to have a problem with MS Cambria.
>> 
>> My file is:
>> 
>> \setupbodyfont[cambria]
>> \definefont[symbola][file:symbola*default at 10pt]
>> \starttext
>> \startMPpage[offset=1dk]
>> draw textext("AC{\symbola ⚡}DC");
>> \stopMPpage
>> \stoptext
>
>Which result (YES or NO) do you get with the following example?
>
>\starttext
>\doiffileelse{cambria.ttc}{YES}{NO}
>\stoptext
>
>Wolfgang
>
>___
>If your question is of interest to others as well, please add an entry to the 
>Wiki!
>
>maillist : ntg-context@ntg.nl / 
>https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
>archive  : https://github.com/contextgarden/context
>wiki : https://wiki.contextgarden.net
>___

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

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


[NTG-context] Re: Problem with Cambria

2024-08-16 Thread Wolfgang Schuster

Lutz Haseloff schrieb am 16.08.2024 um 09:47:

Hi Hans, hi all,

the latest ConTeXt lmtx seems to have a problem with MS Cambria.

My file is:

\setupbodyfont[cambria]
\definefont[symbola][file:symbola*default at 10pt]
\starttext
\startMPpage[offset=1dk]
draw textext("AC{\symbola ⚡}DC");
\stopMPpage
\stoptext


Which result (YES or NO) do you get with the following example?

\starttext
\doiffileelse{cambria.ttc}{YES}{NO}
\stoptext

Wolfgang

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

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


[NTG-context] Problem with Cambria

2024-08-16 Thread Lutz Haseloff
Hi Hans, hi all,

the latest ConTeXt lmtx seems to have a problem with MS Cambria.

My file is:

\setupbodyfont[cambria]
\definefont[symbola][file:symbola*default at 10pt]
\starttext
\startMPpage[offset=1dk]
draw textext("AC{\symbola ⚡}DC");
\stopMPpage
\stoptext

mtxrun finde the font:

➜  ~ mtxrun --script font --list --pattern=cambria --all
identifier   familynamefontnamefilename 
   subfont   instances

cambria  cambria   cambria 
/home/lutz/fonts/winfont/cambria.ttc1
cambriabold  cambria   cambriabold 
/home/lutz/fonts/winfont/cambriab.ttf
cambriabolditaliccambria   cambriabolditalic   
/home/lutz/fonts/winfont/cambriaz.ttf
cambriaitaliccambria   cambriaitalic   
/home/lutz/fonts/winfont/cambriai.ttf
cambriamathnormalcambriamath   cambriamath 
/home/lutz/fonts/winfont/cambria.ttc2
cambriamathregular   cambriamath   cambriamath 
/home/lutz/fonts/winfont/cambria.ttc2
cambrianormalcambria   cambriaitalic   
/home/lutz/fonts/winfont/cambriai.ttf
cambriaregular   cambria   cambria 
/home/lutz/fonts/winfont/cambria.ttc1


ConTeXt doesn't.
logfile:

open source > level 2, order 3, name 
'/home/lutz/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-cambria.mkiv'
open source > level 3, order 4, name 
'/home/lutz/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv'
close source> level 3, order 4, name 
'/home/lutz/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-dejavu.mkiv'
close source> level 2, order 4, name 
'/home/lutz/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-cambria.mkiv'
fonts   > defining > forced type 'ttf' of 'cambria' not found
fonts   > defining > unable to define 'cambria.ttf' as 
'cambria-12pt-rm-tf-0--0'
fonts   > defining > forced type 'ttf' of 'cambmath' not found
fonts   > defining > unable to define 'cambmath.ttf' as 
'cambria-12pt-mm-mr--3'
fonts   > defining > unable to define 'cambmath.ttf' as 
'cambria-12pt-mm-mr--2'
fonts   > defining > unable to define 'cambmath.ttf' as 
'cambria-12pt-mm-mr--1'
fonts   > defining > unable to define 'cambmath.ttf' as 
'cambria-12pt-mm-mb--3'
fonts   > defining > unable to define 'cambmath.ttf' as 
'cambria-12pt-mm-mb--2'
fonts   > defining > unable to define 'cambmath.ttf' as 
'cambria-12pt-mm-mb--1'

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

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


[NTG-context] Re: problem with location={right,high} in latest LMTX

2024-08-14 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 14.08.2024 um 23:11:

There seems to be a regression with sidefloats:

"""
\useMPlibrary[dum]

\starttext

\startplacefigure[title={problem},location={right,high}]
\externalfigure[dummy][width=.3\textwidth]
\stopplacefigure
\samplefile{ward}

\stoptext
"""


Line 1154 in strc-flt.mkxl:

\def\strc_floats_analyze_variables_two
  {...
-    \ifinset\v!high    \floatlocation\global  \plusone  \fi
+    \ifinset\v!high    \floatlocation\global\c_page_sides_skipmode 
\plusone  \fi
 \ifinset\v!low \floatlocation\global\c_page_sides_skipmode 
\plustwo  \fi
 \ifinset\v!fit \floatlocation\global\c_page_sides_skipmode 
\plusthree\fi
 \ifinset\v!tolerant 
\floatlocation\global\c_page_sides_tolerance\plusone  \fi
\ifinset\v!verytolerant\floatlocation\global\c_page_sides_tolerance\plustwo 
\fi

   ...}

Wolfgang

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

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


[NTG-context] problem with location={right,high} in latest LMTX

2024-08-14 Thread Henning Hraban Ramm

There seems to be a regression with sidefloats:

"""
\useMPlibrary[dum]

\starttext

\startplacefigure[title={problem},location={right,high}]
\externalfigure[dummy][width=.3\textwidth]
\stopplacefigure
\samplefile{ward}

\stoptext
"""

results in

tex error   > tex error on line 8 in file 
de/_tests/sidefloattest.tex: Missing number, treated as zero




\global

...80=>\global \c_strc_floats_rotation \commalistelement \relax 
,270=>\global \c_strc_floats_rotation \commalistelement \relax ]\fi 
\ifinset \v!paragraph \floatlocation \global \c_page_sides_force_shape 
\conditionaltrue \else \global

\c_page_sides ...
 \p_crossreference
...ation \floatlocationdefault \let \forcedfloatmethod 
\floatlocationdefault } \donothing \fi \ifempty \forcedfloatmethod \let 
\forcedfloatmethod \v!here \fi \fi \fi \strc_floats_check_extra_actions 
\strc_floats_analyze_variables_two

\strc_floats_ ...

\stopplacefigure

 1
 2 \useMPlibrary[dum]
 3
 4 \starttext
 5
 6 \startplacefigure[title={problem},location={right,high}]
 7 \externalfigure[dummy][width=.3\textwidth]
 8 >>  \stopplacefigure
 9 \samplefile{ward}
10
11 \stoptext
12



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

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


[NTG-context] Re: Missing \endcsname inserted error

2024-08-13 Thread Jeong Dal via ntg-context
Whoops!!!
I didn’t see the backslash in there!!
It is a simple typo.

Thanks Wolfgang.

Best regards,

Dalyoung

> 2024. 8. 14. 오전 4:33, Wolfgang Schuster  
> 작성:
> 
> Jeong Dal via ntg-context schrieb am 13.08.2024 um 21:21:
>> Hi,
>> I draw a figure using MetaFun and insert it \startplacefigure and 
>> \stopplacefigure.
>> (Sample file is listed below)
>> But, I got an error as following:
>> Missing \endcsname inserted
>> [...]
>> \starttext
>> \startplacefigure[location=none,\title=]
> 
> Either remove the backslash before the title key or just remove it from the 
> argument because the values of \startplacefigure are empty by default.
> 
> Wolfgang
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

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

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


[NTG-context] Re: Missing \endcsname inserted error

2024-08-13 Thread Wolfgang Schuster

Jeong Dal via ntg-context schrieb am 13.08.2024 um 21:21:

Hi,

I draw a figure using MetaFun and insert it \startplacefigure and 
\stopplacefigure.

(Sample file is listed below)
But, I got an error as following:

Missing \endcsname inserted

[...]
\starttext
\startplacefigure[location=none,\title=]


Either remove the backslash before the title key or just remove it from 
the argument because the values of \startplacefigure are empty by default.


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

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


[NTG-context] Missing \endcsname inserted error

2024-08-13 Thread Jeong Dal via ntg-context
Hi, 

I draw a figure using MetaFun and insert it \startplacefigure and 
\stopplacefigure.
(Sample file is listed below)
But, I got an error as following:

Missing \endcsname inserted

 

\defcsname 
 \mult_interfaces_get_parameters_item_okay 
#1=#S#2,->\ifarguments \or \mult_interfaces_get_parameters_item_error 
{#1}\else \defcsname \m_mult_interfaces_namespace #1
\endcsname {#2}\fi 
 \mult_interfaces_get_parameters_item 
#*#S#1,->\ifarguments \expandafter \gobbleoneargument \else 
\mult_interfaces_get_parameters_item_okay #1,


If I remove "\startplacefigure and \stopplacefigure”, then there is no error, 
but the figure is not centered.

Please tell me how to fix it.

Thank you for reading.

Best regards,

Dalyoung


\startbuffer[numbers]
path p,q;

p =  unitsquare xyscaled(3,2) superellipsed .85 ;
q :=  p scaled 1cm;
draw q;
label.bot(textext("\naturalnumbers"), point 2 of q);

q :=  p scaled 1.5cm shifted (-.75cm,-.2cm);
draw q ;
label.bot(textext("\integers"), point 2 of q);

q :=  p scaled 2cm shifted (-1.5cm,-.4cm);
draw q;
label.bot(textext("\rationals"), point 2 of q);

q :=  p scaled 2.5cm shifted (-2.25cm,-.6cm);
draw q;
label.bot(textext("\reals"), point 2 of q);

q :=  p scaled 3cm shifted (-3cm,-.8cm);
draw q;
label.bot(textext("\Bbb C"), point 2 of q);
\stopbuffer
\starttext
\startplacefigure[location=none,\title=]
{\scale[scale=1400]{\processMPbuffer[numbers]}}
\stopplacefigure
\stoptext___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] no escaping with scite highlighting any more?

2024-08-11 Thread Henning Hraban Ramm

Hi, this used to work:

"""
\usemodule[scite]

% the setup doesn’t change the behavior, I think it used to.
\setuptyping[TEX][
  option=tex, % scite sets "cld"
]

\starttext

\startTEX[escape=yes]
\definemeasure[PageWidth][165mm]  /BTEX\hfill{\ss Dimensions}/ETEX
\definemeasure[PageHeight][239mm]

\definepapersize[DANTE][  /BTEX\hfill{\ss Paper size}/ETEX
  width=\measure{PageWidth},
  height=\measure{PageHeight},]
\setuppapersize[DANTE]
\stopTEX

\stoptext
"""

Without the scite module, escaping in \startTEX works, but I need the 
module for some other highlighters.


Is there a solution?

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

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


[NTG-context] Breakable tcolorbox in ConTeXt

2024-08-11 Thread Florent Michel
Hi,

I am trying to reproduce the behaviour of the tcolorbox LaTeX package, more
specifically breakable boxes (as illustrated here:
https://tex.stackexchange.com/a/676607/123770). It works nicely out of the
box (pun intended) using `\definetextbackground` and drawing the frame with
MetaPost, using counters to keep track of whether the current text is at
the top, middle, or bottom of the box. However, I'm having issues when one
box ends and another starts on the same page (see more details below). From
what I understand, the issue is that counters seem to be updated on a
page-wide basis, so each MPgraphic ‘sees’ the values of counters at the end
of the current page, which may not be right if another box modifies them.
Would anyone know how to resolve this?

Based on two answer on TeX StackExchange (
https://tex.stackexchange.com/a/486124/123770 ,
https://tex.stackexchange.com/questions/377234/context-frame-problems/377261#377261),
the following code works well if there is no more than one box per page:

```
\definecounter[pageNumberTop]
\definecounter[pageNumberBottom]

\startuseMPgraphic{mp:axiomframe}
  begingroup;
for i=1 upto nofmultipars :
  path p;
  p := ( llcorner multipars[i]
 -- lrcorner multipars[i]
 -- urcorner multipars[i]
 -- ulcorner multipars[i]
 -- cycle )
 enlarged (EmWidth,EmWidth) ;
  fill p withcolor boxfillcolor ;

  % if the current page is the first one covered by the box...
  if (\pagenumber == \rawcountervalue[pageNumberTop]) :
% ... if it is also the last one, the box fits entirely on the
page; we thus draw the full frame
if \rawcountervalue[pageNumberTop] ==
\rawcountervalue[pageNumberBottom] :
  draw p
withpen pencircle scaled 2pt
withcolor boxlinecolor ;

% ... otherwise, don't draw the bottom line
else :
  draw llcorner multipars[i] + (-EmWidth, -EmWidth)
   -- ulcorner multipars[i] + (-EmWidth, EmWidth)
   -- urcorner multipars[i] + (EmWidth, EmWidth)
   -- lrcorner multipars[i] + (EmWidth, -EmWidth)
withpen pencircle scaled 2pt
withcolor boxlinecolor ;
fi ;
picture pic;
pic := textext.ulft("\tfd\symbol[info]");
pic := pic shifted ulcorner multipars[i];
fill bbox pic withcolor white;
draw pic;

  % if the current page is the last one covered by the box, draw the
left, bottom, and right lines
  elseif \pagenumber == \rawcountervalue[pageNumberBottom] :
draw ulcorner multipars[i] + (-EmWidth, EmWidth)
  -- llcorner multipars[i] + (-EmWidth, -EmWidth)
  -- lrcorner multipars[i] + (EmWidth, -EmWidth)
  -- urcorner multipars[i] + (EmWidth, EmWidth)
  withpen pencircle scaled 2pt
  withcolor boxlinecolor ;

  % if the current page is neither the first one nor the last one, only
draw the left and right lines
  else :
draw llcorner multipars[i] - (EmWidth, EmWidth)
 -- ulcorner multipars[i] + (-EmWidth, EmWidth)
  withpen pencircle scaled 2pt
  withcolor boxlinecolor ;
draw urcorner multipars[i] + (EmWidth, EmWidth)
 -- lrcorner multipars[i] + (EmWidth, -EmWidth)
  withpen pencircle scaled 2pt
  withcolor boxlinecolor ;
  fi ;
endfor ;
  setbounds currentpicture to OverlayBox ;
  endgroup;
\stopuseMPgraphic

\definetextbackground
  [theoremFrame]
  [mp=mp:axiomframe,
   location=paragraph,
   backgroundcolor=green,
   framecolor=red,
   before={\setcounter[pageNumberTop][\pagenumber]},
   after={\setcounter[pageNumberBottom][\pagenumber]}]

\definestartstop
  [ColoredBox]
  [before={\blank[2em]\starttheoremFrame},
   after={\stoptheoremFrame\blank[2em]}]
```

For instance,

```
\startColoredBox
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\stopColoredBox
```
correctly gives a box split over multiple pages, with the top part of the
frame only drawn on the first page and the bottom part only drawn on the
last one.
It also works correctly when adding `\page` between boxes:

```
\starttext
\startColoredBox
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\stopColoredBox
\page
\startColoredBox
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\stopColoredBox
```

However,  the following gives an incorrect output:
```
\starttext
\startColoredBox
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input kn

[NTG-context] Re: How to allow hyphenation, only for footnotes?

2024-08-10 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 10.08.2024 um 16:54:
My copy editor urged me to remove all hyphens from the main text of my 
document. I'm using:


\definefontfeature[default][default][expansion=quality,protrusion=quality]


\start \setupalign[nothyphenated,tolerant,hz,hanging]

(text)

\stop


Is there a reason why do the alignment change within a local group?

The problem is that is messing with footnotes, causing things like URLS 
to run off the page. How can I permit the hyphenation to appear 
normally, but only on the footnote text?


\setupalign[verytolerant,nothyphenated]

\setupnotation[footnote][align={hyphenated,normal}]

\starttext

\samplefile{lorem}\footnote{\samplefile{lorem}}

\stoptext

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

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


  1   2   3   4   5   6   7   8   9   10   >