[NTG-context] Re: Artifact in flow cell connection

2024-10-15 Thread Bernd Donner via ntg-context
Hi everyone,

I have tested the minimal example mentioned above on a completely separate
Linux installation, and I am seeing the same observable artifact. This
leads me to believe that the issue might not be specific to my context
installation.

It seems that the overlay in the heading and the \shape{product} are
essential components that trigger the behavior I’m experiencing. At this
point, I'm uncertain whether this is an error on my part or a potential
bug—possibly related to flowcharts.

Could someone please confirm if the output of the minimal example matches
what is shown in the attached PDF?

Thank you!

Best,
Bernd

Am Fr., 11. Okt. 2024 um 22:47 Uhr schrieb Bernd Donner <
bleau1...@googlemail.com>:

> Hi,
>
> I have a broken flow cell connection in this minimal example. The broken
> flow cell is only triggered when drawn within a subsection with an overlay.
> The logic to create the underlined subsection is by the way copied from the
> metafun manual source. I do not have the slightest clue what is going wrong
> in this example. Thanks for ideas.
>
> Best, Bernd
>
> \usemodule[chart]
>
> \startuniqueMPgraphic{SectionUnderline}
>path p;
>p:= unitsquare xscaled OverlayWidth yscaled OverlayHeight;
>draw llcorner p -- lrcorner p;
>setbounds currentpicture to p;
>  \stopuniqueMPgraphic
>
> \defineoverlay[SectionUnderline][\uniqueMPgraphic{SectionUnderline}]
>
> \starttexdefinition unexpanded ChapterCommand #1#2
>   \framed [background=SectionUnderline] {#2}
> \stoptexdefinition
>
> \setuphead
>   [subsection]
>   [command=\ChapterCommand]
>
> \starttext
>
> \subsection[title=Introduction]
>
> \startFLOWchart[toolchain]
>
> \startFLOWcell
>   \location{1,1}
>   \connection [bt] {compiler}
> \stopFLOWcell
>
> \startFLOWcell
>   \name {compiler}
>   \location{1,2}
>   \shape{product}
> \stopFLOWcell
> \stopFLOWchart
>
> \FLOWchart[toolchain]
> \stoptext
>


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

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


[NTG-context] Re: making TABLE spacing match tabulate/halign spacing

2024-10-15 Thread Kirill Davidov
unfortunately, enabling overlay collapses cell heights, ruining vertical 
alignment.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: making TABLE spacing match tabulate/halign spacing

2024-10-14 Thread Henning Hraban Ramm

Am 14.10.24 um 20:09 schrieb Kirill Davidov:

i should have probably mentioned ahead of time that i needed this since
i wanted to replicate a booktabs style table layout with normal text
spacing, like one would have in LaTeX with the appropriate package. the
plan was to have a top/bottom rule enabled for a row. sadly it seems
like with this solution rule thickness is added no matter if the frame
is on or off.

is an equivalent negative offset added to the appropriate rows a proper
way around this? i measured the baseline skip in Inkscape, and it seems
to be correct.


To avoid the rule thickness, you usually use offset=overlay; I don’t 
know if it works with TABLE cells.


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: creating a printed book

2024-10-14 Thread Denis Maier via ntg-context


 
 
  
   Well,
   
  
   The command \setupexternalfigures is an alias of \setupexternalfigure
   
  
   (https://wiki.contextgarden.net/Command/setupexternalfigures)
   
  
   So, it basically says that the available options in the alias commands are the same as in the original command.
   
   
   
David Roderick  hat am 14.10.2024 21:19 CEST geschrieben:

   
 

   
 

   
I have 22 image_000?? directories and file names start as image1, image2 in each one, so even if this path permitted globbing, or regexps, the filenames would clobber each other. should image1 be in image_0006 or image_00019 directory, for example?

   
 

   
Incidentally the definition is:

   
\setupexternalfigures [...,...] [..,..=..,..]

   
1 NAME OPT

   
2 inherits: \setupexternalfigure

   
 

   
Does this mean \setupexternalfigure (single) inherits from \setupexternalfigures (plural)? Yes or no? To say \setupexternalfigures (plural) inherits \setupfigure (single) means that the child (\setupexternalfigures --plural) inherits from the parent (\setupexternalfigure -- singular). Is this a grammatical mistake? e.g. if I inherit 10^6 Euros from my father than I as the benefactor inherit what the deceased has bequeathed to me. Here, my father would here be the plural and I the singular: I would "inherit from" my father, and I would inherit 10^ Euros. The way this stands as it is written means that my father inherits me: which is that I am inherited by my father. Should the definition actually be (?):

   
\setupexternalfigures [...,...] [..,..=..,..]

   
1 NAME OPT

   
2 inherited by: \setupexternalfigure

   
 

   
David Roderick

   
___

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

   
 

   
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.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: creating a printed book

2024-10-14 Thread Henning Hraban Ramm

Am 14.10.24 um 18:17 schrieb Wolfgang Schuster:
You don't have to include the subdirectory in \externalfigure when you 
set the search path at the begin of the document with

Even the file extension can be left out.


I know, but for the generated code it makes sense to include both, IMO.

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: creating a printed book

2024-10-14 Thread David Roderick
I have 22 image_000?? directories and file names start as image1, image2 in 
each one, so even if this path permitted globbing, or regexps, the filenames 
would clobber each other.  should image1 be in image_0006 or image_00019 
directory, for example?

Incidentally the definition is:
\setupexternalfigures [...,...] [..,..=..,..]
1 NAME   OPT
2 inherits: \setupexternalfigure 

Does this mean \setupexternalfigure (single) inherits from 
\setupexternalfigures (plural)?  Yes or no?  To say \setupexternalfigures 
(plural) inherits \setupfigure (single) means that the child 
(\setupexternalfigures --plural) inherits from the parent (\setupexternalfigure 
-- singular).  Is this a grammatical mistake?  e.g. if I inherit 10^6 Euros 
from my father than I as the benefactor inherit what the deceased has 
bequeathed to me.  Here, my father would here be the plural and I the singular: 
I would "inherit from" my father, and I would inherit 10^ Euros.  The way this 
stands as it is written means that my father inherits me: which is that I am 
inherited by my father.  Should the definition actually be (?):
\setupexternalfigures [...,...] [..,..=..,..]
1 NAME   OPT
2 inherited by: \setupexternalfigure 

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: making TABLE spacing match tabulate/halign spacing

2024-10-14 Thread Kirill Davidov
On 10/14/24 23:20, Wolfgang Schuster wrote:

> You can use MetaPost to draw the table rules and keep the default
> lines at 0pt, to add
> additional vertical space when needed you can use the toffset and
> boffset keys.
>
> Wolfgang
oh, that's wonderful. just followed the wiki tutorial on making metapost
rules and made a \toprule equivalent, thickness and all. now i just need
to put the other rules and put the whole TABLE setup into a, well,
setup. this helps greatly so far, thank you!
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: making TABLE spacing match tabulate/halign spacing

2024-10-14 Thread Wolfgang Schuster

Kirill Davidov schrieb am 14.10.2024 um 20:09:

i should have probably mentioned ahead of time that i needed this since
i wanted to replicate a booktabs style table layout with normal text
spacing, like one would have in LaTeX with the appropriate package. the
plan was to have a top/bottom rule enabled for a row. sadly it seems
like with this solution rule thickness is added no matter if the frame
is on or off.

is an equivalent negative offset added to the appropriate rows a proper
way around this? i measured the baseline skip in Inkscape, and it seems
to be correct.


You can use MetaPost to draw the table rules and keep the default lines 
at 0pt, to add
additional vertical space when needed you can use the toffset and 
boffset keys.


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: making TABLE spacing match tabulate/halign spacing

2024-10-14 Thread Kirill Davidov
i should have probably mentioned ahead of time that i needed this since
i wanted to replicate a booktabs style table layout with normal text
spacing, like one would have in LaTeX with the appropriate package. the
plan was to have a top/bottom rule enabled for a row. sadly it seems
like with this solution rule thickness is added no matter if the frame
is on or off.

is an equivalent negative offset added to the appropriate rows a proper
way around this? i measured the baseline skip in Inkscape, and it seems
to be correct.

Kirill


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: making TABLE spacing match tabulate/halign spacing

2024-10-14 Thread Wolfgang Schuster

Kirill Davidov schrieb am 14.10.2024 um 10:12:

Greetings,

TABLE uses framed extensively to make its cells. it adds all sorts of
offsets and paddings (especially vertical) to cells that annoy me
greatly. i'd like to set up TABLEs to have the same vertical spacing as
a regular tabulate table or even halign, but i keep getting lost in the
options for both TABLE and framed. which ones do i need? i'd like it to
play nice with interline spacing options as well.


You can improve the layout of natural tables (and extreme tables) when 
you set the offset value to 0pt. Horizontal space between the columns 
can be either added with the columndistance key or by adding loffset and 
roffset values.


To use \halign use \aligntab as replacement for &.

 begin example
\setupinterlinespace[line=3.5ex]

\startdocument

\halign\bgroup

\hss\aligncontent\removeunwantedspaces\tabskip\emwidth\aligntab\tabskip\zeropoint\aligncontent\cr
  text \aligntab more text\cr
  more text\aligntab text \cr
\egroup


\starttabulate[|r|l|]
\NC text  \NC more text \NC\NR
\NC more text \NC text  \NC\NR
\stoptabulate

\setupTABLE[frame=off,offset=0pt,columndistance=1em,rulethickness=0pt]
\setupTABLE[column][1][align=flushright]
\setupTABLE[column][2][align=flushleft]
\bTABLE
  \bTR \bTD text  \eTD \bTD more text \eTD \eTR
  \bTR \bTD more text \eTD \bTD text  \eTD \eTR
\eTABLE

\stopdocument
 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: GB7714-2015 of author-year format

2024-10-14 Thread Wolfgang Schuster

wangzhongtian schrieb am 14.10.2024 um 01:51:


sorry,corrected the title .

I am trying to implement bibliography management in GB/T 7714-2015 
(Chinese bibliography style standard), of Author-Year format. The bib 
list should be sorted by language, author, year, and then the title of 
the book. The sorting algorithm should use PinYin of Chinese 
characters to compare the order.


I am wondering is this feature already implemented for LuaMetatex?

Or if not, any suggestions on how can I implemented this? Like
1. How to implement the sorting algorithm?
2. Which part of the source code can I rewrite to implement this feature?



Take a look into sort-lan.lua.

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: creating a printed book

2024-10-14 Thread Wolfgang Schuster

David Roderick schrieb am 14.10.2024 um 13:12:

Thank you for fixing this.  I espy another feature which is required.  I save 
the png's into a subdirectory called images_0007 which is a subdirectory of 
where my tex files are located.  I run context from the latter (main or lower) 
working directory.  Your script looks for the png's in this lower (main) 
directory:

  \startplacefigure[location=here,reference=Picture 1178610960,title={}]% rId6
  \externalfigure[image1.png]
  \stopplacefigure

should be:
\startplacefigure[location=here,reference=Picture 1178610960,title={}]% rId6
\externalfigure[images_7/image1.png][hfactor=fit]
\stopplacefigure

If you could fix this it would be greatly appreciated, and methinks useful.


You don't have to include the subdirectory in \externalfigure when you 
set the search path at the begin of the document with


\setupexternalfigures[directory=images_7]

Even the file extension can be left out.

 begin example
\setupexternalfigures[directory=images_7]

\starttext

\startplacefigure[reference=Picture 1178610960]
\externalfigure[image1][hfactor=fit]
\stopplacefigure

\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: creating a printed book

2024-10-14 Thread Henning Hraban Ramm

Am 14.10.24 um 13:12 schrieb David Roderick:

Thank you for fixing this.  I espy another feature which is required.  I save 
the png's into a subdirectory called images_0007 which is a subdirectory of 
where my tex files are located.  I run context from the latter (main or lower) 
working directory.  Your script looks for the png's in this lower (main) 
directory:

  \startplacefigure[location=here,reference=Picture 1178610960,title={}]% rId6
  \externalfigure[image1.png]
  \stopplacefigure

should be:
\startplacefigure[location=here,reference=Picture 1178610960,title={}]% rId6
\externalfigure[images_7/image1.png][hfactor=fit]
\stopplacefigure

If you could fix this it would be greatly appreciated, and methinks useful.


You’re right, that makes sense.
I added the path, but not the width setting.

I never used extracted images unchanged; usually the result of the 
script is just raw material for me, so I can live with imperfections.


Perhaps it would make sense to use adaptable templates for all 
constructs (paragraph, itemization, table, image…); for me, the main 
missing feature is splitting by chapter.


This little script won’t become something like Pandoc.

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: creating a printed book

2024-10-14 Thread David Roderick
Thank you for fixing this.  I espy another feature which is required.  I save 
the png's into a subdirectory called images_0007 which is a subdirectory of 
where my tex files are located.  I run context from the latter (main or lower) 
working directory.  Your script looks for the png's in this lower (main) 
directory:

 \startplacefigure[location=here,reference=Picture 1178610960,title={}]% rId6
 \externalfigure[image1.png]  
 \stopplacefigure 

should be:  
\startplacefigure[location=here,reference=Picture 1178610960,title={}]% rId6
\externalfigure[images_7/image1.png][hfactor=fit]   
   
\stopplacefigure

If you could fix this it would be greatly appreciated, and methinks useful.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: creating a printed book

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

On 10/13/2024 2:19 PM, angel.of.no...@gmail.com wrote:

Hi Hans,
Are you suggesting that both of Hraban's options you would not go for, or just 
the latter (pandoc)?  What would you recommend to take a MSWord file and 
produce a ConText document?  Should I be thinking of doing all the ConText 
markups manually?


It depends on the document. You could do an initial conversions "a la 
Rhaban" but from then on work in "tex lingua". Once you are accustomed 
to it, it's not that hard.


I admit that I never had to work in Word or something other than TeX 
(before that ascii with simple markup a bit like markdown but that was 
ages ago before there was markdown so i wrote a parser and made sure all 
was formatted well for a daisy wheel line printer and/or laser printer).


Maybe just look around abit on the documentation (source) tree to see 
how larger documents look in tex code.


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: creating a printed book

2024-10-13 Thread Henning Hraban Ramm

Am 12.10.24 um 19:59 schrieb Hans Hagen via ntg-context:

On 10/11/2024 10:16 PM, Hraban Ramm wrote:

Am 11.10.24 um 18:19 schrieb David Roderick:
I have created 22 MSword files mainly text with embedded PNG 
diagrams.  I am seeking to have these converted to Context and to 
redo the (simple) diagrams.  I was thinking of using MetaPost.  I am 
seeking to pay a typesetter to assist me in this task.  I would be 
willing to pay for your time or for the time of a colleague you could 
direct me to.  I am seeking to have typeset a book.  The MSWord files 
have already been professionally proof-read, and the subject matter 
is political economy from the 18th century and how this translates to 
and may contradict conventional wisdom within the field of modern 
economics.


Other typesetters I have contacted have suggested running pandoc to 
create a LaTeX file and use Tikz for the diagrams.  But I have spent 
3 days reading on advancements in the ConText side of the industry 
which I suspect is far more advanced.  I would prefer to use better 
tools as a longer term solution.  Can you advise me?


Hi David,

I would take your order, but you can also try it yourself with my tools:
https://codeberg.org/fiee/context-tools/src/branch/master/docx2ctx

Pandoc can also generate ConTeXt code; try which you like better.


I'd never go that route when, as mentioned, a high quality document is 
needed which can involve control (for which one can e.g. use instances 
for specific components). Coding in TeX speak is not that bad. Also, one 
is more likely to get answers for specific problems on the list.


I don’t suggest using DOC(X) to directly create PDF via Pandoc and 
ConTeXt, just converting DOC(X) to ConTeXt for further processing.


The direct approach works only with simple and/or very consistently 
styled documents.


For my youth novel, I’m writing in LibreOffice, convert ODS to DOCX, 
convert that to ConTeXt with my script and finalize the code with an 
additional script, so that it doesn’t need further tweaking. This works 
only because I control the source and the converter.


My script is not trying to keep the layout, just the structure and some 
formatting.


It can extract embedded images (again, since I fixed the bug) and 
creates an \externalfigure, but that usually isn’t enough. Similar 
situation with embedded tables (the conversion is not good, I’ll 
probably enhance it a bit as soon as I need it).


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: creating a printed book

2024-10-13 Thread Henning Hraban Ramm

Am 13.10.24 um 00:32 schrieb angel.of.no...@gmail.com:

I think that there is a bug in your docx2ctx.py.  It works for files which do 
not have embedded pngs  in them.  But for files which do:
TypeError: unsupported operand type(s) for /: 'str' and 'str'


I forgot a pathlib.Path, it’s fixed now. Apparently I never had embedded 
images since I changed that code…


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: creating a printed book

2024-10-13 Thread angel . of . north
Hi Hans,
Are you suggesting that both of Hraban's options you would not go for, or just 
the latter (pandoc)?  What would you recommend to take a MSWord file and 
produce a ConText document?  Should I be thinking of doing all the ConText 
markups manually?  

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: creating a printed book

2024-10-12 Thread angel . of . north
I think that there is a bug in your docx2ctx.py.  It works for files which do 
not have embedded pngs  in them.  But for files which do:

Traceback (most recent call last):
  File "/home/dmr104/Downloads/context-tools/docx2ctx/docx2ctx.py", line 872, 
in 
process_doc(Path(doc), copy.copy(args))
  File "/home/dmr104/Downloads/context-tools/docx2ctx/docx2ctx.py", line 673, 
in process_doc
result = obj.process()
 ^
  File "/home/dmr104/Downloads/context-tools/docx2ctx/docx2ctx.py", line 515, 
in process
dst_fname = self.options['imagedir'] / pname.name
~^~~~
TypeError: unsupported operand type(s) for /: 'str' and 'str'

2024-10-12 23:21:10,979 DEBUG   a_graphic ['xmlns:a']
2024-10-12 23:21:10,979 DEBUG   pic_cNvPr ['id', 'name']
2024-10-12 23:21:10,980 DEBUG   a_blip ['r:embed']
2024-10-12 23:21:10,980 DEBUG   image reference found: rId7 = image2.png
2024-10-12 23:21:10,980 DEBUG   p ['w14:paraId', 'w14:textId', 'w:rsidR', 
'w:rsidRDefault', 'w:rsidP']
2024-10-12 23:21:10,980 DEBUG   pStyle ['w:val']
2024-10-12 23:21:10,980 DEBUG   p ['w14:paraId', 'w14:textId', 'w:rsidR', 
'w:rsidRDefault', 'w:rsidP']
2024-10-12 23:21:10,980 DEBUG   pStyle ['w:val']
2024-10-12 23:21:10,980 DEBUG   p ['w14:paraId', 'w14:textId', 'w:rsidR', 
'w:rsidRDefault', 'w:rsidP']
2024-10-12 23:21:10,981 DEBUG   pStyle ['w:val']
2024-10-12 23:21:10,981 DEBUG   p ['w14:paraId', 'w14:textId', 'w:rsidR', 
'w:rsidRDefault', 'w:rsidP']
2024-10-12 23:21:10,981 DEBUG   pStyle ['w:val']
2024-10-12 23:21:10,981 DEBUG   p ['w14:paraId', 'w14:textId', 'w:rsidR', 
'w:rsidRDefault', 'w:rsidP']
2024-10-12 23:21:10,981 DEBUG   pStyle ['w:val']
2024-10-12 23:21:10,981 DEBUG   Not an image file: [Content_Types].xml
2024-10-12 23:21:10,982 DEBUG   Not an image file: _rels/.rels
2024-10-12 23:21:10,982 DEBUG   Not an image file: word/document.xml
2024-10-12 23:21:10,982 DEBUG   Not an image file: word/_rels/document.xml.rels
2024-10-12 23:21:10,982 DEBUG   Not an image file: word/footnotes.xml
2024-10-12 23:21:10,982 DEBUG   Not an image file: word/endnotes.xml
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: creating a printed book

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

On 10/11/2024 10:16 PM, Hraban Ramm wrote:

Am 11.10.24 um 18:19 schrieb David Roderick:
I have created 22 MSword files mainly text with embedded PNG 
diagrams.  I am seeking to have these converted to Context and to redo 
the (simple) diagrams.  I was thinking of using MetaPost.  I am 
seeking to pay a typesetter to assist me in this task.  I would be 
willing to pay for your time or for the time of a colleague you could 
direct me to.  I am seeking to have typeset a book.  The MSWord files 
have already been professionally proof-read, and the subject matter is 
political economy from the 18th century and how this translates to and 
may contradict conventional wisdom within the field of modern economics.


Other typesetters I have contacted have suggested running pandoc to 
create a LaTeX file and use Tikz for the diagrams.  But I have spent 3 
days reading on advancements in the ConText side of the industry which 
I suspect is far more advanced.  I would prefer to use better tools as 
a longer term solution.  Can you advise me?


Hi David,

I would take your order, but you can also try it yourself with my tools:
https://codeberg.org/fiee/context-tools/src/branch/master/docx2ctx

Pandoc can also generate ConTeXt code; try which you like better.


I'd never go that route when, as mentioned, a high quality document is 
needed which can involve control (for which one can e.g. use instances 
for specific components). Coding in TeX speak is not that bad. Also, one 
is more likely to get answers for specific problems on the list.


Hans

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

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


[NTG-context] Re: Adjusting Font Based Math Parameters

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

On 10/12/2024 7:27 PM, Julius Ross wrote:
Sorry that is not really what I want.  I am looking to adjust (in 
context) all of the 
primitives \Umathfractiondenomdown, \Umathfractionnumup etc described on 
p138 of the LuaMetaTeX reference manual.


Ideally it would be nice to be able to do this once from the start.

The reason is simply it would be much faster than having to export the 
font each time I make a small change to the font (which is slow and so 
harder to see the effect of the change).


If this is not possible/hard I can live without it.


You can make a so called font goodie file and tweak all parameters in 
there (just look at the shipped files) but ... only very few of these 
parameters actually make sense and are often set kind of bad (we're 
still considering just ditching all but a few of them).


If you change them per formula you have to set them at the right moment 
and if needed prefix them with \frozen in order to make them persistent 
for the multiple runs (two in traditional tex, many more in luametatex) 
over a math list (kind of like math style). There are lots of ways to 
control the math rendering as basically everything can be configured in 
the engine, but only a fraction makese sense and many relate to each 
other.


So the question is: what do you want to change? Maybe there are ways 
without messing with these parameters in the document.


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: Adjusting Font Based Math Parameters

2024-10-12 Thread Julius Ross
Sorry that is not really what I want.  I am looking to adjust (in context)
all of the primitives \Umathfractiondenomdown, \Umathfractionnumup etc
described on p138 of the LuaMetaTeX reference manual.

Ideally it would be nice to be able to do this once from the start.

The reason is simply it would be much faster than having to export the font
each time I make a small change to the font (which is slow and so harder to
see the effect of the change).

If this is not possible/hard I can live without it.

JR

On Sat, Oct 12, 2024 at 11:36 AM Mikael Sundqvist  wrote:

> Hi,
>
> I think \frac is resetting, or rather, that it sets to what one has set
> up, so:
>
> \setupmathfractions
>   [distance=bottom,
>bottomdistance=\exheight]
>
> \startformula
>   \frac{a}{b}
> \stopformula
>
> I hope it is what you look for.
>
> /Mikael
>
> PS You can find a bit on how fractions and other stuff are meant to be
> used in the manual
> https://www.pragma-ade.com/general/manuals/mathincontext-screen.pdf.
>
> On Sat, Oct 12, 2024 at 4:10 PM  wrote:
> >
> > Hi,
> >
> > For testing I would like to be able to adjust the font-based math
> parameters within ConTeXt MKIV.  I have been trying this
> >
> > \startformula
> > \Umathfractiondenomdown\displaystyle=1em
> > \displaystyle \frac{a}{b}
> > \stopformula
> >
> > but the second command does not seem to have any effect on the output at
> all. I am sure I am missing something, any help much appreciated.
> >
> > JR
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> > webpage  : https://www.pragma-ade.nl / https://context.aanhet.net
> (mirror)
> > archive  : https://github.com/contextgarden/context
> > wiki : https://wiki.contextgarden.net
> >
> ___
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Adjusting Font Based Math Parameters

2024-10-12 Thread Mikael Sundqvist
Hi,

I think \frac is resetting, or rather, that it sets to what one has set up, so:

\setupmathfractions
  [distance=bottom,
   bottomdistance=\exheight]

\startformula
  \frac{a}{b}
\stopformula

I hope it is what you look for.

/Mikael

PS You can find a bit on how fractions and other stuff are meant to be
used in the manual
https://www.pragma-ade.com/general/manuals/mathincontext-screen.pdf.

On Sat, Oct 12, 2024 at 4:10 PM  wrote:
>
> Hi,
>
> For testing I would like to be able to adjust the font-based math parameters 
> within ConTeXt MKIV.  I have been trying this
>
> \startformula
> \Umathfractiondenomdown\displaystyle=1em
> \displaystyle \frac{a}{b}
> \stopformula
>
> but the second command does not seem to have any effect on the output at all. 
> I am sure I am missing something, any help much appreciated.
>
> JR
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.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: equation to right margin

2024-10-12 Thread Alan Bowen
Hi, Mikael—

In answer to your question: I am one of two editors of *Aestimatio:
Sources and Studies in the History of Science*, where the science in
question is premodern. As it turns out, our publications tend to the
history of mathematics and astronomy (Babylonian, Egyptian, Greco-Roman,
Arabic), where the math, though common enough, is pretty much limited to
arithmetical computations and trigonometry. The paper that introduced the
problem of grouping is actually a lengthy review of a book on Heron’s
*Arithmetica*.

Your exchanges with Aditya are very interesting and, for me, most
informative.

Many thanks!

Alan

On Thu, Oct 10, 2024 at 1:36 AM Mikael Sundqvist  wrote:

> Hi,
>
> A. Bowen: The cases are meant for when you divide something into
> cases, as in the example below with the absolute value. It is a kind
> of inline part of a formula, and I would claim that when you number an
> equation, you do not number one case of a cases, but the equation. If
> you refer to it, you talk abou "the second line in (1)" if you need to
> specify. I also get a bit curious, are you editor of some math journal
> that is typeset by ConTeXt?
>
> A. Braslau: I agree that it is common to put the brace on the left,
> but I insist that it makes more sense to put it on the right _if_ you
> have equation numbers on the right. If equation numbers are to the
> left, it makes sense to put the brace on the left. Nevertheless, to
> put the brace on the left side and numbering on the right is possible
> (see example below). But the equation number in this case is sitting
> in between the two equations, and that is disturbing. If there would
> be three lines, one could argue that it would sit on the middle one.
> Or not distinguish it from the case where it sits on the middle line.
>
> The good thing is of course that one can do as one please.
>
> \starttext
> \startformula
>   \abs{x} =
>   \startcases
> \NC  x, \NC x > 0; \NR
> \NC  0, \NC x = 0; \NR
> \NC -x, \NC x < 0. \NR
>   \stopcases
>   \numberhere[eq:foo]
> \stopformula
>
> \startformula
>   \startalign
> [location=packed,fences=cases]
> \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> \NC  n^2+12 \NC=□^\prime.\NR
>   \stopalign
>   \numberhere[eq:foo]
> \stopformula
>
> \stoptext
>
> /Mikael
>
> On Thu, Oct 10, 2024 at 2:21 AM Alan Braslau via ntg-context
>  wrote:
> >
> > It is common, when writing a system of equations, to put a brace on the
> > left. It could make sense to number this system of equations with a
> > single number, on the right and aligned with the right margin. It would
> > also make sense for this number to be aligned with the middle of the
> > two equations of the system.
> >
> > A brace on the right would not introduce the grouping as a system of
> > equations, rather as a pair of equations sharing a common number.
> >
> > Alan
> >
> >
> >
> > On Wed, 9 Oct 2024 12:20:00 -0400
> > Alan Bowen  wrote:
> >
> > > I understand. The reasoning makes sense to me and, as editor of a
> > > paper in which this appears, I will ask the author to consider
> > > dropping the brace.
> > >
> > > I wonder of there is some similar thinking underlying the fact that
> > > \startcases... puts the equation number so close to the equation
> > > itself and not at a margin (typically right).
> > >
> > > Again, many thanks, Mikael.
> > > Alan
> > >
> > > On Wed, Oct 9, 2024 at 12:12 PM Mikael Sundqvist 
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > I think what you ask for was never supported in ConTeXt, for a
> > > > reason. The idea is that either one groups a set of equations with
> > > > a brace and numbers them with one number, or one does not group,
> > > > and then one can number each line separately/independently.
> > > > Grouping on the left with a brace and numbering one line to the
> > > > right is, even if we see that often, not really logical.
> > > >
> > > > If there is a large request for doing this, I can talk to Hans about
> > > > it, maybe it is easy on the code side to support it. But I remember
> > > > from when we were messing with numbering, and in particular when
> > > > there are alignments, that it is a bit complicated.
> > > >
> > > > /Mikael
> > > >
> > > > On Wed, Oct 9, 2024 at 5:19 PM Alan Bowen 
> > > > wrote:
> > > > >
> > > > > Thank you, Mikael. That is very helpful and much appreciated.
> > > > >
> > > > > What I now have is:
> > > > > \startplaceformula
> > > > >   \startformula
> > > > > \startalign
> > > > >   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR[eq:1]
> > > > >   \NC  n^2+12 \NC=□^\prime.  \NR[eq:2]
> > > > > \stopalign
> > > > >   \stopformula
> > > > > \stopplaceformula
> > > > > which put the numbers at the right margin,as I wanted.
> > > > >
> > > > > So how do I get a brace on the left rather than on the right?  Or
> > > > > is
> > > > there documentation that explains this?
> > > > >
> > > > > Alan
> > > > >
> > > > > On Wed, Oct 9, 2024 at 10:22 AM Mikael Sundqvist
> > > > > 
> >

[NTG-context] Re: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-12 Thread Wolfgang Schuster

Jorge Manuel schrieb am 12.10.2024 um 13:24:

I applied a trick: I created a phantom itemize.

\define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}}

