[NTG-context] Re: Wiki - test/proposal to further clarify documentation

2024-04-18 Thread Henning Hraban Ramm

Am 17.04.24 um 23:25 schrieb Garulfo:
- exactly, it's not a question of proposing new documents, but of 
proposing another complementary way of accessing and browsing existing 
ones.


- Actually, the wiki is (or can be) a hub for the 4 needs:
   - "Reference" like https://wiki.contextgarden.net/Command/setuphead
   - "How-To Guides" like https://wiki.contextgarden.net/Titles
   - "Tutorials":
 - hosted https://wiki.contextgarden.net/Detailed_Example
 - linked https://github.com/mpsmath/stepbystep
   - "Explanation" : mostly linked manuals and books


https://wiki.contextgarden.net/Command/setuphead
and https://wiki.contextgarden.net/Titles
are examples of how difficult it can be to understand where to find a 
particular information.


It might be worth keeping only the key examples on reference pages
like https://wiki.contextgarden.net/Command/***
and moving the "how-to" examples to a separate page (or pages).


I agree. Let’s accept this as a rule for further wiki editing.

Also, explain parameters with top priority in Command/setup* pages 
(keeping them in Command/define* pages etc. doesn’t hurt, but at least 
experienced users should know where to find something without searching).


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: Wiki - test/proposal to further clarify documentation

2024-04-16 Thread Henning Hraban Ramm

Am 14.04.24 um 21:45 schrieb Peter Hopcroft via ntg-context:

It would be great if the main page actually said what Context does.


In my poster (still WIP) I wrote:

start
---

The “infamous” alternative to LaTeX

While most designers use graphical tools, there are still areas where 
code-based typesetting systems are fun, make sense or are even superior. 
While LaTeX is the most known of these, ConTeXt is used by a growing 
minority of ambitioned enthusiasts around the world.


The small but active and creative community of ConTeXt users and 
developers is always driving TeX development over new frontiers:

NTS, MetaFun, Oriental TeX, LuaTeX, mplib, LuaMetaTeX…
They’re also dubbed the incisors (AKA cutting edge) of the dinosaur of 
Open Source.


ConTeXt is aimed at creative users, known for advanced features like 
extensive font control and direct XML processing, with a deep 
integration of Lua and MetaPost.


---

ConTeXt was invented in the 1990s by Hans Hagen and Ton Otten of the 
Dutch company “Pragma Advanced Document Engineering” for typesetting 
schoolbooks. Taco Hoekwater refactored the TeX source code to create 
LuaTeX which was further developed into LuaMetaTeX by Hans Hagen (and 
lately Mikael Sundqvist for refined math typography).


---

“To be fair, switching to the ConTeXt way of thinking and doing things 
was not an overnight process […]. But once I got used to it, I could not 
imagine going back to LaTeX. I’ll go even further and say that, in my 
view, ConTeXt is the future of TeX.

(Prof. Idris Samawi Hamid, 2009)
Source: www.tug.org/interviews/hamid.html

---

“ConTeXt is LaTeX done right. It is simple, flexible and powerful.”
(J. U. Hasecke on Mastodon, 2022)

---

Is ConTeXt for me?

If you want …
* to design your own layout
* best quality math typesetting
* to use Lua functions e.g. for processing data
* deep integration of a graphics language (MetaPost)
* to process XML input
* no package conflicts
* to use OpenType features
* consistent setup commands
* to place stuff on layers
* visual debugging features
* to have a lean, but mighty TeX system
* to typeset much faster than with LaTeX
* high quality Arabic typography
… then ConTeXt is for you!

---
stop

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

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