\defineconversion [BoxedNumber] [\BoxedNumber]

\starttext

\startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount]
    \item xxx
    \startitemize[BoxedNumber,fit, repeat][stopper=,distance=\spaceamount]
      \item multiple choice
* \startitemize[norepeat]*
* \item Your choice: \_\_\_\_*
  \startitemize[A, columns, two, random, fit][stopper={)},style=bold] %%
  \item choice 1
  \item choice 2
  \item choice 3
  \item choice 4
  \stopitemize
* \stopitemize*

  \item normal question 1
  \startitemize[BoxedNumber, repeat] %%
  \item question 1 \par\thinrules[n=2]
  \item question2 \par\thinrules[n=2]
  \stopitemize
    \stopitemize
\stopitemize

\stoptext


You can use an enumeration to have more control about the numbering and 
spacing/width of the counter.


 begin example
\define[1]\BoxedNumber
  {\inframed[width=3ex]{\convertnumber{n}{#1}}}

\defineconversion [BoxedNumber] [\BoxedNumber]

\defineenumeration
  [Question]
  [text=,
   alternative=hang,
   width=broad,
   numberconversion=BoxedNumber]

\starttext

\startQuestion
  xxx
  \startsubQuestion
multiple choice
\startitemize[A,columns,tworandom][stopper={)},style=bold]
  \startitem choice 1 \stopitem
  \startitem choice 2 \stopitem
  \startitem choice 3 \stopitem
  \startitem choice 4 \stopitem
\stopitemize
  \stopsubQuestion
  \startsubQuestion
normal question 1
\startsubsubQuestion
  question 1 \par\thinrules[n=2]
\stopsubsubQuestion
\startsubsubQuestion
  question2 \par\thinrules[n=2]
\stopsubsubQuestion
  \stopsubQuestion
\stopQuestion

\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: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-12 Thread Jorge Manuel
I applied a trick: I created a phantom itemize.

\define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}}

\defineconversion [BoxedNumber] [\BoxedNumber]

\starttext

\startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount]
   \item xxx
   \startitemize[BoxedNumber,fit, repeat][stopper=,distance=\spaceamount]
     \item multiple choice
 \startitemize[norepeat]
 \item Your choice: \_\_\_\_
 \startitemize[A, columns, two, random, fit][stopper={)},style=bold] %%
 \item choice 1
 \item choice 2
 \item choice 3
 \item choice 4
 \stopitemize
 \stopitemize

 \item normal question 1
 \startitemize[BoxedNumber, repeat] %%
 \item question 1 \par\thinrules[n=2]
 \item question2 \par\thinrules[n=2]

 \stopitemize


   \stopitemize
\stopitemize

\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: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-12 Thread Jorge Manuel
To achieve a norepeat in a specific itemize block, I need to introduce the 
norepeat at a higher level. This affects all the children of that itemize. See 
the example below, please. In the multiple-choice block, I want to avoid 
repetition, but afterward, I want to restore the default behavior.

\define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}}

\defineconversion [BoxedNumber] [\BoxedNumber]

\starttext

\startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount]
   \item xxx
   \startitemize[BoxedNumber,fit, norepeat][stopper=,distance=\spaceamount]
     \item multiple choice
 \startitemize[A, columns, two, random, fit][stopper={)},style=bold] %%
 \item choice 1
 \item choice 2
 \item choice 3
 \item choice 4
 \stopitemize

 \item normal question 1
 \startitemize[BoxedNumber, repeat] %%
 \item question 1 \par\thinrules[n=2]
 \item question2 \par\thinrules[n=2]

 \stopitemize


   \stopitemize
\stopitemize

\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: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-12 Thread Wolfgang Schuster

Jorge Manuel schrieb am 12.10.2024 um 11:40:

Good morning to all,

Thank you for the code to insert numbers into boxes. However, I can't 
prevent the multiple-choice questions from repeating labels like 1.1.A). 
It looks very bad. How can I control this behavior? Thank you.


%%% sample code
\define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}}

\defineconversion [BoxedNumber] [\BoxedNumber]

\starttext

\startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount]
    \item xxx
    \startitemize[BoxedNumber,fit][stopper=,distance=\spaceamount]


Add norepeat:

\startitemize[BoxedNumber,norepeat,fit][stopper=,distance=\spaceamount]


      \item multiple choice
      \startitemize[A, columns, two, random][stopper={)},style=bold]
   \item choice 1


You have to replace \item with \startitem ... \stopitem to make use of 
the random option, i.e.


\startitem choice 1 \stopitem

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: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-12 Thread Jorge Manuel
Good morning to all,

Thank you for the code to insert numbers into boxes. However, I can't prevent 
the multiple-choice questions from repeating labels like 1.1.A). It looks very 
bad. How can I control this behavior? Thank you.

%%% sample code
\define[1]\BoxedNumber{\inframed[width=3ex]{\convertnumber{n}{#1}}}

\defineconversion [BoxedNumber] [\BoxedNumber]

\starttext

\startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount]
   \item xxx
   \startitemize[BoxedNumber,fit][stopper=,distance=\spaceamount]
     \item multiple choice
    \startitemize[A, columns, two, random][stopper={)},style=bold]
    \item choice 1
 \item choice 2
 \item choice 3
 \item choice 4
 \stopitemize

   \stopitemize
\stopitemize

\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: Artifact in flow cell connection

2024-10-12 Thread wangzhongtian
I am trying to implement bibliography management in GB/T 7714-2015 (Chinese bibliography style standard), of Author-Year format. The bib list should be sorted by language, author, year, and then the title of the book. The sorting algorithm should use PinYin of Chinese characters to compare the order. I am wondering is this feature already implemented for LuaMetatex? Or if not, any suggestions on how can I implemented this? Like1. How to implement the sorting algorithm?2. Which part of the source code can I rewrite to implement this feature?Thank you all for your time!Best,zhongtian wang Shijiazhuang YouWen Information Technology Co.,Ltd,China13311202589 wang...@189.cn -- 原始邮件 --发件人:Bernd Donner via ntg-context "ntg-context@ntg.nl"时 间:2024/10/12 04:47:29 周六收件人:ntg-context@ntg.nl抄送人:Bernd Donner "bleau1...@googlemail.com"主 题:[NTG-context] Artifact in flow cell connectionHi,I have a broken flow cell connection in this minimal example. The broken flow cell is only triggered when drawn within a subsection with an overlay. The logic to create the underlined subsection is by the way copied from the metafun manual source. I do not have the slightest clue what is going wrong in this example. Thanks for ideas.Best, Bernd\usemodule[chart]\startuniqueMPgraphic{SectionUnderline}   path p;p:= unitsquare xscaled OverlayWidth yscaled OverlayHeight;   draw llcorner p -- lrcorner p;   setbounds currentpicture to p; \stopuniqueMPgraphic\defineoverlay[SectionUnderline][\uniqueMPgraphic{SectionUnderline}]\starttexdefinition unexpanded ChapterCommand #1#2  \framed [background="" {#2}\stoptexdefinition\setuphead  [subsection]  [command=\ChapterCommand]\starttext\subsection[title=Introduction]\startFLOWchart[toolchain]\startFLOWcell  \location{1,1}  \connection [bt] {compiler}\stopFLOWcell\startFLOWcell  \name {compiler}  \location{1,2}  \shape{product}\stopFLOWcell\stopFLOWchart\FLOWchart[toolchain]\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: creating a printed book

2024-10-11 Thread Hraban Ramm

Am 11.10.24 um 18:19 schrieb David Roderick:
I have created 22 MSword files mainly text with embedded PNG 
diagrams.  I am seeking to have these converted to Context and to redo 
the (simple) diagrams.  I was thinking of using MetaPost.  I am 
seeking to pay a typesetter to assist me in this task.  I would be 
willing to pay for your time or for the time of a colleague you could 
direct me to.  I am seeking to have typeset a book.  The MSWord files 
have already been professionally proof-read, and the subject matter is 
political economy from the 18th century and how this translates to and 
may contradict conventional wisdom within the field of modern economics.


Other typesetters I have contacted have suggested running pandoc to 
create a LaTeX file and use Tikz for the diagrams.  But I have spent 3 
days reading on advancements in the ConText side of the industry which 
I suspect is far more advanced.  I would prefer to use better tools as 
a longer term solution.  Can you advise me?


Hi David,

I would take your order, but you can also try it yourself with my tools:
https://codeberg.org/fiee/context-tools/src/branch/master/docx2ctx

Pandoc can also generate ConTeXt code; try which you like better.

Best, Hraban
www.fiee.net

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

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


[NTG-context] Re: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-11 Thread Wolfgang Schuster

desdecha...@gmail.com schrieb am 11.10.2024 um 13:41:

Yes, that's exactly what I'm looking for. However, regarding multiple-choice 
questions, I would like the options to appear simply as A) rather than 1.1.1.A).


Don't use the "repeat" option when you don't want repeated counter values.


Additionally, Is it possible to display each digit of the item numbering in boxes, 
similar to the style used in Pearson exams? Example: |1|.|1|."


This requires a custom number conversion, the following example works 
only for single digits only.


 begin example