[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2024-04-01 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 general/manuals/
 general/manuals/luametafun.pdf
 general/manuals/primitives.pdf
 general/qrcs/
 general/qrcs/setup-mapping-de.pdf
 general/qrcs/setup-mapping-en.pdf
 general/qrcs/setup-mapping-fr.pdf
 general/qrcs/setup-mapping-it.pdf
 
 sent 207,366 bytes  received 58,323,621 bytes  4,036,619.79 bytes/sec
 total size is 579,402,595  speedup is 9.90


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2024-04-01.10
246486540   
/var/www/aanhet.net/context//htdocs/archives/context-2024-04-01.10/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2024-04-01.10/current
373235953   
/var/www/aanhet.net/context//htdocs/archives/context-2024-04-01.10
373235953   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Struggling with the distance and right margin text

2024-03-22 Thread Ursula Hermann
Dear Pablo,


Many thanks for your example. Sorry for writing so late.

At least I found out, how it works for me .  This is the best way.


\setuppapersize[A8,landscape]
\setupbodyfont[termes, 12.50pt]
\setuplayout[inrightmargin=5.1cm
 backspace=2.9cm,
 inleftmargin=0cm,width=4cm]
\inrightmargin{\blackrule\\{3.2.2}}\par \dontleavehmode \blackrule
\showframe
\starttext
Me

\stoptext




Von: Pablo Rodriguez via ntg-context 
Gesendet: Freitag, 15. März 2024 20:00:35
An: ntg-context@ntg.nl
Cc: Pablo Rodriguez
Betreff: [NTG-context] Re: Struggling with the distance and right margin text

On 3/15/24 14:06, Ursula Hermann wrote:
> Dear List,

Dear Ursula,

this might help you (it isn’t perfect, but you just seem to copy and
paste fragments from your source files):

  %\showframe\showstruts
  \mainlanguage[de-at]
  \setuppagenumbering[alternative=doublesided]
  \definemargindata  [MyInMargin][ininner]
  \definemarginframed[MyInMargin]
[topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
  \defineframed[topruletitle]
[width=max,
 frame=off,
 topframe=on,
 rulethickness=1pt,
 align={justify},
 extras=\dontleavehmode]
  \starttext
  \topruletitle{\MyInMargin {1.1.1}\bf
  Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par
  \input knuth\page

  \topruletitle{\MyInMargin{3.2.22}{\bf
  Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und
\input zapf b}
  \stoptext

Sorry for saying that again, but please elaborate both your minimal
samples and your descriptions of the issues you are experiencing.

Some comments on the code fragments you sent.

First of all, please include always code that can be compiled simply
after being copied and pasted.

This requires \starttext (most of the time) and \stoptext (mandatory to
avoid stupid errors).

> \definepapersize[MyBook][width=19cm,height=29.7cm]
> \setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook
> %\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
> \setupbodyfont[modern, 12.50pt]

If these lines are irrelevant for the issue you are experiencing, please
don’t include them.

> \definemargindata  [MyInMargin][inleft]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]

You define this margin framed, but your sample makes no use of it.

Sorry, but I don’t get it.

> \defineenumeration
>   [theorem]
>   [
> text=Theorem,
> title=yes,
> width=fit,
> distance=0.2em,
> alternative=serried,
>   ]
> \definetextbackground[GrayBackground][
>   location=paragraph,
>   background=color,
>   backgroundcolor=lightgray,
>   leftoffset=.5\bodyfontsize,
>   rightoffset=.5\bodyfontsize,
>   topoffset=.5\bodyfontsize,
>   bottomoffset=.5\bodyfontsize,
>   frame=off,]
>   \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
>   \blackrule[color=black, height=0.10ex, width=13.50cm]

If your sample includes no theorem or text background, please remove
these definitions when sending code.

BTW, avoid include text content (such as margin and body rules [but not
their definitions]) before \starttext.

Also, use \clrf instead of \\ (since the mailing list displays the
relevant line as ("\" instead of "\\"):

>   \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\}

Here starts your text:

> \starttext
> \margintext {1.1.1}
> {\bf Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par

Your margin text is undefined. Your code has a defined margin text
command, but it isn’t used.

> So  I have here an example from the second page:

Sorry, but I’m having the impression you are using ConTeXt as a kind of
command-based DTP software (which I think it isn’t at all).

Or, do you define commands for each page?

I think it is better to define a single margin text command and use a
doublesided page setup.

> \definemargindata[inrightmargin][right][margin=margin,width=.50em\rightmarginwidth,style=,color=]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt, 
> width=.90cm]

Again, margin text commands defined, but never used.

> \blackrule[color=black, height=0.10ex, width=13.40cm]
> {\blackrule[color=black, height=0.10ex, width=1cm, distance=.90cm]\par

Here you open a brace that is not closed at all.

At least, consider that this won’t be extremely readable for other
people (this is only a sample).

It also may be problematic for you, if you leave the source untouched
for some weeks.

> \defineenumeration
>   [theorem]
>   [
> text=Theorem,
> title=yes,
> width=fit,
> distance=0.2em,
> alternative=serried,
>   ]

At least, it would be better not to include a definition inside content
that seems to (or may) be grouped with braces.

BTW, it is exactly t

[NTG-context] Re: Use of marking

2024-03-21 Thread Thomas Meyer

Hi Pablo and Bruce,

thank you very much for your two solutions. That helps me enormously now.

Greetings
Thomas

Am 21.03.24 um 16:34 schrieb Bruce Horrocks:

\startsetups[doc:header]
   \getmarking[chapternumber] \space - \space \getmarking[chapter]
   \space :: \space
   \getmarking[sectionnumber] \space - \space \getmarking[section]
\stopsetups
\setupheadertexts[\setup{doc:header}]

\starttext
\dorecurse{10}{
   \startchapter[title={This is my chapter}]
   This is a chapter\par \dorecurse{6}{\input knuth } \input math-kontinuitet-sv

   \startsection[title={This is my section}]
This is a section\par \dorecurse{6}{\input knuth }\input math-kontinuitet-sv
   \stopsection
   \stopchapter
}
\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: Use of marking

2024-03-21 Thread Bruce Horrocks


> On 20 Mar 2024, at 18:45, Andres Conrado Montoya  
> wrote:
> 
> 2. As far as I have found, including the chapter/section number in the 
> marking is not really a trivial task. I usually hack something using 
> \headnumber and \getmarking, like so: 

You can do the following:

\startsetups[doc:header]
  \getmarking[chapternumber] \space - \space \getmarking[chapter]
  \space :: \space
  \getmarking[sectionnumber] \space - \space \getmarking[section]
\stopsetups
\setupheadertexts[\setup{doc:header}]

\starttext
\dorecurse{10}{
  \startchapter[title={This is my chapter}]
  This is a chapter\par \dorecurse{6}{\input knuth } \input math-kontinuitet-sv

  \startsection[title={This is my section}]
   This is a section\par \dorecurse{6}{\input knuth }\input math-kontinuitet-sv
  \stopsection
  \stopchapter
}
\stoptext

Caveat: it needs an if...then test around the section number for when a section 
hasn't started.
—
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: Japanese

2024-03-16 Thread Wolfgang Schuster

Otared Kavian schrieb am 14.03.2024 um 14:48:

Dear Emmanuel,

Thank you for your reply: indeed I understand your approach, which is 
quite efficient. I am not at all good in coding, so I naively thought 
there would be a way for your setup to retrieve the information it 
needs from what the user is doing. Maybe once things are settled, Hans 
and Wolfgang will have a look in the Japanese part of ConTeXt so that 
the user can avoid to enter the setup included in the \directlua part.


There is no need for these calculations because

    1. you can create named layouts (e.g. \definelayout[kinohanmen:a4]) 
for each paper size,


    2. you can put the fontsize etc. settings in a setups block and 
load the one needed for each paper size and


    3. you can put all of them in a module which can be loaded when 
writing documents in japanese, the paper size can be passed as argument 
to the module.


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: Struggling with the distance and right margin text

2024-03-15 Thread Pablo Rodriguez via ntg-context
On 3/15/24 14:06, Ursula Hermann wrote:
> Dear List, 

Dear Ursula,

this might help you (it isn’t perfect, but you just seem to copy and
paste fragments from your source files):

  %\showframe\showstruts
  \mainlanguage[de-at]
  \setuppagenumbering[alternative=doublesided]
  \definemargindata  [MyInMargin][ininner]
  \definemarginframed[MyInMargin]
[topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
  \defineframed[topruletitle]
[width=max,
 frame=off,
 topframe=on,
 rulethickness=1pt,
 align={justify},
 extras=\dontleavehmode]
  \starttext
  \topruletitle{\MyInMargin {1.1.1}\bf
  Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par
  \input knuth\page

  \topruletitle{\MyInMargin{3.2.22}{\bf
  Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und
\input zapf b}
  \stoptext

Sorry for saying that again, but please elaborate both your minimal
samples and your descriptions of the issues you are experiencing.

Some comments on the code fragments you sent.

First of all, please include always code that can be compiled simply
after being copied and pasted.

This requires \starttext (most of the time) and \stoptext (mandatory to
avoid stupid errors).

> \definepapersize[MyBook][width=19cm,height=29.7cm]
> \setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook
> %\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
> \setupbodyfont[modern, 12.50pt]

If these lines are irrelevant for the issue you are experiencing, please
don’t include them.

> \definemargindata  [MyInMargin][inleft]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]

You define this margin framed, but your sample makes no use of it.

Sorry, but I don’t get it.

> \defineenumeration
>   [theorem]
>   [
>     text=Theorem,
>     title=yes,
>     width=fit,
>     distance=0.2em,
>     alternative=serried,
>   ]
> \definetextbackground[GrayBackground][
>   location=paragraph,
>   background=color,
>   backgroundcolor=lightgray,
>   leftoffset=.5\bodyfontsize,
>   rightoffset=.5\bodyfontsize,
>   topoffset=.5\bodyfontsize,
>   bottomoffset=.5\bodyfontsize,
>   frame=off,]
>   \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
>   \blackrule[color=black, height=0.10ex, width=13.50cm]

If your sample includes no theorem or text background, please remove
these definitions when sending code.

BTW, avoid include text content (such as margin and body rules [but not
their definitions]) before \starttext.

Also, use \clrf instead of \\ (since the mailing list displays the
relevant line as ("\" instead of "\\"):

>   \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\}

Here starts your text:

> \starttext
> \margintext {1.1.1}
> {\bf Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par

Your margin text is undefined. Your code has a defined margin text
command, but it isn’t used.

> So  I have here an example from the second page: 

Sorry, but I’m having the impression you are using ConTeXt as a kind of
command-based DTP software (which I think it isn’t at all).

Or, do you define commands for each page?

I think it is better to define a single margin text command and use a
doublesided page setup.

> \definemargindata[inrightmargin][right][margin=margin,width=.50em\rightmarginwidth,style=,color=]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt, 
> width=.90cm]

Again, margin text commands defined, but never used.

> \blackrule[color=black, height=0.10ex, width=13.40cm]
> {\blackrule[color=black, height=0.10ex, width=1cm, distance=.90cm]\par

Here you open a brace that is not closed at all.

At least, consider that this won’t be extremely readable for other
people (this is only a sample).

It also may be problematic for you, if you leave the source untouched
for some weeks.

> \defineenumeration
>   [theorem]
>   [
>     text=Theorem,
>     title=yes,
>     width=fit,
>     distance=0.2em,
>     alternative=serried,
>   ]

At least, it would be better not to include a definition inside content
that seems to (or may) be grouped with braces.

BTW, it is exactly the same definition as the one included before.

It isn’t just to be removed in minimal samples, your final code doesn’t
need the duplicated command definition.

> \inright{3.2.22}
> {\bf Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und 
>
> My problem here is that there is not the same distance between the  the
> text and the  margintext .

Please, always compile the minimal samples that you send to the list.

This is simply to ensure other list subscribers will get the same
results as you.

After adding a final \stoptext command, I had to run:

  mtxrun --script check source-sample.tex

This allowed me to sp

[NTG-context] Re: Japanese

2024-03-14 Thread Otared Kavian
Dear Emmanuel,

Thank you for your reply: indeed I understand your approach, which is quite 
efficient. I am not at all good in coding, so I naively thought there would be 
a way for your setup to retrieve the information it needs from what the user is 
doing. Maybe once things are settled, Hans and Wolfgang will have a look in the 
Japanese part of ConTeXt so that the user can avoid to enter the setup included 
in the \directlua part.

Again thank you for what you are sharing.

Best regards: Otared

> On 14 Mar 2024, at 08:12, Emanuel Han via ntg-context  
> wrote:
> 
> Dear Otared,
> 
> when you read the lua code in the first \directlua{}, you should realize that 
> the dimensions of almost all layout elements are depending on the value of my 
> lua variable "paperSize".
> Thanks to defining the paper size first in lua, I can apply calculations of 
> numeric values.
> 
> The value of paperSize is later passed on to \setuppapersize via 
> \setuppapersize[\directlua{tex.print(paperSize)}]
> 
> Emanuel
> On März 13 2024, at 3:55 pm, Otared Kavian  wrote:
> Hi Emmanuel,
> 
> Thank you so much for the new setup for writing Japanese: I tested with both 
> files, and noticed that with the new version the output looks great.
> 
> I have a question about the code in the \directlua{} part of your setup: why, 
> for instance, the
> paperSize = « B5"
> is defined « by hand » there, instead of being retrieved from the command
> \setuppapersize[B5]
> issued by the user?
> 
> Actually I am using your setup for learning Japanese, and at my beginner’s 
> level I do separate words I am learning with spaces. While with the previous 
> version of your setup the lines were breaking womewhat strangely, but now the 
> spaces between words in the output are as I intended them to be (I should 
> also Thank Wolfgang Schuster for his insight with the \script[nihongo], and 
> indeed Hans for fixing so quickly the slightest bug).
> 
> It is really a great pleasure to be in this community where help comes from 
> everyone and features are given on demand !
> 
> Best regards: Otared
> 
> > On 10 Mar 2024, at 17:43, Emanuel Han via ntg-context  
> > wrote:
> >
> > Hi all,
> >
> > I added 
> > https://wiki.contextgarden.net/Chinese_Japanese_and_Korean#Meeting_the_JIS_X_4051_Requirements_for_Japanese_Text_Layout
> > with attached working example code and to-do list.
> >
> > Thanks for any contributions!
> >
> > The working example code is still a work in progress. Its text layout 
> > output meets already some of the requirements (see comments in the code). 
> > Among the ones to still be implemented are:
> >
> > • solid setting (no extra spacing between characters) 
> > https://www.w3.org/TR/jlreq/#fig1_8 if no requirement for line-adjustment 
> > https://www.w3.org/TR/jlreq/#term.line-adjustment
> > • aligning of the lines to the Kihon-hanmen (optimizing the code below in 
> > this regard)
> > • positioning and realm of headings https://www.w3.org/TR/jlreq/#fig3_1_9 
> > https://www.w3.org/TR/jlreq/#fig3_1_15 et al, and 
> > https://www.w3.org/TR/jlreq/#fig3_1_4
> > • positioning of yokugo-ruby https://www.w3.org/TR/jlreq/#fig2_3_24
> > • inline cutting note (warichu) https://www.w3.org/TR/jlreq/#fig2_4_1
> > • emphasis with sesame dot or bullet
> > • itemization https://www.w3.org/TR/jlreq/#fig2_5_6
> > • indenting of quotation paragraphs https://www.w3.org/TR/jlreq/#fig2_5_7
> > • tab setting https://www.w3.org/TR/jlreq/#fig2_6_1
> > • furiwake https://www.w3.org/TR/jlreq/#fig2_7_2
> > • jidori https://www.w3.org/TR/jlreq/#fig2_7_4
> > • math https://www.w3.org/TR/jlreq/#fig2_7_6 and 
> > https://www.w3.org/TR/jlreq/#fig2_7_62
> > • tategaki (writing vertically)
> > Best regards
> >
> > Emanuel
> > On März 2 2024, at 7:00 pm, Wolfgang Schuster 
> >  wrote:
> > Emanuel Han schrieb am 01.03.2024 um 16:23:
> >
> > Dear Wolfgang,
> >
> > thank you for your valuable remarks. I integrated them, see corrected 
> > attached example.
> >
> > Yes, correct layout examples exist. They're all showing vertical writing, 
> > but the rules and principles are exactly the same for horizontal writing.
> >
> > • position of the headers and footers: https://www.w3.org/TR/jlreq/#fig1_30
> >
> > See my attached gongitsune.tex example how you can squeeze text in a very 
> > narrow header/footer.
> >
> > • aligning lines to the text box: https://www.w3.org/TR/jlreq/#fig1_3
> >
> > You can use the lines key for \setuplayout to let ConTeXt calculate the 
> > necessary value for the 

[NTG-context] Re: Japanese

2024-03-14 Thread Emanuel Han via ntg-context
Dear Otared,

when you read the lua code in the first \directlua{}, you should realize that 
the dimensions of almost all layout elements are depending on the value of my 
lua variable "paperSize".
Thanks to defining the paper size first in lua, I can apply calculations of 
numeric values.

The value of paperSize is later passed on to \setuppapersize via 
\setuppapersize[\directlua{tex.print(paperSize)}]
Emanuel
On März 13 2024, at 3:55 pm, Otared Kavian  wrote:
> Hi Emmanuel,
>
> Thank you so much for the new setup for writing Japanese: I tested with both 
> files, and noticed that with the new version the output looks great.
> I have a question about the code in the \directlua{} part of your setup: why, 
> for instance, the
> paperSize = « B5"
> is defined « by hand » there, instead of being retrieved from the command
> \setuppapersize[B5]
> issued by the user?
>
> Actually I am using your setup for learning Japanese, and at my beginner’s 
> level I do separate words I am learning with spaces. While with the previous 
> version of your setup the lines were breaking womewhat strangely, but now the 
> spaces between words in the output are as I intended them to be (I should 
> also Thank Wolfgang Schuster for his insight with the \script[nihongo], and 
> indeed Hans for fixing so quickly the slightest bug).
> It is really a great pleasure to be in this community where help comes from 
> everyone and features are given on demand !
> Best regards: Otared
> > On 10 Mar 2024, at 17:43, Emanuel Han via ntg-context  
> > wrote:
> >
> > Hi all,
> >
> > I added 
> > https://wiki.contextgarden.net/Chinese_Japanese_and_Korean#Meeting_the_JIS_X_4051_Requirements_for_Japanese_Text_Layout
> > with attached working example code and to-do list.
> >
> > Thanks for any contributions!
> >
> > The working example code is still a work in progress. Its text layout 
> > output meets already some of the requirements (see comments in the code). 
> > Among the ones to still be implemented are:
> >
> > • solid setting (no extra spacing between characters) 
> > https://www.w3.org/TR/jlreq/#fig1_8 if no requirement for line-adjustment 
> > https://www.w3.org/TR/jlreq/#term.line-adjustment
> > • aligning of the lines to the Kihon-hanmen (optimizing the code below in 
> > this regard)
> > • positioning and realm of headings https://www.w3.org/TR/jlreq/#fig3_1_9 
> > https://www.w3.org/TR/jlreq/#fig3_1_15 et al, and 
> > https://www.w3.org/TR/jlreq/#fig3_1_4
> > • positioning of yokugo-ruby https://www.w3.org/TR/jlreq/#fig2_3_24
> > • inline cutting note (warichu) https://www.w3.org/TR/jlreq/#fig2_4_1
> > • emphasis with sesame dot or bullet
> > • itemization https://www.w3.org/TR/jlreq/#fig2_5_6
> > • indenting of quotation paragraphs https://www.w3.org/TR/jlreq/#fig2_5_7
> > • tab setting https://www.w3.org/TR/jlreq/#fig2_6_1
> > • furiwake https://www.w3.org/TR/jlreq/#fig2_7_2
> > • jidori https://www.w3.org/TR/jlreq/#fig2_7_4
> > • math https://www.w3.org/TR/jlreq/#fig2_7_6 and 
> > https://www.w3.org/TR/jlreq/#fig2_7_62
> > • tategaki (writing vertically)
> > Best regards
> >
> > Emanuel
> > On März 2 2024, at 7:00 pm, Wolfgang Schuster 
> >  wrote:
> > Emanuel Han schrieb am 01.03.2024 um 16:23:
> >
> > Dear Wolfgang,
> >
> > thank you for your valuable remarks. I integrated them, see corrected 
> > attached example.
> >
> > Yes, correct layout examples exist. They're all showing vertical writing, 
> > but the rules and principles are exactly the same for horizontal writing.
> >
> > • position of the headers and footers: https://www.w3.org/TR/jlreq/#fig1_30
> >
> > See my attached gongitsune.tex example how you can squeeze text in a very 
> > narrow header/footer.
> >
> > • aligning lines to the text box: https://www.w3.org/TR/jlreq/#fig1_3
> >
> > You can use the lines key for \setuplayout to let ConTeXt calculate the 
> > necessary value for the text height.
> >
> > • protrusion of ruby: https://www.w3.org/TR/jlreq/#fig_ad1_6
> >
> > You're getting this for free because ruby text doesn't take up vertical 
> > space, in case vertical text is working it would now stick into the margins 
> > as expected.
> >
> > \starttext
> > \ruledhbox{a \ruby{x}{y} b}
> > \stoptext
> >
> >
> >
> > In my previous mail, I wrote wrong amounts of lines. They should be 46 
> > lines on one page, while the actual example doesn't show the 46th line.
> >
> > It would be important to identify the reason why only 24 characte

[NTG-context] Re: Japanese

2024-03-13 Thread Otared Kavian
Hi Emmanuel,

Thank you so much for the new setup for writing Japanese: I tested with both 
files, and noticed that with the new version the output looks great. 

I have a question about the code in the \directlua{} part of your setup: why, 
for instance, the 
paperSize = « B5"
is defined « by hand » there, instead of being retrieved from the command
 \setuppapersize[B5]
issued by the user? 

Actually I am using your setup for learning Japanese, and at my beginner’s 
level I do separate words I am learning with spaces. While with the previous 
version of your setup the lines were breaking womewhat strangely, but now the 
spaces between words in the output are as I intended them to be (I should also 
Thank Wolfgang Schuster for his insight with the \script[nihongo], and indeed 
Hans for fixing so quickly the slightest bug).

It is really a great pleasure to be in this community where help comes from 
everyone and features are given on demand !

Best regards: Otared

> On 10 Mar 2024, at 17:43, Emanuel Han via ntg-context  
> wrote:
> 
> Hi all,
> 
> I added 
> https://wiki.contextgarden.net/Chinese_Japanese_and_Korean#Meeting_the_JIS_X_4051_Requirements_for_Japanese_Text_Layout
> with attached working example code and to-do list.
> 
> Thanks for any contributions!
> 
> The working example code is still a work in progress. Its text layout output 
> meets already some of the requirements (see comments in the code). Among the 
> ones to still be implemented are:
> 
>   • solid setting (no extra spacing between characters) 
> https://www.w3.org/TR/jlreq/#fig1_8 if no requirement for line-adjustment 
> https://www.w3.org/TR/jlreq/#term.line-adjustment
>   • aligning of the lines to the Kihon-hanmen (optimizing the code below 
> in this regard)
>   • positioning and realm of headings 
> https://www.w3.org/TR/jlreq/#fig3_1_9 https://www.w3.org/TR/jlreq/#fig3_1_15 
> et al, and https://www.w3.org/TR/jlreq/#fig3_1_4
>   • positioning of yokugo-ruby https://www.w3.org/TR/jlreq/#fig2_3_24
>   • inline cutting note (warichu) https://www.w3.org/TR/jlreq/#fig2_4_1
>   • emphasis with sesame dot or bullet
>   • itemization https://www.w3.org/TR/jlreq/#fig2_5_6
>   • indenting of quotation paragraphs 
> https://www.w3.org/TR/jlreq/#fig2_5_7
>   • tab setting https://www.w3.org/TR/jlreq/#fig2_6_1
>   • furiwake https://www.w3.org/TR/jlreq/#fig2_7_2
>   • jidori https://www.w3.org/TR/jlreq/#fig2_7_4
>   • math https://www.w3.org/TR/jlreq/#fig2_7_6 and 
> https://www.w3.org/TR/jlreq/#fig2_7_62
>   • tategaki (writing vertically)
> Best regards
> 
> Emanuel
> On März 2 2024, at 7:00 pm, Wolfgang Schuster 
>  wrote:
> Emanuel Han schrieb am 01.03.2024 um 16:23:
> 
> Dear Wolfgang,
> 
> thank you for your valuable remarks. I integrated them, see corrected 
> attached example.
> 
> Yes, correct layout examples exist. They're all showing vertical writing, but 
> the rules and principles are exactly the same for horizontal writing.
> 
>   • position of the headers and footers: 
> https://www.w3.org/TR/jlreq/#fig1_30
> 
> See my attached gongitsune.tex example how you can squeeze text in a very 
> narrow header/footer.
> 
>   • aligning lines to the text box: https://www.w3.org/TR/jlreq/#fig1_3
> 
> You can use the lines key for \setuplayout to let ConTeXt calculate the 
> necessary value for the text height.
> 
>   • protrusion of ruby: https://www.w3.org/TR/jlreq/#fig_ad1_6
> 
> You're getting this for free because ruby text doesn't take up vertical 
> space, in case vertical text is working it would now stick into the margins 
> as expected.
> 
> \starttext
> \ruledhbox{a \ruby{x}{y} b}
> \stoptext
> 
> 
> 
> In my previous mail, I wrote wrong amounts of lines. They should be 46 lines 
> on one page, while the actual example doesn't show the 46th line.
> 
> It would be important to identify the reason why only 24 characters are used 
> to create a line when 25 could be used. Then we can develop a method to turn 
> that mechanism off or circumvent it.
> Quotation from https://www.w3.org/TR/jlreq:
> In principle, when composing a line with ideographic (cl-19), hiragana 
> (cl-15) and katakana (cl-16) characters, no extra spacing appears between 
> their character frame. This is called solid setting (see Figure 5).
> 
> 1. ConTeXt has a mechanism to typeset Japanese texts.
> 
> 2. There are flaws in the output it produces but this nothing which can't be 
> fixed.
> 
> 3. To fix the problems someone has to be passionate to fix them and we're 
> willing to help here.
> 
> As you can see in my second example file japanese.tex there is a font feature 
> to create half

[NTG-context] Re: Japanese

2024-02-27 Thread Otared Kavian
Dear Dalyoung,

Thank you very much for your insight. I downloaded the Noto Serif JP fonts and 
set up a fontfamily as you indicated, by adding
\setscript[nihongo]
which solves a problem I had with line breakings. And everything works smoothly!

So, for the mail archive, here is what I have and what works fine:

%%% Noto Fonts

\definefontfamily[JapaneseFont][rm][Noto Serif JP]
  [   it={style:regular,features:{*,slanted}},
  sl={style:regular,features:{*,slanted}},
  bi={style:bold,features:{*,slanted}},force=yes]

\definefontfamily[JapaneseFont][ss][Noto Serif JP]
  [   it={style:regular,features:{*,slanted}},
  sl={style:regular,features:{*,slanted}},
  bi={style:bold,features:{*,slanted}},force=yes]

\definefontfamily[JapaneseFont][tt][Noto Serif JP]
  [   it={style:regular,features:{*,slanted}},
  sl={style:regular,features:{*,slanted}},
  bi={style:bold,features:{*,slanted}},force=yes]

\definefontfamily[JapaneseFont][math][Tex Gyre Termes Math]
%\definefontfamily[JapaneseFont][math][Tex Gyre Pagella Math]
%\definefontfamily[JapaneseFont][math][Tex Gyre Aventor]



\setupbodyfont[JapaneseFont,12pt]
\setupruby[location=top,voffset=-2ex]
\setupwhitespace[big]
\setscript[nihongo]

\starttext
\ruby{早}{はや}く。
いきましょう。
\stoptext

Best regards: Otared


> On 27 Feb 2024, at 13:55, Jeong Dal via ntg-context  
> wrote:
> 
> Dear Otared,
> 
> I am using Korean as main language.
> I used use typescript file, but recently I use \definefontfamily.
> Since using Japanese font is similar to use Korean font, I show my example  
> of using Noto fonts. It was made by the help of expert of this list long time 
> ago.
> 
> You may change "Noto Serif CJK KR” to Japanese font.
> 
> I also use "\setscript[hangul]” when I use Korean as mainlanaguage.
> 
> I hope that you may enhance the following code.
> 
> Best regards,
> 
> Dalyoung
> 
> 
> %%% Noto Fonts
> 
> \definefontfamily[notoFont][rm][Noto Serif CJK KR]
>   [   it={style:regular,features:{*,slanted}},
>   sl={style:regular,features:{*,slanted}},
>   bi={style:bold,features:{*,slanted}},force=yes]
> 
> \definefontfamily[notoFont][ss][Noto Sans CJK KR]
>   [   it={style:regular,features:{*,slanted}},
>   sl={style:regular,features:{*,slanted}},
>   bi={style:bold,features:{*,slanted}},force=yes]
> 
> \definefontfamily[notoFont][tt][Noto Sans Mono CJK KR]
>   [   it={style:regular,features:{*,slanted}},
>   sl={style:regular,features:{*,slanted}},
>   bi={style:bold,features:{*,slanted}},force=yes]
> 
> \definefontfamily[notoFont][math][Tex Gyre Termes Math]
> %\definefontfamily[notoFonts][math][Tex Gyre Pagella Math]
> %\definefontfamily[notoCJK][math][Tex Gyre Aventor]
> 
> 
>> 2024. 2. 27. 오전 6:49, Otared Kavian > <mailto:ota...@gmail.com>> 작성:
>> 
>> Hi Hraban,
>> 
>> Your are right indeed ! I didn’t imagine that it was so easy to set up a 
>> document to write in Japanese…
>> Actually I followed the example by Emanuel Han which is essentially what you 
>> suggest (although he gave me also the hint to add the furagana).
>> 
>> Best regards: Otared
>> 
>>> On 26 Feb 2024, at 21:16, Henning Hraban Ramm >> <mailto:te...@fiee.net>> wrote:
>>> 
>>> Am 26.02.24 um 21:08 schrieb Otared Kavian:
>>>> Does anyone have a simple setup of fonts to write a small Japanese 
>>>> document (possibly with furagana) ? I am using MacOS and I have several 
>>>> Japanese fonts on the system.
>>>> I have some old examples which do not typeset correctly now, maybe because 
>>>> they use the old module simplefonts and  commands such as \setcjkmainfont 
>>>> and friends.
>>> 
>>> Try to replace the simplefonts calls with something like
>>> 
>>> \definefontfamily[myfonts][rm][SomeFont]
>>> \definefontfamily[myfonts][ss][SomeOtherFont]
>>> 
>>> \setupbodyfont[myfonts,rm,12pt]
>>> 
>>> With Latin fonts, it usually works.
>>> 
>>> Hraban
>>> ___
>>> If your question is of interest to others as well, please add an entry to 
>>> the Wiki!
>>> 
>>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl 
>>> <https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl>
>>> webpage  : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / 
>>> https://context.aanhet.net <https://context.aanhet.net/> (mirror)
>>> archive  : https://github.com/contextgarden/context 
&

[NTG-context] Re: Japanese

2024-02-27 Thread Jeong Dal via ntg-context
Dear Otared,

I am using Korean as main language.
I used use typescript file, but recently I use \definefontfamily.
Since using Japanese font is similar to use Korean font, I show my example  of 
using Noto fonts. It was made by the help of expert of this list long time ago.

You may change "Noto Serif CJK KR” to Japanese font.

I also use "\setscript[hangul]” when I use Korean as mainlanaguage.

I hope that you may enhance the following code.

Best regards,

Dalyoung


%%% Noto Fonts

\definefontfamily[notoFont][rm][Noto Serif CJK KR]
  [   it={style:regular,features:{*,slanted}},
  sl={style:regular,features:{*,slanted}},
  bi={style:bold,features:{*,slanted}},force=yes]

\definefontfamily[notoFont][ss][Noto Sans CJK KR]
  [   it={style:regular,features:{*,slanted}},
  sl={style:regular,features:{*,slanted}},
  bi={style:bold,features:{*,slanted}},force=yes]

\definefontfamily[notoFont][tt][Noto Sans Mono CJK KR]
  [   it={style:regular,features:{*,slanted}},
  sl={style:regular,features:{*,slanted}},
  bi={style:bold,features:{*,slanted}},force=yes]

\definefontfamily[notoFont][math][Tex Gyre Termes Math]
%\definefontfamily[notoFonts][math][Tex Gyre Pagella Math]
%\definefontfamily[notoCJK][math][Tex Gyre Aventor]


> 2024. 2. 27. 오전 6:49, Otared Kavian  작성:
> 
> Hi Hraban,
> 
> Your are right indeed ! I didn’t imagine that it was so easy to set up a 
> document to write in Japanese…
> Actually I followed the example by Emanuel Han which is essentially what you 
> suggest (although he gave me also the hint to add the furagana).
> 
> Best regards: Otared
> 
>> On 26 Feb 2024, at 21:16, Henning Hraban Ramm > <mailto:te...@fiee.net>> wrote:
>> 
>> Am 26.02.24 um 21:08 schrieb Otared Kavian:
>>> Does anyone have a simple setup of fonts to write a small Japanese document 
>>> (possibly with furagana) ? I am using MacOS and I have several Japanese 
>>> fonts on the system.
>>> I have some old examples which do not typeset correctly now, maybe because 
>>> they use the old module simplefonts and  commands such as \setcjkmainfont 
>>> and friends.
>> 
>> Try to replace the simplefonts calls with something like
>> 
>> \definefontfamily[myfonts][rm][SomeFont]
>> \definefontfamily[myfonts][ss][SomeOtherFont]
>> 
>> \setupbodyfont[myfonts,rm,12pt]
>> 
>> With Latin fonts, it usually works.
>> 
>> Hraban
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / 
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl 
>> <https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl>
>> webpage  : https://www.pragma-ade.nl <https://www.pragma-ade.nl/> / 
>> https://context.aanhet.net <https://context.aanhet.net/> (mirror)
>> archive  : https://github.com/contextgarden/context 
>> <https://github.com/contextgarden/context>
>> wiki : https://wiki.contextgarden.net <https://wiki.contextgarden.net/>
>> ___
> 
> Otared Kavian
> e-mail: ota...@gmail.com <mailto: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] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2024-02-27 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 general/qrcs/
 general/qrcs/setup-mapping-de.pdf
 general/qrcs/setup-mapping-en.pdf
 general/qrcs/setup-mapping-fr.pdf
 general/qrcs/setup-mapping-it.pdf
 
 sent 190,609 bytes  received 44,736,815 bytes  3,327,957.33 bytes/sec
 total size is 578,807,581  speedup is 12.88


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2024-02-27.10
245889724   
/var/www/aanhet.net/context//htdocs/archives/context-2024-02-27.10/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2024-02-27.10/current
372639137   
/var/www/aanhet.net/context//htdocs/archives/context-2024-02-27.10
372639137   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: Japanese

2024-02-26 Thread Otared Kavian
Hi Hraban,

Your are right indeed ! I didn’t imagine that it was so easy to set up a 
document to write in Japanese…
Actually I followed the example by Emanuel Han which is essentially what you 
suggest (although he gave me also the hint to add the furagana).

Best regards: Otared

> On 26 Feb 2024, at 21:16, Henning Hraban Ramm  wrote:
> 
> Am 26.02.24 um 21:08 schrieb Otared Kavian:
>> Does anyone have a simple setup of fonts to write a small Japanese document 
>> (possibly with furagana) ? I am using MacOS and I have several Japanese 
>> fonts on the system.
>> I have some old examples which do not typeset correctly now, maybe because 
>> they use the old module simplefonts and  commands such as \setcjkmainfont 
>> and friends.
> 
> Try to replace the simplefonts calls with something like
> 
> \definefontfamily[myfonts][rm][SomeFont]
> \definefontfamily[myfonts][ss][SomeOtherFont]
> 
> \setupbodyfont[myfonts,rm,12pt]
> 
> With Latin fonts, it usually works.
> 
> 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
> ___

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

2024-02-26 Thread Otared Kavian
Hi Emanuel,

Thanks for the example. In fact I don’t need vertical typesetting for my 
Japanese text, so your example works fine for me. 
Actually I had to change the name of the font to  Hiragino Mincho ProN W3 in 
order to get your example work.

Also I think with the recent versions of ConTeXt there is no need to add 
\enableregime[utf]
because ConTeXt is working with Unicode any way.
I added also a line to define a math font, since I have read here on the 
mailing list that a math font should be set… Maybe someone among the experts 
can tell us if I am right, or if one has to set other fonts as well.

So your example which works fine for me is now:

% begin simple-japanese.tex
\definefontfamily [JapaneseFont] [rm] [Hiragino Mincho ProN W3]
\definefontfamily [JapaneseFont] [ss] [Hiragino Mincho ProN W3]
\definefontfamily [JapaneseFont] [mm] [math] [lucidaot] [default]

\setupbodyfont[JapaneseFont,14pt]
\setupruby[location=top,voffset=-1.6ex]
\setupwhitespace[big]

\starttext  

\ruby{僕}{ぼく}はもう\ruby{寝}{ね}る。

お\ruby{休}{やす}みなさい^_^

\stoptext
%end simple-japanese.tex

Best regards: Otared

> On 26 Feb 2024, at 21:32, Emanuel Han via ntg-context  
> wrote:
> 
> Unfortunately vertical typesetting is not supported by ConTeXt. That's a big 
> pity.
> 
> If horizontal typesetting is fine, this little working example with furigana 
> might give you some hints. Hiragino Mincho Pro should be installed by Default 
> on MacOS.
> 
> \enableregime[utf] % enable unicoded input
> \definefontfamily [JapaneseFont] [rm] [hiraginominchopro]
> 
> \setupruby[location=top,voffset=-1.6ex, ]
> 
> \starttext \JapaneseFont
> 
> \ruby{僕}{ぼく}はもう\ruby{寝}{ね}る。
> 
> お\ruby{休}{やす}みなさい^_^
> 
> \stoptext
> 
> 
> 
> On Feb. 26 2024, at 9:08 pm, Otared Kavian  wrote:
> Hi all,
> 
> Does anyone have a simple setup of fonts to write a small Japanese document 
> (possibly with furagana) ? I am using MacOS and I have several Japanese fonts 
> on the system.
> I have some old examples which do not typeset correctly now, maybe because 
> they use the old module simplefonts and commands such as \setcjkmainfont and 
> friends.
> 
> Many thanks in advance: Otared
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Japanese

2024-02-26 Thread Emanuel Han via ntg-context
Unfortunately vertical typesetting is not supported by ConTeXt. That's a big 
pity.

If horizontal typesetting is fine, this little working example with furigana 
might give you some hints. Hiragino Mincho Pro should be installed by Default 
on MacOS.
\enableregime[utf] % enable unicoded input
\definefontfamily [JapaneseFont] [rm] [hiraginominchopro]

\setupruby[location=top,voffset=-1.6ex, ]
\starttext \JapaneseFont
\ruby{僕}{ぼく}はもう\ruby{寝}{ね}る。
お\ruby{休}{やす}みなさい^_^
\stoptext

On Feb. 26 2024, at 9:08 pm, Otared Kavian  wrote:
> Hi all,
>
> Does anyone have a simple setup of fonts to write a small Japanese document 
> (possibly with furagana) ? I am using MacOS and I have several Japanese fonts 
> on the system.
> I have some old examples which do not typeset correctly now, maybe because 
> they use the old module simplefonts and commands such as \setcjkmainfont and 
> friends.
>
> Many thanks in advance: Otared
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.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: Japanese

2024-02-26 Thread Hans Hagen

On 2/26/2024 9:08 PM, Otared Kavian wrote:

Hi all,

Does anyone have a simple setup of fonts to write a small Japanese document 
(possibly with furagana) ? I am using MacOS and I have several Japanese fonts 
on the system.
I have some old examples which do not typeset correctly now, maybe because they 
use the old module simplefonts and  commands such as \setcjkmainfont and 
friends.

Many thanks in advance: Otare
there are some files "japanese-*" in the test suite; it boils down to a 
setting up a font and enabling script (because of specific spacing)


Hans

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

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

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


[NTG-context] Re: Japanese

2024-02-26 Thread Henning Hraban Ramm

Am 26.02.24 um 21:08 schrieb Otared Kavian:

Does anyone have a simple setup of fonts to write a small Japanese document 
(possibly with furagana) ? I am using MacOS and I have several Japanese fonts 
on the system.
I have some old examples which do not typeset correctly now, maybe because they 
use the old module simplefonts and  commands such as \setcjkmainfont and 
friends.


Try to replace the simplefonts calls with something like

\definefontfamily[myfonts][rm][SomeFont]
\definefontfamily[myfonts][ss][SomeOtherFont]

\setupbodyfont[myfonts,rm,12pt]

With Latin fonts, it usually works.

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

2024-02-26 Thread Otared Kavian
Hi all,

Does anyone have a simple setup of fonts to write a small Japanese document 
(possibly with furagana) ? I am using MacOS and I have several Japanese fonts 
on the system.
I have some old examples which do not typeset correctly now, maybe because they 
use the old module simplefonts and  commands such as \setcjkmainfont and 
friends.

Many thanks in advance: Otared

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

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


[NTG-context] Re: Memory consumption in new upload

2024-02-17 Thread Hans Hagen

On 2/17/2024 10:50 PM, Shiv Shankar Dayal wrote:
I assume you would have created typescripts for those fonts. Can you 
please add them to

ConTeXt distribution, at least for the popular fonts?


Many of those are covered by typescripts. Those that are not, are on my 
machine because we needed them (often long ago) for a project (these are 
commercial fonts, in most cases typeone and of such a collection 
actually a few were used then). There are also some commercial fonts 
that I got for free. Then there are fonts that I have to check because 
users had an issue (public ones, of different quality and useability). 
Of those 'trying to cover all of unicode with  different fonts of the 
same design' I tested subsets. And of course the fonts that come with 
the operating system (basically all fonts that context can access during 
a run).


We're not going to make typescripts for every combination as in practice 
for most documents one needs a single setup and therefore only a handful 
of lines of code (and likely use some typescript file for a math font). 
There's also the selectfont mechanism that uses heuristics to do the 
same. There are plenty of examples in the distribution and for a 
specific style that demands certain fonts one can also put the 
definitions in the style.


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


The only change I made was that I started using a 9pt modern font
than a 10 pt modern font.

My document decreased from 580+ pages to 500 pages after that.

About your document, I assume you had a lot of Graphics because text
only 180MB is too high.
I have only few diagrams and my file size is only 3MB.

On Sun, Feb 18, 2024 at 2:13 AM Hans Hagen mailto:j.ha...@xs4all.nl>> wrote:

On 2/17/2024 6:17 PM, Shiv Shankar Dayal wrote:
 > Thanks for new upload. I see that memory consumption is much
less than
 > previous version. So
 > once again, thanks a lot.
 >
 > I am curious about what has changed in recent upload, that
memory
 > consumption is about 60% of earlier versions.
it's hard to tell what exact consumpiton is becaue for instance
when lua
creates tables, they grow by factors two when then have to
(maybe 5.5 is
a bit less consuming)

on the one hand luametatex is more efficient than luatex due to
all kind
of ímprovements' but some nodes are larger so that takes more
memory,
which is only noticed when one has lots of text on a page (or keeps
boxes stuff around)

anyway, not that much changed since the previous upload, so
maybe you
just stay below a threshold

I recently generated a 180MB document with 2500 fonts + metapost
outlines of them and that could bump mem usage (with empty
cache) to 30
GB (less after fonts were cached) but normally we stay around
125 MB for
a document. Anyway, tex mem consumption can often be neglected
compared
to other applications.

Hans


-
                                            Hans Hagen | PRAGMA ADE
                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
         tel: 038 477 53 69 | www.pragma-ade.nl
<http://www.pragma-ade.nl> | www.pragma-pod.nl
<http://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 <mailto:ntg-context@ntg.nl> /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
<https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl>
webpage  : https://www.pragma-ade.nl <https://www.pragma-ade.nl>
/ https://context.aanhet.net <https://context.aanhet.net> (mirror)
archive  : https://github.com/contextgarden/context
<https://github.com/contextgarden/context>
wiki     : https://wiki.contextgarden.net
<https://wiki.contextgarden.net>

___



-- 
Respect,

Shiv Shankar Dayal



--
Respect,
Shiv Shankar Dayal

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

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

[NTG-context] Re: An announcement of my new book.

2024-02-15 Thread Tommaso Gordini
Thank you, Mikael,

excellent tutorial, for me.

Ciao
Tommaso

Il giorno gio 15 feb 2024 alle ore 09:29 Mikael Sundqvist 
ha scritto:

> Hi,
>
> This small example from BachoTeX 2023 could perhaps be useful for
> someone: https://github.com/mpsmath/stepbystep
>
> /Mikael
>
> On Thu, Feb 15, 2024 at 8:31 AM Jan Ulrich Hasecke via ntg-context
>  wrote:
> >
> > Hi,
> >
> > Am 14.02.24 um 19:45 schrieb Sir Coleman via ntg-context:
> >
> > I wanted to create more of a reference, a complete reference, and one
> that's of course not meant to be read from cover to cover.
> >
> >
> > I think that setup-en.pdf is a good starting point for a complete
> reference as it contains the commands and their options. With added
> explanations and examples it would be a great reference to beginners.
> >
> > 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
> >
> ___
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.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: An announcement of my new book.

2024-02-15 Thread Mikael Sundqvist
Hi,

This small example from BachoTeX 2023 could perhaps be useful for
someone: https://github.com/mpsmath/stepbystep

/Mikael

On Thu, Feb 15, 2024 at 8:31 AM Jan Ulrich Hasecke via ntg-context
 wrote:
>
> Hi,
>
> Am 14.02.24 um 19:45 schrieb Sir Coleman via ntg-context:
>
> I wanted to create more of a reference, a complete reference, and one that's 
> of course not meant to be read from cover to cover.
>
>
> I think that setup-en.pdf is a good starting point for a complete reference 
> as it contains the commands and their options. With added explanations and 
> examples it would be a great reference to beginners.
>
> 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
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: An announcement of my new book.

2024-02-14 Thread Jan Ulrich Hasecke via ntg-context

Hi,

Am 14.02.24 um 19:45 schrieb Sir Coleman via ntg-context:

I wanted to create more of a reference, a complete reference, and one that's of 
course not meant to be read from cover to cover.



I think that setup-en.pdf is a good starting point for a complete 
reference as it contains the commands and their options. With added 
explanations and examples it would be a great reference to beginners.


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] color profiles

2024-02-07 Thread Henning Hraban Ramm
Hi, I thought I could finally setup color management properly instead of 
converting all print PDFs with Acrobat Pro…


On the wiki, there’s something in https://wiki.contextgarden.net/PDFX; I 
updated it a bit, but we (I?) should combine it with 
https://wiki.contextgarden.net/PDF/A …


How can I add my own profiles to the distributed set in colorprofiles.xml?
Should I provide a colorprofiles.xml or .lua in texmf-local?

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: chronological TOC

2024-01-29 Thread jbf
And indeed this is the best solution I could find, though it obviously 
meant that something like '29 April 2017' was no good for sorting on... 
it has to be the US date format YY-MM-DD


Julian

On 30/1/24 06:15, Wolfgang Schuster wrote:

Henning Hraban Ramm schrieb am 27.01.2024 um 10:05:

Am 26.01.24 um 23:46 schrieb jbf:
I wonder if someone can point me in the right direction for a 
separate TOC which needs to be in chronological order at the back of 
the book (i.e. not in page number order, although I need the page 
numbers to show up in the TOC. There is the normal TOC at the front 
of the book, according to chapter titles.


I have succeeded in defining a separate TOC to place at the back, 
but have not succeeded in the chronological order! Here is what I 
have done:


\definelist[chron][criterium=all,alternative=c]

At the back of the book:

\placelist[chron][criterium=all]

Then at an appropriate point after each \startchapter I have placed 
(as an example):


\writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}

This gives me my list, but in page number order. How do I get the 
date (e.g. 29 April 2017) to be the ordering factor in the list. I 
assume it will be something to do with criterium, but am clueless at 
the moment on how to indicate this.


I don’t know if it works this way (the wizards will know a way), but 
for special needs I’m (ab)using indexes:
just add something like \index[2017-04-29]{Speech, Panama City} to 
your chapter command and setup the index at will.


Lists have a sort option but this is no use here because you can't use 
the title to have a chronological sorted list.


\starttext

\placelist[section][order=title]

\section{Hans}

\section{Peter}

\section{Anton}

\stoptext

Using the register mechanism as you suggest seems to be the best 
option in this case.


Wolfgang
___ 

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


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

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


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

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


[NTG-context] Re: chronological TOC

2024-01-29 Thread Bruce Horrocks
On 29 Jan 2024, at 19:15, Wolfgang Schuster  
wrote:
> 
> Henning Hraban Ramm schrieb am 27.01.2024 um 10:05:
>> Am 26.01.24 um 23:46 schrieb jbf:
>>> I wonder if someone can point me in the right direction for a separate TOC 
>>> which needs to be in chronological order at the back of the book (i.e. not 
>>> in page number order, although I need the page numbers to show up in the 
>>> TOC. There is the normal TOC at the front of the book, according to chapter 
>>> titles.
>>> 
>>> I have succeeded in defining a separate TOC to place at the back, but have 
>>> not succeeded in the chronological order! Here is what I have done:
>>> 
>>> \definelist[chron][criterium=all,alternative=c]
>>> 
>>> At the back of the book:
>>> 
>>> \placelist[chron][criterium=all]
>>> 
>>> Then at an appropriate point after each \startchapter I have placed (as an 
>>> example):
>>> 
>>> \writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}
>>> 
>>> This gives me my list, but in page number order. How do I get the date 
>>> (e.g. 29 April 2017) to be the ordering factor in the list. I assume it 
>>> will be something to do with criterium, but am clueless at the moment on 
>>> how to indicate this.
>> I don’t know if it works this way (the wizards will know a way), but for 
>> special needs I’m (ab)using indexes:
>> just add something like \index[2017-04-29]{Speech, Panama City} to your 
>> chapter command and setup the index at will.
> 
> Lists have a sort option but this is no use here because you can't use the 
> title to have a chronological sorted list.
> 
> \starttext
> 
> \placelist[section][order=title]
> 
> \section{Hans}
> 
> \section{Peter}
> 
> \section{Anton}
> 
> \stoptext
> 
> Using the register mechanism as you suggest seems to be the best option in 
> this case.

The order= mechanism doesn't seem to work for \definelist lists as opposed to 
the built-in ones, viz:

\definelist[chron]
\starttext

\placelist[section][order=title]

\section{Hans}
\writetolist[chron]{}{Hans}

\section{Peter}
\writetolist[chron]{}{Peter}

\section{Anton}
\writetolist[chron]{}{Anton}

\placelist[chron][criterium=all,order=title]
\stoptext


—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] Re: chronological TOC

2024-01-29 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 27.01.2024 um 10:05:

Am 26.01.24 um 23:46 schrieb jbf:
I wonder if someone can point me in the right direction for a separate 
TOC which needs to be in chronological order at the back of the book 
(i.e. not in page number order, although I need the page numbers to 
show up in the TOC. There is the normal TOC at the front of the book, 
according to chapter titles.


I have succeeded in defining a separate TOC to place at the back, but 
have not succeeded in the chronological order! Here is what I have done:


\definelist[chron][criterium=all,alternative=c]

At the back of the book:

\placelist[chron][criterium=all]

Then at an appropriate point after each \startchapter I have placed 
(as an example):


\writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}

This gives me my list, but in page number order. How do I get the date 
(e.g. 29 April 2017) to be the ordering factor in the list. I assume 
it will be something to do with criterium, but am clueless at the 
moment on how to indicate this.


I don’t know if it works this way (the wizards will know a way), but for 
special needs I’m (ab)using indexes:
just add something like \index[2017-04-29]{Speech, Panama City} to your 
chapter command and setup the index at will.


Lists have a sort option but this is no use here because you can't use 
the title to have a chronological sorted list.


\starttext

\placelist[section][order=title]

\section{Hans}

\section{Peter}

\section{Anton}

\stoptext

Using the register mechanism as you suggest seems to be the best option 
in this case.


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 stop

2024-01-27 Thread Hraban Ramm
Just use a group (\start ... \stop, \bgroup ... \egroup or {} ) around 
the setup commands and their table, or use \startsetup mytable ... 
\stopsetup and \startTABLE[setups=mytable] if you need the same settings 
for several tables.


HR

Am 27.01.24 um 22:29 schrieb Joel via ntg-context:
I have a document that uses ~40 different TABLE configurations, each 
with their own special requirements, such as these below, and in 
total, perhaps 2000 tables appear in a file, using one of the 
configurations.


\setupTABLE[r][1][align=raggedleft]
 \setupTABLE[c][1][width=.1\textwidth]
 \setupTABLE[c][2][width=.33\textwidth]
 \setupTABLE[c][3][width=.37\textwidth]
 \setupTABLE[c][4][width=.1\textwidth]
 \setupTABLE[c][5][width=.1\textwidth]
 \setupTABLE[c][1,2,3,4,5][align=raggedleft, frame=off]
 %\setupTABLE[r][2,3,4,5,6,8,9,11,12,14][bottomframe=off]
 \setupTABLE[r][1][bottomframe=on]
                            \bTABLE[split=yes]
                                \bTR\bTD {\it Lesson}  \eTD\bTD {\it 
Time} \\eTD\bTD {\it Date} \eTD\bTD {\it Page} \eTD\eTR

                            \eTABLE

What I've been finding is that previous settings on TABLES appearing 
earlier in the document is impacting later tables. For instance, if 
one has a frame to the right of column 1, then the next table seems to 
acquire this setting as well, even if it isn't expected to have any 
frames at all.


Note that each unique table is defined inside a macro.

How can I make these table settings only apply to the a specific table?

--Joel

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

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

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


[NTG-context] Re: \framed{\externalfigure} vs \externalfigure[frame=on]

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

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

Hi Pablo,

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

I can't disagree with you!  ;-)

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

Thanks for that pointer.

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

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

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

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

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

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


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

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

> I hope it is clear now.

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

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

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

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

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

> I hope it helps,

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

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

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


[NTG-context] Re: \framed{\externalfigure} vs \externalfigure[frame=on]

2024-01-27 Thread Pablo Rodriguez via ntg-context
On 1/27/24 17:44, Jim wrote:
> The wiki page for \setupexternalfigure says
>  "Show frame around image. Most(?) options of \setupframed are usable!"

Hi Jim,

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

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

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

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

> (3) There is a bug in some code.
>
> If anyone would care to enlighten me, I would appreciate it.
>
> In particular, the offset=... option of \externalfigure does not seem to be
> consistent with the offset=... option of \framed.

I hope it is clear now.

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

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

I hope it helps,

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

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


[NTG-context] Re: chronological TOC

2024-01-27 Thread Henning Hraban Ramm

Am 26.01.24 um 23:46 schrieb jbf:
I wonder if someone can point me in the right direction for a separate 
TOC which needs to be in chronological order at the back of the book 
(i.e. not in page number order, although I need the page numbers to show 
up in the TOC. There is the normal TOC at the front of the book, 
according to chapter titles.


I have succeeded in defining a separate TOC to place at the back, but 
have not succeeded in the chronological order! Here is what I have done:


\definelist[chron][criterium=all,alternative=c]

At the back of the book:

\placelist[chron][criterium=all]

Then at an appropriate point after each \startchapter I have placed (as 
an example):


\writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}

This gives me my list, but in page number order. How do I get the date 
(e.g. 29 April 2017) to be the ordering factor in the list. I assume it 
will be something to do with criterium, but am clueless at the moment on 
how to indicate this.


I don’t know if it works this way (the wizards will know a way), but for 
special needs I’m (ab)using indexes:
just add something like \index[2017-04-29]{Speech, Panama City} to your 
chapter command and setup the index at will.


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: \starttable questions

2024-01-26 Thread Jim
On Fri, Jan 26, 2024 at 09:55 (+0100), Aditya Mahajan wrote:

> On Thu, 25 Jan 2024, Jim wrote:

>> The nice thing about your setup above is that it is nice and structured.
>> But if a table calls for some row, column or cell to be treated
>> differently, I guess I am in for some more reading.

> You can do: \setupTABLE[2][3] to select the formatting for row 3 and column 2 
> (or the other way around ... always forget). In the worst case, you can 
> always do 

> ...
> \NC .. \NC[options] ... \NC \NR
> 

> Each cell is just a \framed[...]; so all options for \framed[...] work for 
> Natural Tables. 

Aditya

thanks very much for that information.

I still appreciate the conciseness of the TaBlE macros (and thus
\starttable ... \endtable), but I also appreciate the power of the TABLE
macros.

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

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


[NTG-context] Re: \starttable questions

2024-01-26 Thread Aditya Mahajan
On Thu, 25 Jan 2024, Jim wrote:

> The nice thing about your setup above is that it is nice and structured.
> But if a table calls for some row, column or cell to be treated
> differently, I guess I am in for some more reading.

You can do: \setupTABLE[2][3] to select the formatting for row 3 and column 2 
(or the other way around ... always forget). In the worst case, you can always 
do 

...
\NC .. \NC[options] ... \NC \NR


Each cell is just a \framed[...]; so all options for \framed[...] work for 
Natural Tables. 

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: \starttable questions

2024-01-25 Thread Jim
On Thu, Jan 25, 2024 at 22:22 (+0100), Wolfgang Schuster wrote:

> Jim schrieb am 25.01.2024 um 22:01:
>> Hi Henning,

>> On Thu, Jan 25, 2024 at 17:16 (+0100), Henning Hraban Ramm wrote:

>>> Am 25.01.24 um 16:12 schrieb Jim:
>>> > Hi, I was wondering if anyone here could help me with these three things:
>>> > For a long time I have been using Wichura's TaBle macros (i.e., what one
>>> > gets with
>>> >   \input table
>>> > in plain TeX) and would like to use what appears to be ConTeXt's version 
>>> > of
>>> > those (i.e., what one gets with \starttable ... \stoptable).

>>> > However, https://wiki.contextgarden.net/Command/starttable says
>>> > The environment \starttable ... \stoptable is and (sic) old and
>>> > nearly obsolete way to handle tabular material
>>> > Q1: are there plans to remove \starttable ... \endtable from ConTeXt any
>>> > time "soon", or is that wiki comment gratuitously pessimistic?

>>> Hans suggests to use tabulate as long as it fits.
>> I just gave that a try, using the same syntax as \starttable:

>> \starttable[|c|c|]
>> \HL
>> \VL \bf Year \VL \bf Citizens \VL\SR
>> \HL
>> \VL 1675 \VL ˜428 \VL\FR
>> \VL 1795 \VL 1124 \VL\MR
>> \VL 1880 \VL 2405 \VL\MR
>> \VL 1995 \VL 7408 \VL\LR
>> \HL
>> \stoptable

>> \starttabulate[|c|c|]
>> \HL
>> \VL \bf Year \VL \bf Citizens \VL\SR
>> \HL
>> \VL 1675 \VL ˜428 \VL\FR
>> \VL 1795 \VL 1124 \VL\MR
>> \VL 1880 \VL 2405 \VL\MR
>> \VL 1995 \VL 7408 \VL\LR
>> \HL
>> \stoptabulate

>> While tabulate produced a table with the above input, it needs some work to
>> make the table look good.  (The columns are too narrow, the vrules don't
>> meet the hrules, ...).

>> Perhaps these can be fixed with some tweaking, but I notice that in all of
>> https://wiki.contextgarden.net/Command/starttabulate
>> and
>> https://wiki.contextgarden.net/Tabulate
>> and
>> http://www.ntg.nl/maps/22/28.pdf
>> there is a conspicuous lack of examples with vrules.  And the tables in the
>> (at least) the starttabulate wiki page which use vrules don't use tabulate
>> to create the tables.

>> Coincidence?  I think not.  :-)

> Table which rely on rules to make the content readable have a serious
> problem
> (read Edward Tufte books how you can improve the visual style) but the
> better
> alternative in this case are either natural tables or extreme tables.

> Below is a example which uses the table like wrapper for natural tables
> which makes adding rules and changing the padding around text very
> simple because each table cell is a \framed block with all its options.

> \starttext

> \startsetups[ruledtable]
>   \setupTABLE [frame=off,align=middle,loffset=.5em,roffset=.5em]
>   \setupTABLE [column] [each]  [leftframe=on,rightframe=on]
>   \setupTABLE [row]    [first]
> [topframe=on,bottomframe=on,foregroundstyle=bold]
>   \setupTABLE [row]    [last]  [bottomframe=on]
> \stopsetups

> \startTABLE[setups=ruledtable]
> \NC Year \NC Citizens \NC\NR
> \NC 1675 \NC ˜428 \NC\NR
> \NC 1795 \NC 1124 \NC\NR
> \NC 1880 \NC 2405 \NC\NR
> \NC 1995 \NC 7408 \NC\NR
> \stopTABLE

> \stoptext

Wolfgang,

thanks for the response and the sample code.

[ Note to anyone else trying out this example: there are non-breakable
  spaces above, and depending on your system if you copy and paste them
  into a file, they will cause this code to fail.  ]


I won't argue with you about readability of tables, but if I am typesetting
something for someone and they want it a certain way, I don't want to get
into an argument about it with them either.  :-)


The nice thing about your setup above is that it is nice and structured.
But if a table calls for some row, column or cell to be treated
differently, I guess I am in for some more reading.

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

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


[NTG-context] Re: font error in float placement?

2024-01-14 Thread Bruce Horrocks
On 13 Jan 2024, at 20:29, Henning Hraban Ramm  wrote:
> 
> Am 13.01.24 um 21:09 schrieb Henning Hraban Ramm:
>>> Here’s the image:
>>> https://yemaya.fiee.net/s/8TqwfcP7mLMmy9p
>>> (In a simple document it works.)
>> I found a workaround: I opened the file with Inkscape and converted 
>> everything in curves. The PDF is even smaller now, and it proves that the 
>> problem was with the fonts. Saving it in Acrobat Pro didn’t help.
>> BTW the "compact" settings didn’t change anything for my big songbook 
>> (hundreds of note line PDFs with included fonts); I’m not sure about the 
>> code examples in my ConTeXt book.
> 
> I found more graphics (PDFs with included fonts) that triggered the error, 
> one of them a LilyPond example that was no problem in the songbook.
> Something in my ConTeXt book setup causes a different handling of these 
> externalfigures – but a small example with the same environments worked.

Whenever I've had odd results like this it's been the result of an accumulation 
of 'small' errors. For example, I once had a missing } in a macro in an 
environment file. For whatever reason, it didn't trigger an immediate end to 
the compilation run and a product with one or two components (using that 
environment) didn't trigger odd behaviour. But once all components were 
included then the odd behaviours started happening.

—
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: font error in float placement?

2024-01-13 Thread Henning Hraban Ramm

Am 13.01.24 um 21:09 schrieb Henning Hraban Ramm:

Here’s the image:
https://yemaya.fiee.net/s/8TqwfcP7mLMmy9p
(In a simple document it works.)


I found a workaround: I opened the file with Inkscape and converted 
everything in curves. The PDF is even smaller now, and it proves that 
the problem was with the fonts. Saving it in Acrobat Pro didn’t help.


BTW the "compact" settings didn’t change anything for my big songbook 
(hundreds of note line PDFs with included fonts); I’m not sure about the 
code examples in my ConTeXt book.


I found more graphics (PDFs with included fonts) that triggered the 
error, one of them a LilyPond example that was no problem in the songbook.
Something in my ConTeXt book setup causes a different handling of these 
externalfigures – but a small example with the same environments worked.


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

2024-01-13 Thread Wolfgang Schuster

Ali Ali schrieb am 08.01.2024 um 23:53:

Since in the "setup-en.pdf" on p. 234, in "\setuplayout" the possible values for "grid" key is 
"yes", "no" (default), and "off" respectively.


The commands in the document are not always up to date and somtimes miss 
entries or list no longer valid ones, in this case the NAME placeholder 
is missing.



So what does the "yes " (with a trailing space) sets "grid" key to?


The expected behavior is to ignore invalid arguments and fall back to a 
default (in this case "no")option.


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: Setuphead issue!

2024-01-09 Thread Mikael Sundqvist
Hi,

On Tue, Jan 9, 2024 at 2:45 PM G.C.H.M. Verhaag via ntg-context
 wrote:
>
> Hi,
> The example below works as expected, but within my product it doesn't.
>
> % Subject example before and after!
>
> \setuphead[subject][color=limegreen,before={\blank[none]},after={\blank[none]},align={flushleft,nothyphenated,tolerant}]
>
> \starttext
> A paragraph before calling the subject.
>
> \subject{\sc The subject}
>
> A paragrapf after the subject was called.
> \stoptext
>
> I use the \subject command within a columnset, could that be the problem?

Take the file that is not working. Comment out as much as possible,
but so that you still have something that gives unexpected output. A
sample file that gives correct output is not so easy to help from.

/Mikael

PS The \sc could go into the style= in the setup.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2024-01-08 Thread Ali Ali
Since in the "setup-en.pdf" on p. 234, in "\setuplayout" the possible values 
for "grid" key is "yes", "no" (default), and "off" respectively.

So what does the "yes " (with a trailing space) sets "grid" key to?

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

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


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

2024-01-08 Thread Hans Hagen

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

Hi,

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

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

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


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

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


Here you set the grid variable to "yes".


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


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


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

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

\stoptext

So this is ok:

\setupfoo
 [a=A,
  b=B]

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

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


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

as nested brackets are handled.

Hans

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

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

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


[NTG-context] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2024-01-08 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 show-gra-1.htm
 show-gra-10.htm
 show-gra-11.htm
 show-gra-12.htm
 show-gra-13.htm
 show-gra-14.htm
 show-gra-15.htm
 show-gra-16.htm
 show-gra-17.htm
 show-gra-18.htm
 show-gra-19.htm
 show-gra-2.htm
 show-gra-20.htm
 show-gra-21.htm
 show-gra-22.htm
 show-gra-23.htm
 show-gra-24.htm
 show-gra-25.htm
 show-gra-26.htm
 show-gra-27.htm
 show-gra-28.htm
 show-gra-29.htm
 show-gra-3.htm
 show-gra-4.htm
 show-gra-5.htm
 show-gra-6.htm
 show-gra-7.htm
 show-gra-8.htm
 show-gra-9.htm
 show-gra.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 general/manuals/
 general/manuals/colors-mkiv.pdf
 general/manuals/luametatex.pdf
 general/manuals/ontarget.pdf
 general/manuals/primitives.pdf
 general/manuals/sql-mkiv.pdf
 general/qrcs/
 general/qrcs/setup-mapping-de.pdf
 general/qrcs/setup-mapping-en.pdf
 general/qrcs/setup-mapping-fr.pdf
 general/qrcs/setup-mapping-it.pdf
 general/qrcs/setup-mapping-nl.pdf
 
 sent 234,726 bytes  received 76,243,717 bytes  4,635,057.15 bytes/sec
 total size is 577,881,441  speedup is 7.56


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2024-01-08.12
245335154   
/var/www/aanhet.net/context//htdocs/archives/context-2024-01-08.12/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2024-01-08.12/current
372084567   
/var/www/aanhet.net/context//htdocs/archives/context-2024-01-08.12
372084567   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2023-12-13 Thread Henning Hraban Ramm

Am 13.12.23 um 19:09 schrieb Floris van Manen via ntg-context:



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


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


https://lecture.senfcall.de/gdpr/consent?url=https://lecture.senfcall.de/hen-rbr-rku-oke#
gets blocked by firefox on Linux due to Content-Security-Policy


I’m sorry, but it works for others.
My Firefox is setup very strictly, there’s no problem with ad blockers etc.
I don’t think it’s a browser problem.
Are you behind a proxy?

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

2023-12-11 Thread Henning Hraban Ramm

Am 10.12.23 um 13:24 schrieb Henning Hraban Ramm:
Usually I’d prefer “vulgar fractions”, but \vulgarfraction looks 
“horrible” in comparison to the few usual fractions contained in fonts 
(like ½ & ¾).


I take this back: I had a problem in my font setup.
Usually, \vulgarfraction is quite okay.

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

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

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

Hi,

Here’s a MWE:

\setupinterlinespace[line=3ex]

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

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

\usemodule[ipsum]

\starttext

\ipsum

\stoptext

And I attach the two files to setup the font.

no math ... anyway

\showglyphs

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

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

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

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


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

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

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


[NTG-context] Re: Inline math spacing

2023-12-03 Thread Alexandre Christe
Hi,

Here’s a MWE:

\setupinterlinespace[line=3ex]

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

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

\usemodule[ipsum]

\starttext

\ipsum

\stoptext

And I attach the two files to setup the font.

A. Christe
Le 3 déc. 2023 à 22:44 +0100, Hans Hagen , a écrit :
> On 12/3/2023 10:31 PM, Alexandre Christe wrote:
> > Dear list,
> >
> > I’m facing some strange spacing with inline maths. Sometimes the space
> > is ok (like around the first two fractions), but sometimes it is way too
> > little. Do I miss to configure something?
> your spacing is little between words too .. hard to tell without MWE
>
> Hans
>
> -
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___


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


type-imp-alegreya_libertinus.mkiv
Description: Binary data
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: unwanted blank page

2023-11-19 Thread madiazm . eoicc
sorry if i dont get your problem right understood, but i'm completely new to 
context.

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

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

%%
%%% LOS BLOQUES %
%%%

\definesectionblock[portada][number=no]

\defineconversionset
[portada:pagenumber][][characters]
\defineconversionset
[frontpart:pagenumber][][romannumerals]
\defineconversionset
[bodypart:pagenumber][][numbers]
\defineconversionset
[appendixpart:pagenumber][][Characters]



%%%
%%% NUMERACIÓN DE PÁGINAS, SETUP %
%%%
\setuppagenumbering[alternative=doublesided,location={footer,inmargin}]

\setupuserpagenumber[way=byblock] 



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

\startfrontmatter[] 
\start
  \setuplayout[reset]
  \setupinterlinespace[.8ex]
  \completecontent
\stop
  \stopfrontmatter

  \startbodymatter[]
  
\input{50_Evaluacion.tex}%a piece of text
   
  \stopbodymatter

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

2023-11-19 Thread Henning Hraban Ramm

Am 19.11.23 um 13:27 schrieb Miguel Diaz:
1. Why are the lines printed one over the other when grid=no? how do 
profis then use context without grid?


That usually only happens in one of the column modes that requires the 
grid. It doesn’t happen in usual one-column typesetting. There must be 
something wrong in your setup.


Please make a minimal example (MWE).

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


AFAIK, the details manual is the only documentation for 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: Adobe Source Typescript With Design Sizes

2023-11-03 Thread Hans Hagen

On 11/2/2023 9:00 PM, Vincent Hennebert wrote:

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


they are not really design sizes but more 'designed for s specific 
purpose like display' .. so typesetting a 16 pt bodyfont in display is 
not a good idea ... otherwise, if someone watched the text on a beamer 
you'd have to use the display variant for everything as that definitely 
goes over 10pt


I think I see your point. I think we can still talk about design sizes 
but, instead of thinking in absolute sizes, we would want to think in 
sizes relative to the font setup.


indeed, and even more abstract: running text vs headings vs title pages

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


i'm not sure what captions are for

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


Make sense?


posters stil can use regular but with a screaming bolder and darker 
looking title in display (although often display doesn't look that good)

 Hans


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

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

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


[NTG-context] Re: Adobe Source Typescript With Design Sizes

2023-11-02 Thread Vincent Hennebert

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

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

Hello there,

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


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


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


- attached a different approach


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



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


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



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


I think I see your point. I think we can still talk about design sizes 
but, instead of thinking in absolute sizes, we would want to think in 
sizes relative to the font setup.


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


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


Make sense?

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




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


maybe a side effect of not defining a math font


About Adobe Source
==

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


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


Usage
=

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


 \setupbodyfont[adobesource]

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


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


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


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



Questions For the Experts
=

To avoid a gigantic typescript file with a lot of duplication, I 
offloaded the font filename calculation to a Lua function (see 
attached adobesource.lua). I initially wanted to put the Lua code 
inside the typescript, but then I had all sorts of weird Lua 
compilation errors. The very same code works fine when included in a 
normal document though. Could

[NTG-context] Re: Adobe Source Typescript With Design Sizes

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

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

Hello there,

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


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


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


- attached a different approach

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


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



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


maybe a side effect of not defining a math font


About Adobe Source
==

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


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


Usage
=

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


     \setupbodyfont[adobesource]

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


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


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


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



Questions For the Experts
=

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


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


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


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

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


What’s Next
===

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



Thanks,
Vincent

___
If your question

[NTG-context] Re: colors for links

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

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

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

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

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


Many thanks for your reply, Hans.

I apologize for my poor explanation of the issue.

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

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

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

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

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


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



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

>

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


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



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


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


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

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

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


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



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

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


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



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


indeed


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


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



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


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


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


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



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


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



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


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


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


[NTG-context] Re: colors for links

2023-10-14 Thread Pablo Rodriguez
On 10/14/23 14:19, Hans Hagen via ntg-context wrote:
> On 10/12/2023 3:14 PM, Pablo Rodriguez wrote:
>> […]
>> I see that the directive for link borders only allows one color for
>> links per document.

Many thanks for your reply, Hans.

I apologize for my poor explanation of the issue.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Many thanks for your help again.

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

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

[NTG-context] bibliography questions

2023-10-02 Thread Henning Hraban Ramm


My example is setup as advised in the manual:

"""
%\mainlanguage[de]
\usebtxdataset[beispiel][bib_example.bib]
\setupbtx[dataset=beispiel]
%\usebtxdefinitions[apa]
\definebtxrendering[beispiel][apa][dataset=beispiel,group=beispiele]

\starttext
\placelistofpublications[beispiel]

\cite[authoryear] [WiFo2010]

\cite[authoryear] [rattenhka]

\stoptext
"""

But I get the error message:

"""
system  > error: invalid parent apa for beispiel, apa defined 
too (best check it)
system  > error: invalid parent btx:apa for btx:beispiel, 
btx:apa defined too (best check it)

"""

Are these messages wrong? And why do they come from "system" and not 
from "publications"?



My minimal example works anyway, still investigating why it doesn’t in 
my book.



Another question:

Consider:
@Book {rattenhka,
author = "Bettina von Arnim and Gisela von Arnim",
title = "Das Leben der Hochgräfin Gritta von Rattenzuhausbeiuns",
…
}

The authors are usually given as “Bettina and Gisela von Arnim” (mother 
and daughter; similar “Jacob and Wilhelm Grimm” as brothers or “Bettina 
and Achim von Arnim” as a couple) – is there a good solution for related 
authors?


Hraban
@Book {WiFo2010,
title = "Lesetypografie",
author = "Willberg, Hans Peter and Forssman, Friedrich",
publisher = "Hermann Schmidt",
address = "Mainz",
year = "2010",
  language = "german",
keywords = "typography",
}

@Book {kgdz,
author = "Stephen Hawking and Leonard Mlodinow",
title = "Die kürzeste Geschichte der Zeit",
title:en = "A Briefer History of Time",
publisher = "Rowohlt",
address = "Reinbek",
year = "2005",
language = "german",
keywords = "physics;astromy;time",
}

@Book {rattenhka,
author = "Bettina von Arnim and Gisela von Arnim",
title = "Das Leben der Hochgräfin Gritta von Rattenzuhausbeiuns",
editor = "Otto Mallon",
publisher = "S. Martin Fraenkel",
address = "Berlin",
year = "1926",
language = "german",
keywords = "novel;historical",
}
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: wiki update: Modules

2023-10-02 Thread Henning Hraban Ramm

Am 02.10.23 um 04:00 schrieb Andres Conrado Montoya:
In the wiki, if I click a link to check a source code file (for example 
https://source.contextgarden.net/tex/context/base/mkiv/m-catchword.mkiv 
<https://source.contextgarden.net/tex/context/base/mkiv/m-catchword.mkiv>) I get a blank page with a very long list of source files on the left. If I search for the file with my browser's ctrl+f on that page, it returns zero results. I'm using Chrome. It happens for every link to source files.


Not sure if it's a problem with my setup, but I have noticed that 
before, in different machines. Can anybody else confirm if they can 
correctly see the source files when clicking the links?


Sorry, I used the general {{src|filename}} template in the wiki, that 
links to the source browser, but only to files in tex/context/base but 
not to the modules in tex/context/modules

Not a problem on your side, I just need to fix the links.

Otherwise you can use the search field of the source browser.

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

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

[NTG-context] Re: wiki update: Modules

2023-10-01 Thread Andres Conrado Montoya
In the wiki, if I click a link to check a source code file (for example
https://source.contextgarden.net/tex/context/base/mkiv/m-catchword.mkiv) I
get a blank page with a very long list of source files on the left. If I
search for the file with my browser's ctrl+f on that page, it returns zero
results. I'm using Chrome. It happens for every link to source files.

Not sure if it's a problem with my setup, but I have noticed that
before, in different machines. Can anybody else confirm if they can
correctly see the source files when clicking the links?

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

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


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

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

[NTG-context] Re: \setupitemgroup for footnotes

2023-09-26 Thread Pablo Rodriguez
On 9/25/23 21:57, Henning Hraban Ramm wrote:
> Am 25.09.23 um 19:19 schrieb Pablo Rodriguez:
>> On 9/25/23 18:19, Henning Hraban Ramm wrote:
>>> Am 25.09.23 um 17:52 schrieb Pablo Rodriguez:
>>>> [...]
>>>> Excuse my ignorance, but which is the right way to get the itemize setup
>>>> only for footnotes?
>>>
>>> I would use \defineitemgroup to define your own, like "footnoteitemize".
>>
>> Many thanks for your reply, Hraban.
>>
>> It works fine, but I wonder why the itemize itemgroup should be avoided.
>
> I didn’t say you should avoid it; defining your own version was just the
> first idea that I had – and apparently it wasn’t a bad idea.

Sorry, Hraban, your proposal works perfectly fine and I really
appreciate it.

It was only me the one that had the impression that standard itemize has
be avoided in footnotes (to get \setupitemgroup working there).

> I’m sure there are several other approaches.

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

[NTG-context] Re: \setupitemgroup for footnotes

2023-09-25 Thread Henning Hraban Ramm

Am 25.09.23 um 19:19 schrieb Pablo Rodriguez:

On 9/25/23 18:19, Henning Hraban Ramm wrote:

Am 25.09.23 um 17:52 schrieb Pablo Rodriguez:

[...]
Excuse my ignorance, but which is the right way to get the itemize setup
only for footnotes?


I would use \defineitemgroup to define your own, like "footnoteitemize".


Many thanks for your reply, Hraban.

It works fine, but I wonder why the itemize itemgroup should be avoided.


I didn’t say you should avoid it; defining your own version was just the 
first idea that I had – and apparently it wasn’t a bad idea.


I’m sure there are several other approaches.

Hraban

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

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

[NTG-context] Re: \setupitemgroup for footnotes

2023-09-25 Thread Pablo Rodriguez
On 9/25/23 18:19, Henning Hraban Ramm wrote:
> Am 25.09.23 um 17:52 schrieb Pablo Rodriguez:
>> [...]
>> Excuse my ignorance, but which is the right way to get the itemize setup
>> only for footnotes?
>
> I would use \defineitemgroup to define your own, like "footnoteitemize".

Many thanks for your reply, Hraban.

It works fine, but I wonder why the itemize itemgroup should be avoided.

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


[NTG-context] Re: \setupitemgroup for footnotes

2023-09-25 Thread Henning Hraban Ramm

Am 25.09.23 um 17:52 schrieb Pablo Rodriguez:

Dear list,

I have the following sample (with current latest from 2023.09.18 21:13):

 \setuppapersize[A6]
 \starttext
 \startsetups[forfootnote]
 \setupitemgroup
[itemize][1]
[   before={\endgraf{\ttbf[before]}\endgraf},
 after={\endgraf{\ttbf [after]}\endgraf}]
 \stopsetups

 \setupnote[footnote][setups=forfootnote]

 \footnote{\startitemize
  \startitem Choose the correct answer.
  \startitemize
  \item This one
  \stopitemize
  \stopitem
 \stopitemize}
 \stoptext

Excuse my ignorance, but which is the right way to get the itemize setup
only for footnotes?


I would use \defineitemgroup to define your own, like "footnoteitemize".

https://wiki.contextgarden.net/Command/defineitemgroup

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

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


[NTG-context] \setupitemgroup for footnotes

2023-09-25 Thread Pablo Rodriguez
Dear list,

I have the following sample (with current latest from 2023.09.18 21:13):

\setuppapersize[A6]
\starttext
\startsetups[forfootnote]
\setupitemgroup
   [itemize][1]
   [   before={\endgraf{\ttbf[before]}\endgraf},
after={\endgraf{\ttbf [after]}\endgraf}]
\stopsetups

\setupnote[footnote][setups=forfootnote]

\footnote{\startitemize
 \startitem Choose the correct answer.
 \startitemize
 \item This one
 \stopitemize
 \stopitem
\stopitemize}
\stoptext

Excuse my ignorance, but which is the right way to get the itemize setup
only for footnotes?

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


[NTG-context] Re: XML: flush to lua function

2023-09-12 Thread Taco Hoekwater
Hi,

xml.text(t) is safer than directly accessing t.dt[1].

Note: you may need to strip some XML tags from that content. 

If the element is not straight-up data but has nested elements, then this will 
return the full xml representation instead:

 A short title=> ‘A short title'
 A short title=> ‘'
 A short title => 'A short 
title'


Best wishes,
Taco

> On 12 Sep 2023, at 08:56,   wrote:
> 
> Ok, I’ve found a way, see below.
> But maybe someone has some nice lua (or other) tricks to share… (I’m not sure 
> accessing t.dt[1] is particularly safe when operating on nested structures.)
>  Best,
> Denis
>  \startbuffer[test]
> 
> 
> 
> A short title
> asdf asdf asdf jklö jklö jklö
>   
>   
> A longer title bla bla bla bla bla bla bla bla
> 
> asdf asdf asdf jklö jklö jklö
> 
>   
> 
> \stopbuffer
>  \startxmlsetups xml:test
> \xmlsetsetup{#1}{*}{-}
> \xmlsetsetup{#1}{doc|chapter|p}{xml:*}
> \stopxmlsetups
>  \xmlregisterdocumentsetup{test}{xml:test}
>  \startxmlsetups xml:doc
>\xmlflush{#1}
> \stopxmlsetups
>  \setuphead[chapter][expansion=yes] % make sure the stuff gets expanded on 
> time
> \startxmlsetups xml:chapter
> \startchapter
>[
>
> title={\xmlfilter{#1}{/title/command(xml:chapter:title)}},
>
> marking={\xmlfilter{#1}{/title/command(xml:chapter:title:marking)}},
>]
>\xmlflush{#1}
> \stopchapter
> \stopxmlsetups
>  \startxmlsetups xml:p
> \xmlflush{#1}\par
> \stopxmlsetups
>  \startluacode
> function xml.functions.getMarking(t)
> _,n = t.dt[1]:gsub("%S+","")
> if n > 10 then   local words = {} 
>   for word in t.dt[1]:gmatch("%S+") do table.insert(words, word) end
>   local resWords = {}
>   resWords =  { unpack( words, 1, 7 ) }
>   res = table.concat(resWords, " ") .. " …"
> else   res = t.dt[1]
> end
> context(res)
> end
> \stopluacode
>  \startxmlsetups xml:chapter:title:marking
> \xmlfunction{#1}{getMarking}
> \stopxmlsetups
>  \startxmlsetups xml:chapter:title
> \xmlflush{#1}
> \stopxmlsetups
>   \setupheadertexts[chapter]
>  \starttext
>  \xmlprocessbuffer{test}{test}{}
>  \stoptext
>   Von: denis.ma...@unibe.ch  
> Gesendet: Montag, 11. September 2023 16:47
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] XML: flush to lua function
>  Hi,
> I have the following xml setup with a lua function:
>  \startluacode
> function markingLength(s)
> _,n = s:gsub("%S+","")
> if n > 3 then context("yes" .. " …") else 
> context("no") end
> end
> \stopluacode
>  \startxmlsetups xml:ink:ink-title:marking
> %\ctxlua{markingLength(\xmlflush{#1})}  % does not work
> \ctxlua{markingLength{"1 2 3 4"}}
> \stopxmlsetups
>  While the function works, I cannot use xmlflush here. How can I properly 
> pass the xml content to the lua function?
>  Best,
> Denis
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___


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


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

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

[NTG-context] Re: XML: flush to lua function

2023-09-12 Thread denis.maier
Ok, I've found a way, see below.
But maybe someone has some nice lua (or other) tricks to share... (I'm not sure 
accessing t.dt[1] is particularly safe when operating on nested structures.)

Best,
Denis

\startbuffer[test]



A short title
asdf asdf asdf jklö jklö jklö
  
  
A longer title bla bla bla bla bla bla bla bla

asdf asdf asdf jklö jklö jklö

  

\stopbuffer

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{doc|chapter|p}{xml:*}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

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

\setuphead[chapter][expansion=yes] % make sure the stuff gets expanded on time
\startxmlsetups xml:chapter
\startchapter
   [
   
title={\xmlfilter{#1}{/title/command(xml:chapter:title)}},
   
marking={\xmlfilter{#1}{/title/command(xml:chapter:title:marking)}},
   ]
   \xmlflush{#1}
\stopchapter
\stopxmlsetups

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

\startluacode
function xml.functions.getMarking(t)
_,n = t.dt[1]:gsub("%S+","")
if n > 10 then
  local words = {}
  for word in t.dt[1]:gmatch("%S+") do table.insert(words, 
word) end
  local resWords = {}
  resWords =  { unpack( words, 1, 7 ) }
  res = table.concat(resWords, " ") .. " ..."
else
  res = t.dt[1]
end
context(res)
end
\stopluacode

\startxmlsetups xml:chapter:title:marking
\xmlfunction{#1}{getMarking}
\stopxmlsetups

\startxmlsetups xml:chapter:title
\xmlflush{#1}
\stopxmlsetups


\setupheadertexts[chapter]

\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext


Von: denis.ma...@unibe.ch 
Gesendet: Montag, 11. September 2023 16:47
An: ntg-context@ntg.nl
Betreff: [NTG-context] XML: flush to lua function

Hi,
I have the following xml setup with a lua function:

\startluacode
function markingLength(s)
_,n = s:gsub("%S+","")
if n > 3 then
context("yes" .. " ...") else context("no") end
end
\stopluacode

\startxmlsetups xml:ink:ink-title:marking
%\ctxlua{markingLength(\xmlflush{#1})}  % does not work
\ctxlua{markingLength{"1 2 3 4"}}
\stopxmlsetups

While the function works, I cannot use xmlflush here. How can I properly pass 
the xml content to the lua function?

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

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

[NTG-context] XML: flush to lua function

2023-09-11 Thread denis.maier
Hi,
I have the following xml setup with a lua function:

\startluacode
function markingLength(s)
_,n = s:gsub("%S+","")
if n > 3 then
context("yes" .. " ...") else context("no") end
end
\stopluacode

\startxmlsetups xml:ink:ink-title:marking
%\ctxlua{markingLength(\xmlflush{#1})}  % does not work
\ctxlua{markingLength{"1 2 3 4"}}
\stopxmlsetups

While the function works, I cannot use xmlflush here. How can I properly pass 
the xml content to the lua function?

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

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

[NTG-context] Re: how to define an environment with key=value arguments

2023-09-09 Thread Henning Hraban Ramm

Am 08.09.23 um 19:37 schrieb Henning Hraban Ramm:

But it uses its own page size, I don’t understand why. I need the 
bleed/trim area.


If I use \setlayer in the setup, the content gets placed on the next 
page, i.e. under the text.


\structureuservariable{image} in the setup gets the value from the 
_next_ chapter. Maybe the approach in from the source with

\dummyparameter\c!name
would work better, but I don’t know how to transfer it.


I gave up, ran into too many problems.

Tried to avoid injections and put everything in before/beforesection 
macros, but \structureuservariable there also always picks up the values 
from the next chapter (while I would expect the current or maybe the 
previous).


So I copy-pasted the whole bunch of ugly commands in front of every 
chapter, and it works.


It’s only for one book with 18 chapters, doesn’t make much sense to 
spend even more time on a more elegant solution.


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

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

[NTG-context] Re: how to define an environment with key=value arguments

2023-09-08 Thread Henning Hraban Ramm

Am 08.09.23 um 17:02 schrieb Henning Hraban Ramm:
We can discuss the details next week and you put the resulting 
template on the wiki.


Ah, I guess I understand the template mechanism. Yet again glorious 
setups. Will probably manage.


So far:

\definepageinjection[chapter:start][
  page=left,
  alternative=setups,
  setups=frontispiz,
  color=white,
  background=color,
  backgroundcolor=Eifel,
]

\startsetups[frontispiz]
\starttransparent[tlumi]%
\externalfigure[\structureuservariable{image}][
  width=\measure{MaxWidth},
]%
\stoptransparent%
\stopsetups

\setuphead[chapter][
  page=right,
  style=\ChapterFont,
  beforesection={\pageinjection[chapter:start]},
  command=\ChapterStart,
  before={\startcolumnset[Spalten]},
  after={\vskip-\lineheight}, % fix column start
  inbetween=,
  aftersection={\stopcolumnset},
]

\startchapter[title={Prolog 2: Reiseführer}][
  motto={(quotation.}}, % used in \ChapterStart
  image={00 Lavakeller Mendig g}, % wrong
  blank=2,
]


Not a MWE, I know.
Here’s a screenshot:
https://yemaya.fiee.net/s/G2NcwE8qQrLAx8B

(Funny, I never needed all of before, after, beforesection and 
aftersection so far.)


The injection is a frame, that’s great, because I can set the 
background, and \externalfigure starts at (0,0).


But it uses its own page size, I don’t understand why. I need the 
bleed/trim area.


If I use \setlayer in the setup, the content gets placed on the next 
page, i.e. under the text.


\structureuservariable{image} in the setup gets the value from the 
_next_ chapter. Maybe the approach in from the source with

\dummyparameter\c!name
would work better, but I don’t know how to transfer 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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: ifxmlselfempty

2023-09-04 Thread Hans van der Meer via ntg-context
I changed this in the source of lxml-ini.lua (line 225). It seems the 'not' has been accidentally crept in (from  copying that line in ifxmlempty, the item above?)Anyway, remade the format and now the result is as I expected it to be. See below in the output of the MWE from my first post on this subject. I added the relevant portion of the code for clarity.I am sure the next update will reflect it in the source ;-)dr. Hans van der Meer   implement {        name      = "ifxmlselfempty",        public    = true,        usage     = "condition",        arguments = "argument",        actions   = function(id)--            return boolean_code, not checkedempty(getid(id)) and true            return boolean_code, checkedempty(getid(id)) and true        end    }

xmlsetup-template.pdf
Description: Adobe PDF document
On 4 Sep 2023, at 10:05, denis.ma...@unibe.ch wrote:IDK. But why do have a setup for , which does not appear in your xml source (shouldn’t it be ?)?  Von: Hans van der Meer via ntg-context <ntg-context@ntg.nl> Gesendet: Sonntag, 3. September 2023 14:11An: NTG ConTeXt <ntg-context@ntg.nl>Cc: Hans van der Meer <havdm...@ziggo.nl>Betreff: [NTG-context] ifxmlselfempty Is it possible that  the new \ifxmlselfempty has reversed its outcome? Or did I something wrong in this MWE?Here an MWE. yours sincerelydr. Hans van der Meer   \startbuffer[test]!not empty node!\stopbuffer \startxmlsetups xml:mysetups   \xmlsetsetup{\xmldocument}{something|emptynode|notemptynode}{xml:*}\stopxmlsetups \xmlregistersetup{xml:mysetups} \startxmlsetups xml:emptynodenode=\xmltag{#1}:\crlfifxmlselfempty-else-fi:\space\ifxmlselfempty{#1}attribute = \xmlatt{#1}{value}\elsecontent = \xmlflush{#1}\fi\crlfifxmlselfempty-else-fi reversed:\space\ifxmlselfempty{#1}content = \xmlflush{#1}\elseattribute = \xmlatt{#1}{value}\fi\blank\stopxmlsetups \startxmlsetups xml:notemptynodenode=\xmltag{#1}:\crlfifxmlselfempty-else-fi:\space\ifxmlselfempty{#1}attribute = \xmlatt{#1}{value}\elsecontent = \xmlflush{#1}\fi\crlfifxmlselfempty-else-fi reversed:\space\ifxmlselfempty{#1}content = \xmlflush{#1}\elseattribute = \xmlatt{#1}{value}\fi\blank\stopxmlsetups \startxmlsetups xml:something\xmlall{#1}{./emptynode}\blank\xmlall{#1}{./notemptynode}\blank\stopxmlsetups \starttext\ConTeXt\ \contextversion\blank   \xmlprocessbuffer{main}{test}{}\stoptext___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Trimming (rearranging) long section name

2023-09-04 Thread Wolfgang Schuster

Lukas via ntg-context schrieb am 04.09.2023 um 13:33:

Hello,

just

"
\setuphead[section][distance=1.25em]
\setuphead[section][style=\bfc]
"

Lukas


On 2023-09-04 11:25, Henning Hraban Ramm wrote:

Am 04.09.23 um 13:06 schrieb Lukas via ntg-context:

IOW to force the word "stavby" not to cross the right border (see the
green vertical line) but to appear on the next line?

I played with "strict", "verytolerant" and similar options but they 
seem

not to affect section titles.


What’s your section setup, esp. the align settings?


Please try to provide a *working* minimal example the next time, 
otherwise we have

to fill the missing parts (\starttext ... \stoptext).

\mainlanguage[cz]

\setuphead
  [section]
  [distance=1.25em,
   style=\bfc,
   align={flushleft,broad,nothyphenated}]

\setupbodyfont[8pt]

\starttext

\chapter{Dummy}

\samplefile{lorem}

\section{Specifické požadavky pro předpokládanou technologii stavby 
(přístupy, přívody el. energie, skladovací plochy, montážní a pomocné 
plochy, montážní a pomocné konstrukce, ...)}


\stoptext

Wolfgang

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

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

[NTG-context] Re: Trimming (rearranging) long section name

2023-09-04 Thread Lukas via ntg-context

Hello,

just

"
\setuphead[section][distance=1.25em]
\setuphead[section][style=\bfc]
"

Lukas


On 2023-09-04 11:25, Henning Hraban Ramm wrote:

Am 04.09.23 um 13:06 schrieb Lukas via ntg-context:

IOW to force the word "stavby" not to cross the right border (see the
green vertical line) but to appear on the next line?

I played with "strict", "verytolerant" and similar options but they 
seem

not to affect section titles.


What’s your section setup, esp. the align settings?

Hraban

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

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

[NTG-context] Re: Trimming (rearranging) long section name

2023-09-04 Thread Henning Hraban Ramm

Am 04.09.23 um 13:06 schrieb Lukas via ntg-context:

IOW to force the word "stavby" not to cross the right border (see the
green vertical line) but to appear on the next line?

I played with "strict", "verytolerant" and similar options but they seem
not to affect section titles.


What’s your section setup, esp. the align settings?

Hraban

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

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

[NTG-context] Re: ifxmlselfempty

2023-09-04 Thread denis.maier
IDK. But why do have a setup for , which does not appear in your xml 
source (shouldn't it be ?)?


Von: Hans van der Meer via ntg-context 
Gesendet: Sonntag, 3. September 2023 14:11
An: NTG ConTeXt 
Cc: Hans van der Meer 
Betreff: [NTG-context] ifxmlselfempty

Is it possible that  the new \ifxmlselfempty has reversed its outcome? Or did I 
something wrong in this MWE?
Here an MWE.

yours sincerely
dr. Hans van der Meer



\startbuffer[test]


!not empty node!

\stopbuffer

\startxmlsetups xml:mysetups
   \xmlsetsetup{\xmldocument}{something|emptynode|notemptynode}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetups}

\startxmlsetups xml:emptynode
node=\xmltag{#1}:\crlf
ifxmlselfempty-else-fi:\space
\ifxmlselfempty{#1}
attribute = \xmlatt{#1}{value}
\else
content = \xmlflush{#1}
\fi
\crlf
ifxmlselfempty-else-fi reversed:\space
\ifxmlselfempty{#1}
content = \xmlflush{#1}
\else
attribute = \xmlatt{#1}{value}
\fi
\blank
\stopxmlsetups

\startxmlsetups xml:notemptynode
node=\xmltag{#1}:\crlf
ifxmlselfempty-else-fi:\space
\ifxmlselfempty{#1}
attribute = \xmlatt{#1}{value}
\else
content = \xmlflush{#1}
\fi
\crlf
ifxmlselfempty-else-fi reversed:\space
\ifxmlselfempty{#1}
content = \xmlflush{#1}
\else
attribute = \xmlatt{#1}{value}
\fi
\blank
\stopxmlsetups

\startxmlsetups xml:something
\xmlall{#1}{./emptynode}\blank
\xmlall{#1}{./notemptynode}\blank
\stopxmlsetups

\starttext
\ConTeXt\ \contextversion\blank
   \xmlprocessbuffer{main}{test}{}
\stoptext

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

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

[NTG-context] Re: Building luametatex with Lua symbols exposed

2023-09-02 Thread Michal Vlasák
On Wed Aug 30, 2023 at 6:23 PM CEST, Jairo A. del Rio wrote:
> Hi, beloved list. Since sources are in the distribution, I've tried
> compiling luametatex by setting LMT_STRIP in CMakeLists.txt to 0, yet the
> resulting binary still warns about undefined symbols, such as lua_gettop,
> when an external library is loaded in Lua. Any ideas on how to solve it?

Hi Jairo,

you need to expose _dynamic_ symbols in your luametatex binary. If you
are using Linux, just adding the following to the CMake invocation line
should work:

-DCMAKE_EXECUTABLE_ENABLE_EXPORTS=1

For example, I compiled with:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release 
-DCMAKE_EXECUTABLE_ENABLE_EXPORTS=1
cmake --build build -j10

You can check the difference in dynamic symobls with:

readelf --dyn-syms build/luametatex


Note, that while this approach doesn't require any modification to
luametatex's source files, it does export _all_ symbols, which makes
binaries bigger, and symbol resolution slower. It also exports also
symbols that are not intended to be used by external modules, like
"tex_get_x_token".

Back when luametatex source code wasn't available, I created a demo
which showed how to build a "luametatex like application" (i.e.
executable with Lua statically linked in), with exported dynamic
symbols, working with CMake on both Unix and Windows. It might interest
you:

https://github.com/vlasakm/lua-demo

To support Windows in the case of luametatex, "#define LUA_BUILD_AS_DLL"
would need to be added when compiling Lua.

The problem with any module is, that you want to compile against exactly
the same Lua headers as the ones in luametatex, and with similar flags.
That is why the demo hosts everything in one CMake setup, but since
Lua's API hopefully doesn't change in the 5.4 series, you are probably
fine even with separate compilation.

IIRC stripping (LMT_STRIP) applies only to static symbols ("symbols")
and not the dynamic ones ("dynamic symbols"), and thus should be
irrelevant.

It seems that people had similar issues before:

   https://www.mail-archive.com/ntg-context@ntg.nl/msg97764.html
   https://www.mail-archive.com/ntg-context@ntg.nl/msg98184.html

I think it would be nice to support this "by default", but in that case,
the binary size would have to be addressed, and only the "supported"
public API of luametatex actually exposed. Support of this could also be
behind a compile time switch, but I am not sure how useful would that
be.

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

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


[NTG-context] Re: your opinion about list structures

2023-08-22 Thread Henning Hraban Ramm

Am 22.08.23 um 17:12 schrieb denis.ma...@unibe.ch:

Hi Hraban,

a late reply concerning the ToCs in your book: maybe you could an 
two-toc-approach like in the Memoir manual? One could show only the chapters, 
another would contain everything.


Hi,
since Keith as the only other responder also preferred the chapter-ToC 
approach, I changed my setup accordingly. It was easy and looks good ;)


Hraban

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

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


[NTG-context] Re: Fallbacks for design sizes in the current typescripts regime

2023-08-22 Thread Hamid,Idris
On Aug 22, 2023, 2:06 AM -0600, Hans Hagen via ntg-context 
, wrote:
On 8/22/2023 6:31 AM, Hamid,Idris wrote:

Design sizes for typefaces -- aka "optical sizes" -- are no longer directly 
implemented in typescripts. From the manual Fonts out of ConTeXt by Hans Hagen, 
p. 109:

You can still do it but for all these years only cm has design sizes so
one can wonder.

Hm.. There are a few others, Minion perhaps being the most popular and 
extensive. More below:

"at some point the decision was made to kick out these definitions and move the 
burden of figuring out the right size to Lua."

They were moved to the goodie file (there are every few design size
setups in goodie files, minion has one, but i don't have these fonts nor
use them.

Have just completed a minion-pro-opticals typescript collection with a 
minion-opticalsizes.lfg.

Somehow I didn't even see yours and Mathias' minion.lfg (and associated 
type-imp-minion) until just now, had to figure it all out from scratch from 
demo.lfg and lm.lfg templates -)

(OTOH, had previously seen yours and Mikael's sophisticated minion-math.lfg)

I think that my version is/will be more complete - except for mathematics. Once 
some fine-tuning and additional testing is done, will donate the results to 
ConTeXt.

(Thus some large typescript collections painstakingly built over the years are 
now obsolete and have to be rewritten. Oh well..)

Well, i suppose one can still setup/use the typescripts but it's less
fun. The old definefont mechanism is still there.

Unfortunately it doesn't work anymore -  or at least not the way it used to. My 
mkiv minion typescript collection, for example, still compiles in lmtx, but the 
design sizes do not show up in the output anymore, only the default size.

As a side note: we have design sizes (very few fonts) and weights (more
and more fonts) .. weights are imo an even bigger mess, as it looks like
some designers can't make up their mind and come with plenty weights
independent of the fact that some look bad; variable fonts only add to
this: the easier to use the creater tools become the easier it becomes
to make ugly fonts (I tend to ignore fonts that show off too many
possible choices; not much different from excessive kerning, ligatures
and other incomplete features).

You make an important point, especially about the proliferation of bad fonts 
via more accessible tools. On a related front, there are more and more 
Arabic-script fonts, but hardly anything really good or useable, even from 
reputable foundries like Adobe. At some point, presumably, designers quit early 
(or the company does not care to invest the needed time and funds).

Presumably, designing good optical sizes requires more care and subtlety than 
designing weights.

OTOH the more professional/high-end foundries sometimes recommend certain 
weights for optical-sizes. For example, your neighbors at Enschede:

http://www.teff.nl/fonts/geronimo/

"While Geronimo was mainly conceived as a typeface for (small) text, it also 
performs well at bigger sizes most notably the lighter weights.”"

There are 12 weights total (six regular + six italic), but the lighter weights 
are designed to work well at larger sizes. So from 12 fonts one can create a 
reasonable, combined optical-size and weight space.

(Speaking of Enschede, their Lexicon typeface use an interesting/unique 
optical-size concept.)

One thing about the explosion of weights is that the distinction between \tf 
and \bf (or \it and \bi) vanishes and becomes a spectrum. In that case, 
presumably one would

i)  forget about \bf and \bi
ii) multiply bodyfont-typefaces and switch directly between them as needed.

Etc.

If this appearance of a loss reflects the reality of the situation, would like 
to kindly request that the original functionality be restored to the 
higher-level user interface, presumably within the lfg file. So perhaps 
something like a keyval

fallbacks = {
["MyRomanRegular"] = {
"file:MyFont-Small" = "fallbacks=",
"file:MyFont-Regular", = "fallbacks=",
"file:MyFont-Bigger", = "fallbacks=",
"file:MyFont-Biggest", = "fallbacks=",
},

On the other hand, if access to the former functionality is still there 
somewhere in the user interface, would like to humbly request that someone 
share where it is and how to use it!

Thank you kindly for consideration of this request.

I'm not going to look into this until there is a complete test case for
this which means:

- free fonts (so that others can also test and use)
- design sizes
- fallback design sizes

As for free fonts. MinionPro Opticals should be considered an exception to the 
free-fonts rubric. After all,

i)  its multiple-master design base was inspired by MetaFont/Knuth, and hence
ii) it's very popular with TeXies.

Put another way, Minion Pro should be considered an honorary TeX typeface -)

(There is also an update, Mi

[NTG-context] Re: Nested itemize

2023-08-22 Thread fv leung
It seems that displaystyle fractions insert extra vertical space before the
main item.
With textstyle fractions, the code works fine.
\blank[back,overlay] can get rid of the gap above the first row, but not
the space inserted by \dfrac.


\defineitemgroup[alex]

\setupitemgroup
 [alex]
 [each]
 [a,two]
 [
 margin=2cm,
 before={\blank[overlay,-depth]},
 after={\blank[nowhite]},
 stopper=)
 ]

%\showboxes
\autofences

\starttext
\samplefile{ward}
\startitemize[n][style=\bf,before={\blank[back,overlay]},after={\blank[medium]}]
  \startitem
\startalextable
  \startitem
\m{6(x - \frac{5}{12})^2 - \frac{1}{24}}
  \stopitem
  \startitem
\m{-3(x - \frac{1}{3})^2 + \frac{1}{3}}
  \stopitem
  \startitem
\m{7(x + \frac{5}{14})^2 + \frac{199}{28}}
  \stopitem
  \startitem
\m{-\frac{1}{2}(x + 2)^2 + \frac{9}{2}}
  \stopitem
\stopalextable
  \stopitem
\stopitemize

\samplefile{ward}
\stoptext

Alexandre Christe  於 2023年8月22日 週二 下午5:48寫道:

> Hi Mikael,
>
> That looks very attractive. However, with the following code, I end up
> with a large gap above the first row.
>
> \defineitemgroup[alex]
>
> \setupitemgroup
>  [alex]
>  [each]
>  [a,two]
>  [
>  margin=2cm,
>  before=\blank[overlay,-depth],
>  stopper=)
>  ]
>
> \showboxes
> \autofences
>
> \starttext
> \samplefile{ward}
>
> \startitemize[n][style=\bf]
>  \startitem
>  \startalextable
>  \startitem $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$ \stopitem
>  \startitem $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$ \stopitem
>  \startitem $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$ \stopitem
>  \startitem $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$ \stopitem
>  \stopalextable
>  \stopitem
> \stopitemize
>
> \samplefile{ward}
> \stoptext
>
> A. Christe
> Le 22 août 2023 à 07:12 +0200, Alexandre Christe ,
> a écrit :
>
> It’s true that \vtop{…} does the job for a single line of items, but it
> doesn’t in the case there’re multiple (\vtop{}) aligns with the bottom.
>
> Here’s a modified MWE
>
> \startitemize[n][style=\bf]
>   \item \godown[-\lineheight] \startitemize
> [a,columns,two,packed,broad][stopper=),before={\blank[nowhite]}]
> \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
> \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
> \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
> \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
>   \stopitemize
> \stopitemize
>
> A. Christe
> Le 22 août 2023 à 04:08 +0200, fv leung , a écrit :
>
> I'd do it this way:
>
> \starttext
> \startitemize[n][style=\bf]
> \item\vtop{%
>   \startitemize[a,horizontal,four][stopper=\)]
> \startitem
>   $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
> \stopitem
> \startitem
>   $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
> \stopitem
> \startitem
>   $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
> \stopitem
> \startitem
>   $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
> \stopitem
>   \stopitemize
> }
> \stopitemize
>
> \stoptext
>
> Alexandre Christe  於 2023年8月22日 週二 上午2:58寫道:
>
>> Dear ConTeXt users,
>>
>> Time goes by but I haven't yet found a nice solution to this issue. When
>> having mathematics, I'd not like to adjust by hand the factor of \linewidth
>> for the \godown command.
>>
>> Here's a MWE
>>
>> \starttext
>>
>> \startitemize[n][style=\bf]
>>   \item \godown[-\lineheight] \startitemize
>> [a,columns,four,packed,broad][stopper=),before={\blank[nowhite]}]
>> \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
>> \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
>> \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
>> \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
>>   \stopitemize
>> \stopitemize
>>
>> \stoptext
>>
>> Thanks in advance.
>>
>> Le ven. 2 sept. 2022 à 11:24, fv leung via ntg-context <
>> ntg-context@ntg.nl> a écrit :
>>
>>>
>>> \starttext
>>>
>>> \startitemize[n]
>>> \item\godown[-\lineheight]
>>>
>>> \startitemize[a,columns,packed][before={\blank[nowhite]},right=\),stopper=]
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \stopitemize
>>> \item\godown[-\lineheight]
>>>
>>> \startitemize[a,columns,packed][before={\blank[nowhite]},n=3,right=\),stopper=]
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \stopitemize
>>> \item\godown[-\lineheight]
>>>
>>> \star

[NTG-context] Re: Nested itemize

2023-08-22 Thread Alexandre Christe
Hi Mikael,

That looks very attractive. However, with the following code, I end up with a 
large gap above the first row.

\defineitemgroup[alex]

\setupitemgroup
 [alex]
 [each]
 [a,two]
 [
 margin=2cm,
 before=\blank[overlay,-depth],
 stopper=)
 ]

\showboxes
\autofences

\starttext
\samplefile{ward}

\startitemize[n][style=\bf]
 \startitem
 \startalextable
 \startitem $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$ \stopitem
 \startitem $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$ \stopitem
 \startitem $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$ \stopitem
 \startitem $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$ \stopitem
 \stopalextable
 \stopitem
\stopitemize

\samplefile{ward}
\stoptext

A. Christe
Le 22 août 2023 à 07:12 +0200, Alexandre Christe , a 
écrit :
> It’s true that \vtop{…} does the job for a single line of items, but it 
> doesn’t in the case there’re multiple (\vtop{}) aligns with the bottom.
>
> Here’s a modified MWE
>
> \startitemize[n][style=\bf]
>   \item \godown[-\lineheight] \startitemize 
> [a,columns,two,packed,broad][stopper=),before={\blank[nowhite]}]
>     \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
>     \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
>     \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
>     \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
>   \stopitemize
> \stopitemize
>
> A. Christe
> Le 22 août 2023 à 04:08 +0200, fv leung , a écrit :
> > I'd do it this way:
> >
> > \starttext
> > \startitemize[n][style=\bf]
> > \item\vtop{%
> >   \startitemize[a,horizontal,four][stopper=\)]
> >     \startitem
> >       $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
> >     \stopitem
> >     \startitem
> >       $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
> >     \stopitem
> >     \startitem
> >       $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
> >     \stopitem
> >     \startitem
> >       $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
> >     \stopitem
> >   \stopitemize
> > }
> > \stopitemize
> >
> > \stoptext
> >
> > > Alexandre Christe  於 2023年8月22日 週二 上午2:58寫道:
> > > > Dear ConTeXt users,
> > > >
> > > > Time goes by but I haven't yet found a nice solution to this issue. 
> > > > When having mathematics, I'd not like to adjust by hand the factor of 
> > > > \linewidth for the \godown command.
> > > >
> > > > Here's a MWE
> > > >
> > > > \starttext
> > > >
> > > > \startitemize[n][style=\bf]
> > > >   \item \godown[-\lineheight] \startitemize 
> > > > [a,columns,four,packed,broad][stopper=),before={\blank[nowhite]}]
> > > >     \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
> > > >     \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
> > > >     \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
> > > >     \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
> > > >   \stopitemize
> > > > \stopitemize
> > > >
> > > > \stoptext
> > > >
> > > > Thanks in advance.
> > > >
> > > > > Le ven. 2 sept. 2022 à 11:24, fv leung via ntg-context 
> > > > >  a écrit :
> > > > > >
> > > > > > \starttext
> > > > > >
> > > > > > \startitemize[n]
> > > > > > \item\godown[-\lineheight]
> > > > > >   
> > > > > > \startitemize[a,columns,packed][before={\blank[nowhite]},right=\),stopper=]
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \stopitemize
> > > > > > \item\godown[-\lineheight]
> > > > > >   
> > > > > > \startitemize[a,columns,packed][before={\blank[nowhite]},n=3,right=\),stopper=]
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \stopitemize
> > > > > > \item\godown[-\lineheight]
> > > > > >   
> > > > > > \startitemize[a,columns,packed][before={\blank[nowhite]},n=4,right=\),stopper=]
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > > >   \item bla
> > > > >

[NTG-context] Re: Nested itemize

2023-08-22 Thread Mikael Sundqvist
Hi,

On Tue, Aug 22, 2023 at 7:16 AM Alexandre Christe
 wrote:
>
> It’s true that \vtop{…} does the job for a single line of items, but it 
> doesn’t in the case there’re multiple (\vtop{}) aligns with the bottom.
>
> Here’s a modified MWE
>
> \startitemize[n][style=\bf]
>   \item \godown[-\lineheight] \startitemize 
> [a,columns,two,packed,broad][stopper=),before={\blank[nowhite]}]
> \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
> \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
> \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
> \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
>   \stopitemize
> \stopitemize
>
> A. Christe
> Le 22 août 2023 à 04:08 +0200, fv leung , a écrit :
>
> I'd do it this way:
>
> \starttext
> \startitemize[n][style=\bf]
> \item\vtop{%
>   \startitemize[a,horizontal,four][stopper=\)]
> \startitem
>   $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
> \stopitem
> \startitem
>   $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
> \stopitem
> \startitem
>   $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
> \stopitem
> \startitem
>   $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
> \stopitem
>   \stopitemize
> }
> \stopitemize
>
> \stoptext
>
> Alexandre Christe  於 2023年8月22日 週二 上午2:58寫道:
>>
>> Dear ConTeXt users,
>>
>> Time goes by but I haven't yet found a nice solution to this issue. When 
>> having mathematics, I'd not like to adjust by hand the factor of \linewidth 
>> for the \godown command.
>>
>> Here's a MWE
>>
>> \starttext
>>
>> \startitemize[n][style=\bf]
>>   \item \godown[-\lineheight] \startitemize 
>> [a,columns,four,packed,broad][stopper=),before={\blank[nowhite]}]
>> \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
>> \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
>> \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
>> \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
>>   \stopitemize
>> \stopitemize
>>
>> \stoptext
>>
>> Thanks in advance.
>>
>> Le ven. 2 sept. 2022 à 11:24, fv leung via ntg-context  
>> a écrit :
>>>
>>>
>>> \starttext
>>>
>>> \startitemize[n]
>>> \item\godown[-\lineheight]
>>>   
>>> \startitemize[a,columns,packed][before={\blank[nowhite]},right=\),stopper=]
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \stopitemize
>>> \item\godown[-\lineheight]
>>>   
>>> \startitemize[a,columns,packed][before={\blank[nowhite]},n=3,right=\),stopper=]
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \stopitemize
>>> \item\godown[-\lineheight]
>>>   
>>> \startitemize[a,columns,packed][before={\blank[nowhite]},n=4,right=\),stopper=]
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \item bla
>>>   \stopitemize
>>> \stopitemize
>>>
>>> \stoptext
>>>
>>> Alexandre Christe via ntg-context  於 2022年9月2日 週五 
>>> 下午5:08寫道:
>>>>
>>>> Dear all,
>>>>
>>>> I'm struggling to setup a nested itemize with no blank line and several 
>>>> columns.
>>>>
>>>> What I mean is something like
>>>> 1. a) bla   c) bla
>>>> b) bla   d) bla
>>>>
>>>> The following MWE is my starting point
>>>>
>>>> \starttext
>>>> \startitemize[n]
>>>> \item \blank[-line]
>>>> \startitemize[a,horizontal,two] [margin=2cm]
>>>> \item First
>>>> \item Second
>>>> \item Third
>>>> \item Fourth
>>>> \stopitemize
>>>> \item \blank[-line]
>>>> \startitemize[a,horizontal,columns,two]
>>>> \item First
>>>> \item Second
>>>> \item Third
>>>> \item Fourth
>>>> \stopitemize
>>>> \stopitemize
>>>> \stoptext
>>>>
>>>> Thanks in advance

Not really tested, but \blank[overlay,-depth] seems to work OK (thanks Hans!).

I also take the opportunity to push a bit for the new itemtable mechanism:

\defineitemgroup[alex]

\setupitemgroup
[alex]
[each]
[a,two]
[margin=2cm,
before=\blank[overlay,-depth]]

\showboxes

\starttext
\startitemize[n]
\startitem
\startalextable
\startitem First \stopitem
\startitem Second \stopitem
\startitem Third \stopitem
\startitem Fourth \stopitem
\stopalextable
\stopitem
\stopitemize
\stoptext

Please test for a larger document to see if it works well.

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

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

[NTG-context] Re: Fallbacks for design sizes in the current typescripts regime

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

On 8/22/2023 6:31 AM, Hamid,Idris wrote:

Dear gang,

Design sizes for typefaces -- aka "optical sizes" -- are no longer directly 
implemented in typescripts. From the manual Fonts out of ConTeXt by Hans Hagen, p. 109:


You can still do it but for all these years only cm has design sizes so 
one can wonder.



"at some point the decision was made to kick out these definitions and move the 
burden of figuring out the right size to Lua."


They were moved to the goodie file (there are every few design size 
setups in goodie files, minion has one, but i don't have these fonts nor 
use them.



(Thus some large typescript collections painstakingly built over the years are 
now obsolete and have to be rewritten. Oh well..)


Well, i suppose one can still setup/use the typescripts but it's less 
fun. The old definefont mechanism is still there.


As a side note: we have design sizes (very few fonts) and weights (more 
and more fonts) .. weights are imo an even bigger mess, as it looks like 
some designers can't make up their mind and come with plenty weights 
independent of the fact that some look bad; variable fonts only add to 
this: the easier to use the creater tools become the easier it becomes 
to make ugly fonts (I tend to ignore fonts that show off too many 
possible choices; not much different from excessive kerning, ligatures 
and other incomplete features).



But there is an issue in the new regime:

In the old system, every typescript mapping to a font within a design-size 
range could have its own fallback. For example:

% Small ="small point size"
% Regular = "regular point size"
% Bigger = "bigger point size"
% Biggest = "biggest point size"

\definefontsynonym [MyRomanRegular]
 [file:MyFont-Regular.ttf] [features=,fallbacks=]
\definefontsynonym [MyRomanSmall]
 [file:MyFont-Small.ttf] [features=,fallbacks=]
\definefontsynonym [MyRomanBigger]
 [file:MyFont-Bigger.ttf] [features=,fallbacks=]
\definefontsynonym [MyRomanBiggest]
 [file:MyFont-Biggest.ttf] [features=,fallbacks=]

In the new typescripts regime we keep one font from the design-size range in 
the typescript file; the rest of the optical sizes go into an lfg goodies file:

\definefontsynonym [MyRomanRegular]
   \loadfontgoodies[myfonts-opticalsizes] % other three fonts go into an lfg 
table
 [file:MyFont-Regular.ttf] [features=,fallbacks=]

designsizes = {
 ["MyRomanRegular"] = {
 ["7pt"]  = "file:MyFont-Small",
 ["8pt"]  = "file:MyFont-Small",
 ["9pt"]  = "file:MyFont-Regular",
 ["10pt"]= "file:MyFont-Regular",
 ["11pt"]= "file:MyFont-Regular",
 ["12pt"]= "file:MyFont-Bigger",
 ["14pt"]= "file:MyFont-Bigger",
 ["17pt"]= "file:MyFont-Biggest",
 ["21pt"]= "file:MyFont-Biggest",
 default  = "file:MyFont-Regular",
 },

But there is an apparent drawback to this new way of doing things: It appears 
that only the default font can have an explicit fallback, and there appears 
that there is no straightforward way to map each of the other design sizes to 
its own fallback.

If there is indeed no way to map each non-default design size to a fallback, 
then that constitutes a significant/unfortunate loss of functionality in the 
user interface.

If this appearance of a loss reflects the reality of the situation, would like 
to kindly request that the original functionality be restored to the 
higher-level user interface, presumably within the lfg file. So perhaps 
something like a keyval

 fallbacks = {
 ["MyRomanRegular"] = {
 "file:MyFont-Small"= "fallbacks=",
 "file:MyFont-Regular",   = "fallbacks=",
 "file:MyFont-Bigger", = "fallbacks=",
 "file:MyFont-Biggest",   = "fallbacks=",
 },

On the other hand, if access to the former functionality is still there 
somewhere in the user interface, would like to humbly request that someone 
share where it is and how to use it!

Thank you kindly for consideration of this request.
I'm not going to look into this until there is a complete test case for 
this which means:


- free fonts (so that others can also test and use)
- design sizes
- fallback design sizes

Of course one can have some abstract fallback defined using the 
"MyFont-Small" namespace where the files used get remapped too as one 
goes. A bit like we do with the gyre fonts where we share definitions.


Hans


-
  Hans

[NTG-context] Re: XML processing beginner's question

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

On 8/22/2023 9:06 AM, denis.ma...@unibe.ch wrote:


But, I think the way this is processed differs a bit from XSLT. In XSLT the 
most specific match will be applied, but ConTeXt seems to proceed from top to 
bottom until it finds a match. (Is that correct?)
it just associates the most recent match with a setup . if needed we 
could extend the mechanism with varianst but i have to admit that it has 
been stable (mostly untouched) for close to 15 years now so all has to 
be done very careful; it has also be tuned for performance and large 
scale throughput


Hans

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

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

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


[NTG-context] Re: Nested itemize

2023-08-21 Thread Alexandre Christe
It’s true that \vtop{…} does the job for a single line of items, but it doesn’t 
in the case there’re multiple (\vtop{}) aligns with the bottom.

Here’s a modified MWE

\startitemize[n][style=\bf]
  \item \godown[-\lineheight] \startitemize 
[a,columns,two,packed,broad][stopper=),before={\blank[nowhite]}]
    \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
    \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
    \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
    \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
  \stopitemize
\stopitemize

A. Christe
Le 22 août 2023 à 04:08 +0200, fv leung , a écrit :
> I'd do it this way:
>
> \starttext
> \startitemize[n][style=\bf]
> \item\vtop{%
>   \startitemize[a,horizontal,four][stopper=\)]
>     \startitem
>       $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
>     \stopitem
>     \startitem
>       $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
>     \stopitem
>     \startitem
>       $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
>     \stopitem
>     \startitem
>       $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
>     \stopitem
>   \stopitemize
> }
> \stopitemize
>
> \stoptext
>
> > Alexandre Christe  於 2023年8月22日 週二 上午2:58寫道:
> > > Dear ConTeXt users,
> > >
> > > Time goes by but I haven't yet found a nice solution to this issue. When 
> > > having mathematics, I'd not like to adjust by hand the factor of 
> > > \linewidth for the \godown command.
> > >
> > > Here's a MWE
> > >
> > > \starttext
> > >
> > > \startitemize[n][style=\bf]
> > >   \item \godown[-\lineheight] \startitemize 
> > > [a,columns,four,packed,broad][stopper=),before={\blank[nowhite]}]
> > >     \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
> > >     \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
> > >     \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
> > >     \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
> > >   \stopitemize
> > > \stopitemize
> > >
> > > \stoptext
> > >
> > > Thanks in advance.
> > >
> > > > Le ven. 2 sept. 2022 à 11:24, fv leung via ntg-context 
> > > >  a écrit :
> > > > >
> > > > > \starttext
> > > > >
> > > > > \startitemize[n]
> > > > > \item\godown[-\lineheight]
> > > > >   
> > > > > \startitemize[a,columns,packed][before={\blank[nowhite]},right=\),stopper=]
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \stopitemize
> > > > > \item\godown[-\lineheight]
> > > > >   
> > > > > \startitemize[a,columns,packed][before={\blank[nowhite]},n=3,right=\),stopper=]
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \stopitemize
> > > > > \item\godown[-\lineheight]
> > > > >   
> > > > > \startitemize[a,columns,packed][before={\blank[nowhite]},n=4,right=\),stopper=]
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \item bla
> > > > >   \stopitemize
> > > > > \stopitemize
> > > > >
> > > > > \stoptext
> > > > >
> > > > > > Alexandre Christe via ntg-context  於 2022年9月2日 
> > > > > > 週五 下午5:08寫道:
> > > > > > > Dear all,
> > > > > > >
> > > > > > > I'm struggling to setup a nested itemize with no blank line and 
> > > > > > > several columns.
> > > > > > >
> > > > > > > What I mean is something like
> > > > > > > 1. a) bla   c) bla
> > > > > > >     b) bla   d) bla
> > > > > > >
> > > > > > > The following MWE is my starting point
> > > > > > >
> > > > > > > \starttext
> > > > > > > \startitemize[n]
> > > > > > > \item \blank[-line]
> > > > > > > \startitemize[a,horizontal,two] [margin=2cm]
> > > > > > > \item First
> > > > > > > \item Second
> > > > > > > \item T

[NTG-context] Low res output possible?

2023-08-21 Thread Benjamin Buchmuller
Hi Julian,

I had the same question a couple of days ago and I found a thread on the 
mailing list, which I'm reposting here. Although this worked for me, I found 
downsampling of the pdf with gs more convenient.

Hope this helps,


Benjamin

%

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

assert(not figures.getinfo2)

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

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

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

   figures.pop()

   return --data
  info
 end
end


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

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

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

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

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

for _, s in ipairs(formats) do
  figures.converters[s] = figures.converters[s] or {}
  figures.converters[s]["lowres." .. s] = sample_down
end

local function sample_down_pdf(oldname, newname, resolution)
print("DOWNSAMPLE sample_down " .. oldname .. " to " .. newname)

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

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

local s = format("gs \
-o \"%s\" \
-sDEVICE=pdfwrite \
-dDownsampleColorImages=true \
-dDownsampleGrayImages=true \
-dDownsampleMonoImages=true \
-dColorImageResolution=%s \
-dGrayImageResolution=%s \
-dMonoImageResolution=%s \
-dColorImageDownsampleThreshold=1.0 \
-dGrayImageDownsampleThreshold=1.0 \
-dMonoImageDownsampleThreshold=1.0 \
\"%s\"",
oldname, resolution, resolution, resolution, newname)
   print("DOWNSAMPLE Conversion: " .. s)
  os.execute(s)
end

figures.converters["pdf"]["lowres." .. "pdf"] = sample_down_pdf

%

\loadluafile[grph-downsample]
\doifmodeelse{print}{%
\def\Resolution{300}
}{%
\def\Resolution{96}
}%
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Nested itemize

2023-08-21 Thread fv leung
I'd do it this way:

\starttext
\startitemize[n][style=\bf]
\item\vtop{%
  \startitemize[a,horizontal,four][stopper=\)]
\startitem
  $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
\stopitem
\startitem
  $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
\stopitem
\startitem
  $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
\stopitem
\startitem
  $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
\stopitem
  \stopitemize
}
\stopitemize

\stoptext

Alexandre Christe  於 2023年8月22日 週二 上午2:58寫道:

> Dear ConTeXt users,
>
> Time goes by but I haven't yet found a nice solution to this issue. When
> having mathematics, I'd not like to adjust by hand the factor of \linewidth
> for the \godown command.
>
> Here's a MWE
>
> \starttext
>
> \startitemize[n][style=\bf]
>   \item \godown[-\lineheight] \startitemize
> [a,columns,four,packed,broad][stopper=),before={\blank[nowhite]}]
> \item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
> \item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
> \item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
> \item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
>   \stopitemize
> \stopitemize
>
> \stoptext
>
> Thanks in advance.
>
> Le ven. 2 sept. 2022 à 11:24, fv leung via ntg-context 
> a écrit :
>
>>
>> \starttext
>>
>> \startitemize[n]
>> \item\godown[-\lineheight]
>>
>> \startitemize[a,columns,packed][before={\blank[nowhite]},right=\),stopper=]
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \stopitemize
>> \item\godown[-\lineheight]
>>
>> \startitemize[a,columns,packed][before={\blank[nowhite]},n=3,right=\),stopper=]
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \stopitemize
>> \item\godown[-\lineheight]
>>
>> \startitemize[a,columns,packed][before={\blank[nowhite]},n=4,right=\),stopper=]
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \item bla
>>   \stopitemize
>> \stopitemize
>>
>> \stoptext
>>
>> Alexandre Christe via ntg-context  於 2022年9月2日 週五
>> 下午5:08寫道:
>>
>>> Dear all,
>>>
>>> I'm struggling to setup a nested itemize with no blank line and several
>>> columns.
>>>
>>> What I mean is something like
>>> 1. a) bla   c) bla
>>> b) bla   d) bla
>>>
>>> The following MWE is my starting point
>>>
>>> \starttext
>>> \startitemize[n]
>>> \item \blank[-line]
>>> \startitemize[a,horizontal,two] [margin=2cm]
>>> \item First
>>> \item Second
>>> \item Third
>>> \item Fourth
>>> \stopitemize
>>> \item \blank[-line]
>>> \startitemize[a,horizontal,columns,two]
>>> \item First
>>> \item Second
>>> \item Third
>>> \item Fourth
>>> \stopitemize
>>> \stopitemize
>>> \stoptext
>>>
>>> Thanks in advance
>>>
>>> ___
>>> If your question is of interest to others as well, please add an entry
>>> to the Wiki!
>>>
>>> maillist : ntg-context@ntg.nl /
>>> https://www.ntg.nl/mailman/listinfo/ntg-context
>>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> wiki : https://contextgarden.net
>>>
>>> ___
>>>
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> https://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : https://contextgarden.net
>>
>> ___
>>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Nested itemize

2023-08-21 Thread Alexandre Christe
Dear ConTeXt users,

Time goes by but I haven't yet found a nice solution to this issue. When
having mathematics, I'd not like to adjust by hand the factor of \linewidth
for the \godown command.

Here's a MWE

\starttext

\startitemize[n][style=\bf]
  \item \godown[-\lineheight] \startitemize
[a,columns,four,packed,broad][stopper=),before={\blank[nowhite]}]
\item $6(x - \dfrac{5}{12})^2 - \dfrac{1}{24}$
\item $-3(x - \dfrac{1}{3})^2 + \dfrac{1}{3}$
\item $7(x + \dfrac{5}{14})^2 + \dfrac{199}{28}$
\item $-\dfrac{1}{2}(x + 2)^2 + \dfrac{9}{2}$
  \stopitemize
\stopitemize

\stoptext

Thanks in advance.

Le ven. 2 sept. 2022 à 11:24, fv leung via ntg-context 
a écrit :

>
> \starttext
>
> \startitemize[n]
> \item\godown[-\lineheight]
>
> \startitemize[a,columns,packed][before={\blank[nowhite]},right=\),stopper=]
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \stopitemize
> \item\godown[-\lineheight]
>
> \startitemize[a,columns,packed][before={\blank[nowhite]},n=3,right=\),stopper=]
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \stopitemize
> \item\godown[-\lineheight]
>
> \startitemize[a,columns,packed][before={\blank[nowhite]},n=4,right=\),stopper=]
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \item bla
>   \stopitemize
> \stopitemize
>
> \stoptext
>
> Alexandre Christe via ntg-context  於 2022年9月2日 週五
> 下午5:08寫道:
>
>> Dear all,
>>
>> I'm struggling to setup a nested itemize with no blank line and several
>> columns.
>>
>> What I mean is something like
>> 1. a) bla   c) bla
>> b) bla   d) bla
>>
>> The following MWE is my starting point
>>
>> \starttext
>> \startitemize[n]
>> \item \blank[-line]
>> \startitemize[a,horizontal,two] [margin=2cm]
>> \item First
>> \item Second
>> \item Third
>> \item Fourth
>> \stopitemize
>> \item \blank[-line]
>> \startitemize[a,horizontal,columns,two]
>> \item First
>> \item Second
>> \item Third
>> \item Fourth
>> \stopitemize
>> \stopitemize
>> \stoptext
>>
>> Thanks in advance
>>
>> ___
>> If your question is of interest to others as well, please add an entry to
>> the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> https://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : https://contextgarden.net
>>
>> ___
>>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: XML processing beginner's question