\define[1]\BoxedNumber
  {\inframed[width=3ex]{\convertnumber{n}{#1}}}

\defineconversion [BoxedNumber] [\BoxedNumber]

\starttext

\startitemize[BoxedNumber,fit,repeat][stopper=,distance=\spaceamount]
  \item xxx
  \startitemize[BoxedNumber,fit][stopper=,distance=\spaceamount]
    \item xxx
  \stopitemize
\stopitemize

\stoptext
 end example


Like this:  
https://filestore.aqa.org.uk/sample-papers-and-mark-schemes/2023/june/AQA-74051-QP-JUN23.PDF


For question blocks like here you want to use an enumeration environment 
rather than itemize.


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: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-11 Thread desdechaves
Yes, that's exactly what I'm looking for. However, regarding multiple-choice 
questions, I would like the options to appear simply as A) rather than 
1.1.1.A). Additionally, Is it possible to display each digit of the item 
numbering in boxes, similar to the style used in Pearson exams? Example: 
|1|.|1|." 
Like this:  
https://filestore.aqa.org.uk/sample-papers-and-mark-schemes/2023/june/AQA-74051-QP-JUN23.PDF

Have a nice day

Thanks in advance.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: equation to right margin

2024-10-10 Thread Aditya Mahajan
On Thu, 10 Oct 2024, Otared Kavian wrote:

> Hi Mikael,
> 
> My personal experience with numbered equations gathered with a big left curly 
> brace (assuming that the numbers are put to the right of formulas) is that it 
> is very useful (or indispensable…) to be able to number each equation and be 
> able to refer to them. For instance, when one writes a partial differential 
> equation, usually there are boundary conditions, initial conditions and such, 
> which may take 3, 4 or 5 lines of equations (some authors may even have more 
> than that, but I personally avoid it…). It is useful to be able to refer to 
> each of these equations, either by numebring them as subformulas, or 
> numebering them sequentially. It is true that in this case, that is when each 
> line has a number, usually one does not number the whole system of equations 
> gathered by the big left brace. The optimal solution would be to have the 
> option to number each line, or to number them as subformulas.
> 
> For instance in the following minimal example (based on one of your answers 
> some time ago), the reference to « eq:Robin » does not work and the numbers 
> of each line of the PDE problem are not correctly aligned to the right.

Reference to eq:Robin doesn't work because of the following reason: You define

> \define[1]\eqref{(\in[eq:#1])}

and then use \eqref[eq:Robin] which is then translated to (\in[eq:eq:Robin]). 
It may be better to use:

\definereferenceformat
  [eqref]
  [left=(, right=), style=normal]


Regarding \startcases number not being to the right edge of the textarea: there 
is no good solution here. Keep in mind that \startcases is an "inner level" 
construct, so it is not aware of the width of the outer environment. It is 
possible to circumvent it on a code-logic level, but we first need to decide 
how should the following behave:

\startformula
  x(t) = \startcases
\NC 0, \NC t < 0 \NR
\NC 1, \NC t \ge 0 \NR[+]
  \stopcases
  \quad\text{and}\quad
  y(t) = \startcases
\NC 0, \NC t < 0 \NR[+]
\NC 1, \NC t \ge 0 \NR
  \stopcases
\stopformula

The point is, that \stopcases can be followed by additional text, so placing 
the number at the right edge may interfere with other things. 

In the example that you sent, the solution presented by Mikael 
(\startalign[fences=cases]) will work. 

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: equation to right margin

2024-10-10 Thread Otared Kavian
Hi Mikael,

My personal experience with numbered equations gathered with a big left curly 
brace (assuming that the numbers are put to the right of formulas) is that it 
is very useful (or indispensable…) to be able to number each equation and be 
able to refer to them. For instance, when one writes a partial differential 
equation, usually there are boundary conditions, initial conditions and such, 
which may take 3, 4 or 5 lines of equations (some authors may even have more 
than that, but I personally avoid it…). It is useful to be able to refer to 
each of these equations, either by numebring them as subformulas, or numebering 
them sequentially. It is true that in this case, that is when each line has a 
number, usually one does not number the whole system of equations gathered by 
the big left brace. The optimal solution would be to have the option to number 
each line, or to number them as subformulas.

For instance in the following minimal example (based on one of your answers 
some time ago), the reference to « eq:Robin » does not work and the numbers of 
each line of the PDE problem are not correctly aligned to the right.

% begin example alignedcases.tex

\definemathsimplealign[pdeproblem][
left={\startmathfenced[cases]},
right=\stopmathfenced,
align={1:right,2:left,3:left},
strut=yes,
]

\define[1]\eqref{(\in[eq:#1])}
\starttext
A function $u$ is said to be harmonic in $\Omega$ if
\placeformula[eq:Harmonic]
\startformula
\Delta u = 0 \quad\text{in }\, \Omega.
\stopformula
For a given potential $V$ defined on $\partial\Omega$ and a smooth function 
$\phi$ defined on $\partial\Omega$, study here the PDE
\placeformula 
\startformula
\startpdeproblem
\NC - \Delta u \NC = 0 \NC \qquad\text{in } \Omega \NR[eq:Harmonic-1]
\NC \frac{\partial u}{\partial {\bi n}} \NC = V u + \phi \NC
\qquad\text{on } \partial\Omega \NR[eq:Robin]
\stoppdeproblem
\stopformula

In the above PDE problem, the boundary condition \eqref{eq:Robin} may be 
replaced by a nonlinear condition such as
\startformula
\frac{\partial u}{\partial {\bi n}} \NC = V u + u^3 \qquad\text{on } 
\partial\Omega,
\stopformula
while the notion of a harmonic function \eqref{Harmonic} may be replaced with 
\startformula
-{\rm div}(a(x)\nabla u) = 0 \quad\text{in }\, \Omega.
\stopformula

\stoptext

% end example alignedcases.tex

Best regards: Otared

> On 10 Oct 2024, at 07:32, Mikael Sundqvist  wrote:
> 
> Hi,
> 
> A. Bowen: The cases are meant for when you divide something into
> cases, as in the example below with the absolute value. It is a kind
> of inline part of a formula, and I would claim that when you number an
> equation, you do not number one case of a cases, but the equation. If
> you refer to it, you talk abou "the second line in (1)" if you need to
> specify. I also get a bit curious, are you editor of some math journal
> that is typeset by ConTeXt?
> 
> A. Braslau: I agree that it is common to put the brace on the left,
> but I insist that it makes more sense to put it on the right _if_ you
> have equation numbers on the right. If equation numbers are to the
> left, it makes sense to put the brace on the left. Nevertheless, to
> put the brace on the left side and numbering on the right is possible
> (see example below). But the equation number in this case is sitting
> in between the two equations, and that is disturbing. If there would
> be three lines, one could argue that it would sit on the middle one.
> Or not distinguish it from the case where it sits on the middle line.
> 
> The good thing is of course that one can do as one please.
> 
> \starttext
> \startformula
>  \abs{x} =
>  \startcases
>\NC  x, \NC x > 0; \NR
>\NC  0, \NC x = 0; \NR
>\NC -x, \NC x < 0. \NR
>  \stopcases
>  \numberhere[eq:foo]
> \stopformula
> 
> \startformula
>  \startalign
>[location=packed,fences=cases]
>\NC \[21-(9 - n^2)\NC =□^\prime\]\NR
>\NC  n^2+12 \NC=□^\prime.\NR
>  \stopalign
>  \numberhere[eq:foo]
> \stopformula
> 
> \stoptext
> 
> /Mikael
> 
> On Thu, Oct 10, 2024 at 2:21 AM Alan Braslau via ntg-context
>  wrote:
>> 
>> It is common, when writing a system of equations, to put a brace on the
>> left. It could make sense to number this system of equations with a
>> single number, on the right and aligned with the right margin. It would
>> also make sense for this number to be aligned with the middle of the
>> two equations of the system.
>> 
>> A brace on the right would not introduce the grouping as a system of
>> equations, rather as a pair of equations sharing a common number.
>> 
>> Alan
>> 
>> 
>> 
>> On Wed, 9 Oct 2024 12:20:00 -0400
>> Alan Bowen  wrote:
>> 
>>> I understand. The reasoning makes sense to me and, as editor of a
>>> paper in which this appears, I will ask the author to consider
>>> dropping the brace.
>>> 
>>> I wonder of there is some similar thinking underlying the fact that
>>> \startcases... puts the equation number so close to the equation
>>> itself and not at a margin (typically righ

[NTG-context] Re: Lua <-> TeXShop

2024-10-10 Thread Otared Kavian
Hi Thomas,

Thanks for sharing the lua.engine. It works jsut fine !

Best regards: Otared

> On 10 Oct 2024, at 16:06, Thomas Meyer  wrote:
> 
> Hi Otared,
> 
> I used what Hans wrote in his answers.
> 
> #!/bin/bash
> export PATH=$PATH:~/context-osx-64/tex/texmf-osx-64/bin
> ~/context-osx-64/tex/texmf-osx-64/bin/mtxrun  --script "$1" 
> 
> 
> Greetings 
> Thomas
> 
> 
> 
> 
> Am 10.10.24 um 14:47 schrieb Otared Kavian:
>> Hi Thomas,
>> 
>> Out of curiosity, could you please what is the content of your lua.engine ? 
>> I would like to see whether it is better for me to use your approach 
>> suggested dy Richard Koch and Hans…
>> 
>> Best regards: Otared
>> 
>>> On 10 Oct 2024, at 10:52, Thomas Meyer >> > wrote:
>>> 
>>> Thank you very much, Hans,
>>> 
>>> I had already written to Dick Koch before the first replies arrived. He 
>>> wrote that I could simply use Lua(La)TeX.
>>> So it works with Lua(La)TeX. A self-created lua.engine works and your 
>>> ConTeXt solution with --runner=mtxrun in the first line works as well. 
>>> 
>>> Best regards
>>> Thomas 
>>> 
>>> 
>>> Am 09.10.24 um 21:20 schrieb Hans Hagen:
 On 10/8/2024 12:35 PM, Thomas Meyer wrote: 
> Hello, 
> 
> at the risk of this being the wrong address: can I edit and run Lua with 
> TeXShop? 
> Does anyone have experience with this? 
> Or what could be used as an IDE for Lua? 
 
 you can try this with 
 
 -- runner=mtxrun 
 
 as first line in your lua file 
 
 
 
 - 
   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 
>>> ___
>> 
>> Otared Kavian
>> e-mail: ota...@gmail.com 
>> Phone: +33 6 88 26 70 95
>> 
>> 
>> 
>> 
>> 
>> 
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl  / 
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.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
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95




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

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

2024-10-10 Thread Henning Hraban Ramm

Thank you both, that clears up everything I wanted to know (so far).

Yesterday it was just too fast to really understand everything, and I 
got confused since the typographical term is “widows and orphans”, but 
TeX uses \cubpenalties for orphans.


I’m looking forward to the article!

I just re-did the page breaking for our current novel, “Gesicht zur 
Wand”, 452 pages so far; the last third is still in the works between 
author and editors.
With the better penalties setup, I need much less manual tweaking – but 
of course it’ll never be perfect. (Still better than our printshop’s 
cutting…)


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

2024-10-10 Thread Mikael Sundqvist
Hi,

On Thu, Oct 10, 2024 at 2:58 PM Henning Hraban Ramm  wrote:
>
> Yesterday I learned:
>
> \startsetups[*default]
> \widowpenalties 3 1 1000 0
> \clubpenalties 3 1 1000 0
> \orphanpenalties 2 8000 1000
> \stopsetups
>
> If I want the penalty settings applied to “everything” (after defining
> the layout, I think?), then I need the setup "*defaults".

Yes, for now, since it got reset when \setuplayout was done. But we
are working on making it possible to also setup this with \setupalign,
with a few "reasonable" pre-defined setups. So, for example in my math
book I currently run

\setupalign[lesswidows,lessclubs,lessorphans,strictmath]

and that actually makes a few of these setups. It will of course be
possible to define your own set of penalties and use them instead.

>
> Since TeX uses a club against orphans (brutal!), I’m not sure what
> \orphanpenalty is for.

Wolfgang already explained this, but in short they are there to
discourage that a paragraph ends with only one word. We looked at it
yesterday at the meeting. You saw those penalties in action when you
did \showmakeup[hpenalty].

>
> I remember \twinpenalty is against doubled words (below each other?),
> and \toddlerpenalty against single letter words at the end of a line
> (why “toddler”?).

Indeed. Well, you can imagine a little toddler not really being able
to join the rest, or if you want, tied to the rest.

>
> widows and clubs get only 150 in TeX, but 2000 in ConTeXt, as far as I
> could find.
>
> Are there more penalties that make sense to set individually?

If you do math there might be more (set above by strictmath), but I
think you are fine with the ones above. Since you are finishing a
project, please tell if more problems show up. We can have another
chat where we try to solve...

>
> WRT demerits: Did I understand correctly that demerits are the “sum”
> (some formula) of badness and penalties in a line or paragraph?

A bit like that. For each possible breakpoint you get a badness value.
Then you can see it as if TeX runs over the paragraph once more, given
all possible breakpoints, with or without extra penalties, and builds
up a demerits for the different possible solutions. They can come from
badness, penalties and additional demerits (adjdemerits not to have
incompatible lines for example). Then, at the end, the best solution
(least demerits) is the one that will be used.

We are currently writing an article on the parbuilder, with and
without parpasses. You saw an early draft at the meeting yesterday.

/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: penalties

2024-10-10 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 10.10.2024 um 14:54:

Yesterday I learned:

\startsetups[*default]
\widowpenalties 3 1 1000 0
\clubpenalties 3 1 1000 0
\orphanpenalties 2 8000 1000
\stopsetups

If I want the penalty settings applied to “everything” (after defining 
the layout, I think?), then I need the setup "*defaults".


Since TeX uses a club against orphans (brutal!), I’m not sure what 
\orphanpenalty is for.


 begin primitives.tex
[...]

\startnewprimitive[title={\prm {orphanpenalties}}]

This an (single entry) array parameter: first the size is given followed 
by that amount of penalties. These penalties are injected before spaces, 
going backward from the end of a paragraph. When we see a math node with 
a penalty set then we take the max and jump over a (preceding) skip.


\stopnewprimitive

\startnewprimitive[title={\prm {orphanpenalty}}]

This penalty is inserted before the last space in a paragraph, unless 
\prm {orphanpenalties} mandates otherwise.


\stopnewprimitive

[...]
 end primitives.tex

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: Lua <-> TeXShop

2024-10-10 Thread Thomas Meyer

Hi Otared,

I used what Hans wrote in his answers.

#!/bin/bash
export PATH=$PATH:~/context-osx-64/tex/texmf-osx-64/bin
~/context-osx-64/tex/texmf-osx-64/bin/mtxrun  --script "$1"


Greetings
Thomas




Am 10.10.24 um 14:47 schrieb Otared Kavian:

Hi Thomas,

Out of curiosity, could you please what is the content of your 
lua.engine ? I would like to see whether it is better for me to use 
your approach suggested dy Richard Koch and Hans…


Best regards: Otared


On 10 Oct 2024, at 10:52, Thomas Meyer  wrote:

Thank you very much, Hans,

I had already written to Dick Koch before the first replies arrived. 
He wrote that I could simply use Lua(La)TeX.
So it works with Lua(La)TeX. A self-created lua.engine works and your 
ConTeXt solution with --runner=mtxrun in the first line works as well.


Best regards
Thomas


Am 09.10.24 um 21:20 schrieb Hans Hagen:

On 10/8/2024 12:35 PM, Thomas Meyer wrote:

Hello,

at the risk of this being the wrong address: can I edit and run Lua 
with TeXShop?

Does anyone have experience with this?
Or what could be used as an IDE for Lua?


you can try this with

-- runner=mtxrun

as first line in your lua file



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


Otared Kavian
e-mail: ota...@gmail.com 
Phone: +33 6 88 26 70 95





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

maillist :ntg-context@ntg.nl 
/https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Lua <-> TeXShop

2024-10-10 Thread Otared Kavian
Hi Thomas,

Out of curiosity, could you please what is the content of your lua.engine ? I 
would like to see whether it is better for me to use your approach suggested dy 
Richard Koch and Hans…

Best regards: Otared

> On 10 Oct 2024, at 10:52, Thomas Meyer  wrote:
> 
> Thank you very much, Hans,
> 
> I had already written to Dick Koch before the first replies arrived. He wrote 
> that I could simply use Lua(La)TeX.
> So it works with Lua(La)TeX. A self-created lua.engine works and your ConTeXt 
> solution with --runner=mtxrun in the first line works as well. 
> 
> Best regards
> Thomas 
> 
> 
> Am 09.10.24 um 21:20 schrieb Hans Hagen:
>> On 10/8/2024 12:35 PM, Thomas Meyer wrote: 
>>> Hello, 
>>> 
>>> at the risk of this being the wrong address: can I edit and run Lua with 
>>> TeXShop? 
>>> Does anyone have experience with this? 
>>> Or what could be used as an IDE for Lua? 
>> 
>> you can try this with 
>> 
>> -- runner=mtxrun 
>> 
>> as first line in your lua file 
>> 
>> 
>> 
>> - 
>>   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
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95




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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Lua <-> TeXShop

2024-10-10 Thread Thomas Meyer

Thank you very much, Hans,

I had already written to Dick Koch before the first replies arrived. He 
wrote that I could simply use Lua(La)TeX.
So it works with Lua(La)TeX. A self-created lua.engine works and your 
ConTeXt solution with --runner=mtxrun in the first line works as well.


Best regards
Thomas


Am 09.10.24 um 21:20 schrieb Hans Hagen:

On 10/8/2024 12:35 PM, Thomas Meyer wrote:

Hello,

at the risk of this being the wrong address: can I edit and run Lua 
with TeXShop?

Does anyone have experience with this?
Or what could be used as an IDE for Lua?


you can try this with

-- runner=mtxrun

as first line in your lua file



-
  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: equation to right margin

2024-10-09 Thread Mikael Sundqvist
Hi,

A. Bowen: The cases are meant for when you divide something into
cases, as in the example below with the absolute value. It is a kind
of inline part of a formula, and I would claim that when you number an
equation, you do not number one case of a cases, but the equation. If
you refer to it, you talk abou "the second line in (1)" if you need to
specify. I also get a bit curious, are you editor of some math journal
that is typeset by ConTeXt?

A. Braslau: I agree that it is common to put the brace on the left,
but I insist that it makes more sense to put it on the right _if_ you
have equation numbers on the right. If equation numbers are to the
left, it makes sense to put the brace on the left. Nevertheless, to
put the brace on the left side and numbering on the right is possible
(see example below). But the equation number in this case is sitting
in between the two equations, and that is disturbing. If there would
be three lines, one could argue that it would sit on the middle one.
Or not distinguish it from the case where it sits on the middle line.

The good thing is of course that one can do as one please.

\starttext
\startformula
  \abs{x} =
  \startcases
\NC  x, \NC x > 0; \NR
\NC  0, \NC x = 0; \NR
\NC -x, \NC x < 0. \NR
  \stopcases
  \numberhere[eq:foo]
\stopformula

\startformula
  \startalign
[location=packed,fences=cases]
\NC \[21-(9 - n^2)\NC =□^\prime\]\NR
\NC  n^2+12 \NC=□^\prime.\NR
  \stopalign
  \numberhere[eq:foo]
\stopformula

\stoptext

/Mikael

On Thu, Oct 10, 2024 at 2:21 AM Alan Braslau via ntg-context
 wrote:
>
> It is common, when writing a system of equations, to put a brace on the
> left. It could make sense to number this system of equations with a
> single number, on the right and aligned with the right margin. It would
> also make sense for this number to be aligned with the middle of the
> two equations of the system.
>
> A brace on the right would not introduce the grouping as a system of
> equations, rather as a pair of equations sharing a common number.
>
> Alan
>
>
>
> On Wed, 9 Oct 2024 12:20:00 -0400
> Alan Bowen  wrote:
>
> > I understand. The reasoning makes sense to me and, as editor of a
> > paper in which this appears, I will ask the author to consider
> > dropping the brace.
> >
> > I wonder of there is some similar thinking underlying the fact that
> > \startcases... puts the equation number so close to the equation
> > itself and not at a margin (typically right).
> >
> > Again, many thanks, Mikael.
> > Alan
> >
> > On Wed, Oct 9, 2024 at 12:12 PM Mikael Sundqvist 
> > wrote:
> >
> > > Hi,
> > >
> > > I think what you ask for was never supported in ConTeXt, for a
> > > reason. The idea is that either one groups a set of equations with
> > > a brace and numbers them with one number, or one does not group,
> > > and then one can number each line separately/independently.
> > > Grouping on the left with a brace and numbering one line to the
> > > right is, even if we see that often, not really logical.
> > >
> > > If there is a large request for doing this, I can talk to Hans about
> > > it, maybe it is easy on the code side to support it. But I remember
> > > from when we were messing with numbering, and in particular when
> > > there are alignments, that it is a bit complicated.
> > >
> > > /Mikael
> > >
> > > On Wed, Oct 9, 2024 at 5:19 PM Alan Bowen 
> > > wrote:
> > > >
> > > > Thank you, Mikael. That is very helpful and much appreciated.
> > > >
> > > > What I now have is:
> > > > \startplaceformula
> > > >   \startformula
> > > > \startalign
> > > >   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR[eq:1]
> > > >   \NC  n^2+12 \NC=□^\prime.  \NR[eq:2]
> > > > \stopalign
> > > >   \stopformula
> > > > \stopplaceformula
> > > > which put the numbers at the right margin,as I wanted.
> > > >
> > > > So how do I get a brace on the left rather than on the right?  Or
> > > > is
> > > there documentation that explains this?
> > > >
> > > > Alan
> > > >
> > > > On Wed, Oct 9, 2024 at 10:22 AM Mikael Sundqvist
> > > > 
> > > wrote:
> > > >>
> > > >> Hi,
> > > >>
> > > >> On Mon, Oct 7, 2024 at 11:45 PM Alan Bowen
> > > >> 
> > > wrote:
> > > >> >
> > > >> > I have the following which works, except for the fact that the
> > > equation number does not go to the right margin.
> > > >> >
> > > >> > \startplaceformula
> > > >> > \startformula[align=middle, prefix=no]
> > > >> > \startcases[distance=2pt]
> > > >> > \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> > > >> > \NC\hfill n^2+12 \NC=□^\prime.\NR[eq04]
> > > >> > \stopcases
> > > >> > \stopformula
> > > >> > \stopplaceformula
> > > >> >
> > > >> > I expect that I have missed something pretty basic here, so any
> > > guidance will be greatly appreciated.
> > > >>
> > > >> Maybe I misunderstand you, but I do not think cases is right
> > > >> here. Also, are you sure you want to group two equations but
> > > >> only number one of them.
> > > >>
> > > >> If I understand you corr

[NTG-context] Re: equation to right margin

2024-10-09 Thread Alan Braslau via ntg-context
It is common, when writing a system of equations, to put a brace on the
left. It could make sense to number this system of equations with a
single number, on the right and aligned with the right margin. It would
also make sense for this number to be aligned with the middle of the
two equations of the system.

A brace on the right would not introduce the grouping as a system of
equations, rather as a pair of equations sharing a common number.

Alan



On Wed, 9 Oct 2024 12:20:00 -0400
Alan Bowen  wrote:

> I understand. The reasoning makes sense to me and, as editor of a
> paper in which this appears, I will ask the author to consider
> dropping the brace.
> 
> I wonder of there is some similar thinking underlying the fact that
> \startcases... puts the equation number so close to the equation
> itself and not at a margin (typically right).
> 
> Again, many thanks, Mikael.
> Alan
> 
> On Wed, Oct 9, 2024 at 12:12 PM Mikael Sundqvist 
> wrote:
> 
> > Hi,
> >
> > I think what you ask for was never supported in ConTeXt, for a
> > reason. The idea is that either one groups a set of equations with
> > a brace and numbers them with one number, or one does not group,
> > and then one can number each line separately/independently.
> > Grouping on the left with a brace and numbering one line to the
> > right is, even if we see that often, not really logical.
> >
> > If there is a large request for doing this, I can talk to Hans about
> > it, maybe it is easy on the code side to support it. But I remember
> > from when we were messing with numbering, and in particular when
> > there are alignments, that it is a bit complicated.
> >
> > /Mikael
> >
> > On Wed, Oct 9, 2024 at 5:19 PM Alan Bowen 
> > wrote:
> > >
> > > Thank you, Mikael. That is very helpful and much appreciated.
> > >
> > > What I now have is:
> > > \startplaceformula
> > >   \startformula
> > > \startalign
> > >   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR[eq:1]
> > >   \NC  n^2+12 \NC=□^\prime.  \NR[eq:2]
> > > \stopalign
> > >   \stopformula
> > > \stopplaceformula
> > > which put the numbers at the right margin,as I wanted.
> > >
> > > So how do I get a brace on the left rather than on the right?  Or
> > > is
> > there documentation that explains this?
> > >
> > > Alan
> > >
> > > On Wed, Oct 9, 2024 at 10:22 AM Mikael Sundqvist
> > > 
> > wrote:
> > >>
> > >> Hi,
> > >>
> > >> On Mon, Oct 7, 2024 at 11:45 PM Alan Bowen
> > >> 
> > wrote:
> > >> >
> > >> > I have the following which works, except for the fact that the
> > equation number does not go to the right margin.
> > >> >
> > >> > \startplaceformula
> > >> > \startformula[align=middle, prefix=no]
> > >> > \startcases[distance=2pt]
> > >> > \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> > >> > \NC\hfill n^2+12 \NC=□^\prime.\NR[eq04]
> > >> > \stopcases
> > >> > \stopformula
> > >> > \stopplaceformula
> > >> >
> > >> > I expect that I have missed something pretty basic here, so any
> > guidance will be greatly appreciated.
> > >>
> > >> Maybe I misunderstand you, but I do not think cases is right
> > >> here. Also, are you sure you want to group two equations but
> > >> only number one of them.
> > >>
> > >> If I understand you correctly, I'd try with one of these,
> > >> depending on if citing the group or one of the equations.
> > >>
> > >> \starttext
> > >>
> > >> \startformula
> > >>   \startalign[location=packed,fences=sesac]
> > >> \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> > >> \NC  n^2+12 \NC=□^\prime.\NR
> > >>   \stopalign
> > >>   \numberhere[eq:foo]
> > >> \stopformula
> > >>
> > >> \startplaceformula
> > >>   \startformula
> > >> \startalign
> > >>   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR%[eq:bar-a]
> > >>   \NC  n^2+12 \NC=□^\prime.  \NR[eq:bar-b]
> > >> \stopalign
> > >>   \stopformula
> > >> \stopplaceformula
> > >>
> > >> \stoptext
> > >>
> > >> /Mikael
> > >>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: widows and orphans in \definestartstop?

2024-10-09 Thread Wolfgang Schuster

Florian Grammel schrieb am 09.10.2024 um 13:48:

I have defined a simple environment for verse within prose-context. Obviously I 
never want the first or last lines of the verses to stand as widows or orphans. 
I could just add \nobreak to every first and last line of verse to achieve 
this. But I was wondering whether I could change anything of my 
\definestartstop to do this automatically. Simply adding \nobreak to before= 
and after= doesn't work.


1. You example is missing \stopdocument at he end.

2. You can use \dorecurse to place the placeholder text.

3. Use \noindentation to prevent paragraph indentation after an 
environment, \setupindenting is wrong here because it changes the 
indentation settings for the whole document.


4. Add "keeptogether=paragraph" to your lines settings.

 begin example
\definenarrower
  [VerseIndent]
  [default={left,right},
   before=\blank,
   after=\blank\noindentation]

\definelines
  [origverse]
  [before=\startVerseIndent,
   after=\stopVerseIndent,
   keeptogether=paragraph]

\startdocument

\dorecurse{34}{prose\par}

\startorigverse
vvv
vvv
vv

vvv

v
\stoporigverse

\dorecurse{38}{prose\par}

\startorigverse
vvv
vvv
vv

vvv

v
\stoporigverse

prose

\stopdocument
 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: Lua <-> TeXShop

2024-10-09 Thread Hans Hagen

On 10/9/2024 5:29 PM, Thomas Meyer wrote:

Hello Hans and Otared,

thank you for your answers.
Context can run Lua. The output then ends up somewhere in the console 
output between the other specifications.
LuaLaTeX can execute Lua. The output is then the only one in the 
console. Console output was not what I wanted.
However, I was naive enough to hope that the output would be in TeXShop, 
but that only works with pdf I think.

So I am still a little helpless.


Well, context

context foo.lua

is asking for tex run, not a lua run; what do you expect from

foo.lua :

context.starttext()
context("Hi there")
context.stoptext()

other than a tex document showing that text. How is luatex to know if 
you want to typeset or just run tex? So don't take latex as reference. 
You don't want to start the whole tex machinery to run a lua file, 
running in luaonly mode is what one needs then.


When you have foo.lua :

print("Hi there")

and want it in the console you run:

mtxun --script

and here i get this in the console when i hit the "compile" key

>mtxrun --script "oeps.lua"
Hi There

So you need to figure out in texshop how to relate a run command "mtxrun 
--script" to a file with suffix ".lua".


This approach hasn't changes in the about 20 years that we have luatex. 
You can ask Dick to add an option like that (specify runner for a lua 
file) it it's not already there.


Hans

ps. Of course we can add support for a first line parsing when context 
sees a .lua file


-- mtxrun --script %filename%

or just

-- runner=mtxrun

for editors that lack support for suffix specific runners, but let's 
first see what texshop can do already.


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: Downsampling images (again)

2024-10-09 Thread Henning Hraban Ramm

Am 22.09.24 um 09:06 schrieb Peter Münster:

On Sat, Sep 21 2024, Henning Hraban Ramm wrote:


How can a converter function access …
– the final (scaled) size of a placed image


Hi,

I use "figures.current().request" in my module (here attached).



– the original pixel size of an image ?


I use img.scan() for that.


Hi Peter,
sorry, I forgot to answer.
I was using your code for years, and AFAIR it also doesn’t use the final 
scaled size. But I must check again – too much going on ATM…

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: Lua <-> TeXShop

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

On 10/9/2024 6:11 PM, Bruce Horrocks wrote:




On 9 Oct 2024, at 16:29, Thomas Meyer  wrote:

Hello Hans and Otared,

thank you for your answers.
Context can run Lua. The output then ends up somewhere in the console output 
between the other specifications.
LuaLaTeX can execute Lua. The output is then the only one in the console. 
Console output was not what I wanted.
However, I was naive enough to hope that the output would be in TeXShop, but 
that only works with pdf I think.
So I am still a little helpless.


If the output went into TeXShop then it would overwrite your Lua program.

If you mean have the output go to a file and have TeXShop open that file then 
maybe just configure TeXShop with an “engine” that runs Lua and sends the 
output to a .out or .txt file. If you then open the file in a separate TeXShop 
window, maybe it picks up changes as they happen and displays them? (I haven’t 
checked for TeXShop but many programming editors can.)

I don’t think ConTeXt can run Lua without the output going to the console along 
with all the initialisation messages. However there is a `lua` command line app 
to run lua porgrams available from www.lua.org which you could install and use 
instead.


If you want the samelua feature sas in context, just

mtxrun --script foo.lua

is the way to go. (To be sure I cheched if i have lua installed at all 
and it's some version from 2000; i always use mtxrun because after all 
luametatex is also a regular lua interpreter)


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: equation to right margin

2024-10-09 Thread Alan Bowen
I understand. The reasoning makes sense to me and, as editor of a paper in
which this appears, I will ask the author to consider dropping the brace.

I wonder of there is some similar thinking underlying the fact that
\startcases... puts the equation number so close to the equation itself and
not at a margin (typically right).

Again, many thanks, Mikael.
Alan

On Wed, Oct 9, 2024 at 12:12 PM Mikael Sundqvist  wrote:

> Hi,
>
> I think what you ask for was never supported in ConTeXt, for a reason.
> The idea is that either one groups a set of equations with a brace and
> numbers them with one number, or one does not group, and then one can
> number each line separately/independently. Grouping on the left with a
> brace and numbering one line to the right is, even if we see that
> often, not really logical.
>
> If there is a large request for doing this, I can talk to Hans about
> it, maybe it is easy on the code side to support it. But I remember
> from when we were messing with numbering, and in particular when there
> are alignments, that it is a bit complicated.
>
> /Mikael
>
> On Wed, Oct 9, 2024 at 5:19 PM Alan Bowen  wrote:
> >
> > Thank you, Mikael. That is very helpful and much appreciated.
> >
> > What I now have is:
> > \startplaceformula
> >   \startformula
> > \startalign
> >   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR[eq:1]
> >   \NC  n^2+12 \NC=□^\prime.  \NR[eq:2]
> > \stopalign
> >   \stopformula
> > \stopplaceformula
> > which put the numbers at the right margin,as I wanted.
> >
> > So how do I get a brace on the left rather than on the right?  Or is
> there documentation that explains this?
> >
> > Alan
> >
> > On Wed, Oct 9, 2024 at 10:22 AM Mikael Sundqvist 
> wrote:
> >>
> >> Hi,
> >>
> >> On Mon, Oct 7, 2024 at 11:45 PM Alan Bowen 
> wrote:
> >> >
> >> > I have the following which works, except for the fact that the
> equation number does not go to the right margin.
> >> >
> >> > \startplaceformula
> >> > \startformula[align=middle, prefix=no]
> >> > \startcases[distance=2pt]
> >> > \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> >> > \NC\hfill n^2+12 \NC=□^\prime.\NR[eq04]
> >> > \stopcases
> >> > \stopformula
> >> > \stopplaceformula
> >> >
> >> > I expect that I have missed something pretty basic here, so any
> guidance will be greatly appreciated.
> >>
> >> Maybe I misunderstand you, but I do not think cases is right here.
> >> Also, are you sure you want to group two equations but only number one
> >> of them.
> >>
> >> If I understand you correctly, I'd try with one of these, depending on
> >> if citing the group or one of the equations.
> >>
> >> \starttext
> >>
> >> \startformula
> >>   \startalign[location=packed,fences=sesac]
> >> \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> >> \NC  n^2+12 \NC=□^\prime.\NR
> >>   \stopalign
> >>   \numberhere[eq:foo]
> >> \stopformula
> >>
> >> \startplaceformula
> >>   \startformula
> >> \startalign
> >>   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR%[eq:bar-a]
> >>   \NC  n^2+12 \NC=□^\prime.  \NR[eq:bar-b]
> >> \stopalign
> >>   \stopformula
> >> \stopplaceformula
> >>
> >> \stoptext
> >>
> >> /Mikael
> >>
> ___
> >> If your question is of interest to others as well, please add an entry
> to the Wiki!
> >>
> >> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> >> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net
> (mirror)
> >> archive  : https://github.com/contextgarden/context
> >> wiki : https://wiki.contextgarden.net
> >>
> ___
> >
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> > webpage  : https://www.pragma-ade.nl / https://context.aanhet.net
> (mirror)
> > archive  : https://github.com/contextgarden/context
> > wiki : https://wiki.contextgarden.net
> >
> ___
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : 

[NTG-context] Re: Lua <-> TeXShop

2024-10-09 Thread Bruce Horrocks


> On 9 Oct 2024, at 16:29, Thomas Meyer  wrote:
> 
> Hello Hans and Otared,
> 
> thank you for your answers.
> Context can run Lua. The output then ends up somewhere in the console output 
> between the other specifications.
> LuaLaTeX can execute Lua. The output is then the only one in the console. 
> Console output was not what I wanted.
> However, I was naive enough to hope that the output would be in TeXShop, but 
> that only works with pdf I think.
> So I am still a little helpless.

If the output went into TeXShop then it would overwrite your Lua program.

If you mean have the output go to a file and have TeXShop open that file then 
maybe just configure TeXShop with an “engine” that runs Lua and sends the 
output to a .out or .txt file. If you then open the file in a separate TeXShop 
window, maybe it picks up changes as they happen and displays them? (I haven’t 
checked for TeXShop but many programming editors can.)

I don’t think ConTeXt can run Lua without the output going to the console along 
with all the initialisation messages. However there is a `lua` command line app 
to run lua porgrams available from www.lua.org which you could install and use 
instead.

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: equation to right margin

2024-10-09 Thread Mikael Sundqvist
Hi,

I think what you ask for was never supported in ConTeXt, for a reason.
The idea is that either one groups a set of equations with a brace and
numbers them with one number, or one does not group, and then one can
number each line separately/independently. Grouping on the left with a
brace and numbering one line to the right is, even if we see that
often, not really logical.

If there is a large request for doing this, I can talk to Hans about
it, maybe it is easy on the code side to support it. But I remember
from when we were messing with numbering, and in particular when there
are alignments, that it is a bit complicated.

/Mikael

On Wed, Oct 9, 2024 at 5:19 PM Alan Bowen  wrote:
>
> Thank you, Mikael. That is very helpful and much appreciated.
>
> What I now have is:
> \startplaceformula
>   \startformula
> \startalign
>   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR[eq:1]
>   \NC  n^2+12 \NC=□^\prime.  \NR[eq:2]
> \stopalign
>   \stopformula
> \stopplaceformula
> which put the numbers at the right margin,as I wanted.
>
> So how do I get a brace on the left rather than on the right?  Or is there 
> documentation that explains this?
>
> Alan
>
> On Wed, Oct 9, 2024 at 10:22 AM Mikael Sundqvist  wrote:
>>
>> Hi,
>>
>> On Mon, Oct 7, 2024 at 11:45 PM Alan Bowen  wrote:
>> >
>> > I have the following which works, except for the fact that the equation 
>> > number does not go to the right margin.
>> >
>> > \startplaceformula
>> > \startformula[align=middle, prefix=no]
>> > \startcases[distance=2pt]
>> > \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
>> > \NC\hfill n^2+12 \NC=□^\prime.\NR[eq04]
>> > \stopcases
>> > \stopformula
>> > \stopplaceformula
>> >
>> > I expect that I have missed something pretty basic here, so any guidance 
>> > will be greatly appreciated.
>>
>> Maybe I misunderstand you, but I do not think cases is right here.
>> Also, are you sure you want to group two equations but only number one
>> of them.
>>
>> If I understand you correctly, I'd try with one of these, depending on
>> if citing the group or one of the equations.
>>
>> \starttext
>>
>> \startformula
>>   \startalign[location=packed,fences=sesac]
>> \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
>> \NC  n^2+12 \NC=□^\prime.\NR
>>   \stopalign
>>   \numberhere[eq:foo]
>> \stopformula
>>
>> \startplaceformula
>>   \startformula
>> \startalign
>>   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR%[eq:bar-a]
>>   \NC  n^2+12 \NC=□^\prime.  \NR[eq:bar-b]
>> \stopalign
>>   \stopformula
>> \stopplaceformula
>>
>> \stoptext
>>
>> /Mikael
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl / 
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
>> archive  : https://github.com/contextgarden/context
>> wiki : https://wiki.contextgarden.net
>> ___
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Lua <-> TeXShop

2024-10-09 Thread Thomas Meyer

Hello Hans and Otared,

thank you for your answers.
Context can run Lua. The output then ends up somewhere in the console 
output between the other specifications.
LuaLaTeX can execute Lua. The output is then the only one in the 
console. Console output was not what I wanted.
However, I was naive enough to hope that the output would be in TeXShop, 
but that only works with pdf I think.

So I am still a little helpless.

Greetings
Thomas


Am 08.10.24 um 19:12 schrieb Otared Kavian:

Hi,

I use TeXShop and it is possible to save a file with a .lua suffix 
(under « Save as… » you choose the menu File format where it is called 
Lua script).

Then I use ConTeXt to run the lua file…
Another possibility is to put your lua file between \startluacode … 
\stopluacode in a TeX file and then you typeset the TeX file in 
TeXShop with ConTeXt.


But probably this is not what you want to do.

Best regards: Otared


On 8 Oct 2024, at 12:35, Thomas Meyer  wrote:

Hello,

at the risk of this being the wrong address: can I edit and run Lua 
with TeXShop?

Does anyone have experience with this?
Or what could be used as an IDE for Lua?

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


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

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


Otared Kavian
e-mail: ota...@gmail.com 
Phone: +33 6 88 26 70 95





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

maillist :ntg-context@ntg.nl 
/https://mailman.ntg.nl/mailman3/lists/ntg-context.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: equation to right margin

2024-10-09 Thread Alan Bowen
Thank you, Mikael. That is very helpful and much appreciated.

What I now have is:
\startplaceformula
  \startformula
\startalign
  \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR[eq:1]
  \NC  n^2+12 \NC=□^\prime.  \NR[eq:2]
\stopalign
  \stopformula
\stopplaceformula
which put the numbers at the right margin,as I wanted.

So how do I get a brace on the left rather than on the right?  Or is there
documentation that explains this?

Alan

On Wed, Oct 9, 2024 at 10:22 AM Mikael Sundqvist  wrote:

> Hi,
>
> On Mon, Oct 7, 2024 at 11:45 PM Alan Bowen  wrote:
> >
> > I have the following which works, except for the fact that the equation
> number does not go to the right margin.
> >
> > \startplaceformula
> > \startformula[align=middle, prefix=no]
> > \startcases[distance=2pt]
> > \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> > \NC\hfill n^2+12 \NC=□^\prime.\NR[eq04]
> > \stopcases
> > \stopformula
> > \stopplaceformula
> >
> > I expect that I have missed something pretty basic here, so any guidance
> will be greatly appreciated.
>
> Maybe I misunderstand you, but I do not think cases is right here.
> Also, are you sure you want to group two equations but only number one
> of them.
>
> If I understand you correctly, I'd try with one of these, depending on
> if citing the group or one of the equations.
>
> \starttext
>
> \startformula
>   \startalign[location=packed,fences=sesac]
> \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> \NC  n^2+12 \NC=□^\prime.\NR
>   \stopalign
>   \numberhere[eq:foo]
> \stopformula
>
> \startplaceformula
>   \startformula
> \startalign
>   \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR%[eq:bar-a]
>   \NC  n^2+12 \NC=□^\prime.  \NR[eq:bar-b]
> \stopalign
>   \stopformula
> \stopplaceformula
>
> \stoptext
>
> /Mikael
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: widows and orphans in \definestartstop?

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

On 10/9/2024 1:48 PM, Florian Grammel wrote:

I have defined a simple environment for verse within prose-context. Obviously I 
never want the first or last lines of the verses to stand as widows or orphans. 
I could just add \nobreak to every first and last line of verse to achieve 
this. But I was wondering whether I could change anything of my 
\definestartstop to do this automatically. Simply adding \nobreak to before= 
and after= doesn't work.


\widowpenalty1
\clubpenalty 1

The next upload actually has \setupalign[lesswidows,lessclubs] and such 
as part of more (also local) control over the par builder.


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: fixing kerning and substitutions

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

On 10/9/2024 12:22 PM, Florian Grammel wrote:

I am trying to reuse code of a project from 2017 with TL23 context. (Other 
questions probably coming up...)

Back then I used font handlers to fix some smaller problems in the font, i.e. a 
wrongly placed small capital and missing kerning for the small caps.

The following code works with context 2017.04.27 01:00 MKIV beta but has 
stopped having any effect using recent context (2023.05.05 18:36 LMTX).
There are no error messages.

Has the syntax changed? Or is the functionality dropped completely?

I was also wondering why it has never been working to adjust the kerning for the regular letters, 
e.g. "A" and "V" in the example, neither in 2017 nor today.

Thanks a lot in advance!
Florian.








\definefontfamily [mainface] [serif] [Palatino Linotype] [oldstyle]

\setupbodyfont [mainface]



%\feature[+][oldstyle]
%\feature[+][kernup]



%works with Context beta from 2017, doesn't work with TL 2023
\directlua{
fonts.handlers.otf.addfeature
{
 name = "smcp",
 type = "alternate",
 data =
{
 ['eth'] = 'Eth.ordn' ,
%['k.smcp'] = 'Ķ' ,
 },
}
}

%works for the smcp with Context beta from 2017, doesn't work for the regular 
capital letters
%doesn't work at all with Context TL 2023
\directlua
{
  fonts.handlers.otf.addfeature
   {
 name = "kern",
 type = "kern",
 data =
 {
 ["A"] = { ["V"] =  1500 },
 ["P"] = { ["Æ"] =  1500 },
 ["a.smcp"] = { ["s.smcp"] =  1500 },
  },
   }
  }
  




\startdocument


AVAPÆV

þýðask

{\sc þýðask}

123


Nothing has changed (in fact, the font handler hasn't been touched that 
much at all, apart from some fixes for border cases that you're unlikely 
to run into).


There are several issues with your approach, one being that you add a 
feature *after* defining the font, so it is not applied. You also use 
names and that fonts doesn't have names like that.


Something like this can work:


\startluacode
local getsubstitution = fonts.handlers.otf.getsubstitution

fonts.handlers.otf.addfeature {
name = "smcp",
type = "alternate",
data = {
["ð"] = char_e,
},
data = function(data,specification,list,i)
-- maybe intercept this cheat in a next version
data = { shared = { rawdata = { resources = data.resources } } }
--
local char_e = 
getsubstitution(data,utf.byte("ð"),"ordn",1,"latn","dflt")

return {
["ð"] = char_e,
}
end,
}

fonts.handlers.otf.addfeature {
name = "kern",
type = "kern",
data = function(data,specification,list,i)
-- maybe intercept this cheat in a next version
data = { shared = { rawdata = { resources = data.resources } } }
--
local char_a = 
getsubstitution(data,utf.byte("a"),"smcp",1,"latn","dflt")
local char_s = 
getsubstitution(data,utf.byte("s"),"smcp",1,"latn","dflt")

return {
["A"]= { ["V"]= 1500 },
["P"]= { ["Æ"]= 1500 },
[char_a] = { [char_s] = 1500 },
}
end,
}
\stopluacode

\definefontfamily [mainface] [serif]  [Palatino Linotype]
\definefontfamily [mainface] [math]   [TeX Gyre Pagella]

\setupbodyfont [mainface]

\starttext
AVAPÆV
þýðask
{\smallcaps þýðask}
123
\stoptext

But it is a kind of ugly solution, mostly demonstrating that the nature 
of tex is that one can always find a solution for any weird problem.


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: equation to right margin

2024-10-09 Thread Mikael Sundqvist
Hi,

On Mon, Oct 7, 2024 at 11:45 PM Alan Bowen  wrote:
>
> I have the following which works, except for the fact that the equation 
> number does not go to the right margin.
>
> \startplaceformula
> \startformula[align=middle, prefix=no]
> \startcases[distance=2pt]
> \NC \[21-(9 - n^2)\NC =□^\prime\]\NR
> \NC\hfill n^2+12 \NC=□^\prime.\NR[eq04]
> \stopcases
> \stopformula
> \stopplaceformula
>
> I expect that I have missed something pretty basic here, so any guidance will 
> be greatly appreciated.

Maybe I misunderstand you, but I do not think cases is right here.
Also, are you sure you want to group two equations but only number one
of them.

If I understand you correctly, I'd try with one of these, depending on
if citing the group or one of the equations.

\starttext

\startformula
  \startalign[location=packed,fences=sesac]
\NC \[21-(9 - n^2)\NC =□^\prime\]\NR
\NC  n^2+12 \NC=□^\prime.\NR
  \stopalign
  \numberhere[eq:foo]
\stopformula

\startplaceformula
  \startformula
\startalign
  \NC \[21-(9 - n^2)\NC =□^\prime\]  \NR%[eq:bar-a]
  \NC  n^2+12 \NC=□^\prime.  \NR[eq:bar-b]
\stopalign
  \stopformula
\stopplaceformula

\stoptext

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

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


[NTG-context] Re: regular online meet-up

2024-10-09 Thread Henning Hraban Ramm

Reminder: This is tonight!

Am 05.10.24 um 19:29 schrieb Henning Hraban Ramm:

You’re invited to our regular online meet-up, this upcoming
Wednesday, October 9, 19:00 CEST (UTC+2)

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

ConTeXt users of all levels are welcome!

Looking forward to seeing you,
Hraban


(Same blurb as always:)

[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the URL above, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the 
audio.
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button.
Beware there is only one presenter at a time, so don’t kill someone 
else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).
* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* Sometimes leaving and re-entering helps.
* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.
* BigBlueButton documentation applies: https://bigbluebutton.org/ 
teachers/tutorials/


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...
___
If your question is of interest to others as well, please add an entry 
to the Wiki!


maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ 
ntg-context.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: Adding a line after the TOC

2024-10-08 Thread Wolfgang Schuster

Duncan Hothersall schrieb am 08.10.2024 um 22:22:
Sorry for not being clearer Julian, I was meaning could you just do 
something like this?


\starttochead[title={Contents}]
\setupheader[state=stop]
\placecombinedlist[content]
\blank[2*big]
Note: All translations throughout the book are my own.
\stoptochead

Obviously you might need to apply styling to that line if you need it to 
match whatever you have set up for the combinedlist, but it wasn't clear 
to me why you needed the text to be *in* the TOC.


This seems to be the best solution.

Below is a different method how a custom header can be used to create 
additional toc entries on the chapter level.


 begin example
\definehead
  [chapternote]
  [chapter]
  [page=no,
   number=no,
   placehead=no]

\setuplist
  [chapternote]
  [margin=2em,
   pagenumber=no]

\startdocument

\completecontent[list={chapter,chapternote}]

\dorecurse{10}{\chapter{Chapter \convertnumber{word}{#1}}}

\chapternote{All translations are by the author!}

\stopdocument
 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: Adding a line after the TOC

2024-10-08 Thread jbf
Well, you couldn't be more clearer than that! So I should have applied 
Occam's Razor all along... the law of parsimony, or put otherwise, the 
simplest solution is the best! I hadn't realised I could simply add to 
the TOC that way. Always assumed it was to do with the heads, and those 
alone.


Thank you,

Julian

On 9/10/24 07:22, Duncan Hothersall wrote:

\blank[2*big]
Note: All translations throughout the book are my own.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Adding a line after the TOC

2024-10-08 Thread Duncan Hothersall
Sorry for not being clearer Julian, I was meaning could you just do
something like this?

\starttochead[title={Contents}]
\setupheader[state=stop]
\placecombinedlist[content]
\blank[2*big]
Note: All translations throughout the book are my own.
\stoptochead

Obviously you might need to apply styling to that line if you need it to
match whatever you have set up for the combinedlist, but it wasn't clear
to me why you needed the text to be *in* the TOC.

Cheers,

Duncan

On Tue, 8 Oct 2024 at 21:10, jbf  wrote:

> What I have just tried might be rather ugly and unorthodox, but it
> achieves what I want. As you can see from below, after the final chapter I
> simply created a 'subject' without giving it a title as such. I realised I
> needed the [location=here] to place it below the last item in the TOC.
>
> So I have what I want, in the end, but am I missing something that is
> obvious to others but not to me when you say 'Is there something stopping
> you just outputting the line of text after the TOC?' Since the TOC is
> created automatically from heads like chapter, section etc., I don't know
> (other than the solution I came up with below) how to 'just output a line
> of text after the TOC'. I suppose I was imagining a \writeafterlist command
> or something like that🙂
>
> Thanks for you help Duncan, since at least it made me look to the end of
> the document rather than the beginning of it, as I had been doing.
>
> Julian .
>
> \stopchapter
>
> \startsubject[title={}]
>
> \writebetweenlist[section][location=here]{\blank[2*big] Note: All
> translations throughout the book are my own.}
>
> \stopsubject
>
> \stopbodymatter
>
> \stopdocument
>
> On 8/10/24 21:07, Duncan Hothersall wrote:
>
> You need to write to a list at the end of your document if you want
> what you are writing to appear at the end of the list.
>
> Is there something stopping you just outputting the line of text after the
> TOC? Do you need it to appear as if it was part of the TOC?
>
> Duncan
>
> On Tue, 8 Oct 2024 at 10:25, jbf  wrote:
>
>> I am struggling with something that might be simple enough, but...
>>
>> The author is insisting that on the TOC page, after all the chapters and
>> their page numbers, I need to add the line (obviously without any page
>> number associated with it): 'All translations are by the author'.
>>
>> I have trie various combinations of \writetolist and \writebetweenlist,
>> and I can get his comment at the beginning of the TOC, but I cannot get it
>> at the end, and perhaps with some vertical space separation from the main
>> list. How can I place it at the end?
>>
>> Here is my simple MWE where at least I can get it at the beginning:
>>
>> \starttochead[title={Contents}]
>>
>> \setcounter [userpage] [7]
>>
>> \setupheader[state=stop]
>>
>> \placecombinedlist[content]
>>
>> \writebetweenlist[chapter]{All translations are by the author!}
>>
>> \stoptochead
>>
>> Julian
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net
>> (mirror)
>> archive  : https://github.com/contextgarden/context
>> wiki : https://wiki.contextgarden.net
>>
>> ___
>>
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Adding a line after the TOC

2024-10-08 Thread jbf
What I have just tried might be rather ugly and unorthodox, but it 
achieves what I want. As you can see from below, after the final chapter 
I simply created a 'subject' without giving it a title as such. I 
realised I needed the [location=here] to place it below the last item in 
the TOC.


So I have what I want, in the end, but am I missing something that is 
obvious to others but not to me when you say 'Is there something 
stopping you just outputting the line of text after the TOC?' Since the 
TOC is created automatically from heads like chapter, section etc., I 
don't know (other than the solution I came up with below) how to 'just 
output a line of text after the TOC'. I suppose I was imagining a 
\writeafterlist command or something like that🙂


Thanks for you help Duncan, since at least it made me look to the end of 
the document rather than the beginning of it, as I had been doing.


Julian .

\stopchapter

\startsubject[title={}]

\writebetweenlist[section][location=here]{\blank[2*big] Note: All 
translations throughout the book are my own.}


\stopsubject

\stopbodymatter

\stopdocument

On 8/10/24 21:07, Duncan Hothersall wrote:
You need to write to a list at the end of your document if you want 
what you are writing to appear at the end of the list.


Is there something stopping you just outputting the line of text after 
the TOC? Do you need it to appear as if it was part of the TOC?


Duncan

On Tue, 8 Oct 2024 at 10:25, jbf  wrote:

I am struggling with something that might be simple enough, but...

The author is insisting that on the TOC page, after all the
chapters and their page numbers, I need to add the line (obviously
without any page number associated with it): 'All translations are
by the author'.

I have trie various combinations of \writetolist and
\writebetweenlist, and I can get his comment at the beginning of
the TOC, but I cannot get it at the end, and perhaps with some
vertical space separation from the main list. How can I place it
at the end?

Here is my simple MWE where at least I can get it at the beginning:

\starttochead[title={Contents}]

\setcounter [userpage] [7]

\setupheader[state=stop]

\placecombinedlist[content]

\writebetweenlist[chapter]{All translations are by the author!}

\stoptochead

Julian


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

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

___


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

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

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


[NTG-context] Re: configuring spitter

2024-10-08 Thread Wolfgang Schuster

juh+ntg-cont...@mailbox.org schrieb am 08.10.2024 um 20:10:

Am 08.10.24 um 19:16 schrieb Wolfgang Schuster:

You can change the separator when you create a custom splitter.

local csvsplitter = utilities.parsers.rfc4180splitter{ separator = ";" }


Thanks a lot.

Just curious. I often wonder in pure ConTeXt when to use curly bracets 
and when square brackets


In this lua code I would think we would need simple rounded ones.

Like in your first example where you call the splitter without options:

local csvsplitter = utilities.parsers.rfc4180splitter()

I am sure that this is some lua convention, but, nevertheless, it 
puzzles me.



It's explained in the Lua manual:

 begin quotation
Lua 5.4 Reference manual

[...]

3.4.10 -- Function calls

[...]
A call of the form f{fields} is syntactic sugar for f({fields}); that 
is, the argument list is a single new table.

[...]
 end quotation

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: configuring spitter

2024-10-08 Thread juh+ntg-context--- via ntg-context

Am 08.10.24 um 19:16 schrieb Wolfgang Schuster:

You can change the separator when you create a custom splitter.

local csvsplitter = utilities.parsers.rfc4180splitter{ separator = ";" }


Thanks a lot.

Just curious. I often wonder in pure ConTeXt when to use curly bracets 
and when square brackets


In this lua code I would think we would need simple rounded ones.

Like in your first example where you call the splitter without options:

local csvsplitter = utilities.parsers.rfc4180splitter()

I am sure that this is some lua convention, but, nevertheless, it 
puzzles me.


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

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


[NTG-context] Re: configuring spitter

2024-10-08 Thread Wolfgang Schuster

juh+ntg-cont...@mailbox.org schrieb am 08.10.2024 um 18:13:

Am 03.10.24 um 14:15 schrieb Wolfgang Schuster:


 begin example
\setuplayout[tight]

\setuppapersize[A8,landscape]

\starttext

\startbuffer[cattle]
"Year","Cattle, total","Dairy cows"
"2009","3968","1489"
"2010","3975","1479"
"2011","3885","1470"
"2012","3879","1484"
"2013","4000","1553"
"2014","4068","1572"
"2015","4134","1622"
"2016","4251","1745"
"2017","4096","1694"
\stopbuffer

% \savebuffer [list=cattle,prefix=no,file=cattle.csv]

\startluacode

local csvsplitter = utilities.parsers.rfc4180splitter()

local tablecontent, tableheader = 
csvsplitter(buffers.getcontent("cattle"),true)
-- local tablecontent, tableheader = 
csvsplitter(io.loaddata("cattle.csv"),true)


context.bTABLE{ split = "repeat" }
   context.bTABLEhead()
 context.bTR()
   for _, tablecell in next, tableheader do
 context.bTH()
 context(tablecell)
 context.eTH()
   end
 context.eTR()
   context.eTABLEhead()
   context.bTABLEbody()
 for _, tablerow in next, tablecontent do
   context.bTR()
 for _, tablecell in next, tablerow do
   context.bTD()
   context(tablecell)
   context.eTD()
 end
   context.eTR()
 end
   context.eTABLEbody()
context.eTABLE()

\stopluacode

\stoptext
 end example


This works perfectly with commas and doublequotes. Is it possible to 
configure the splitter so that it works with semicolons as column 
separator and no char as data separator?


I don't know what you mean with data separator but the quote marks are 
optional and only needed when the column entry contains the column 
separator itself. In my example all double quotes except the one for 
"Cattle, total" are redundant and can be removed.



Something like:

foo;bar;baz
second foo; second bar; second baz



You can change the separator when you create a custom splitter.

local csvsplitter = utilities.parsers.rfc4180splitter{ separator = ";" }

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: Lua <-> TeXShop

2024-10-08 Thread Otared Kavian
Hi,

I use TeXShop and it is possible to save a file with a .lua suffix (under « 
Save as… » you choose the menu File format where it is called Lua script).
Then I use ConTeXt to run the lua file… 
Another possibility is to put your lua file between \startluacode … 
\stopluacode in a TeX file and then you typeset the TeX file in TeXShop with 
ConTeXt.

But probably this is not what you want to do.

Best regards: Otared

> On 8 Oct 2024, at 12:35, Thomas Meyer  wrote:
> 
> Hello,
> 
> at the risk of this being the wrong address: can I edit and run Lua with 
> TeXShop? 
> Does anyone have experience with this? 
> Or what could be used as an IDE for Lua? 
> 
> Greetings
> Thomas
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95




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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: configuring spitter

2024-10-08 Thread Henning Hraban Ramm

Am 08.10.24 um 18:13 schrieb juh+ntg-context--- via ntg-context:
This works perfectly with commas and doublequotes. Is it possible to 
configure the splitter so that it works with semicolons as column 
separator and no char as data separator?


Something like:

foo;bar;baz
second foo; second bar; second baz


Use the source, juh!

In
https://source.contextgarden.net/tex/context/base/mkiv/util-prs.lua?search=rfc4180splitter#l580
you can find that rfc4180splitter takes a "specification" parameter that 
looks like { separator = ",", quote = '"' }.


I didn’t check if it works without quote character.

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: Lua <-> TeXShop

2024-10-08 Thread Hans Hagen

On 10/8/2024 12:35 PM, Thomas Meyer wrote:

Hello,

at the risk of this being the wrong address: can I edit and run Lua with 
TeXShop?

Does anyone have experience with this?
Or what could be used as an IDE for Lua?


depends ... if you can associate a lua suffix:

mtxrun --script 

will run lua with all relevant context libs preloaded.

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: Adding a line after the TOC

2024-10-08 Thread Duncan Hothersall
You need to write to a list at the end of your document if you want
what you are writing to appear at the end of the list.

Is there something stopping you just outputting the line of text after the
TOC? Do you need it to appear as if it was part of the TOC?

Duncan

On Tue, 8 Oct 2024 at 10:25, jbf  wrote:

> I am struggling with something that might be simple enough, but...
>
> The author is insisting that on the TOC page, after all the chapters and
> their page numbers, I need to add the line (obviously without any page
> number associated with it): 'All translations are by the author'.
>
> I have trie various combinations of \writetolist and \writebetweenlist,
> and I can get his comment at the beginning of the TOC, but I cannot get it
> at the end, and perhaps with some vertical space separation from the main
> list. How can I place it at the end?
>
> Here is my simple MWE where at least I can get it at the beginning:
>
> \starttochead[title={Contents}]
>
> \setcounter [userpage] [7]
>
> \setupheader[state=stop]
>
> \placecombinedlist[content]
>
> \writebetweenlist[chapter]{All translations are by the author!}
>
> \stoptochead
>
> Julian
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Deactivate (back)links of the bibliography

2024-10-07 Thread Bruce Horrocks
On 6 Oct 2024, at 16:38, Gerion Entrup  wrote:
> 
> Thank you, but it disables the interaction at all. I would like to have the 
> citation linked to its bibliography entry but not the other way around.

Hi Gerion,

You can make a change to your local version of Context to deactivate the back 
linking.

1) Goto the home directory where Context is installed (the one with 
“install.sh" in it)

2) Edit the file tex/texmf-context/tex/context/base/mkiv/publ-ini.lua

3) Goto line 2313 which should read:

 local interactive = not rendering.collected

4) Immediately after it, add the line:

 interactive = false

5) Close and save the file

6) Re-make Context using the command

 context —-make

Now generate your document again: the back linking should be disabled but the 
forward links should still work.

Caveats:
- only tested on your MWE - a longer document may reveal problems with this hack
- remember that if you install a Context update then you will lose the change 
and will need to do it again.

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: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-07 Thread Wolfgang Schuster

Jorge Manuel schrieb am 06.10.2024 um 17:44:

Dear ConTeXt Support Team,

I hope this message finds you well.
In the latest version of ConTeXt, the following piece of code no longer 
works as expected. I use it to define a custom legal numbering format 
for itemized lists:


\def\legalconversion#1{
  \dorecurse{\numexpr\currentitemlevel-1}{%
  \namedstructurecounter{itemgroup}{\currentparentitemgroup}{\recurselevel}.}%
  #1%
}

\defineconversion[legal][\legalconversion]

Could you kindly advise on how to modify or fix this code to be 
compatible with the current version of ConTeXt?



Do you want this kind of numbering for itemize?

\starttext

\startitemize[n,repeat][stopper=,width=\widthofstring{0},distance=.5em]
  \item 1
  \startitemize[n,repeat][stopper=,width=\widthofstring{0.0},distance=.5em]
\item 1.1
\startitemize[n][stopper=,width=\widthofstring{0.0.0},distance=.5em]
  \item 1.1.1
\stopitemize
  \stopitemize
\stopitemize

\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: Issue with Custom Conversion Code in Latest Version of ConTeXt

2024-10-07 Thread Wolfgang Schuster

Jorge Manuel schrieb am 06.10.2024 um 17:44:

Dear ConTeXt Support Team,

I hope this message finds you well.
In the latest version of ConTeXt, the following piece of code no 
longer works as expected. I use it to define a custom legal numbering 
format for itemized lists:


\def\legalconversion#1{
 \dorecurse{\numexpr\currentitemlevel-1}{%
 \namedstructurecounter{itemgroup}{\currentparentitemgroup}{\recurselevel}.}%
 #1%
}

\defineconversion[legal][\legalconversion]

Could you kindly advise on how to modify or fix this code to be 
compatible with the current version of ConTeXt?

Thank you very much for your assistance and support


Can you show a complete (non) working 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) (Beginner) how do i set up vertical CJK?

2024-10-07 Thread Henning Hraban Ramm

Am 07.10.24 um 21:12 schrieb Felix:

Where does one find this "followingup-directions.tex"? The only thing I am 
aware of existing is the ConTeXt wiki. It is very hard to navigate through this 
language's resources for me, perhaps that is due to this being the 'first' language I am 
truly trying to learn without the help of AI like I did with LaTeX. searching for 
followingup-directions.tex in context wiki shows nothing.


"followingup.pdf" is a manual in the distribution*, "directions" is one 
chapter.
But the code shown is very low level, probably not suitable for 
productive typesetting.


*) in texmf-context/doc/context/documents/general/manuals

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: (ConTeXt LMTX) (Beginner) how do i set up vertical CJK?

2024-10-07 Thread Aditya Mahajan
On Mon, 7 Oct 2024, Felix wrote:

> Where does one find this "followingup-directions.tex"? The only thing I am 
> aware of existing is the ConTeXt wiki. It is very hard to navigate through 
> this language's resources for me, perhaps that is due to this being the 
> 'first' language I am truly trying to learn without the help of AI like I did 
> with LaTeX. searching for followingup-directions.tex in context wiki shows 
> nothing.

See the list of manuals and documentation:
https://www.pragma-ade.nl/overview.htm

The followingup manual is here:
https://www.pragma-ade.nl/general/manuals/followingup.pdf#page=29.07

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: (ConTeXt LMTX) (Beginner) how do i set up vertical CJK?

2024-10-07 Thread Hans Hagen via ntg-context

On 10/7/2024 9:12 PM, Felix wrote:

Where does one find this "followingup-directions.tex"? The only thing I am 
aware of existing is the ConTeXt wiki. It is very hard to navigate through this 
language's resources for me, perhaps that is due to this being the 'first' language I am 
truly trying to learn without the help of AI like I did with LaTeX. searching for 
followingup-directions.tex in context wiki shows nothing.


better trust your own intelligence ...

these documents are in the distribution under the doc tree

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: (ConTeXt LMTX) (Beginner) how do i set up vertical CJK?

2024-10-07 Thread Felix
Where does one find this "followingup-directions.tex"? The only thing I am 
aware of existing is the ConTeXt wiki. It is very hard to navigate through this 
language's resources for me, perhaps that is due to this being the 'first' 
language I am truly trying to learn without the help of AI like I did with 
LaTeX. searching for followingup-directions.tex in context wiki shows nothing.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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) (Beginner) how do i set up vertical CJK?

2024-10-07 Thread Florent Michel
Hi,

Out of curiosity, I tried compiling the followingup manual with ConTeXt
LMTX 2024.09.25. I did not check the whole manual, but section 6 seems to
render fine as far as I can tell, up to two small issues (not sure whether
they are due to changes in ConTeXt or to font issues on my side):

* I had to replace NotoSansCJKtc-VF with the name of the font file
(NotoSansCJK-Regular.ttc) in followingup-directions.tex . (I suspect that
may be due to my system not having the ‘right’ font installed.

* The glyphs are not rotated in Figure 6.12. Figure 6.11 looks correct,
though.

So at least one of the methods mentioned in
followingup-directions.tex seems to work with the latest version of ConTeXt
LMTX.

Cheers,
Florent

Le lun. 7 oct. 2024 à 08:10, Hans Hagen via ntg-context 
a écrit :

> On 10/6/2024 8:40 PM, Felix wrote:
> > https://pastebin.com/Cg8ZPDVK
> >
> > I have the code listed above and I am wondering how I can get CJK text
> to be in a vertical form (along with Vietnamese. I know l2r as an option
> exists in startalignment, but there seems to not be a vertical equivalent
> for vertical text. How do I achieve this?
>
> there is something mentioned in followingup-directions.tex
>
> i removed top to bottom directions from luametatex because it made no
> sense; one cannot do vertical typesettign without also looking at the
> layout and other things
>
> instead of directions we do rotation at the glyph level and such which
> has less interference and more flexible
>
> but ... i haven't looked at it recently (could be broken by other
> features) as there is little demand for it
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.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 LMTX) (Beginner) how do i set up vertical CJK?

2024-10-07 Thread luigi scarso
On Mon, 7 Oct 2024 at 09:10, Hans Hagen via ntg-context 
wrote:

> On 10/6/2024 8:40 PM, Felix wrote:
> > https://pastebin.com/Cg8ZPDVK
> >
> > I have the code listed above and I am wondering how I can get CJK text
> to be in a vertical form (along with Vietnamese. I know l2r as an option
> exists in startalignment, but there seems to not be a vertical equivalent
> for vertical text. How do I achieve this?
>
> there is something mentioned in followingup-directions.tex
>
> i removed top to bottom directions from luametatex because it made no
> sense; one cannot do vertical typesettign without also looking at the
> layout and other things
>
> instead of directions we do rotation at the glyph level and such which
> has less interference and more flexible
>
> but ... i haven't looked at it recently (could be broken by other
> features) as there is little demand for it
>
> Hans
>
>
For japanese, I think that the only reference for luatex (actually
lualatex) is
https://ctan.org/tex-archive/macros/luatex/generic/luatexja

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

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


[NTG-context] Re: (ConTeXt LMTX) (Beginner) how do i set up vertical CJK?

2024-10-07 Thread Hans Hagen via ntg-context

On 10/6/2024 8:40 PM, Felix wrote:

https://pastebin.com/Cg8ZPDVK

I have the code listed above and I am wondering how I can get CJK text to be in 
a vertical form (along with Vietnamese. I know l2r as an option exists in 
startalignment, but there seems to not be a vertical equivalent for vertical 
text. How do I achieve this?


there is something mentioned in followingup-directions.tex

i removed top to bottom directions from luametatex because it made no 
sense; one cannot do vertical typesettign without also looking at the 
layout and other things


instead of directions we do rotation at the glyph level and such which 
has less interference and more flexible


but ... i haven't looked at it recently (could be broken by other 
features) as there is little demand for it


Hans


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Small issue with \breakhere in math mode

2024-10-07 Thread Otared Kavian
Hi Wolfgang,

Indeed I overlooked the fact that in « mathcontext-screen.pdf » it is explained 
that:

\breakhere [...] {…} 
1  left right before after page samepage
2 TEXT

Thanks for your patience with superficial users such as me :-)

Best regards: Otared

> On 7 Oct 2024, at 00:24, Wolfgang Schuster 
>  wrote:
> 
> Otared Kavian schrieb am 06.10.2024 um 23:43:
>> Hi Hans and Mikael,
>> 
>> I found a small issue in math mode with \breakhere.
>> When \breakhere is followed by a brace in the following line, it creates a 
>> spurious break line.
>> It can be fixed easily by the user by adding an empty line or issuing a 
>> \relax command, but I wanted to let you know.
> 
> \breakhere accepts an optional argument which has to be enclosed in braces 
> and in your example you just passed the argument.
> 
> Wolfgang
> 

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

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


[NTG-context] Re: How to improve appearance of bars in frac, sqrt, etc. on screens?

2024-10-06 Thread Alan Braslau via ntg-context
Old mailing list post ...

I do not see any issues whatsoever with any viewer under FreeBSD, btw.

Alan



On Fri, 14 Jun 2024 11:44:34 +0200
Hans Hagen via ntg-context  wrote:

> > So it’s dependend on the screen rendering, anti aliasing settings
> > (that you usually can’t influence).
> 
> hm, so i have to stick to windows for viewing (and an ancient
> hardware laptop in order to avoid copilot and recall) but i'll check
> ubuntu anyway



-- 
Alan Braslau
816 West Mountain Avenue
Fort Collins, CO 80521 USA
mobile: (970) 237-0957

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Draw leftframe to a description