2023-08-21 Thread Michael Löscher
Yes, I have done that. But I don't seem to have the basic context of how 
the processing works in order. All I have so far is this as a starting 
point:


\startxmlsetups xml:mysetup

\xmlsetsetup{main}{document|element|mdata|tdata|name|date|num|content|shortdescription|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetup}

\startxmlsetups xml:mysetup:document
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:element
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:mdata
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:tdata
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:name
\xmlflush
\stopxmlsetups

\startxmlsetups xml:mysetup:num
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:content
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:shortdescription
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:mysetup:p
\xmlflush{#1}\par
\stopxmlsetups

\starttext
  \xmlprocessbuffer {mysetup}{xmlcontent}{}
\stoptext

Am 21.08.2023 um 17:45 schrieb Thomas A. Schmitz:
Have you looked at chapter 3.10 "Testing" of the manual xml-mkiv.pdf? 
There are a lot of commands there that should help you, such as


\xmldoiftext {#1} {/mdata/date}
  {\bf \xmlflush {#1}}

or \xmldoifelsetext.

There's also \xmlfilter, which you can use to test for the content of 
tags. And of course, you can process in Lua and search for strings or 
use lpeg. However, your question is a bit vague now. Show us some code 
you have and we can take it from there; that's easier than writing the 
whole setup for you.


Thomas


On 8/21/23 17:29, Michael Löscher wrote:

Hello list,

having the xml data at the bottom, I would like to process it so that 
the result is like this:


---
What it is (e.g. bold formatted)
date: 2023-08-01 (italic)
Description (small font size)
Another text (small font size)

hd1 - Header 1

§ 1 First  (A first short description)
AA
BB

§ 2 Second (A second short description)
CC
DD

§ 3 Third (A third short description)
EE
FF
---

How can I process the s differently? The first element 
contains a  tag and so it differs from the other ones. The 
second element's  tag contains the word "Header" which makes it 
different again. The other elements contain a  tag 
that they all have in common.


What could be the appropriate xml setups to generate the above output?

Michael

---
xml data:
\startbuffer[xmlcontent]


   
 
   What it is
   2023-08-01
 
 
   
 Description
 Another text
   
 
   
   
 
   hd1
   Header 1
 
 
   
 Text of Header 1
   
 
   
   
 
   1
   First
   A first short description
 
 
   
 AA
 BB
   
 
   
   
 
   2
   Second
   A second short description
 
 
   
 CC
 DD
   
 
   
   
 
   3
   Third
   A third short description
 
 
   
 EE
 FF
   
 
   

\stopbuffer



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


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

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

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

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

[NTG-context] Re: XML processing beginner's question

2023-08-21 Thread Thomas A. Schmitz
Have you looked at chapter 3.10 "Testing" of the manual xml-mkiv.pdf? 
There are a lot of commands there that should help you, such as


\xmldoiftext {#1} {/mdata/date}
 {\bf \xmlflush {#1}}

or \xmldoifelsetext.

There's also \xmlfilter, which you can use to test for the content of 
tags. And of course, you can process in Lua and search for strings or 
use lpeg. However, your question is a bit vague now. Show us some code 
you have and we can take it from there; that's easier than writing the 
whole setup for you.


Thomas


On 8/21/23 17:29, Michael Löscher wrote:

Hello list,

having the xml data at the bottom, I would like to process it so that 
the result is like this:


---
What it is (e.g. bold formatted)
date: 2023-08-01 (italic)
Description (small font size)
Another text (small font size)

hd1 - Header 1

§ 1 First  (A first short description)
AA
BB

§ 2 Second (A second short description)
CC
DD

§ 3 Third (A third short description)
EE
FF
---

How can I process the s differently? The first element contains 
a  tag and so it differs from the other ones. The second element's 
 tag contains the word "Header" which makes it different again. 
The other elements contain a  tag that they all have 
in common.


What could be the appropriate xml setups to generate the above output?

Michael

---
xml data:
\startbuffer[xmlcontent]


   
     
   What it is
   2023-08-01
     
     
   
     Description
     Another text
   
     
   
   
     
   hd1
   Header 1
     
     
   
     Text of Header 1
   
     
   
   
     
   1
   First
   A first short description
     
     
   
     AA
     BB
   
     
   
   
     
   2
   Second
   A second short description
     
     
   
     CC
     DD
   
     
   
   
     
   3
   Third
   A third short description
     
     
   
     EE
     FF
   
     
   

\stopbuffer



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

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

[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach

2023-08-21 Thread Carlos
On Sun, Aug 20, 2023 at 06:41:42PM +0200, Hans Hagen wrote:
> On 8/20/2023 5:51 PM, Carlos wrote:
> > On Sun, Aug 20, 2023 at 03:38:15PM +0200, Wolfgang Schuster wrote:
> > > Carlos schrieb am 19.08.2023 um 15:32:
> > > > On Fri, Aug 18, 2023 at 08:58:58PM +0200, Wolfgang Schuster wrote:
> > > > > Hi,
> > > > > 
> > > > > 1. Learn to two provide a working minimal example which shows the 
> > > > > problem.
> > > > > 
> > > > Did the minimal example I provided earlier wasn't enough for you?
> > > > 
> > > > Besides, You know perfectly well that \stoptext is not even necessary,
> > > > superflous; it's not required to compile any context flavor file for
> > > > ages now.
> > > > 
> > > > So I suggest you to save those keystrokes for other tasks. Not those,
> > > > petty petty betty. I know it's hard to teach an ol' dog new tricks,
> > > > but… it's worth to try! right?
> > > 
> > > Please explain why this example (which is a valid ConTeXt document) works
> > 
> > Opening a group with \starttext makes no sense because there is nothing 
> > after \stoptext.
> > 
> > The possibility to nest \starttext is necessary when you \startproduct etc. 
> > where components can be be documents on its own and this means 
> > \startcomponent includes \starttext in its
> > definition.
> > 
> > >  begin example
> > > \starttext
> > > 
> > > \starttext
> > > 
> > > \stoptext
> > > 
> > > \stoptext
> > >  end example
> > > 
> > > but this doesn't.
> > > 
> > >  begin example
> > > \starttext
> > > 
> > > \starttext
> > >  end example
> > > 
> > > Wolfgang
> > 
> > Take a look at the command line when you process a file and you should see 
> > something like this:
> > 
> > As you can see the luatex engine processes the file cont-yes.mkiv and not 
> > your document which put as argument to context. Your document is just read 
> > by cont-yes.mkiv and at the end of the document ConTeXt inserts an extra 
> > \stoptext which is ignored when your document
> > is valid (equal number of \starttext and \stoptext).
> 
> The bonus \starttext is just there so that we can use \startTEXpage etc
> without wrapper and a second bonus is that it catches sloppy coding and if a
> user want to take a shortcut and save a handful of keystrokes it's fine for
> me but support converges to zero (unless one pays top money for the
> incovenience). There is only so much you can expect from volunteers.
> 

I remember now I read it somewhere before.

> > Wolfgang. I do appreciate your emphasis and your input on all of this.
> > I do. I really do. But we can't go over this, over and over again. Do
> > you know who said the above? Not me. You. Do you know whose remarks
> > are those? Not mine.  Yours.
> > 
> > Replace cont-yes.mkiv with the newer equivalent. And you're right though. 
> > \starttext is not even needed most of the times.
> Wolfgang tries to educate you ... starttext is the anchor for checking if a
> bodyfont has been defined and if not it kicks in some default.
> 
> Now with that said:
> 
> When Wolfgang asks / tells something because there is nothing in context
> that he doesn't know. And you can bet then he knowa more than you do about
> the internals, objectives and implementation. So, let me put it a bit
> stronger: if Wolfgang gives you an answer that you don't like, you should be
> very careful in your answering because there is very little change that he's
> wrong. To stress his position here: if he sends me a patch I can merge it in
> without testing it which (believe me) is a rather unique positin. From this
> you might conclude that I don't like your tone.

It has nothing to do with liking/disliking a tone. A simple document
does not require any \stoptext and I told Wolfgang about it.

> 
> And with that out if the way:
> 
> When Mikael wonders if there might be something with your installation you
> should indeed sit down and wonder a bit if that could be the case because he
> is a pretty good tester who had been around for quite a while. So you can be
> sure that he tested it well and that he has a proper setup. Personally I'd
> be worried if someone doubts my installation.

it has nothing to do with the installation. Different installations have
nothing to do with what the backend fails to do in the end. 

It's deceitful. And lying his ass off. At least that message from the
log, that is. 

[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach

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

Carlos,

> On 8/20/2023 6:41 PM, Wolfgang Schuster wrote:


And now it gets even worse, see 
https://meeting.contextgarden.net/2021/talks/2021-09-21/starttext.pdf 
why \starttext is necessar
And watch how \startTEXpage is defined. It clearly explains why that 
works without.


Also watch how \TEX\ comes our without the space between T and E that 
occurs at yoru end.


And finally, appreciate the nice layout / setup of that presentation, 
which contradicts your (implcit and/or explicit) claims that lmtx is 
unusable.


Hans

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

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

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


[NTG-context] Re: redefine space to be the same as \␣ similar to knuthian approach

2023-08-20 Thread Hans Hagen

On 8/20/2023 5:51 PM, Carlos wrote:

On Sun, Aug 20, 2023 at 03:38:15PM +0200, Wolfgang Schuster wrote:

Carlos schrieb am 19.08.2023 um 15:32:

On Fri, Aug 18, 2023 at 08:58:58PM +0200, Wolfgang Schuster wrote:

Hi,

1. Learn to two provide a working minimal example which shows the problem.


Did the minimal example I provided earlier wasn't enough for you?

Besides, You know perfectly well that \stoptext is not even necessary,
superflous; it's not required to compile any context flavor file for
ages now.

So I suggest you to save those keystrokes for other tasks. Not those,
petty petty betty. I know it's hard to teach an ol' dog new tricks,
but… it's worth to try! right?


Please explain why this example (which is a valid ConTeXt document) works


Opening a group with \starttext makes no sense because there is nothing after 
\stoptext.

The possibility to nest \starttext is necessary when you \startproduct etc. 
where components can be be documents on its own and this means \startcomponent 
includes \starttext in its
definition.


 begin example
\starttext

\starttext

\stoptext

\stoptext
 end example

but this doesn't.

 begin example
\starttext

\starttext
 end example

Wolfgang


Take a look at the command line when you process a file and you should see 
something like this:

As you can see the luatex engine processes the file cont-yes.mkiv and not your 
document which put as argument to context. Your document is just read by 
cont-yes.mkiv and at the end of the document ConTeXt inserts an extra \stoptext 
which is ignored when your document
is valid (equal number of \starttext and \stoptext).


The bonus \starttext is just there so that we can use \startTEXpage etc 
without wrapper and a second bonus is that it catches sloppy coding and 
if a user want to take a shortcut and save a handful of keystrokes it's 
fine for me but support converges to zero (unless one pays top money for 
the incovenience). There is only so much you can expect from volunteers.



Wolfgang. I do appreciate your emphasis and your input on all of this.
I do. I really do. But we can't go over this, over and over again. Do
you know who said the above? Not me. You. Do you know whose remarks
are those? Not mine.  Yours.

Replace cont-yes.mkiv with the newer equivalent. And you're right though. 
\starttext is not even needed most of the times.
Wolfgang tries to educate you ... starttext is the anchor for checking 
if a bodyfont has been defined and if not it kicks in some default.


Now with that said:

When Wolfgang asks / tells something because there is nothing in context 
that he doesn't know. And you can bet then he knowa more than you do 
about the internals, objectives and implementation. So, let me put it a 
bit stronger: if Wolfgang gives you an answer that you don't like, you 
should be very careful in your answering because there is very little 
change that he's wrong. To stress his position here: if he sends me a 
patch I can merge it in without testing it which (believe me) is a 
rather unique positin. From this you might conclude that I don't like 
your tone.


And with that out if the way:

When Mikael wonders if there might be something with your installation 
you should indeed sit down and wonder a bit if that could be the case 
because he is a pretty good tester who had been around for quite a 
while. So you can be sure that he tested it well and that he has a 
proper setup. Personally I'd be worried if someone doubts my installation.


Did you install from the garden, using the lmtx installer? Because that 
is the reference. Everything installed otherwise is the users problem.


Which brings me to this file read only thing you mention. If your font 
cache is not writable you migth end up with bad metrics indeed just 
because there are no font resources but that's not up to context to deal 
with.


Also, \␣ is a fixed space and has no glue so i keep wondering what  this 
brings to the picture,


Hans

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

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

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

[NTG-context] Re: Experiments with \doloopoverlist

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

On 8/17/2023 3:50 AM, Andres Conrado Montoya wrote:

Hello List.

I've been trying to typeset a somewhat complex list of authors for several
articles and a book.
My proof of concept seems to work fine, however, I know I am doing weird
things that I think could probably be done in a better way. I'm using
datasets and a recursion, kind of hacky but I can't find a better way of
handling it. Specifically I would like to know:
1. Is there a way of getting the length of a filled dataset? (how many
entries it contains)
2. Is it OK to use \startuserdata \stopuserdata without its inlineuserdata?
Is there an alternative that does not require inlineuserdata?


Weird is relative. Just use what you like most. One could for instance 
use the publication mechanism but you need to set up a bit more (see 
manual for example of usa as database).


Now datasets. It is not hard to add a size query so I added that. Your 
data is missins commas so let's fix that first


\definedataset[autores]

\setdataset[autores]
[
nombre={Angie Natalia Farfán Acevedo},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002125949},
orcid={https://orcid.org/0009-0007-0765-4241},

gscholar={https://scholar.google.com/citations?user=GpYTTU0J=es=1},
]

\setdataset[autores]
[
nombre={Ivon Andrea Rodríguez Román},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=027033},
orcid={https://orcid.org/0009-0001-1183-6829},

gscholar={https://scholar.google.com/citations?user=iz8SQNcJ=es},
]

\setdataset[autores]
[
  nombre={Angie Caterin Garzón González},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002128501},
  orcid={https://orcid.org/0009-0009-0990-6902},

gscholar={https://scholar.google.com/citations?view_op=list_works=es=5WqcOeEJ},
]

\setdataset[autores]
[
  nombre={Heidy Paola Veira Tenorio},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002127550},
  orcid={https://orcid.org/0009-0008-4076-7317},

gscholar={https://scholar.google.es/citations?view_op=new_profile=es=1},
]

\setdataset[autores]
[
nombre={Yerly Lorena Diaz Aldana},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002127754},
orcid={https://orcid.org/0009-0008-1720-4057},

gscholar={https://scholar.google.com/citations?hl=es=0obyCwkJ_op=list_works=AOV7GLPWRTK-xooHNe0iQ3uubfcSbG__GY_Guy35FdaqDJA3OfLLtp01-E1kzjxUhltlsfj494MaoQFkk9U9hCFYSipoR8aX0Vu2E6sV},
]

There is no need to use userdata as intermediate:

% \startsetups[userdata:idautor]
%   \dontleavehmode
%   \imghref
% {\externalfigure[cvlac.pdf][logo]}
% {\datasetvariable{autores}{\recurselevel}{vclac}}
% \quad
%   \imghref
% {\externalfigure[orcid.pdf][logo]}
% {\datasetvariable{autores}{\recurselevel}{orcid}}
% \quad
%   \imghref
% {\externalfigure[gscholar.pdf][logo]}
% {\datasetvariable{autores}{\recurselevel}{nombre}}
% \quad
%   \datasetvariable{autores}{\recurselevel}{nombre}\par
% \stopsetups

Just loop over the set and call up the variables in the setup:

% \startdocument
%   \dorecurse{\datasetsize{autores}}{
% \setups[userdata:idautor]
%   }
% \stopdocument

However, i can provide a processor:

% \startsetups[userdata:idautor]
%   \dontleavehmode
%   \imghref
% {\externalfigure[cvlac.pdf][logo]}
% {\datasetvariable{autores}{\datasetindex}{vclac}}
% \quad
%   \imghref
% {\externalfigure[orcid.pdf][logo]}
% {\datasetvariable{autores}{\datasetindex}{orcid}}
% \quad
%   \imghref
% {\externalfigure[gscholar.pdf][logo]}
% {\datasetvariable{autores}{\datasetindex}{nombre}}
% \quad
%   \datasetvariable{autores}{\datasetindex}{nombre}\par
% \stopsetups

As we know what dataset we process:

\startsetups[userdata:idautor]
  \dontleavehmode
  \imghref
{\externalfigure[cvlac.pdf][logo]}
{\datasetentry{vclac}}
\quad
  \imghref
{\externalfigure[orcid.pdf][logo]}
{\datasetentry{orcid}}
\quad
  \imghref
{\externalfigure[gscholar.pdf][logo]}
{\datasetentry{nombre}}
\quad
  \datasetentry{nombre}
  \par
\stopsetups

We then end up with:

\startdocument
  \processdataset[autores][userdata:idautor]
\stopdocument

I'll mail you the patch. Copy it to the right place and remake the format.

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

[NTG-context] Re: disable header for endnotes

2023-08-16 Thread Rik Kabel

On 8/16/2023 5:02 AM, jbf wrote:


I wonder if someone might be able to help me with this.

I have a book in three parts and the author wants endnotes. No 
problem. I can produce those with \setupfootnotes[location=text] and 
then \placefootnotes.


However, I would like the header to read 'Notes' on the recto page (or 
indeed be blank with no header), but I am currently getting the header 
that belongs to the main setup for headers, which happens to be:


\startsetups[middle]

\hfill

\getmarking[section]

\hfill

\stopsetups

\setupheadertexts

[{\hfill\documentvariable{metadata:title}\hfill}][]

[\setups{middle}][]

How do I deal with the \placefootnotes command so that it ignores this 
and either gives me no header, or perhaps a new header with 'Notes' in 
place of [section] (which is achieved in centered position with 
setups[middle])?


Julian


I use the following for a notes chapter at the end of a book. It 
produces headings that indicate the pages for which the notes apply. 
Perhaps you can adapt it to your needs:


   In the environment file:

   \definemarking [notePage] \startsetups noteHeadingsText {\em
   Notes for page
   \doifelse{\fetchmark[notePage][top]}{\fetchmark[notePage][bottom]}
   { \getmarking[notePage][top]} {s
   \getmarking[notePage][top]–\getmarking[notePage][bottom]}}
   \stopsetups \startsetups noteHeadings:on
   \setupheadertexts[][\setups{noteHeadingsText}]
   [\setups{noteHeadingsText}][] \stopsetups

   In the text:

   \startbackmatter \startchapter[reference={cha:notes},
   list={Notes}, % toc bookmark={Notes}, % pdf bookmark
   title={Notes}] % chapter head [Lettrine=no]
   \setups{noteHeadings:on} \placenotes[endnote] \stopchapter

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

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

[NTG-context] disable header for endnotes

2023-08-16 Thread jbf

I wonder if someone might be able to help me with this.

I have a book in three parts and the author wants endnotes. No problem. 
I can produce those with \setupfootnotes[location=text] and then 
\placefootnotes.


However, I would like the header to read 'Notes' on the recto page (or 
indeed be blank with no header), but I am currently getting the header 
that belongs to the main setup for headers, which happens to be:


\startsetups[middle]

\hfill

\getmarking[section]

\hfill

\stopsetups

\setupheadertexts

[{\hfill\documentvariable{metadata:title}\hfill}][]

[\setups{middle}][]

How do I deal with the \placefootnotes command so that it ignores this 
and either gives me no header, or perhaps a new header with 'Notes' in 
place of [section] (which is achieved in centered position with 
setups[middle])?


Julian

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

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

[NTG-context] Re: upload

2023-08-10 Thread Thangalin
Did arguments regress in 2023.08.10 02:59?

$ cat u.tex
\starttext
Feisty arguments
\stoptext
$ context u.tex
$  ls -la *.pdf
-rw-r--r-- 1 username username 6279 Aug 10 18:28 u.pdf
$ context --arguments=x=y u.tex | grep error
tex error   > tex error on line 13 in file : Use of \getrawparameters
doesn't match its definition
mtx-context | fatal error: return code: 1

This was working with the previous release.

On Wed, Aug 9, 2023 at 8:43 AM Hans Hagen  wrote:

> Hi,
>
> I uploaded a new lmtx. There are some new features that wil be revealed
> in the future (likely after the meeting) but here is one:
>
> \starttext
>
>  \defineoverlay
>[test]
>[\color
>   [blue]
>   {TEST
>\inframed
>  [foregroundcolor=red]
>  {xxx}
>TEST}]
>
>  \framed
>[background=test,
> foregroundstyle=\switchtobodyfont[small]]
>{test}
>
> \stoptext
>
>  From now on many commands accept (properly) nested [] inside commands
> that use [] as fences (like the setup commands) where it makes sense. It
> is up to the user to decide to use {} (as before) or not but it is less
> error prone.
>
> It is now also possible to nest setups as in
>
> \starttext
>
> \startsetups one
>  \startsetups [three]
>  HERE
>  \stopsetups
> \stopsetups
>
> \startsetups two
>  \startsetups [three]
>  THERE
>  \stopsetups
> \stopsetups
>
> \setups[one] \setups[three]
>
> \setups[two] \setups[three]
>
> \stoptext
>
> As part of the ongoing improvements on math rendering we added some
> classic lm/cm kerns (between upperacse and periods / commas) in the
> goodie files.
>
> Some lowlevel manuals have been extended, explaining experimental 'named
> cross macro nesting parameter referencing' and 'constrained cq. retained
> assignments', but that is only relevant for those interested in
> overcoming some limitations in the traditional engines.
>
> Hans
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Map XML attributes to variables, dynamically

2023-08-10 Thread Thangalin
Hello!

A Markdown document resembles the following:

::: {.concurrent title="Berth 5" location="San Diego"}
Text Goes Here
:::

::: {.concurrent title="Road" location="Beale AFB"}
Different Text Goes Here
:::

The XHTML generated from that document resembles:


Text Goes Here


Different Text Goes Here


Environments for the DIV element gets translated using:

\startxmlsetups xml:div
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

This creates "\startconcurrent" and "\stopconcurrent", which are later
defined using "\definestartstop[concurrent]".

I'd like to dynamically define all the data- attributes to make key/value
pairs accessible from the document. For example, I have this:

\definestartstop[concurrent][
  before={%
\blank[big]%
\setMPtext{1}{Berth 5}%
\startTextConcurrentFrame},
  after={\stopTextConcurrentFrame\blank[big]},
]

I'd like to replace \setMPText calls with a reference to a dynamically
created variable reference. For example:

\setMPtext{1}{\usermap[concurrent.title]}
\setMPtext{2}{\usermap[concurrent.location]}

I can verify the attribute values exist by exporting them to the document:

\startxmlsetups xml:div
  title:\xmlatt{#1}{data-title} location:\xmlatt{#1}{data-location}
  \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop
\stopxmlsetups

How would you change the xml:div setup to create a map of its attributes as
key/value pairs?

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

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

[NTG-context] upload

2023-08-09 Thread Hans Hagen

Hi,

I uploaded a new lmtx. There are some new features that wil be revealed 
in the future (likely after the meeting) but here is one:


\starttext

\defineoverlay
  [test]
  [\color
 [blue]
 {TEST
  \inframed
[foregroundcolor=red]
{xxx}
  TEST}]

\framed
  [background=test,
   foregroundstyle=\switchtobodyfont[small]]
  {test}

\stoptext

From now on many commands accept (properly) nested [] inside commands 
that use [] as fences (like the setup commands) where it makes sense. It 
is up to the user to decide to use {} (as before) or not but it is less 
error prone.


It is now also possible to nest setups as in

\starttext

\startsetups one
\startsetups [three]
HERE
\stopsetups
\stopsetups

\startsetups two
\startsetups [three]
THERE
\stopsetups
\stopsetups

\setups[one] \setups[three]

\setups[two] \setups[three]

\stoptext

As part of the ongoing improvements on math rendering we added some 
classic lm/cm kerns (between upperacse and periods / commas) in the 
goodie files.


Some lowlevel manuals have been extended, explaining experimental 'named 
cross macro nesting parameter referencing' and 'constrained cq. retained 
assignments', but that is only relevant for those interested in 
overcoming some limitations in the traditional engines.


Hans


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

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


[NTG-context] Re: Bibliography cite

2023-08-05 Thread Robert via ntg-context
Dear Alan,

Thanks for your response. What I need in fact is this

Knuth (1984:12).

I am sorry for the confusion.

I will try your suggestions!

Robert


> Op 4 aug. 2023, om 13:57 heeft Alan Braslau  het 
> volgende geschreven:
> 
> Indeed, one does not need the comma, it is programmed in the style.
> You can see this in the manual, on p. 43 documenting citations.
> 
> The style is setup to put the righttext inside the parenthesis for 
> alternative=authoryear and outside of the year parenthesis for 
> alternative=authoryears.
> 
> I looked carefully in the APA Style Guide and did not find any suggestion 
> that one should use Knuth (1984, p. 3). The variant (Knuth, 1984, p. 3) is 
> documented.
> 
> You can make the following changes (untested)
> \setupbtx [apa:cite:author:years] [right=]
> \setupbtx [apa:cite:authoryears] [right={)}]
> to get the other behavior.
> 
> --
> Alan
> 
> 
> On 01/08/23 01/08/23, 23:26, Robert via ntg-context wrote:
>> Thank you, Alan for the suggestion.
>> I tried as you said: \cite[alternative=authoryears,righttext={{, p. 
>> 3}}][Knuth1984].
>> Yet the result is this: Knuth (1984), , p. 3
>> If I leave out the first comma, the result is: Knuth (1984), p. 3
>> Righttext probably refers to the text outside the parentheses.
>> Thank you in advance,
>> Robert.
>>> Op 1 aug. 2023, om 22:42 heeft Alan Braslau  het 
>>> volgende geschreven:
>>> 
>>> Using the APA specification:
>>> 
>>> \usebtxdefinitions
>>>[apa]
>>> 
>>> 
>>> you can then
>>> 
>>> \cite[alternative=authoryears,righttext={{, p.\nbsp 12}}] [Knuth1984]
>>> mentions ….
>>> 
>>> 
>>> The tricky part concerning righttext= is the double {{ }}, needed because 
>>> the text contains a comma. The reason for this is simple, as righttext is a 
>>> comma-separated list, where each entry corresponds to a cited reference, as 
>>> in \cite[righttext={a,b}] [ref1,ref2]
>>> so a is associated with ref1 and b is associated with ref2.
>>> 
>>> Alan
>>> 
>>> 
>>> 
>>> On 01/08/23 01/08/23, 15:37, Robert via ntg-context wrote:
>>>> Dear List members,
>>>> For my academic work with context I need the following cite according to 
>>>> Apa standards:
>>>> Knuth (1984, p. 12) mentions ….
>>>> The matrix is this:
>>>> AUTHOR (, p.~n).
>>>> I reckon this can somehow be accomplished with the \setupbtx command.
>>>> (Standard these and other variants are possible: AUTHOR () and AUTHOR 
>>>> , p. n.)
>>>> I tried different setups: \setupbtx[apa:cite:authoryear], and 
>>>> \setupbtx[apa:cite:authoryears], I played with the lefttext, righttext and 
>>>> other options, but none of them give the desired result.
>>>> Thank you for any suggestions.
>>>> Regards,
>>>> Robert
>>>> @article{Knuth1984,
>>>> author={Knuth, Donald E.},
>>>> title={Literate Programming},
>>>> journal={The Computer Journal}, Volume={27}, Number={2}, year={1984},
>>>> Pages={97--111},
>>>> }
>> 

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

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

[NTG-context] Re: Bibliography cite

2023-08-04 Thread Alan Braslau via ntg-context

Indeed, one does not need the comma, it is programmed in the style.
You can see this in the manual, on p. 43 documenting citations.

The style is setup to put the righttext inside the parenthesis for 
alternative=authoryear and outside of the year parenthesis for 
alternative=authoryears.


I looked carefully in the APA Style Guide and did not find any 
suggestion that one should use Knuth (1984, p. 3). The variant (Knuth, 
1984, p. 3) is documented.


You can make the following changes (untested)
\setupbtx [apa:cite:author:years] [right=]
\setupbtx [apa:cite:authoryears] [right={)}]
to get the other behavior.

--
Alan


On 01/08/23 01/08/23, 23:26, Robert via ntg-context wrote:

Thank you, Alan for the suggestion.

I tried as you said: \cite[alternative=authoryears,righttext={{, p. 
3}}][Knuth1984].


Yet the result is this: Knuth (1984), , p. 3

If I leave out the first comma, the result is: Knuth (1984), p. 3

Righttext probably refers to the text outside the parentheses.

Thank you in advance,

Robert.


Op 1 aug. 2023, om 22:42 heeft Alan Braslau  
het volgende geschreven:


Using the APA specification:

\usebtxdefinitions
   [apa]


you can then

\cite[alternative=authoryears,righttext={{, p.\nbsp 12}}] [Knuth1984]
mentions ….


The tricky part concerning righttext= is the double {{ }}, needed 
because the text contains a comma. The reason for this is simple, as 
righttext is a comma-separated list, where each entry corresponds to a 
cited reference, as in \cite[righttext={a,b}] [ref1,ref2]

so a is associated with ref1 and b is associated with ref2.

Alan



On 01/08/23 01/08/23, 15:37, Robert via ntg-context wrote:

Dear List members,
For my academic work with context I need the following cite according 
to Apa standards:

Knuth (1984, p. 12) mentions ….
The matrix is this:
AUTHOR (, p.~n).
I reckon this can somehow be accomplished with the \setupbtx command.
(Standard these and other variants are possible: AUTHOR () and 
AUTHOR , p. n.)
I tried different setups: \setupbtx[apa:cite:authoryear], and 
\setupbtx[apa:cite:authoryears], I played with the lefttext, 
righttext and other options, but none of them give the desired result.

Thank you for any suggestions.
Regards,
Robert
@article{Knuth1984,
author={Knuth, Donald E.},
title={Literate Programming},
journal={The Computer Journal}, Volume={27}, Number={2}, year={1984},
Pages={97--111},
}



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

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

[NTG-context] Re: Par Builder Tests

2023-07-30 Thread Keith McKay
Hraban's suggestion works really well. I setup hyphenation rules for the 
underfull boxes of Russian names and reduced the \tolerance to 600.  I'm 
now down to about 20 underfull boxes which to my eyes look fine.


Thanks again Hraban

Best Wishes

Keith

On 28/07/2023 19:20, Keith McKay wrote:


Thanks Hraban, didn't think of that so will give it a try.
Best Wishes
Keith


On Fri, 28 Jul 2023, 17:28 Henning Hraban Ramm,  wrote:

Am 28.07.23 um 17:04 schrieb Keith McKay:
> I played around with the setups for the align:pass:test4 code
below, as
> Hans suggested, and it was changing the \tolerance value which
made the
> difference. Increasing the \tolerance value to 1000 eliminated all
> overfull hboxes but still left 79 underfull hboxes. I continued to
> increase the \tolerance value up to 6600 and was left with two
overfull
> hboxes. One with a badness of 6641 (warAndPeace1.png) and one
with a
> badness of 1097 (warAndPeace2.png). Above the \tolerance of 6600
only
> warAndPeace2.png was left with a badness of 1097. Both of these
> underfull hboxes were at the beginning of a paragraph - "To his
Honor"
> in the first png and "Well, you see," in the second png. I not
sure a
> reader would spot the second png badness but the first is
noticeable to
> my eyes.

Hi Keith,
since both cases are caused by names with accents, did you try to add
hyphenation exceptions for those? Such cases are probably not
covered by
English hyphentation rules.

Hraban


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

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

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

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

[NTG-context] Re: combining \definetyping and \definebuffer

2023-07-30 Thread Henning Hraban Ramm

Am 29.07.23 um 23:16 schrieb Hans Hagen:

On 7/29/2023 10:35 PM, Henning Hraban Ramm wrote:


The setup for MyCode is not applied to \typeMyBuffer, and I don’t know 
how it could; something like \typeMyBuffer[MyCode] doesn’t work.


These commands inherit from buffer, so \setupbuffer will work. But as I 
need to prevent you to come up with some ugly hack (after all your 
upcoming book should be hack free) ...


;-D

I’m not sure my book will even go so deep, it’s already too big and will 
never contain everything I’d like it to.
For the code examples therein I used some hacks (getting rid of them one 
by one), but I’m working on a module (more like a LaTeX-style document 
class) for DANTE’s DTK, to be able to write my articles about ConTeXt in 
ConTeXt and have them included as PDFs. For other authors, I’d like the 
syntax to be as simple as possible (using generic ConTeXt macros), so I 
use \setuptyping for the general style with a background box. But that 
conflicts with the setups for special cases like code and result side by 
side.

I guess I’ll also include this in the CGJ setup.

... attached an extension that supports inheritance (via category), 
still honors 'buffer' otherwise and accepts an optional category instead 
of settings. take your choice ...


You can put the patch in cont-new.mkxl assuming you wikify it too.


Thank you! Will do. I guess it’ll be in the next upload, too?

Hraban

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

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

[NTG-context] Re: combining \definetyping and \definebuffer

2023-07-29 Thread Hans Hagen

On 7/29/2023 10:35 PM, Henning Hraban Ramm wrote:

Am 29.07.23 um 22:06 schrieb Bruce Horrocks:
Your example seems to work: I see the \getbuffer[MyBuffer] command 
typed (not executed) with colour coding on the keyword and line 
numbered; then the block text fakewords from the visual module; then 
the \fakewords macro shown (again not executed) as per the default for 
typing.


The setup for MyCode is not applied to \typeMyBuffer, and I don’t know 
how it could; something like \typeMyBuffer[MyCode] doesn’t work.


These commands inherit from buffer, so \setupbuffer will work. But as I 
need to prevent you to come up with some ugly hack (after all your 
upocoming book should be hack free) ...


... attached an extension that supports inheritance (via category), 
still honors 'buffer' otherwise and accepts an optional category instead 
of settings. take your choice ...


You can put the patch in cont-new.mkxl assuming you wikify it too.

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
-
\unprotect \pushoverloadmode

\appendtoks
\frozen\instance\protected\edefcsname\e!type\currentbuffer\endcsname
  
{\buff_verbatim_type_defined_buffer[\currentbuffer][\currentdefinedbuffer]}%
\to \everydefinebuffer

\tolerant\protected\def\buff_verbatim_type_defined_buffer[#1]#*[#2]#*[#3]% 
category name settings
  {\begingroup
   \cdef\currenttyping{\namedbufferparameter{#1}\c!category}%
   \ifempty\currenttyping
 \let\currenttyping\v!buffer
   \fi
   \ifhastok={#3}%
 \setupcurrenttyping[#3]%
   \orelse\ifempty{#3}\else
 \cdef\currenttyping{#3}
   \fi
   \buff_verbatim_type_buffer_indeed{\currenttyping}{#2}%
   \useindentnextparameter\typingparameter
   \endgroup
   \dorechecknextindentation}

\popoverloadmode \protect

\usemodule[visual]

\definetyping[MyCode]

\setuptyping
  [MyCode]
  [option=tex,
   numbering=file]

\definebuffer
  [MyBuffer]
  [category=MyCode]

\setuptyping
  [MyBuffer]
  [option=TEX,
   numbering=file]

% \setuptyping
%   [buffer]
%   [option=TEX,
%numbering=file]

\startMyBuffer
\fakewords{10}{20}
\stopMyBuffer

\starttext

\startMyCode
\fakeword
\stopMyCode

\getMyBuffer

\typeMyBuffer

\typeMyBuffer[MyCode]

\typeMyBuffer[option=TEX]

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

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

[NTG-context] Re: combining \definetyping and \definebuffer

2023-07-29 Thread Henning Hraban Ramm

Am 29.07.23 um 22:06 schrieb Bruce Horrocks:

Your example seems to work: I see the \getbuffer[MyBuffer] command typed (not 
executed) with colour coding on the keyword and line numbered; then the block 
text fakewords from the visual module; then the \fakewords macro shown (again 
not executed) as per the default for typing.


The setup for MyCode is not applied to \typeMyBuffer, and I don’t know 
how it could; something like \typeMyBuffer[MyCode] doesn’t work.


Hraban

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

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

  1   2   3   4   5   6   7   8   9   10   >