2024-10-06 Thread Aditya Mahajan
On Sun, 6 Oct 2024, Gerion Entrup wrote:

> I got exactly the same problems like with textbackground (see the 
> stackexchange post for screenshots).

I had replied to you on stackexachange, but I think that the mailing list is a 
better place to discuss this, so I am following up here. 

Regarding the footnote, what is happening is that text-background extends to 
the "end of the page". This is from one of my old files where I had encountered 
a similar issue:

%D By default, the textbackground extends till the page boundary. This does
%D not look good if a page break occurs when there is not enough material to
%D fit in the page. So, we want to limit textbackground till the typeset
%D material. This has not been interfaced yet, so I use a low level \TEX\
%D command.

\chardef\kindofpagetextareas\plusone


Adding the same works in your example:

\definetextbackground
  [leftbartext]
  [
location=paragraph,
mp=mpos:region:leftbar,
width=broad,
frame=off,
framecolor=darkgray,
rulethickness=2ex,
leftoffset=5ex,
rightoffset=2.25ex,
topoffset=2.25ex,
bottomoffset=2.25ex,
background=color,
backgroundcolor=lightgray,
  ]


\startuseMPgraphic{mpos:region:leftbar}
  draw_multi_pars;
  draw_multi_side;
\stopuseMPgraphic

\definecolor[lightblue]  [0.95(blue,white)]

\definetextbackground
  [blocktext]
  [leftbartext]
  [
framecolor=darkblue,
backgroundcolor=lightblue,
  ]

\definedescription
  [excursus]
  [
text={Excursus},
alternative=top,
headstyle=bold,
margin=1cm,
width=broad,
before={\startblocktext},
after={\stopblocktext},
  ]

\chardef\kindofpagetextareas\plusone


\starttext

\input ward

\startexcursus[title={A Knuth extract}]

\input knuth

\stopexcursus

\input ward

\startexcursus[title={A much longer Knuth extract}]

\input knuth
Sometimes, sentences have footnotes\footnote{Some footnote}.

\input knuth
\input knuth

\stopexcursus

\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: Deactivate (back)links of the bibliography

2024-10-06 Thread Alan Braslau via ntg-context
On Sun, 06 Oct 2024 17:38:25 +0200
Gerion Entrup  wrote:

> Am Sonntag, 6. Oktober 2024, 13:34:19 MESZ schrieb Pablo Rodriguez
> via ntg-context:
> > On 10/6/24 04:37, Gerion Entrup wrote:
> > > Hi,
> > > > when typesetting bibliographies, ConTeXt seems to link back to
> > > > the
> > > (first?) citation within the text.
> > > A side effect is that the whole reference entry is colored in the
> > > link color.>
> > > Is there a possibility to deactivate the back linking or limit it
> > > to the key?
> > Hi Gerion,
> > 
> > \setupbtx[interaction=stop] disables all interaction.
> > 
> > Other values are: number text page all (according to
> > https://www.pragma-ade.com/general/manuals/mkiv-publications.pdf#page=17).
> 
> Thank you, but it disables the interaction at all. I would like to
> have the citation linked to its bibliography entry but not the other
> way around. I also tested the other values without any visible change.
> 
> Gerion

I use

\setupinteraction
  [state=start,
   color=,
   contrastcolor=,
  ]

for colored links are kind-of pedestrian anyways, a MS/Word-like habit.

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

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


[NTG-context] Re: Small issue with \breakhere in math mode

2024-10-06 Thread Wolfgang Schuster

Otared Kavian schrieb am 06.10.2024 um 23:43:

Hi Hans and Mikael,

I found a small issue in math mode with \breakhere.
When \breakhere is followed by a brace in the following line, it creates a 
spurious break line.
It can be fixed easily by the user by adding an empty line or issuing a \relax 
command, but I wanted to let you know.


\breakhere accepts an optional argument which has to be enclosed in 
braces and in your example you just passed the argument.


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: Issues with vim and lettrine modules

2024-10-06 Thread Henning Hraban Ramm

Am 06.10.24 um 18:49 schrieb Tommaso Gordini:

Hi all,

I'm trying to compile Axel Kielhorn's guide available here:

https://github.com/AKielhorn/Context-Intro 


However, I get compilation errors regarding *vim *and *lettrine*. Both 
modules are loaded in the source files, so I typed in the terminal:


mtxrun --script install-modules --install vim lettrine

but the errors do not disappear.
I ask you if these two modules produce known errors.

In any case, the sources are available at the URL indicated above.
If needed, I'll paste a MWE here in a future message.


vim should work if you have vim and the filter module installed (both by 
Aditya Mahajan).


lettrine is outdated, try the built-in
https://wiki.contextgarden.net/Command/setupinitial
https://wiki.contextgarden.net/Command/placeinitial

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: Issues with vim and lettrine modules

2024-10-06 Thread Tommaso Gordini
Sorry,

I forgot to specify the following:

macOS Sonoma 14.5
context version 2024.09.25 11.53
lmtx version 2.11.05

Ciao
Tommaso

Il giorno dom 6 ott 2024 alle ore 18:49 Tommaso Gordini <
illinguista1...@gmail.com> ha scritto:

> Hi all,
>
> I'm trying to compile Axel Kielhorn's guide available here:
>
> https://github.com/AKielhorn/Context-Intro
>
> However, I get compilation errors regarding *vim *and *lettrine*. Both
> modules are loaded in the source files, so I typed in the terminal:
>
> mtxrun --script install-modules --install vim lettrine
>
> but the errors do not disappear.
> I ask you if these two modules produce known errors.
>
> In any case, the sources are available at the URL indicated above.
> If needed, I'll paste a MWE here in a future message.
>
> Thanks in advance
> Tommaso
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Vertical spacing in table of content

2024-10-06 Thread Gerion Entrup
Thank you, nice, that works like exactly as expected.

Gerion

Am Sonntag, 6. Oktober 2024, 09:18:47 MESZ schrieb Mikael Sundqvist:
> Hi,
> 
> not sure exactly what you want, but does adding \setupinterlinespace
> help you? As in
> 
> \setuplist[section][
> aligntitle=yes,
> style=\tfx\setupinterlinespace,
> ]
> 
> /Mikael
> 
> On Sun, Oct 6, 2024 at 4:27 AM Gerion Entrup  wrote:
> >
> > Hi,
> >
> > for my table of contents, I have set a style that makes sections and 
> > subsections smaller than chapters.
> > However, in the rendering the vertical space seems not to adapt: It remains 
> > equal for all entities.
> >
> > Is there a possibility to reduce the vertical space between subsections and 
> > sections?
> > I tried before and after but only get it to add additional space and not 
> > reducing it.
> >
> > Here is a MWE:
> > ```
> > \setuplist[chapter][
> > style=bold,
> > aligntitle=yes,
> > ]
> >
> > \setuplist[section][
> > aligntitle=yes,
> > style=\tfx,
> > ]
> > \setuplist[subsection][
> > aligntitle=yes,
> > style=\tfxx,
> > after={\blank[none]},
> > before={\blank[none]},
> > ]
> >
> > \starttext
> >
> > \placecontent
> >
> > \hairline
> >
> > \startchapter[title=foo]
> > \startsection[title=foo]
> > \startsubsection[title=foo]
> > \stopsubsection
> > \startsubsection[title=foo]
> > \stopsubsection
> > \startsubsection[title=foo]
> > \stopsubsection
> > \stopsection
> > \startsection[title=foo]
> > \startsubsection[title=foo]
> > \stopsubsection
> > \startsubsection[title=foo]
> > \stopsubsection
> > \stopsection
> > \stopchapter
> > \startchapter[title=foo]
> > \stopchapter
> >
> > \stoptext
> > ```
> >
> > Gerion___
> > If your question is of interest to others as well, please add an entry to 
> > the Wiki!
> >
> > maillist : ntg-context@ntg.nl / 
> > https://mailman.ntg.nl/mailman3/lists/ntg-context.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
> ___
> 



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: Deactivate (back)links of the bibliography

2024-10-06 Thread Gerion Entrup
Am Sonntag, 6. Oktober 2024, 13:34:19 MESZ schrieb Pablo Rodriguez via 
ntg-context:
> On 10/6/24 04:37, Gerion Entrup wrote:
> > Hi,
> > > when typesetting bibliographies, ConTeXt seems to link back to the
> > (first?) citation within the text.
> > A side effect is that the whole reference entry is colored in the
> > link color.>
> > Is there a possibility to deactivate the back linking or limit it to
> > the key?
> Hi Gerion,
> 
> \setupbtx[interaction=stop] disables all interaction.
> 
> Other values are: number text page all (according to
> https://www.pragma-ade.com/general/manuals/mkiv-publications.pdf#page=17).

Thank you, but it disables the interaction at all. I would like to have the 
citation linked to its bibliography entry but not the other way around.
I also tested the other values without any visible change.

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: Deactivate (back)links of the bibliography

2024-10-06 Thread Pablo Rodriguez via ntg-context
On 10/6/24 04:37, Gerion Entrup wrote:
> Hi,
> > when typesetting bibliographies, ConTeXt seems to link back to the
> (first?) citation within the text.
> A side effect is that the whole reference entry is colored in the
> link color.>
> Is there a possibility to deactivate the back linking or limit it to
> the key?
Hi Gerion,

\setupbtx[interaction=stop] disables all interaction.

Other values are: number text page all (according to
https://www.pragma-ade.com/general/manuals/mkiv-publications.pdf#page=17).

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: Vertical spacing in table of content

2024-10-06 Thread mf
There's also \writetolist to add arbitrary content and make local 
adjustments.


\writetolist[section]{}{\blank[...]}

Massi


Il 06/10/24 04:26, Gerion Entrup ha scritto:

Hi,

for my table of contents, I have set a style that makes sections and 
subsections smaller than chapters.
However, in the rendering the vertical space seems not to adapt: It remains 
equal for all entities.

Is there a possibility to reduce the vertical space between subsections and 
sections?
I tried before and after but only get it to add additional space and not 
reducing it.

Here is a MWE:
```
\setuplist[chapter][
style=bold,
aligntitle=yes,
]

\setuplist[section][
aligntitle=yes,
style=\tfx,
]
\setuplist[subsection][
aligntitle=yes,
style=\tfxx,
after={\blank[none]},
before={\blank[none]},
]

\starttext

\placecontent

\hairline

\startchapter[title=foo]
\startsection[title=foo]
\startsubsection[title=foo]
\stopsubsection
\startsubsection[title=foo]
\stopsubsection
\startsubsection[title=foo]
\stopsubsection
\stopsection
\startsection[title=foo]
\startsubsection[title=foo]
\stopsubsection
\startsubsection[title=foo]
\stopsubsection
\stopsection
\stopchapter
\startchapter[title=foo]
\stopchapter

\stoptext
```

Gerion

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Vertical spacing in table of content

2024-10-06 Thread Mikael Sundqvist
Hi,

not sure exactly what you want, but does adding \setupinterlinespace
help you? As in

\setuplist[section][
aligntitle=yes,
style=\tfx\setupinterlinespace,
]

/Mikael

On Sun, Oct 6, 2024 at 4:27 AM Gerion Entrup  wrote:
>
> Hi,
>
> for my table of contents, I have set a style that makes sections and 
> subsections smaller than chapters.
> However, in the rendering the vertical space seems not to adapt: It remains 
> equal for all entities.
>
> Is there a possibility to reduce the vertical space between subsections and 
> sections?
> I tried before and after but only get it to add additional space and not 
> reducing it.
>
> Here is a MWE:
> ```
> \setuplist[chapter][
> style=bold,
> aligntitle=yes,
> ]
>
> \setuplist[section][
> aligntitle=yes,
> style=\tfx,
> ]
> \setuplist[subsection][
> aligntitle=yes,
> style=\tfxx,
> after={\blank[none]},
> before={\blank[none]},
> ]
>
> \starttext
>
> \placecontent
>
> \hairline
>
> \startchapter[title=foo]
> \startsection[title=foo]
> \startsubsection[title=foo]
> \stopsubsection
> \startsubsection[title=foo]
> \stopsubsection
> \startsubsection[title=foo]
> \stopsubsection
> \stopsection
> \startsection[title=foo]
> \startsubsection[title=foo]
> \stopsubsection
> \startsubsection[title=foo]
> \stopsubsection
> \stopsection
> \stopchapter
> \startchapter[title=foo]
> \stopchapter
>
> \stoptext
> ```
>
> Gerion___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Draw leftframe to a description

2024-10-05 Thread Gerion Entrup
Am Montag, 30. September 2024, 05:58:10 MESZ schrieb ai2472206...@yeah.net:
> I'm not sure I understand your needs. 
> But if you don't want a background, but just need a border. 
> You can try command “startsidebar“ :
> https://wiki.contextgarden.net/Command/setupsidebar

Thank you for that command, it is pretty much that what I want.
In contrast to a textbackground, it seems to be always in the margin of the 
page.

I tried:
```
\definesidebar[excursussb][
rulethickness=1mm,
rulecolor=darkred,
distance=1mm, % <- this seems to be not respected for text that is 
narrower
]

\definedescription[excursus][
text={Excursus:\ },
alternative=top,
headstyle=bold,
width=broad,
before={\startnarrower\startsidebar[exkursussb]},
after={\stopsidebar\stopnarrower},
]
```

The more relevant problem, however, is that it does not work with footnotes.
I got exactly the same problems like with textbackground (see the stackexchange 
post for screenshots).

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: different type in footnote

2024-10-05 Thread Pablo Rodriguez via ntg-context
On 10/4/24 23:55, Aditya Mahajan wrote:
> You can also use:
> [...}
> \footnote{\typebuffer}

Many thanks for your reply, Aditya.

Your message helped me to realize that verbatim in footnotes needs buffers.

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: different type in footnote

2024-10-05 Thread Pablo Rodriguez via ntg-context
On 10/4/24 19:01, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 04.10.2024 um 18:44:
>> [...]
>> I mean, this is verbatim and in some cases it is essential to be able to
>> display spaces as they are in the source.
>
> A reminder from of past:
> https://www.mail-archive.com/ntg-context@ntg.nl/msg74688.html

Many thanks for your reply, Wolfgang.

This helped me to realize why I was stuck with the same issue again.

My source files are Markdown (converted to XML with pandoc) to be
compiled with ConTeXt.

When I type ConTeXt code, it is really rare that its contains verbatim
(especially inside footnotes).

Both \xmlprettyprinttext and \xmlinlineprettyprinttext use buffers.

This avoids having issues when deployed inside a footnote.

As always, many thanks for your insightful explanation and 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: Is there any way to automatically control the spacing between Chinese and non-Chinese characters?

2024-10-04 Thread hf
thank you. I am trying to get some usable OpenType Chinese font for ConTeXt 
on GNU/Linux.

Cheers,
Hong

October 3, 2024 at 7:45 AM, "黄复雄"  wrote:

> I use \usetypescriptfile[mscore], which means using the font
> 
> configuration that comes with ConTeXt,
> 
> which is suitable for Windows systems. For details, see the
> 
> installation file type-imp-mscore.mkiv.
> 
> If you set the body font, both OpenType and TrueType are OK.
> 
> On Thu, Oct 3, 2024 at 6:42 AM  wrote:
> 
>> I'm curious what Chinese font(s) you are using with ConTeXt? Are they 
>> OpenType font,
>> 
>> or TrueType?
>> 
>> October 2, 2024 at 12:56 PM, "黄复雄"  wrote:
>> 
>> This is a preliminary solution for inserting spaces between Chinese
>> 
>> characters and non-Chinese characters
>> 
>> ```ConTeXt
>> 
>> \mainlanguage[cn]
>> 
>> \language[cn]
>> 
>> \setscript[hanzi]
>> 
>> \usetypescriptfile[mscore]
>> 
>> \usebodyfont [mschinese,12pt]
>> 
>> \showglyphs
>> 
>> \startluacode
>> 
>> Thirddata = Thirddata or {}
>> 
>> local glyph_id = nodes.nodecodes.glyph --node.id("glyph")
>> 
>> local node_insertbefore = node.insertbefore
>> 
>> local node_insertafter = node.insertafter
>> 
>> local node_new = node.new
>> 
>> local tex_sp = tex.sp
>> 
>> local function ischinesechar(c)
>> 
>> -- for more ranges:
>> 
>> -- https://wiki.contextgarden.net/List_of_Unicode_blocks
>> 
>> return (c >= 0x04E00 and c <= 0x09FFF)
>> 
>> or (c >= 0x03400 and c <= 0x04DBF)
>> 
>> or (c >= 0x2 and c <= 0x2A6DF)
>> 
>> end
>> 
>> function Thirddata.processmystuff(head)
>> 
>> local n = head
>> 
>> while n do
>> 
>> if n.id == glyph_id and ischinesechar(n.char) then
>> 
>> local n_prev = n.prev
>> 
>> if n_prev
>> 
>> and n_prev.id == glyph_id
>> 
>> and not ischinesechar(n_prev.char)
>> 
>> then
>> 
>> local glue = node_new("glue")
>> 
>> glue.width = tex_sp("0.25em")
>> 
>> glue.stretch = tex_sp("0.25em")
>> 
>> print("insert space before:", utf8.char(n.char))
>> 
>> head, glue = node_insertbefore(head, n, glue)
>> 
>> end
>> 
>> local n_next = n.next
>> 
>> if n_next
>> 
>> and n_next.id == glyph_id
>> 
>> and not ischinesechar(n_next.char)
>> 
>> then
>> 
>> local glue = node_new("glue")
>> 
>> glue.width = tex_sp("0.25em")
>> 
>> glue.stretch = tex_sp("0.25em")
>> 
>> print("insert space after:", utf8.char(n.char))
>> 
>> head, glue = node_insertafter(head, n, glue)
>> 
>> n = glue.next
>> 
>> end
>> 
>> end
>> 
>> n = n.next
>> 
>> end
>> 
>> return head, done
>> 
>> end
>> 
>> nodes.tasks.appendaction("processors", "after", "Thirddata.processmystuff")
>> 
>> \stopluacode
>> 
>> \starttext
>> 
>> 今天出去买菜花了5000元。
>> 
>> 新MacBook Pro有15\%的CPU性能提升。
>> 
>> \stoptext
>> 
>> ```
>> 
>> On Tue, Oct 1, 2024 at 2:07 PM  wrote:
>> 
>> hi,
>> 
>> Is there any way to automatically control the spacing between Chinese and 
>> non-Chinese characters?
>> 
>> I noticed that there is a tracker that tracks character types and annotates 
>> them.
>> 
>> But I don't know much about lua and the underlying tex.
>> 
>> Any suggestions would be greatly appreciated.
>> 
>> For example, glue is automatically added between Chinese characters and 
>> English or numbers.
>> 
>> input: 今天出去买菜花了5000元。
>> 
>> will get: 今天出去买菜花了 5000 元。
>> 
>> --
>> 
>> input: 新MacBook Pro有15%的CPU性能提升。
>> 
>> will get: 新 MacBook Pro 有 15% 的 CPU 性能提升。
>> 
>> 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
>> 
>> ___
>> 
>> ___
>> 
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / 
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.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: different type in footnote

2024-10-04 Thread Aditya Mahajan
On Fri, 4 Oct 2024, Pablo Rodriguez via ntg-context wrote:

> On 10/4/24 18:06, Wolfgang Schuster wrote:
> > Pablo Rodriguez via ntg-context schrieb am 04.10.2024 um 17:28:
> >> [...]
> >>\type{\a.bc}\footnote{\type{\a.bc}}
> >
> > \type{\a.bc}\footnote{\type[compact=absolute]{\a.bc}}
> 
> I mean, this is verbatim and in some cases it is essential to be able to
> display spaces as they are in the source.

You can also use:

\startbuffer
\a.bc
\stopbuffer

\footnote{\typebuffer}

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: different type in footnote

2024-10-04 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 04.10.2024 um 18:44:

On 10/4/24 18:06, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 04.10.2024 um 17:28:

[...]
\type{\a.bc}\footnote{\type{\a.bc}}


\type{\a.bc}\footnote{\type[compact=absolute]{\a.bc}}


Many thanks for your help, Wolfgang.

I wonder why I have just discovered it.

Given this sample:

   \setuppapersize[A9]
   \starttext
   \setuptype[compact=all]
   \footnote{\type{\a.b  c} \type{\a .b  c}}
   \setuptype[compact=absolute]
   \footnote{\type{\a.b c} \type{\a .b c}}
   \stoptext

There seems not to be a way to disable space compacting (or showing
spaces as they were typed). What is the rationale behind this?

I mean, this is verbatim and in some cases it is essential to be able to
display spaces as they are in the source.


A reminder from of past: 
https://www.mail-archive.com/ntg-context@ntg.nl/msg74688.html


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: different type in footnote

2024-10-04 Thread Pablo Rodriguez via ntg-context
On 10/4/24 18:06, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 04.10.2024 um 17:28:
>> [...]
>>\type{\a.bc}\footnote{\type{\a.bc}}
>
> \type{\a.bc}\footnote{\type[compact=absolute]{\a.bc}}

Many thanks for your help, Wolfgang.

I wonder why I have just discovered it.

Given this sample:

  \setuppapersize[A9]
  \starttext
  \setuptype[compact=all]
  \footnote{\type{\a.b  c} \type{\a .b  c}}
  \setuptype[compact=absolute]
  \footnote{\type{\a.b c} \type{\a .b c}}
  \stoptext

There seems not to be a way to disable space compacting (or showing
spaces as they were typed). What is the rationale behind this?

I mean, this is verbatim and in some cases it is essential to be able to
display spaces as they are in the source.

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: different type in footnote

2024-10-04 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 04.10.2024 um 17:28:

Dear list,

I have the following sample:

   \setuppapersize[A9]
   \starttext
   \type{\a.bc}\footnote{\type{\a.bc}}


\type{\a.bc}\footnote{\type[compact=absolute]{\a.bc}}

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: different type in footnote

2024-10-04 Thread Rik Kabel

Same here with ConTeXt  ver: 2024.09.25 11:53 LMTX  fmt: 2024.9.25

On 2024-10-04 11:28, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

   \setuppapersize[A9]
   \starttext
   \type{\a.bc}\footnote{\type{\a.bc}}
   \stoptext

Using current latest from 2024.09.25 11:53, I get an extra space after
\a in the footnote.

This happens both with LMTX and LuaTeX.

Could anyone confirm this? (A patch would be greatly appreciated, if
this were a reproducible issue.)

Many thanks for your help,

Pablo


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

maillist :ntg-context@ntg.nl 
/https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Typescript font for math script and scriptscript

2024-10-04 Thread Julius Ross
I am not sure how one would (sensibly) use that opentype feature along with
a change of axis for a variable font.

(Your hesitation for a variable math font is not unwarranted, and might in
the end not be something that works)


On Fri, Oct 4, 2024 at 9:12 AM Mikael Sundqvist  wrote:

> Hi,
>
> are you looking for
> https://learn.microsoft.com/en-us/typography/opentype/spec/features_pt#ssty
> ?
>
> /Mikael
>
> PS I hate to say that I am hesitant about a variable opentype math
> font, but I look forward to be proven wrong.
>
> On Fri, Oct 4, 2024 at 3:57 PM  wrote:
> >
> > Hi,
> >
> > I was wondering if there is a (good) way to have a specific font for
> sub/superscripts in mathematics that is different from the main font?
> >
> > I ask because I am working on a variable opentype math font, and it can
> be made to look a better if the superscripts are made a little bolder.
> >
> > Thanks in advance for any suggestions or examples.
> >
> > JR
> >
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> > webpage  : https://www.pragma-ade.nl / https://context.aanhet.net
> (mirror)
> > archive  : https://github.com/contextgarden/context
> > wiki : https://wiki.contextgarden.net
> >
> ___
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


  1   2   3   4   5   6   7   8   9   10   >