[NTG-context] Font switching for titles and subtitle not working as expected ?

2024-04-30 Thread denis.maier
Hi,
I just jumbled upon this question on tex stackexchange : 
https://tex.stackexchange.com/questions/715799/context-switching-font-for-both-title-and-subject#715804
Using the style key as suggested in the accepted answer works, but I've had a 
look in to this, and I don't understand why the original code does not work.
I've also tried to find a solution using textcommand instead of command, but 
that makes no difference. Only one setting will be accepted. As soon as both, 
titles and subjects, are changed only the first change will be accepted.

Is this a bug, or am I missing something?

Best,
Denis


%
% Original MWE

\define[2]\mytitle{%
  \switchtobodyfont[chorus]%
  #2
}

\define[2]\mysubject{%
  \switchtobodyfont[chorus]%
  #2
}

\setuphead[title][command=\mytitle]
\setuphead[subject][command=\mysubject]

\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\stoptext
%

%
% Adapted MWE
%

\define[1]\mytitleformat{%
  \switchtobodyfont[chorus]%
  #1
}

%\setuphead[subject,title][textcommand=\mytitleformat]
%\setuphead[title][textcommand=\mytitleformat]
\setuphead[subject][textcommand=\mytitleformat] % this will adapt the format 
for subjects, as long as titles are not changed


\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\stoptext
%%
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] \par and \startlines

2024-04-26 Thread denis.maier
Hi,

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

Best,
Denis

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

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

\xmlregistersetup{xml:test}

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

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

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

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

\startbuffer[test]




The
lines
are
there!


The
lines
are
there!



\stopbuffer


\starttext

This works:

\startlines
The
lines
are
there!

The
lines
are
there!
\stoplines

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

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

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

\xmlprocessbuffer{test}{test}{}

\stoptext
%%

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

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


[NTG-context] floats re-ordering and numbering

2024-04-22 Thread denis.maier
Hi,

I've found that occasionally the order of floats change, but the numbering 
still reflects the order in the input file. Is that the intended behaviour? Is 
there a way to number to floats according to their order in the (visual) output?

Best,
Denis

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

\setupfloats[compress=no]
\setupfloat[figure][default=top]

\starttext

\input knuth

\placefigure{Cow 1}{\externalfigure[cow][
width=.5\textwidth,
]}
\placefigure{Cow 2}{\externalfigure[cow][
width=.8\textwidth,
]}

\placefigure{Cow 3}{\externalfigure[cow][
width=.7\textwidth,
]}

\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] minwidth not working ?

2024-04-10 Thread denis.maier
Hi,
Shouldn't minwidth set a default minimal width for external figures? But this 
here does not work

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

\starttext

\externalfigure[cow.pdf]

\externalfigure[cow.pdf][width=\textwidth]

\stoptext
==

Am I missing something here?

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

2023-09-15 Thread denis.maier
I thought there should be a setups key on \setupsectionblock, but apparently 
there isn’t. So, the example below does not work, but maybe it wouldn’t be too 
hard to add it…

Best,
Denis


\setuphead[chapter][page=yes]

\setupsectionblock[backmatter][setups={\setuphead[chapter][page=no]}]

\starttext

\chapter{One}
\input knuth

\chapter{Two}
\input ward


\startbackmatter
\chapter{Three}
\input knuth

\chapter{Four}
\input ward
\stopbackmatter
\stoptext


Von: Jeroen 
Gesendet: Donnerstag, 14. September 2023 23:50
An: mailing list for ConTeXt users 
Betreff: [NTG-context] Chapters without new page

In the \startbackmatter ... \stopbackmatter section i would like to have some 
chapters that are not automatically placed on a new page for the next chapter. 
Is there an easy way to suppress the new page for these chapters?
Thanks, Jeroen
___
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: tiffs: autoconversion via graphicsmagick produces invalid pdfs

2023-09-13 Thread denis.maier
Ok, I've found a solution.

%
\enabletrackers[graphics.conversion]

\startluacode
local function convert(oldname, newname)
os.execute(string.format(
'gm convert "%s" "%s"', oldname, newname)
)
end

-- Set the PDF, JPEG and default TIFF converters to the above function.
figures.converters.tif.pdf = convert
figures.converters.tif.jpg = convert
figures.converters.tif.default = convert
\stopluacode

\setfigureconversion[tif][jpg] % has no effect

\starttext

\externalfigure[test.tif][conversion=jpg]

\stoptext
%%%

Would it make sense to add
tifconverter.pdf = converter
to grph-con.lua (line 293) ?

Why is it that \setfigureconversion has no effect? Without conversion=jpg on 
\externalfigure, ConTeXt insists on converting to PDF. (I couldn't find the 
command in the sources, but I'm not getting a undef'ed cs error either, so it 
must be defined somewhere...)

I've also found out I can use a custom command that calls \externalfigure with 
the right settings depending on the filetype:

%%%
\enabletrackers[graphics.conversion]

\startluacode
local function convert(oldname, newname)
os.execute(string.format(
'gm convert "%s" "%s"', oldname, newname)
)
end

-- Set the PDF and default TIFF converters to the above function.
figures.converters.tif.pdf = convert
figures.converters.tif.jpg = convert
figures.converters.tif.default = convert
\stopluacode

\setfigureconversion[tif][jpg] % has no effect

\defineexternalfigure[tif][conversion=jpg]

\starttexdefinition includegraphics #1
  \splitfilename{#1}

  \processaction[\splitofftype][
tif=>{\externalfigure[#1][tif]},
default=>{\externalfigure[#1]},
unknown=>{\externalfigure[#1]}
  ]
\stoptexdefinition

\starttext

\includegraphics{test.tif} % will be converted to jpg

\externalfigure[test.tif] % will be converted to pdf

\stoptext


But I think it would be nicer to stick to the default \externalfigure.

Best,
Denis

Von: denis.ma...@unibe.ch 
Gesendet: Dienstag, 12. September 2023 17:09
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: tiffs: autoconversion via graphicsmagick produces 
invalid pdfs

Sorry, that was too quick...

Hi,

currently, ConTeXt can't use tiffs directly, but it uses Graphicsmagick to 
convert tiffs to pdf on the fly. However, as it seems, graphicsmagick is 
producing invalid pdfs.

For every included tiff I have something like this in the log:
luatex warning  > pdfe: invalid 11 0 R object at offset 573751
luatex warning  > pdfe: invalid 11 0 R object at offset 629127

The offsets are different, but it's always this .

This bug has been known for quite some time, but it apparently hasn't been 
fixed yet: https://sourceforge.net/p/graphicsmagick/bugs/513/

Converting the tiffs to jpeg circumvents the problem. Would it be an option to 
convert tiffs to jpegs instead of to pdf? (Is that already possible?)

Best,
Denis



Von: denis.ma...@unibe.ch 
mailto:denis.ma...@unibe.ch>>
Gesendet: Dienstag, 12. September 2023 17:03
An: ntg-context@ntg.nl
Betreff: [NTG-context] tiffs: autoconversion via graphicsmagick produces 
invalid pdfs

Hi,

currently, ConTeXt can't use tiffs directly, but it uses
___
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: Using structureuservariables before the heading

2023-09-12 Thread denis.maier
Von: Wolfgang Schuster 
Gesendet: Dienstag, 12. September 2023 23:16
An: Maier, Denis Christian (UB) 
Cc: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Using structureuservariables before the heading

denis.ma...@unibe.ch schrieb am 12.09.2023 um 
21:38:

Von: Wolfgang Schuster 

Gesendet: Dienstag, 12. September 2023 21:30
An: Maier, Denis Christian (UB) 

Cc: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Using structureuservariables before the heading

denis.ma...@unibe.ch schrieb am 12.09.2023 um 
21:24:



Von: Wolfgang Schuster 

Gesendet: Dienstag, 12. September 2023 20:41
An: mailing list for ConTeXt users 
; Maier, Denis Christian (UB) 

Betreff: Re: [NTG-context] Using structureuservariables before the heading

denis.ma...@unibe.ch schrieb am 12.09.2023 um 
17:47:



Hi,

is it possible to access a structureuservariable before the heading's title ?
Using the  key does not seem to work.

There are ways but not in a general way because you try to access the values
before they are known to ConTeXt. To provide a proper solution you have
to tell what you're trying to achieve.

I'm just trying to output the author's name above a chapter heading. Do you 
need more information?

You can create a custom header for the chapter page and show the value of the 
author key
which works without problems because the header is added after to the finished 
page
after the value is available.

Another option when the name should appear in the same space as the chapter 
title
is a custom layout for the title.
Yes, I've tried that in the original MWE:

...

Here, I'm getting  just before <3 Third>. So I guess this goes in 
the right direction, but \define doesn't allow for blanks etc. 
\starttexdefinition and \def on the other hand gave me erros.

You need a box to get the author on a separate line.

% \define[2]\ChapterCommand
%   {\vbox
%  {\structureuservariable{author}
%  \blank
%  #1\space#2}}

\starttexdefinition protected ChapterCommand #1#2
  \vbox\bgroup
\structureuservariable{author}
\blank
#1\space#2
  \egroup
\stoptexdefinition


Thank you so much, Wolfgang!

Why do you need protected here? I've realized that \protected\def also helps a 
bit, but, of course, paragraph breaks are ignored there as well...
If just found the following in the lowlevel-macros manual:

So, \long is gone, but why is that? Is there a new mechanism that serves the 
same purpose? Other than using a vbox, I mean...

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: Using structureuservariables before the heading

2023-09-12 Thread denis.maier
Von: Wolfgang Schuster 
Gesendet: Dienstag, 12. September 2023 21:30
An: Maier, Denis Christian (UB) 
Cc: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Using structureuservariables before the heading

denis.ma...@unibe.ch schrieb am 12.09.2023 um 
21:24:


Von: Wolfgang Schuster 

Gesendet: Dienstag, 12. September 2023 20:41
An: mailing list for ConTeXt users 
; Maier, Denis Christian (UB) 

Betreff: Re: [NTG-context] Using structureuservariables before the heading

denis.ma...@unibe.ch schrieb am 12.09.2023 um 
17:47:


Hi,

is it possible to access a structureuservariable before the heading's title ?
Using the  key does not seem to work.

There are ways but not in a general way because you try to access the values
before they are known to ConTeXt. To provide a proper solution you have
to tell what you're trying to achieve.

I'm just trying to output the author's name above a chapter heading. Do you 
need more information?

You can create a custom header for the chapter page and show the value of the 
author key
which works without problems because the header is added after to the finished 
page
after the value is available.

Another option when the name should appear in the same space as the chapter 
title
is a custom layout for the title.
Yes, I've tried that in the original MWE:

%%
\setuphead[chapter][
before={Before: \structureuservariable{author}\blank},
beforesection={Beforesection: \structureuservariable{author}\blank},
insidesection={Insidesection: \structureuservariable{author}\blank},
after={After: \structureuservariable{author}\blank},
]

\def\myChapterCommand#1#2{\structureuservariable{author}\space\blank}
\define[2]\myChapterCommand{\structureuservariable{author}\blank #1\space#2}
%\def\myChapterCommand#1#2{\structureuservariable{author}\blank #1\space#2} % 
does not work

% \starttexdefinition myChapterCommand #1 #2 % doesn't work either, but at 
least blanks should work
%   \structureuservariable{author}
%   Test
%   \blank
%   #1\space#2
% \stoptexdefinition

\starttext

\myChapterCommand{1}{asdf}

\startchapter[title=First][author=First Author]
\input knuth
\stopchapter

\startchapter[title=Second][author=Second Author]
\input knuth
\stopchapter

\setuphead[chapter]
[
before=,after=,beforesection=,insidesection=,
command=\myChapterCommand,
]

\startchapter[title=Third][author={Third Author}]
\input knuth
\stopchapter

\stoptext
%%

Here, I'm getting  just before <3 Third>. So I guess this goes in 
the right direction, but \define doesn't allow for blanks etc. 
\starttexdefinition and \def on the other hand gave me erros.

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: Using structureuservariables before the heading

2023-09-12 Thread denis.maier

Von: Wolfgang Schuster 
Gesendet: Dienstag, 12. September 2023 20:41
An: mailing list for ConTeXt users ; Maier, Denis Christian 
(UB) 
Betreff: Re: [NTG-context] Using structureuservariables before the heading

denis.ma...@unibe.ch schrieb am 12.09.2023 um 
17:47:

Hi,

is it possible to access a structureuservariable before the heading's title ?
Using the  key does not seem to work.

There are ways but not in a general way because you try to access the values
before they are known to ConTeXt. To provide a proper solution you have
to tell what you're trying to achieve.

I'm just trying to output the author's name above a chapter heading. Do you 
need more information?

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: Using structureuservariables before the heading

2023-09-12 Thread denis.maier
Ok, \starttexdefinition allows blanks, apparently just like setups.
But, it still fails exactly like the version with \def


\setuphead[chapter][
before={Before: \structureuservariable{author}\blank},
beforesection={Beforesection: \structureuservariable{author}\blank},
insidesection={Insidesection: \structureuservariable{author}\blank},
after={After: \structureuservariable{author}\blank},
]

\def\myChapterCommand#1#2{\structureuservariable{author}\space\blank}
\define[2]\myChapterCommand{\structureuservariable{author}\blank #1\space#2}
%\def\myChapterCommand#1#2{\structureuservariable{author}\blank #1\space#2} % 
does not work

% \starttexdefinition myChapterCommand #1 #2 % doesn't work either, but at 
least blanks should work
%   \structureuservariable{author}
%   Test
%   \blank
%   #1\space#2
% \stoptexdefinition


\starttext

\myChapterCommand{1}{asdf}

\startchapter[title=First][author=First Author]
\input knuth
\stopchapter

\startchapter[title=Second][author=Second Author]
\input knuth
\stopchapter

\setuphead[chapter]
[
before=,after=,beforesection=,insidesection=,
command=\myChapterCommand,
]

\startchapter[title=Third][author={Third Author}]
\input knuth
\stopchapter


\stoptext

Von: denis.ma...@unibe.ch 
Gesendet: Dienstag, 12. September 2023 17:48
An: ntg-context@ntg.nl
Betreff: [NTG-context] Using structureuservariables before the heading

Hi,

is it possible to access a structureuservariable before the heading's title ?
Using the  key does not seem to work.

As an aside, I've tried to use the < command > key to provide my own command, 
but while \define works here (but ignores \blank), \def gives me an error.
Why is that?
How would you add blanks to a user-defined command?

Best,
Denis



\setuphead[chapter][
before={Before: \structureuservariable{author}\blank},
beforesection={Beforesection: \structureuservariable{author}\blank},
insidesection={Insidesection: \structureuservariable{author}\blank},
after={After: \structureuservariable{author}\blank},
]

\def\myChapterCommand#1#2{\structureuservariable{author}\space\blank}
\define[2]\myChapterCommand{\structureuservariable{author}\blank #1\space#2}
%\def\myChapterCommand#1#2{\structureuservariable{author}\blank #1\space#2} % 
does not work

\starttext
\macro{1}{2}

\startchapter[title=First][author=First Author]
\input knuth
\stopchapter

\startchapter[title=Second][author=Second Author]
\input knuth
\stopchapter

\setuphead[chapter]
[
before=,after=,beforesection=,insidesection=,
command=\myChapterCommand,
]

\startchapter[title=Third][author=Third Author]
\input knuth
\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://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] Using structureuservariables before the heading

2023-09-12 Thread denis.maier
Hi,

is it possible to access a structureuservariable before the heading's title ?
Using the  key does not seem to work.

As an aside, I've tried to use the < command > key to provide my own command, 
but while \define works here (but ignores \blank), \def gives me an error.
Why is that?
How would you add blanks to a user-defined command?

Best,
Denis



\setuphead[chapter][
before={Before: \structureuservariable{author}\blank},
beforesection={Beforesection: \structureuservariable{author}\blank},
insidesection={Insidesection: \structureuservariable{author}\blank},
after={After: \structureuservariable{author}\blank},
]

\def\myChapterCommand#1#2{\structureuservariable{author}\space\blank}
\define[2]\myChapterCommand{\structureuservariable{author}\blank #1\space#2}
%\def\myChapterCommand#1#2{\structureuservariable{author}\blank #1\space#2} % 
does not work

\starttext
\macro{1}{2}

\startchapter[title=First][author=First Author]
\input knuth
\stopchapter

\startchapter[title=Second][author=Second Author]
\input knuth
\stopchapter

\setuphead[chapter]
[
before=,after=,beforesection=,insidesection=,
command=\myChapterCommand,
]

\startchapter[title=Third][author=Third Author]
\input knuth
\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://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: tiffs: autoconversion via graphicsmagick produces invalid pdfs

2023-09-12 Thread denis.maier
Sorry, that was too quick...

Hi,

currently, ConTeXt can't use tiffs directly, but it uses Graphicsmagick to 
convert tiffs to pdf on the fly. However, as it seems, graphicsmagick is 
producing invalid pdfs.

For every included tiff I have something like this in the log:
luatex warning  > pdfe: invalid 11 0 R object at offset 573751
luatex warning  > pdfe: invalid 11 0 R object at offset 629127

The offsets are different, but it's always this .

This bug has been known for quite some time, but it apparently hasn't been 
fixed yet: https://sourceforge.net/p/graphicsmagick/bugs/513/

Converting the tiffs to jpeg circumvents the problem. Would it be an option to 
convert tiffs to jpegs instead of to pdf? (Is that already possible?)

Best,
Denis



Von: denis.ma...@unibe.ch 
Gesendet: Dienstag, 12. September 2023 17:03
An: ntg-context@ntg.nl
Betreff: [NTG-context] tiffs: autoconversion via graphicsmagick produces 
invalid pdfs

Hi,

currently, ConTeXt can't use tiffs directly, but it uses
___
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] tiffs: autoconversion via graphicsmagick produces invalid pdfs

2023-09-12 Thread denis.maier
Hi,

currently, ConTeXt can't use tiffs directly, but it uses
___
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-11 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: Reduce space between lines in Natural Tables

2023-09-11 Thread denis.maier
\bTABLE[spaceinbetween=0cm]
  ...
\eTABLE



Von: Jeroen 
Gesendet: Sonntag, 10. September 2023 22:05
An: mailing list for ConTeXt users 
Betreff: [NTG-context] Reduce space between lines in Natural Tables

Is there an easy way to reduce the line space between rows in a natural table 
so the table takes less vertical space.
Thanks, Jeroen
___
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, multiple spaces encoded as %20 get merged into one space

2023-09-06 Thread denis.maier
Hi,

I have the example below that uses the three images in the attachment.
For some reason multiple spaces encoded as %20 get merged into a single %20.

The first image () does not get included even though the 
name is correct.
The second image () gets included. Filename is correct.
The third image () gets included even though the actual 
file name does not contain two spaces (but @xlink:href does).

Any ideas what is going on here?

Then, in the case of the link, the two %20 end up as a single %20.

Best,
Denis

\setupinteraction[state=start]

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{document|fig}{xml:*}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

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

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

\startxmlsetups xml:graphic
  \externalfigure[\xmlfilter{#1}{./url('xlink:href')}]
\stopxmlsetups

\startxmlsetups xml:link
  https://uv-v4.netlify.app/\#?manifest=\xmlfilter{#1}{./url('xlink:href')}
\stopxmlsetups

\startxmlsetups xml:fig
\startplacefigure[title=Test]
\startalignment[center]
   \goto
   {\xmlfilter{#1}{/graphic/command(xml:graphic)}}
   [url(\xmlfilter{#1}{/link/command(xml:link)})]
\stopalignment
\stopplacefigure

\goto{test}[url(\xmlfilter{#1}{/link/command(xml:link)})]
\stopxmlsetups


\startbuffer[test]





https://iiif.ub.unibe.ch/presentation/v2.1/berner-inkunabeln/manifest/Inc%20IV%2076%20%20Spiegel%20vorn_Teigstempel"/>




https://iiif.ub.unibe.ch/presentation/v2.1/berner-inkunabeln/manifest/Inc%20IV%2076%20%20Spiegel%20vorn_Teigstempel"/>




https://iiif.ub.unibe.ch/presentation/v2.1/berner-inkunabeln/manifest/Inc%20IV%2076%20%20Spiegel%20vorn_Teigstempel"/>


\stopbuffer


\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext



test  two spaces.pdf
Description: test  two spaces.pdf


test one space.pdf
Description: test one space.pdf


test not two spaces.pdf
Description: test not two spaces.pdf
___
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: xmldoif: checking for contents of attribute

2023-08-25 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Freitag, 25. August 2023 09:06
> An: Maier, Denis Christian (UB) ; mailing list for
> ConTeXt users 
> Betreff: Re: [NTG-context] Re: xmldoif: checking for contents of attribute
> 
> On 8/25/2023 8:22 AM, denis.ma...@unibe.ch wrote:
> 
> > Thanks for your help. I can use that, but why is this sort of 
> > double-checking
> necessary here?
> 
> because containsa in a function that has checking while find is just the lua 
> find
> .. so i've added a check in that one too now but no upload
> 

So, that would mean that the double checking is only necessary for find, not 
for contains. And indeed the example below works.
Is that correct or are there any unwanted side-effects?

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

\xmlregisterdocumentsetup{test}{xml:test}

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

\startxmlsetups xml:element
1 \xmldoifelse{#1}{.[contains(@class,'abc')]}{Yes}{No} \par
2 \xmldoifelse{#1}{.[@class and find(@class,'abc')]}{Yes}{No} \par % runs, but 
no match

\stopxmlsetups

\startxmlsetups xml:whatever
Yes
\stopxmlsetups

\startbuffer[test]


Yes
No

\stopbuffer

\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext


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

maillist : ntg-context@ntg.nl / https://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: Correct usage of hash symbol in url

2023-08-25 Thread denis.maier
Hi,

I need to process URLs in XML documents differently depending on the target. 
Thanks to Hans and Thomas I can now deal with the attributes.
Now I need to prefix certain kind of targets with a certain URL (a web viewer 
for IIIF images in this particular case). The prefix contains a #, which, as a 
special character seems to cause an error. Adding a double hash seems to work, 
but those ## will end up in the link URL. How can I properly escape a single #? 
I've already tried using \Ux{23}, but that won't work either.

Best,
Denis

\setupinteraction[state=start]

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

\xmlregisterdocumentsetup{test}{xml:test}

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

\startluacode
 function xml.finalizers.tex.url(e,a)
 local u = #e > 0 and e[1].at[a]
 local s = u and lpeg.match(lpeg.patterns.urlunescaper,u)
 context(s)
 end
\stopluacode

\startxmlsetups xml:element
\xmldoifelse{#1}{.[@href and contains(@href,'https://iiif.ub.unibe.ch')]}


{\goto{\xmlflush{#1}}[url(https://uv-v4.netlify.app/##?manifest=\xmlatt{#1}{href})]}
 % gives me two hashes in the Link


%{\goto{\xmlflush{#1}}[url(https://uv-v4.netlify.app/#?manifest=\xmlatt{#1}{xlink:href})]}
 \par % does not work

{\goto{\xmlflush{#1}}[url(\xmlatt{#1}{href})]}
\stopxmlsetups


\startbuffer[test]


https://iiif.ub.unibe.ch/presentation/v2.1/berner-inkunabeln/manifest/Inc%20I%20104%20fol%20a1r";>IIIF-Link
https://wiki.contextgarden.net/";>Other Link

\stopbuffer

\starttext

\xmlprocessbuffer{test}{test}{}

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

maillist : ntg-context@ntg.nl / https://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: xmldoif: checking for contents of attribute

2023-08-24 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Thomas A. Schmitz 
> Gesendet: Donnerstag, 24. August 2023 16:35
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] Re: xmldoif: checking for contents of attribute
> 
> 
> One way would be to do the search in Lua; when you have multiple searches
> to perform, that may be the easiest way to go. For example:
> 
...
> 
> Hope that gets you started.
> 
> Thomas

Thank you, Thomas. Yes, that get's me started. But same question applies this 
solution too: Why do you need to double check? (I guess the answer will 
probably be the same.)

Anyway, it looks like I should really look more into Lua as this will probably 
make a few things much easier.

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: xmldoif: checking for contents of attribute

2023-08-24 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Donnerstag, 24. August 2023 16:54
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] Re: xmldoif: checking for contents of attribute
> 
> On 8/24/2023 4:11 PM, denis.ma...@unibe.ch wrote:
> > Hi,
> >
> > I'm trying to check whether an attribute contains (or, actually starts 
> > with) a
> given string.


> \xmldoifelse{#1}{.[@class and contains(@class,'abc')]}{Yes}{No}
> \xmldoifelse{#1}{.[@class and find(@class,"abc")]}{Yes}{No}

Thanks for your help. I can use that, but why is this sort of double-checking 
necessary here?

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

\xmlregisterdocumentsetup{test}{xml:test}

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

\startxmlsetups xml:element
1 \xmldoifelse{#1}{.[@class and contains(@class,'abc')]}{Yes}{No} \par
2 \xmldoifelse{#1}{.[@class and find(@class,"abc")]}{Yes}{No} \par
3 \xmldoifelse{#1}{.[True and contains(@class,'abc')]}{Yes}{No} \par % runs, 
but no match
4 \xmldoifelse{#1}{.[True and find(@class,"abc")]}{Yes}{No} \par % run, but no 
match
% 5 \xmldoifelse{#1}{.[contains(@class,'abc')]}{Yes}{No} \par % causes an error
% 6 \xmldoifelse{#1}{.[find(@class,"abc")]}{Yes}{No} \par % causes an error

\stopxmlsetups

\startxmlsetups xml:whatever
Yes
\stopxmlsetups

\startbuffer[test]


Yes
No

\stopbuffer

\starttext

\xmlprocessbuffer{test}{test}{}

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

maillist : ntg-context@ntg.nl / https://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] xmldoif: checking for contents of attribute

2023-08-24 Thread denis.maier
Hi,

I'm trying to check whether an attribute contains (or, actually starts with) a 
given string.
I've tried a whole bunch of different combinations, but I've had no luck so 
far. Minimal example below. Anyone has a hint?

Best,
Denis


%
\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{doc|element}{xml:*}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}


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

\startxmlsetups xml:element
\xmlfilter{#1}{./find(attribute('class'), 'abc')/command(xml:whatever)}

\xmldoifelse{#1}{./attribute('class')/contains('abc')} {Yes}{No}
\stopxmlsetups

\startxmlsetups xml:whatever
Yes
\stopxmlsetups

\startbuffer[test]


Yes
No

\stopbuffer

\starttext

\xmlprocessbuffer{test}{test}{}

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

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

Best,
Denis

> -Ursprüngliche Nachricht-
> Von: Henning Hraban Ramm 
> Gesendet: Donnerstag, 10. August 2023 15:22
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] your opinion about list structures
> 
> Hi, this is about my ConTeXt book again.
> 
> [ToC]
> 
> At the moment, my table of contents has chapters and sections and is 8 pages
> long. I would probably hardly use it.
> 
> Maybe it would be better to show only chapters (29 content + 12 appendix = 2
> pages) and include a list of sections after the chapter title (or not at all).
> 
> [Registers]
> 
> I split between command and topic index (9 pages each), because I find it
> annoying to have the commands between the topics.
> I also include the topics that are mentioned in titles in the index, because 
> I hate
> it if I must look in two places.
> (Otherwise I wouldn't think about omitting the sections from the ToC.)
> 
> At the moment there's also an index of todo items, but that will disappear
> before print.
> 
> [Glossary]
> 
> There's a short dictionary of technical terms in the appendix (8.5 p.).
> Each lemma is also included in the index.
> 
> Should I add a list of abbreviations? (TDS, TEI, OCG, RAL, PDF, SVG.?) They're
> in the index and explained where they matter - I don't think the meaning of
> many abbreviations like file types is important.
> 
> [Other lists]
> 
> Should I include a list of colors, like the output of \showcolor[crayola]? (I 
> think
> it would only bloat the book, and everyone can create the list themselves.)
> 
> I have lists of supported languages (should get checked), fonts in the
> distribution and all math fonts, because these are not easily reproducible
> (AFAIK).
> 
> 
> So, what do you think, and how do you like to work with technical books?
> What kind of information (about ConTeXt or documents/printing in
> general) do you find hard to find?
> 
> Hraban
> ___
> 
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl /
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
> .ntg.nl%2Fmailman%2Flistinfo%2Fntg-
> context&data=05%7C01%7Cdenis.maier%40unibe.ch%7C8c6e26b5f7a14d8
> 5386c08db99a4ef16%7Cd400387a212f43eaac7f77aa12d7977e%7C1%7C0
> %7C638272705889584734%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
> 7C%7C%7C&sdata=wp5lFDSJq9915y4de%2BNuNiULb09yT%2FpDr%2FWXrq
> OcdVI%3D&reserved=0
> webpage  :
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
> .pragma-
> ade.nl%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C8c6e26b5f7a14
> d85386c08db99a4ef16%7Cd400387a212f43eaac7f77aa12d7977e%7C1%7
> C0%7C638272705889584734%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC
> 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000
> %7C%7C%7C&sdata=TLdBrqOp1GuhmQRLiaydxRox1aeaO%2BWASrA%2FBa
> OAs%2BI%3D&reserved=0 /
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcontex
> t.aanhet.net%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C8c6e26b5
> f7a14d85386c08db99a4ef16%7Cd400387a212f43eaac7f77aa12d7977e%7
> C1%7C0%7C638272705889584734%7CUnknown%7CTWFpbGZsb3d8eyJWI
> joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
> 3000%7C%7C%7C&sdata=T%2FP42p3V5RzC%2B%2BwX5vByYtXy3LFOHce5
> Eues%2F8PPsug%3D&reserved=0
> archive  :
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbitbu
> cket.org%2Fphg%2Fcontext-
> mirror%2Fcommits%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C8c6
> e26b5f7a14d85386c08db99a4ef16%7Cd400387a212f43eaac7f77aa12d79
> 77e%7C1%7C0%7C638272705889584734%7CUnknown%7CTWFpbGZsb3d
> 8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%
> 3D%7C3000%7C%7C%7C&sdata=MR51GITNqb9ludzBJMwmu4AqE%2BaWw
> 0%2BIPpPm76Nwv%2BE%3D&reserved=0
> wiki :
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fconte
> xtgarden.net%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C8c6e26b
> 5f7a14d85386c08db99a4ef16%7Cd400387a212f43eaac7f77aa12d7977e%
> 7C1%7C0%7C638272705889584734%7CUnknown%7CTWFpbGZsb3d8eyJ
> WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D
> %7C3000%7C%7C%7C&sdata=ubpCSLzX4vdgb7WNlaK7ASRwd94Ugv0TtuF8
> wzDnnts%3D&reserved=0
> ___
> 
___
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:/

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

2023-08-22 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Thomas A. Schmitz 
> Gesendet: Montag, 21. August 2023 18:20
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] Re: XML processing beginner's question
> 
> On 8/21/23 17:59, Michael Löscher wrote:
> > 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:
> >
> Really? I told you about the various commands \xmldoif, but there's nothing in
> your starting point. I don't want to provide anybody homework solutions, so
> just to give you an idea to get you started:
> 
> \startxmlsetups xml:mysetup
> \xmlsetsetup{main}{document|element|mdata|tdata|name|date|num|con
> tent|shortdescription|p}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:mysetup}
> 
> \startxmlsetups xml:document
>   \xmlflush {#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:element
>   \xmlflush {#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:mdata
>   \xmldoifelsetext {#1} {/date}
>   {{\bf \xmltext {#1} {name}}\par
>   {\it \xmltext {#1} {date}}\par}
>   {\xmltext {#1} {content}\par}
> \stopxmlsetups
> 

Just to add to this: You can also apply a more XSLT-like approach, like test 
directly when matching:

\startxmlsetups xml:mysetup
\xmlsetsetup{main}{document}{xml:*}
\xmlsetsetup{main}{element[@class="myclass"]}{xml:element-with-attribute}
\xmlsetsetup{main}{element[./subelement-one]}{xml:element-with-subelement-one}
\xmlsetsetup{main}{element[./subelement-two]}{xml:element-with-subelement-two}
\stopxmlsetups

\xmlregistersetup{xml:mysetup}

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

\startxmlsetups xml:element-with-attribute
0
\stopxmlsetups

\startxmlsetups element-with-subelement-one
1
\stopxmlsetups

\startxmlsetups element-with-subelement-two
2
\stopxmlsetups


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

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: XML processing beginner's question

2023-08-21 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen via ntg-context 
> Gesendet: Montag, 21. August 2023 19:09
> 
> you need a bit of imagination because basically (depends a bit on what you
> do) one big nested expansion is going on, as Thomas explained: using setups
> which are basically macros. The #1 is the current node (but you can store it 
> in a
> macro and use it later if needed). So, only references are passed around.
> 
> for thomas: we now also have (in lmtx)
> 
> \ifxml {id}{pattern}  \else \fi
> \ifxmltext {id}{pattern}  \else \fi
> \ifxmlatt  {id}{name}{value}  \else \fi
> \ifxmlattempty {id}{pattern}  \else \fi
> \ifxmlempty{id}{pattern}  \else \fi
> \ifxmlselfempty{id}   \else \fi

So, these new commands diverge from the older patterns:
\xmldoifelse{#1}{pattern}{TRUE}{FALSE} ?

Am I reading this correctly?

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: Penalties and overprinting in tabulate

2023-08-21 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Freitag, 18. August 2023 17:10
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] Re: Penalties and overprinting in tabulate
> 
> On 8/18/2023 4:36 PM, denis.ma...@unibe.ch wrote:
> > Dear list,
> >
> > typesetting the example below results in lines printed above each other?
> Without the penalties, this doesn't happen. What am I missing here? How I
> can use the penalties without the not wanted overprinting?
> >
> > Best,
> > Denis
> >
> >
> > \startsetups[mypenalties]
> >  \setdefaultpenalties
> >  \setpenalties\clubpenalties{1}{150}
> >  \setpenalties\widowpenalties{1}{1}
> >  \setpenalties\displaywidowpenalties{1}{1}
> > \stopsetups
> >
> > \setuplayout[setups=mypenalties]
> >
> > \starttext
> > \starttabulate[|p(.15\textwidth)|p|]
> > \NC asdf \NC a asdf asdf asdf asdf asdf 
> > asdf sdf asdf asdf
> asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> >  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf 
> > asdf asdf
> asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> >  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf 
> > asdf asdf
> asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> >  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf 
> > asdf asdf
> asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> >  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf 
> > asdf asdf
> asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> > \stoptabulate
> >
> > \stoptext
> \startsetups[nopenalties]
>  \setdefaultpenalties
> \stopsetups
> 
> 
> % \setuptabulate[setups=nopenalties] % in next version
> 
> \setuptabulate[inner=\setups{nopenalties}]
> 
> or
> 
> \starttabulate[|p(.15\textwidth)s{nopenalties}|ps{nopenalties}|]
> 
> but i admit it needs some thought ... outer level only but that is also pretty
> much an engine thing then (no big deal but ... needs pondering)

Thanks, I guess that should be added to this page: 
https://wiki.contextgarden.net/Tabulate 
I'll add it to my list of todos..., but just to make sure the explanation will 
be correct: what exactly is happening here? The tabulate environment will 
"inherit" the outer environments setups, but why does this result in the 
overprinting?

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] Penalties and overprinting in tabulate

2023-08-18 Thread denis.maier
Dear list,

typesetting the example below results in lines printed above each other? 
Without the penalties, this doesn't happen. What am I missing here? How I can 
use the penalties without the not wanted overprinting?

Best,
Denis


\startsetups[mypenalties]
\setdefaultpenalties
\setpenalties\clubpenalties{1}{150}
\setpenalties\widowpenalties{1}{1}
\setpenalties\displaywidowpenalties{1}{1}
\stopsetups

\setuplayout[setups=mypenalties]

\starttext
\starttabulate[|p(.15\textwidth)|p|]
   \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf 
asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\stoptabulate

\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: Tracker for hyphens at the end of lines

2023-08-09 Thread denis.maier
Keith, you can also check hyphenations using a script:

-- check-hyphens.lua
--[[ 
analyze hyphenations based on a ConTeXt log file
enable hyphenation tracking in the ConTeXt file with
\enabletrackers[hyphenation.applied]
then run this script with
lua check-hyphens.lua input_file whitelist.ending
for the input_file we assume .log, so no need to add this
for the whitelist a file ending has to be supplied
the whitelist is optional
]] 

-- local lines = string.splitlines(io.loaddata("oeps.tex")or "") or { }

-- local pprint = require('pprint')

function main (input_file, whitelist_file)
local lines = lines_from(input_file .. ".log")
local whitelist = {}
if whitelist_file == nil then
whitelist = {}
else 
whitelist = lines_from(whitelist_file)
end
--pprint (lines)
--pprint (whitelist)
local filteredWordlist = filterHyphenationsWordlist
(cleanLines
(getHyphenationLines(lines)), 
whitelist)
-- pprint(filteredWordlist)
saveResultsToFile(filteredWordlist, 'check-hyphens.log')
end

-- see if the file exists

-- http://lua-users.org/wiki/FileInputOutput

-- see if the file exists
function file_exists(file)
local f = io.open(file, "rb")
if f then f:close() end
return f ~= nil
end
  
-- get all lines from a file, returns an empty 
-- list/table if the file does not exist
function lines_from(file)
if not file_exists(file) then return {} end
local lines = {}
for line in io.lines(file) do 
lines[#lines + 1] = line
end
return lines
end

-- String testing
function starts_with(str, start)
return str:sub(1, #start) == start
end

-- get relevant lines
function getHyphenationLines(lines)
local lines_with_hyphenations = {}
for k,v in pairs(lines) do
if 
(starts_with(v, "hyphenated") 
and not string.find(v, "start hyphenated words") 
and not string.find(v, "stop hyphenated words"))
then table.insert(lines_with_hyphenations, v) end
end
return lines_with_hyphenations
end

-- String cleaning
-- wrapper functions

function cleanLines (xs)
local cleanedLines = {}
for k,v in pairs(xs) do
table.insert(cleanedLines, cleanLine(v))
end
return cleanedLines
end

function cleanLine (x)
return removeTrailingPunctuation(getWord(x))
end

-- 1. Start reading at colon 
function getWord(x)
-- wir lesen aber Zeichen 26
return string.sub(x,26)
end

-- 2. Remove trailing punctuation
function removeTrailingPunctuation (x)
if string.find(x, ',') then
return x:sub(1, -2)
else
return x
end
end

-- test if word is in second list
function inList (x, list)
for k,v in ipairs(list) do
if v == x then
return true
end
end
return nil
end

-- Filter hyphenated words based on second list (whitelist)
function filterHyphenationsWordlist (xs, list)
local result = {}
for k,v in ipairs(xs) do
if not inList(v, list) then table.insert (result, v) end
end
return result
end

function saveResultsToFile(results, output_file)
-- Opens a file in write mode
output_file = io.open("check_hyphens.log", "w")
-- sets the default output file as output_file
io.output(output_file)
-- iterate oiver 
for k,v in ipairs(results) do
io.write(v..'\n')
end
-- closes the open file
io.close(output_file)
end

-- Run
main(arg[1], arg[2])

> -Ursprüngliche Nachricht-
> Von: Keith McKay 
> Gesendet: Dienstag, 1. August 2023 20:22
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] Re: Tracker for hyphens at the end of lines
> 
> Thanks Hans!
> 
> I'm never disappointed, always amazed with ConTeXt!
> 
> This is just what I was looking for.
> 
> Best Wishes
> 
> Keith McKay
> 
> On 01/08/2023 18:10, Hans Hagen via ntg-context wrote:
> > On 8/1/2023 4:54 PM, Keith McKay wrote:
> >> Hi colleagues,
> >>
> >> Is there a tracker for highlighting hyphens at the end of lines
> >> similar the way underfull and overfull boxes can be displayed with a
> >> coloured bar at the end of the offending line?
> >>
> >> I have looked at the wiki page "Reviewing hyphenation" and it has a
> >> solution for mkii from 2009 which, I would think, won't be suitable
> >> for present day ConTeXt. I have tried searching for hyphens using
> >> Skim and Adobe Acrobate viewers but although they find hyphenation in
> >> line they don't recognise hyphens at the edge of lines.
> >>
> >> Any help would be appreciated.
> > I suppose you would be disappointed it there was no tracker ...
> >
> > \enabletrackers[hyphenation.applied.console]
> > \enabletrackers[hyphenation.applied.visualize]
> >
> > you even get a file with the hyphenated words
> >
> > You can see all of them with
> >
> > \disabledirectives[backend.cleanup.flatten]
> > \bitwiseflip \normalizelinemode -\flattendiscretionariesnormalizecode

[NTG-context] Re: xml: matches always child of other element

2023-07-27 Thread denis.maier
Ok, after a bit of more testing I can now come up with another example.

The version using startstop works, but with the normal command, I'm always 
getting back the content of the first element. I thought it might be an 
expansion issue, but \expanded and also expansion=yes or expansion=xml on 
\definedescription have no effect. Perhaps most interestingly, adding using the 
startstop variant together with the command variant gives correct results for 
the command as well (xml:index-entry-term-3).

I have now found a way to proceed with my project (I'll just use the startstop 
variant), but I'd still be interested in understanding what is happening here. 
Does anyone know? Or is there anything I'm doing wrong here?

Best,
Denis

%%
\startxmlsetups xml:test
  \xmlsetsetup{#1}{*}{-}
  \xmlsetsetup{#1}{index}{xml:*}
  \xmlsetsetup{#1}{index-entry}{xml:index-entry}
  %\xmlsetsetup{#1}{term}{xml:index-entry-term}
  \xmlsetsetup{#1}{term}{xml:index-entry-term-2}
  \xmlsetsetup{#1}{term}{xml:index-entry-term-3}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

% Index

\startxmlsetups xml:book-back
  \xmlflush{#1}
\stopxmlsetups

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

\definedescription[indexentry][]
%\definedescription[indexentry][expansion=yes] % has no effect
%\definedescription[indexentry][expansion=xml] % has no effect


\startxmlsetups xml:index-entry
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term % does not work
  \expanded{\indexentry{\xmlflush{#1}}}
  \indexentry{\xmlflush{#1}}
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term-2 % works
\startindexentry{\xmlflush{#1}}
\xmlflush{#1}
\stopindexentry
\stopxmlsetups

\startxmlsetups xml:index-entry-term-3 % works
\expanded{\indexentry{\xmlflush{#1}}}
\indexentry{\xmlflush{#1}}
\startindexentry{\xmlflush{#1}}
\xmlflush{#1}
\stopindexentry
\stopxmlsetups


\startbuffer[test]



One


Two


Three


\stopbuffer

\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext
%%

Von: denis.ma...@unibe.ch 
Gesendet: Montag, 24. Juli 2023 15:57
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: xml: matches always child of other element

Interestingly, we should be in the right subtree as this modified example is 
supposed to demonstrate (we're getting the correct numbers under each 
index-entry-term, just the terms are incorrect in all but the first case):

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{index}{xml:*}
\xmlsetsetup{#1}{index-entry}{xml:index-entry}
%\xmlsetsetup{#1}{index-entry}{xml:index-entry-2}
\xmlsetsetup{#1}{term}{xml:index-entry-term}
\xmlsetsetup{#1}{nav-pointer-group}{xml:*}
\xmlsetsetup{#1}{nav-pointer}{xml:nav-pointer}
\xmlsetsetup{#1}{nav-pointer/ext-link}{xml:nav-pointer-link}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

% Index

\startxmlsetups xml:book-back
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index
  
\startsectionlevel[title={\xmlfilter{#1}{/index-title-group/title/command(xml:index-title)}},]
\xmlflush{#1}
  \stopsectionlevel
\stopxmlsetups

\startxmlsetups xml:index-title
\xmlflush{#1}
\stopxmlsetups

\definedescription[indexentry]
[alternative=top,
headstyle=normal,
headcommand=\hskip-1cm,
margin=1cm,
inbetween=,
]

\startxmlsetups xml:index-entry
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-2
\xmlfilter{#1}{/term/command(xml:index-entry-term)}%
\xmlverbatim{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term
\indexentry{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-group
\xmlconcat{#1}{/nav-pointer}{, }
\stopxmlsetups

\startxmlsetups xml:nav-pointer
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-link
\xmlflush{#1}
\stopxmlsetups

\startbuffer[test]


  
Index
  
  
First

  
1
  
  
2
  
  
3
  

  
  
Second

  
4
  

  
  
Third

  
5
  
  
6
  
  
7
  

  

\stopbuffer


\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext

Von: denis.ma...@unibe.ch 
mailto:denis.ma...@unibe.ch>>
Gesendet: Montag, 24. Juli 2023 13:38
An: ntg-context@ntg.nl
Betreff: [NTG-context

[NTG-context] Re: xml: matches always child of other element

2023-07-24 Thread denis.maier
Interestingly, we should be in the right subtree as this modified example is 
supposed to demonstrate (we're getting the correct numbers under each 
index-entry-term, just the terms are incorrect in all but the first case):

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{index}{xml:*}
\xmlsetsetup{#1}{index-entry}{xml:index-entry}
%\xmlsetsetup{#1}{index-entry}{xml:index-entry-2}
\xmlsetsetup{#1}{term}{xml:index-entry-term}
\xmlsetsetup{#1}{nav-pointer-group}{xml:*}
\xmlsetsetup{#1}{nav-pointer}{xml:nav-pointer}
\xmlsetsetup{#1}{nav-pointer/ext-link}{xml:nav-pointer-link}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

% Index

\startxmlsetups xml:book-back
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index
  
\startsectionlevel[title={\xmlfilter{#1}{/index-title-group/title/command(xml:index-title)}},]
\xmlflush{#1}
  \stopsectionlevel
\stopxmlsetups

\startxmlsetups xml:index-title
\xmlflush{#1}
\stopxmlsetups

\definedescription[indexentry]
[alternative=top,
headstyle=normal,
headcommand=\hskip-1cm,
margin=1cm,
inbetween=,
]

\startxmlsetups xml:index-entry
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-2
\xmlfilter{#1}{/term/command(xml:index-entry-term)}%
\xmlverbatim{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term
\indexentry{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-group
\xmlconcat{#1}{/nav-pointer}{, }
\stopxmlsetups

\startxmlsetups xml:nav-pointer
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-link
\xmlflush{#1}
\stopxmlsetups

\startbuffer[test]


  
Index
  
  
First

  
1
  
  
2
  
  
3
  

  
  
Second

  
4
  

  
  
Third

  
5
  
  
6
  
  
7
  

  

\stopbuffer


\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext

Von: denis.ma...@unibe.ch 
Gesendet: Montag, 24. Juli 2023 13:38
An: ntg-context@ntg.nl
Betreff: [NTG-context] xml: matches always child of other element

Hi,

I must be missing something obvious, but in this example the pattern for  
always matches the first element, not the one under the current .
Interestingly, using xml:index-entry-2 instead of the normal version matches 
correctly... Any hints what is going off the rails here?

Best,
Denis

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{index}{xml:*}
\xmlsetsetup{#1}{index-entry}{xml:index-entry}
%\xmlsetsetup{#1}{index-entry}{xml:index-entry-2}
\xmlsetsetup{#1}{term}{xml:index-entry-term}
\xmlsetsetup{#1}{nav-pointer-group}{xml:*}
\xmlsetsetup{#1}{nav-pointer}{xml:nav-pointer}
\xmlsetsetup{#1}{nav-pointer/ext-link}{xml:nav-pointer-link}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

% Index

\startxmlsetups xml:book-back
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index
  
\startsectionlevel[title={\xmlfilter{#1}{/index-title-group/title/command(xml:index-title)}},]
\xmlflush{#1}
  \stopsectionlevel
\stopxmlsetups

\startxmlsetups xml:index-title
\xmlflush{#1}
\stopxmlsetups

\definedescription[indexentry]
[alternative=top,
headstyle=normal,
headcommand=\hskip-1cm,
margin=1cm,
inbetween=,
]

\startxmlsetups xml:index-entry
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-2
\xmlfilter{#1}{/term/command(xml:index-entry-term)}%
\xmlverbatim{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term
\indexentry{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-group
\xmlconcat{#1}{/nav-pointer}{, }
\stopxmlsetups

\startxmlsetups xml:nav-pointer
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-link
\xmlflush{#1}
\stopxmlsetups

\startbuffer[test]


  
Index
  
  
First

  
1
  
  
2
  
  
3
  

  
  
Second

  
1
  

  
  
Third

  
1
  

  

\stopbuffer

\starttext

\xmlprocessbuffer{test}{test}{}

\stoptext

[NTG-context] xml: matches always child of other element

2023-07-24 Thread denis.maier
Hi,

I must be missing something obvious, but in this example the pattern for  
always matches the first element, not the one under the current .
Interestingly, using xml:index-entry-2 instead of the normal version matches 
correctly... Any hints what is going off the rails here?

Best,
Denis

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{index}{xml:*}
\xmlsetsetup{#1}{index-entry}{xml:index-entry}
%\xmlsetsetup{#1}{index-entry}{xml:index-entry-2}
\xmlsetsetup{#1}{term}{xml:index-entry-term}
\xmlsetsetup{#1}{nav-pointer-group}{xml:*}
\xmlsetsetup{#1}{nav-pointer}{xml:nav-pointer}
\xmlsetsetup{#1}{nav-pointer/ext-link}{xml:nav-pointer-link}
\stopxmlsetups

\xmlregisterdocumentsetup{test}{xml:test}

% Index

\startxmlsetups xml:book-back
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index
  
\startsectionlevel[title={\xmlfilter{#1}{/index-title-group/title/command(xml:index-title)}},]
\xmlflush{#1}
  \stopsectionlevel
\stopxmlsetups

\startxmlsetups xml:index-title
\xmlflush{#1}
\stopxmlsetups

\definedescription[indexentry]
[alternative=top,
headstyle=normal,
headcommand=\hskip-1cm,
margin=1cm,
inbetween=,
]

\startxmlsetups xml:index-entry
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-2
\xmlfilter{#1}{/term/command(xml:index-entry-term)}%
\xmlverbatim{#1}
\stopxmlsetups

\startxmlsetups xml:index-entry-term
\indexentry{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-group
\xmlconcat{#1}{/nav-pointer}{, }
\stopxmlsetups

\startxmlsetups xml:nav-pointer
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:nav-pointer-link
\xmlflush{#1}
\stopxmlsetups

\startbuffer[test]


  
Index
  
  
First

  
1
  
  
2
  
  
3
  

  
  
Second

  
1
  

  
  
Third

  
1
  

  

\stopbuffer

\starttext

\xmlprocessbuffer{test}{test}{}

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

maillist : ntg-context@ntg.nl / https://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: Convert tif to jpg (instead of pdf)

2023-07-24 Thread denis.maier
Partial success:

I haven't been able to convert the images to jpg proper, but I've been at least 
been able to enable jpeg compression, thus making the resulting pdfs much 
smaller:

% enable compression for tiffs
\startluacode
local function compress(oldname, newname, compression)
if not compression or compression == "" then
compression = "jpeg"
end
os.execute(string.format(
'gm convert -compress %s "%s" "%s"',
compression, oldname, newname)
   )
end

-- Set the PDF and default TIFF converters to the above function.
figures.converters.tif.pdf = compress
figures.converters.tif.default = compress
\stopluacode

Best,
Denis

Von: denis.ma...@unibe.ch 
Gesendet: Freitag, 21. Juli 2023 13:25
An: ntg-context@ntg.nl
Betreff: [NTG-context] Convert tif to jpg (instead of pdf)

Hi,

According to the documentation, it is possible to automatically convert TIFF 
images to a format supported by LMTX via GraphicsMagick.
https://wiki.contextgarden.net/Using_Graphics#Image_Conversion

However, by default this produces pdf files which are quite huge. is it 
possible to instruct grapichsmagick to convert tiff images to jpg instead of to 
pdf ? There's an example on the linked page in the documentation, but I have to 
admit that I don't quite understand what I should do...

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: Replacing %20 with spaces in xml attributes

2023-07-21 Thread denis.maier
Thanks, but I'm still getting the same error. I'm thinking that it has 
something to do with the percent characters...

This here works just fine:

\startluacode
function test(s)
  result = string.gsub(s, 'x20', 'MATCH')
  context(result)
end
\stopluacode

\define[1]\test{\ctxlua{test("#1")}}

\starttext
\test{asdfx20} % -> asdfMATCH
\stoptext

But this here won't:

\startluacode
function test(s)
  result = string.gsub(s, '%%20', 'MATCH')
  context(result)
end
\stopluacode

\define[1]\test{\ctxlua{test("#1")}}

\starttext
\test{asdf%20} % -> does not work
\stoptext

Any ideas?

Best,
Denis


Von: Hans van der Meer via ntg-context 
Gesendet: Freitag, 21. Juli 2023 16:26
An: NTG ConTeXt 
Cc: Hans van der Meer 
Betreff: [NTG-context] Re: Replacing %20 with spaces in xml attributes

Here in Terminal on my Mac:


21 ~: lua

Lua 5.4.6  Copyright (C) 1994-2023 Lua.org, PUC-Rio

> string.gsub('a%20b', '%%20', ' ')

a b1

> (string.gsub('a%20b', '%%20', ' '))

a b

> ^D

21 ~:


The first call returns the 1 giving the match, the extra ()'s get rid of that 
second return value.


yours sincerely
dr. Hans van der Meer




On 21 Jul 2023, at 12:37, denis.ma...@unibe.ch 
wrote:

Hi,

I'm typesetting an XML document where the links to the images contain spaces 
which are encoded as %20


Using this works in cases without spaces:

\startxmlsetups xml:fig:graphic
  \externalfigure[\xmlatt{#1}{xlink:href}]
\stopxmlsetups

This also works for normal spaces, but is there a way to decode/expand the %20s 
to regular spaces?

I've tried with some Lua, but I don't really know how to pass data around.

%
\startluacode
function replaceSpaces(s)
  result = string.gsub(s, "%%20", " ")
  context(result)
end
\stopluacode

\define[1]\replaceSpaces{\ctxlua{replaceSpaces("#1")}}

\startxmlsetups xml:fig:graphic
  \externalfigure[\replaceSpaces{\xmlatt{#1}{xlink:href}}]
\stopxmlsetups
%

Any hints, why this does not work?`

Also, maybe there's a simpler way for this kind of scenario?

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
___

___
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] Convert tif to jpg (instead of pdf)

2023-07-21 Thread denis.maier
Hi,

According to the documentation, it is possible to automatically convert TIFF 
images to a format supported by LMTX via GraphicsMagick.
https://wiki.contextgarden.net/Using_Graphics#Image_Conversion

However, by default this produces pdf files which are quite huge. is it 
possible to instruct grapichsmagick to convert tiff images to jpg instead of to 
pdf ? There's an example on the linked page in the documentation, but I have to 
admit that I don't quite understand what I should do...

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] Replacing %20 with spaces in xml attributes

2023-07-21 Thread denis.maier
Hi,

I'm typesetting an XML document where the links to the images contain spaces 
which are encoded as %20


Using this works in cases without spaces:

\startxmlsetups xml:fig:graphic
  \externalfigure[\xmlatt{#1}{xlink:href}]
\stopxmlsetups

This also works for normal spaces, but is there a way to decode/expand the %20s 
to regular spaces?

I've tried with some Lua, but I don't really know how to pass data around.

%
\startluacode
function replaceSpaces(s)
  result = string.gsub(s, "%%20", " ")
  context(result)
end
\stopluacode

\define[1]\replaceSpaces{\ctxlua{replaceSpaces("#1")}}

\startxmlsetups xml:fig:graphic
  \externalfigure[\replaceSpaces{\xmlatt{#1}{xlink:href}}]
\stopxmlsetups
%

Any hints, why this does not work?`

Also, maybe there's a simpler way for this kind of scenario?

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] Suppress label in captions without suppressing number

2023-07-20 Thread denis.maier
Hi,

is there an option to suppress the label in captions without suppressing the 
number as well?

I know, I can use \setuplabeltext[de][figure=,], but this will delete the label 
text globally... Is there a better way via \setupcaption?

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: new upload

2023-07-10 Thread denis.maier
Hi Hans,

Page puilder mode sounds interesting! What are you plans for that?

Best,
Denis

> -Ursprüngliche Nachricht-
> Von: Hans Hagen via ntg-context 
> Gesendet: Sonntag, 9. Juli 2023 19:51
> An: mailing list for ConTeXt users 
> Cc: Hans Hagen 
> Betreff: [NTG-context] new upload
> 
> Hi,
> 
> No functional changes this time:
> 
> - some more consistent usage of new primitives instead of helper macros, also
> a bit of a look and feel related effort as well as getting even less tracing 
> clutter
> (the kind of changes for Wolfgang to check -)
> 
> - as aside effect there is some performance gain (there is not that much more
> to gain now unless we go ugly); this all depends on usage of course
> 
> - at some point some of the more obscure middle level helpers (dating from
> mkii) might move to a module as i don't think anyone uses them in lmtx
> 
> There are quite some files affected (all is tripple checked but who knows). If
> there are issues, they should be easy to fix.
> 
> We're now moving into page builder (another side effect of math tuneup)
> mode and have some new features coming there.
> 
> Hans
> 
> 
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 |
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> pragma-
> ade.nl%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C19dfcbacacda44
> fca92308db80a59c54%7Cd400387a212f43eaac7f77aa12d7977e%7C1%7C
> 0%7C638245221007372928%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
> 7C%7C%7C&sdata=G7QB0pUJwFq5Crvdd4hLvSzCnvtdcXASsjWLUs1%2FfbU
> %3D&reserved=0 |
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> pragma-
> pod.nl%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C19dfcbacacda44
> fca92308db80a59c54%7Cd400387a212f43eaac7f77aa12d7977e%7C1%7C
> 0%7C638245221007372928%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
> 7C%7C%7C&sdata=mOLZeMc5fuwcF3UXd%2BGgQmA04HxVs4c1kNSkWlnGL
> VU%3D&reserved=0
> -
> ___
> 
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl /
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
> .ntg.nl%2Fmailman%2Flistinfo%2Fntg-
> context&data=05%7C01%7Cdenis.maier%40unibe.ch%7C19dfcbacacda44fca
> 92308db80a59c54%7Cd400387a212f43eaac7f77aa12d7977e%7C1%7C0%
> 7C638245221007372928%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C
> %7C%7C&sdata=cXh7bNY48ulIZPX3P6Imj5tkgdR%2B0TRXzWxoTEOVrbE%3D
> &reserved=0
> webpage  :
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
> .pragma-
> ade.nl%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C19dfcbacacda44
> fca92308db80a59c54%7Cd400387a212f43eaac7f77aa12d7977e%7C1%7C
> 0%7C638245221007372928%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4
> wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
> 7C%7C%7C&sdata=FLpFbVGfocFjXA3qqoyUb96bGY%2F36zbeexypTcW0EcY
> %3D&reserved=0 /
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcontex
> t.aanhet.net%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C19dfcbaca
> cda44fca92308db80a59c54%7Cd400387a212f43eaac7f77aa12d7977e%7C
> 1%7C0%7C638245221007372928%7CUnknown%7CTWFpbGZsb3d8eyJWIj
> oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
> 3000%7C%7C%7C&sdata=Ua4zTxMemOWwmsT5AeMJNw0r1oQRVNVrHnaz
> bdvnmJs%3D&reserved=0
> archive  :
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbitbu
> cket.org%2Fphg%2Fcontext-
> mirror%2Fcommits%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C19
> dfcbacacda44fca92308db80a59c54%7Cd400387a212f43eaac7f77aa12d797
> 7e%7C1%7C0%7C638245221007372928%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> D%7C3000%7C%7C%7C&sdata=DXoFJ0Ng%2B4cfRLwglgcBGeY4qGTUBBR65
> 8JZe7HooRs%3D&reserved=0
> wiki :
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fconte
> xtgarden.net%2F&data=05%7C01%7Cdenis.maier%40unibe.ch%7C19dfcbac
> acda44fca92308db80a59c54%7Cd400387a212f43eaac7f77aa12d7977e%7
> C1%7C0%7C638245221007372928%7CUnknown%7CTWFpbGZsb3d8eyJWI
> joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
> 3000%7C%7C%7C&sdata=vOXj9LP1mNcKIsct76foOm8TT3YAZlL7vEbAH6cOs
> 88%3D&reserved=0
> ___
> 
___
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/mail

Re: [NTG-context] Fontsizes in Adobe Acrobat vs ConTeXt

2021-07-20 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Henning
> Hraban Ramm
> Gesendet: Dienstag, 20. Juli 2021 13:12
> An: mailing list for ConTeXt users 
> Betreff: Re: [NTG-context] Fontsizes in Adobe Acrobat vs ConTeXt
> 
> 
> 
> > Am 20.07.2021 um 13:09 schrieb denis.ma...@unibe.ch:
> >
> > Hi,
> >
> > I have to reproduce a book layout that was done in Adobe Indesign, and I
> don’t really manage to get the right fontsizes, i.e. according to Acrobat Pro 
> the
> fonts are consistently a bit smaller then expected.
> > That may well be an Adobe problem, it’s just that I have to aim for rather
> specific target values... As you can see below the deviation is not so 
> significant
> with the normal font size and bigger sizes, but more so with the smaller 
> sizes.
> 
> The TeX point is smaller than the PostScript/DTP point.
> Use the unit "bp" to get the same sizes as in desktop apps.
> 
> See https://en.wikipedia.org/wiki/Point_(typography)
> 
> Hraban

Thanks for your help. That's already better. The base font size, and the bigger 
sizes are correct now. But it still does not work with the smaller sizes:

% ---
\setupbodyfont[10bp] 
\definebodyfontenvironment
[10bp]
[xx=7bp,
x=8.5bp,
a=11.75bp, 
b=15bp,
] 

\starttext


{\tfxx Smallest } % => expected 7pt, actual 6pt with LM Roman 7

{\tfx Small} % => expected 8.5pt, actual 8pt with LM Roman 9

{\tf Normal} % => expected 10pt, ok

{\tfa Larger} % => expected 11.75pt, ok

{\tfb Largest} % => expected 15pt, ok

\stoptext
%---

Maybe that's an issue with optical sizes?

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

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


[NTG-context] Fontsizes in Adobe Acrobat vs ConTeXt

2021-07-20 Thread denis.maier
Hi,

I have to reproduce a book layout that was done in Adobe Indesign, and I don't 
really manage to get the right fontsizes, i.e. according to Acrobat Pro the 
fonts are consistently a bit smaller then expected.
That may well be an Adobe problem, it's just that I have to aim for rather 
specific target values... As you can see below the deviation is not so 
significant with the normal font size and bigger sizes, but more so with the 
smaller sizes.


% --
\setupbodyfont[10pt]
\definebodyfontenvironment
[default]
[xx=0.7,
x=0.85,
a=1.175,
b=1.5,
]

\starttext


{\tfxx Smallest } % => expected 7pt, actual 5.98pt

{\tfx Small} % => expected 8.5pt, actual 7.97pt

{\tf Normal} % => expected 10pt, actual 9.96pt

{\tfa Larger} % => expected 11.75pt, actual 11.71pt

{\tfb Largest} % => expected 15pt, actual 14.94pt

\stoptext
% --

Any ideas, how I could get that right? (The project uses Noto Serif, but the 
same happens there.)

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

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


Re: [NTG-context] Different authorconversion for citation alternatives and bibliographic entries

2021-07-02 Thread denis.maier
Oh, and needless to say, I'd be happy to help with this.

> -Ursprüngliche Nachricht-
> Von: Maier, Denis Christian (UB)
> Gesendet: Freitag, 2. Juli 2021 10:01
> An: 'Alan Braslau' 
> Cc: ntg-context@ntg.nl
> Betreff: AW: [NTG-context] Different authorconversion for citation 
> alternatives
> and bibliographic entries
> 
> > -Ursprüngliche Nachricht-
> > Von: Alan Braslau 
> > Gesendet: Mittwoch, 30. Juni 2021 23:50
> > An: Maier, Denis Christian (UB) 
> > Cc: ntg-context@ntg.nl
> > Betreff: Re: [NTG-context] Different authorconversion for citation
> > alternatives and bibliographic entries
> >
> [...]
> > >
> > > So what would be needed to make add real support for it?
> >
> > First of all, come to a consensus on a clear style guide to base this
> > on, so as not to run after ambiguous and perhaps contradictory
> > specifications. This would be distinct from the APA (author-year)
> > model as well as from the minimalist APS
> > (numbered) style. Could this perhaps be the Chicago style? (does that
> > have a footnote specification?)
> 
> Chicago is certainly not a bad choice for this. It's probably one of the most
> complete footnote specifications out there. (I knows multiple variants though,
> so you need to settle for one or support both.) One thing to be aware of is 
> that
> Chicago is utterly complex. Other styles like MHRA are a bit simpler. This
> complexity might be an advantage and a disadvantage at the same time. It may
> be hard to get this completely right. The already mentioned biblatex-chicago
> package shows how much is involved. OTOH, if you get this right that should
> cover almost everything that might come up in note based styles.
> 
> Denis

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

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


Re: [NTG-context] Different authorconversion for citation alternatives and bibliographic entries

2021-07-02 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Alan Braslau 
> Gesendet: Mittwoch, 30. Juni 2021 23:50
> An: Maier, Denis Christian (UB) 
> Cc: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] Different authorconversion for citation 
> alternatives
> and bibliographic entries
> 
[...]
> >
> > So what would be needed to make add real support for it?
> 
> First of all, come to a consensus on a clear style guide to base this on, so 
> as not
> to run after ambiguous and perhaps contradictory specifications. This would be
> distinct from the APA (author-year) model as well as from the minimalist APS
> (numbered) style. Could this perhaps be the Chicago style? (does that have a
> footnote specification?)

Chicago is certainly not a bad choice for this. It's probably one of the most 
complete footnote specifications out there. (I knows multiple variants though, 
so you need to settle for one or support both.)
One thing to be aware of is that Chicago is utterly complex. Other styles like 
MHRA are a bit simpler. This complexity might be an advantage and a 
disadvantage at the same time. It may be hard to get this completely right. The 
already mentioned biblatex-chicago package shows how much is involved. OTOH, if 
you get this right that should cover almost everything that might come up in 
note based styles.

Denis

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

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


Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes

2021-07-02 Thread denis.maier
Thanks for this. I'll look into it.

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Rik Kabel
> Gesendet: Mittwoch, 30. Juni 2021 21:40
> An: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes
> 
> For what its worth, I offer my endnote apparatus with updates for parts.
> It uses the standard note/notation mechanism, not a list, for endnotes.
> Perhaps it can be further adapted to the needs of this thread.
> 
> There is at least one small issue with it: I have to use \stopendnote even 
> though
> I define \startEndnote. This causes issues with the linter (mtxrun --script 
> check
> ) but seems otherwise harmless.
> 
> I am sure that others more versed in ConTeXt can find some ways to fix this 
> and
> improve the overall approach. I welcome suggestions.
> 
> %--%
> % Endnote apparatus adapted for parts
> %
> \mainlanguage  [en]
> \language  [en]
> \setupinteraction  [state=start]
> \setuppagenumbering[alternative=doublesided]
> 
> \setupheadertexts [{\it\getmarking[part]}][{\it\getmarking[section]}]
> [{\it\getmarking[chapter]}][{\it\getmarking[part]}]
> \setupheads    [number=no]
> \setuphead [part]
>     [placehead=yes,
>      header=empty]
> 
> %- footnote setup -% % 
> footnotes uses
> asterisk, dagger, ddagger... so that endnotes %   and pagenotes have separate
> sequences. Change way= to suit %   your footnote frequency
> 
> \setupnotation [footnote]
>     [numberconversion=set 2,
>      way=chapter]
> 
> %- endnote setup --% % 
> endnotes use
> numeric indices, reset by part
> 
> \setupnote [endnote][
>      textseparator={,},
>      textstyle=\high{\small\hairspace},
>      location=none,
>      bodyfont=]
> 
> \setupnotation [endnote]
>     [headstyle=\small,
>      way=bypart,
>      numbercommand=,
>      after={\blank[halfline]}]
> 
> %- endnote pages setup %
> 
> \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
> 
> \starttexdefinition unexpanded startEndnote
>    \dosingleempty\doStartEndnote
> \stoptexdefinition
> 
> \starttexdefinition doStartEndnote [#1]
>    \expanded{\dodoStartEndnote[#1][{\rawcountervalue[userpage]}]}
> \stoptexdefinition
> 
> \starttexdefinition dodoStartEndnote [#1][#2]
>    \startendnote[#1]
>      \marking[notePage]{#2}\removeunwantedspaces
> \stoptexdefinition
> 
> \starttexdefinition endnoteChapter
>    \startchapter    [title=Notes]
> \setupheadertexts[{\it\getmarking[part]}][\setups{noteHeadingsText}]
> [\setups{noteHeadingsText}][{\it\getmarking[part]}]
>    \placenotes  [endnote]
>    \page
> \setupheadertexts[{\it\getmarking[part]}][{\it\getmarking[section]}]
>     [{\it\getmarking[chapter]}][part]
>    \stopchapter
> \stoptexdefinition
> 
> %--%
> 
> \starttext
> 
> \completecontent
> 
> \startpart[title=Part 1]
> \dorecurse{3}{
>    \startchapter[title=Chapter #1]
>      If a man wants to read good books, he must make a point of
>      avoiding bad ones; for life is short, and time and energy
>      limited.
>      \startfootnote
>    T.\,Baily Saunders’ translation, in his 1891 {\em
>    The Art of Literature}, of part of one of Arthur
>    Schopenhauer’s essays.
>      \stopfootnote
>      \startEndnote
>    {\language[deo]%
>    Um das Gute zu lesen, ist eine Bedingung, dass man das
>    Schlechte nicht lese: denn das Leben ist kurz, Zeit und
>    Kräfte beschränkt.}
>      \stopendnote
> 
>      \dorecurse{6}{
>    \startsection[title=Section ##1]
>      This followed by:
> 
>      {\it Repetitio est mater studiorum}. Any book that is at
>      all important ought to be at once read through twice;
>      partly because, on a second reading, the connection of the
>      different portions of the book will be better understood,
>      and the beginning comprehended only when the end is known;
>      and partly because we are not in the same temper and
>      disposition on both readings. On the second perusal we get a
>      new view of every passage and a different impression of the
>      whole book, which then appears in another light.
>    \startEndnote
>      {\language[deo]%
>      Repetitio est mater studiorum. Jedes irgend wichtige

Re: [NTG-context] Rolling out a pandoc-context publication workflow in an organization

2021-07-02 Thread denis.maier
Hi,
in case you don't know it already, for your use-case you might also be 
interested in this workflow:
https://oa-pub.hos.tuhh.de/de/

It's a publishing workflow for OA-Journals. IIUC, the interesting part (in this 
context here) is that they use Gitlab, author in markdown, and whenever you 
push a commit, Gitlab actions are used to produce the final output. I think 
they use Pandoc and LaTeX with Docker Images, but maybe it could be possible to 
set something similar up with ConTeXt... 

Denis


> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Jan U. Hasecke
> Gesendet: Donnerstag, 1. Juli 2021 08:03
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] Rolling out a pandoc-context publication workflow in an
> organization
> 
> 
> Dear all,
> 
> in the last weeks I asked more questions than I normally do. The reason is 
> that
> my organization is discussing to roll out a markdown-pandoc-context
> publication workflow.
> 
> Some time ago we started to use context to produce flyers and some other
> documents. In fact I was the only one to use it. The results are so good that 
> we
> discussed how to use it more often.
> 
> Currently we use LaTeX to produce our legal documents, terms of services etc.
> With ConTeXt we are able to meet our corporate design guidelines and to
> produce good looking and individually designed documents.
> 
> But our authors and editors were not willing to use ConTeXt directly so that 
> we
> decided to look into Pandoc and use Markdown as authors input markup.
> Markdown is much better supported by text editors than ConTeXt.
> 
> The main problem for me is to come up with a good organization of the
> ConTeXt workflow so that it is easy usable and meets our requirements for
> quality management.
> 
> These are quite strict. We are a Debian based cooperative and the majority of
> our editors also use this distribution on their private computers. Some use a
> MacBook, only one uses of Windows.
> 
> For this reason we would like to stay with the Debian ConTeXt, which I never
> used as it is quite old. The same is true for Pandoc which made some
> improvements in the last years and also is very old in the current Debian
> distribution. As we did not decide this issue I can't say how much I have to
> refactor our styles to meet the older versions of ConTeXt.
> 
> Apart from this I have to organize our style files and ressources, anyway.
> 
> In another thread Hans said how to use these folders. Thanks a lot.
> 
> texmf-local   : maybe configurations
> texmf-project : stuff you're working on (styles)
> texmf-fonts   : fonts you downloaded or bought
> 
> All our styles and our shared image folder are versioned by git so I think 
> that I
> either put links into texmf-project pointing to our style repository and to 
> our
> image repository to have easy access to these ressources no matter how we
> call context or to put them into texmf-project directly. (We did not decide 
> yet
> whether we call context from pandoc using a tmp directory for building or
> directly from our build script.
> 
> If we use the current lmtx distribution, all editors would have to install 
> ConTeXt
> with the install.sh script on their private computers, then we would either 
> call a
> post installation script to clone the repositories in texmf-project or to 
> clone
> them in another folder and set links to texmf-project. Linking seems better 
> as I
> am not sure what "context generate" would do with the .git folder inside the
> repositories.
> 
> All document projects are in their own repository. Currently we use a build
> script to call pandoc with an individual set of arguments including a custom
> context template which is stored in the document repository, also. Inside of 
> this
> template we include all the environments we need for this particular
> document. We have a lot of small environments to reuse them in different
> document types.
> 
> This is our plan so far.
> 
> But to role out this successfully I would like to ease the way to a working
> pandoc-context installation for our editors. Do you have an idea how to do 
> this?
> 
> I come up with the idea of an "organizational context distribution" that has 
> all
> requirements preinstalled. That could look like this:
> 
> We have a repository:
> 
> hs.lmtx
> 
> which contains the install script and all our ressources (images and styles).
> 
> Our editors would clone the repository and just call the installation script 
> to
> download the lmtx distribution. Afterwards they are ready to start as we would
> point to the right context executable in our build scripts.
> 
> Problem: What will happen if our editors do a git pull in hs.lmtx and a 
> "context
> generate"? There are also concerns if something breaks after updating context
> with the install.sh. Is there a way to reset the installation to a given point
> release? How do you solve this in a production environment? On my private
> computer I sometimes ins

Re: [NTG-context] Different authorconversion for citation alternatives and bibliographic entries

2021-06-30 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Alan Braslau 
> Gesendet: Mittwoch, 30. Juni 2021 21:11
> An: mailing list for ConTeXt users ; Maier, Denis 
> Christian
> (UB) 
> Betreff: Re: [NTG-context] Different authorconversion for citation 
> alternatives
> and bibliographic entries
> 
> On 30/06/21 12:59, denis.ma...@unibe.ch wrote:
> > Hi,
> >
> >> -Ursprüngliche Nachricht-
> >> Von: ntg-context  Im Auftrag von Ágoston
> >> Volcz
> >> Gesendet: Mittwoch, 30. Juni 2021 10:20 An:ntg-context@ntg.nl
> >> Betreff: [NTG-context] Different authorconversion for citation
> >> alternatives and bibliographic entries
> >>
> >> Hi there,
> >>
> >> My university has special requirements for the theses I submit.
> >> Layout, fonts etc. are pretty straightforward to set up in ConTeXt.
> >> The one part I'm struggling with is citations / bibliography.
> >> I have to use the german citation style with footnotes. Essentially
> >> the first time I cite something, I have to put the full entry in a
> >> footnote. From the second time on, I only have to put a shorter entry in 
> >> the
> footnotes.
> > Is this first citation vs other citations thing currently possible with 
> > ConTeXt? I
> was thinking that there was no proper support for note style citations in
> ConTeXt? Has that changed? I remember reading the phrase "We may add
> additional citation styles if there demand and clear requirements exist." So
> what's the current state of affairs here?
> >
> > Denis
> 
> Indeed (one can always use \footnote{} but that might not be a good substitute
> for a proper footnote citation style.
> 
> I do not use footnote citations as a general style (and personally dislike it,
> finding them somewhat distracting and sloppy). Yet these are popular in many
> fields and there is no reason not to support it.

So what would be needed to make add real support for it?
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes

2021-06-30 Thread denis.maier


> Von: Hans Hagen 
> 
> On 6/30/2021 4:57 PM, denis.ma...@unibe.ch wrote:
> >
> [...]
> >
> > Will this interfere with how parts are displayed in the regular table
> > of contents?
> 
> sure but you can group
> 
> \start
>.. flush the list
> \stop
> 
> although it's not really needed when you do this at the end of the document

Hmm, but don't you usually style thing before \starttext? (Ok, you can use 
setups to keep the definitions in one place.)

> 
> > 2. Does this treat endnotes just like a list entry, with page numbers
> > and so?
> 
> indeed

Ok, so you cannot use the regular \setupnotation[endnote][settings] for styling 
the endnotes?

Denis

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

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


Re: [NTG-context] Different authorconversion for citation alternatives and bibliographic entries

2021-06-30 Thread denis.maier
Hi,

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Ágoston Volcz
> Gesendet: Mittwoch, 30. Juni 2021 10:20
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] Different authorconversion for citation alternatives 
> and
> bibliographic entries
> 
> Hi there,
> 
> My university has special requirements for the theses I submit.
> Layout, fonts etc. are pretty straightforward to set up in ConTeXt.
> The one part I'm struggling with is citations / bibliography.
> I have to use the german citation style with footnotes. Essentially the first 
> time I
> cite something, I have to put the full entry in a footnote. From the second 
> time
> on, I only have to put a shorter entry in the footnotes.

Is this first citation vs other citations thing currently possible with 
ConTeXt? I was thinking that there was no proper support for note style 
citations in ConTeXt? Has that changed? I remember reading the phrase "We may 
add additional citation styles if there demand and clear requirements exist." 
So what's the current state of affairs here?

Denis 



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

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


Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes

2021-06-30 Thread denis.maier


> -Ursprüngliche Nachricht-

> Von: Hans Hagen 

> Gesendet: Mittwoch, 30. Juni 2021 11:28

> An: Maier, Denis Christian (UB) ; mailing list for

> ConTeXt users 

> Betreff: Re: AW: [NTG-context] Heading for endnotes / grouped by chapter

> endnotes

>

> On 6/30/2021 10:06 AM, denis.ma...@unibe.ch wrote:

> >> -Ursprüngliche Nachricht-

> >> Von: Hans Hagen 

> >> Gesendet: Dienstag, 29. Juni 2021 16:20

> >> An: mailing list for ConTeXt users ; Maier, Denis

> >> Christian

> >> (UB) 

> >> Betreff: Re: [NTG-context] Heading for endnotes / grouped by chapter

> >> endnotes

> >>

> >> On 6/29/2021 12:53 PM, denis.ma...@unibe.ch wrote:

> >>> Hi,

> >>>

> >>> may I reask the question from below? Would be really great if

> >>> something grouped endnotes were possible...

> >>

> >> i need some lines to the code base for that (everything is actually

> >> already in place to support that)

> >>

> > [...]

> >

> > That looks very promising. Would be great if that missing piece could be

> added!

> it's in the latest



Cool. Thanks. So again something to be wikified.

Two questions related to this relying on the list mechanism:



1. You use this to flush the notes

\setuplist

   [part]

   [after={\blank[samepage,big]\placelist[endnote][criterium=part]}]



\placelist

   [part]

   [criterium=all]

Will this interfere with how parts are displayed in the regular table of 
contents?



2. Does this treat endnotes just like a list entry, with page numbers and so?



And, something seems to e wrong with the numbering of the notes:

[cid:image001.png@01D76DD1.032A3850]



The endnote marks in the text are correct.



Best,

Denis





>

>

> -

>Hans Hagen | PRAGMA ADE

>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands

> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl

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

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


Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes

2021-06-30 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Dienstag, 29. Juni 2021 16:20
> An: mailing list for ConTeXt users ; Maier, Denis 
> Christian
> (UB) 
> Betreff: Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes
> 
> On 6/29/2021 12:53 PM, denis.ma...@unibe.ch wrote:
> > Hi,
> >
> > may I reask the question from below? Would be really great if
> > something grouped endnotes were possible...
> 
> i need some lines to the code base for that (everything is actually already in
> place to support that)
> 
[...]

That looks very promising. Would be great if that missing piece could be added!

Thanks for your help
Denis

> 
> Hans
> 
> 
> > Best
> >
> > Denis
> >
> > *Von:*ntg-context  *Im Auftrag von
> > *denis.ma...@unibe.ch
> > *Gesendet:* Donnerstag, 24. Juni 2021 13:05
> > *An:* ntg-context@ntg.nl
> > *Betreff:* [NTG-context] Heading for endnotes / grouped by chapter
> endnotes
> >
> > Hi,
> >
> > I have two questions regarding endnotes:
> >
> > 1. Is there a way to add a heading automatically to the endnotes placed
> > with \placenotes[endnote]?
> >
> > 2. I reset the endnote number at each part. Is there a way to insert the
> > title of the corresponding part heading to the endnotes?
> >
> > I have searched the wiki and the mailing list, and I've found two
> > relevant questions, but no answers.
> >
> > https://www.mail-archive.com/ntg-context@ntg.nl/msg68490.html
> > 
> >
> > https://www.mail-archive.com/ntg-context@ntg.nl/msg34163.html
> > 
> >
> > Best,
> >
> > Denis
> >
> > ===
> >
> > \setuphead[part][placehead=yes]
> >
> > \setupnotation
> >
> >    [endnote]
> >
> >    [way=bypart]
> >
> > \starttext
> >
> > \part{First Part}
> >
> > asdf\endnote{asdf}
> >
> > jklö\endnote{jklö}
> >
> > \part{Second Part}
> >
> > asdf\endnote{asdf}
> >
> > jklö\endnote{jklö}
> >
> > \placenotes[endnote]
> >
> > \stoptext
> >
> > =
> >
> >
> >
> 
> ___
> > If your question is of interest to others as well, please add an entry to 
> > the
> Wiki!
> >
> > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-
> context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> 
> ___
> >
> 
> 
> --
> 
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Heading for endnotes / grouped by chapter endnotes

2021-06-29 Thread denis.maier
Hi,

may I reask the question from below? Would be really great if something grouped 
endnotes were possible...

Best
Denis

Von: ntg-context  Im Auftrag von 
denis.ma...@unibe.ch
Gesendet: Donnerstag, 24. Juni 2021 13:05
An: ntg-context@ntg.nl
Betreff: [NTG-context] Heading for endnotes / grouped by chapter endnotes

Hi,

I have two questions regarding endnotes:

1. Is there a way to add a heading automatically to the endnotes placed with 
\placenotes[endnote]?

2. I reset the endnote number at each part. Is there a way to insert the title 
of the corresponding part heading to the endnotes?

I have searched the wiki and the mailing list, and I've found two relevant 
questions, but no answers.
https://www.mail-archive.com/ntg-context@ntg.nl/msg68490.html
https://www.mail-archive.com/ntg-context@ntg.nl/msg34163.html

Best,
Denis

===
\setuphead[part][placehead=yes]
\setupnotation
  [endnote]
  [way=bypart]

\starttext

\part{First Part}
asdf\endnote{asdf}

jklö\endnote{jklö}


\part{Second Part}

asdf\endnote{asdf}

jklö\endnote{jklö}


\placenotes[endnote]

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

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


Re: [NTG-context] new upload lmtx

2021-06-29 Thread denis.maier
Any progress on this? That sounds like a really useful feature for multilingual 
texts. 

Best,
Denis

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Pablo
> Rodriguez
> Gesendet: Mittwoch, 23. Juni 2021 16:53
> An: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] new upload lmtx
> 
> On 6/18/21 11:46 PM, Hans Hagen wrote:
> > Hi,
> >
> > End of the week so time to wrap up.
> > [...]
> > (2) (Pablo:) There is some progress with facing floats that Thomas
> > will check out for real usage. So, still experimental.
> 
> Excellent news, Hans.
> 
> Many thanks for your work, Hans and Thomas.
> 
> Pablo
> --
> http://www.ousia.tk
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> 
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] First line of larger font paragraph on grid

2021-06-28 Thread denis.maier
Ok, I've now tried to adapt my real document to this (see below). But I'm 
running into some problems:

1. I'm not sure whether to use \setuplocalinterlinespace or 
\setupinterlinespace. With \setuphead, \setuplocalinterlinespace works, but it 
doesn't work with \framed... But even with \setuphead it leads to results I 
didn't expect: \blank[force,3*line,depth] -> four empty lines instead of three.

2. foregroundstyle={\bfe\setupinterlinespace[line=17.5pt]} works sort of with 
the default fonts, i.e. the visuals are ok, but with \showstruts enabled, you 
see that the struts are incorrect. Now, with the font I have to use (Noto Serif 
Semicondensed ExtraBold at 15pt, with linespacing 17.5pt, available at 
http://www.google.com/get/noto/#serif-lgc) this shows up even visually: The 
letters are placed a tiny bit below the baseline.

Any ideas? Hints?

TIA,
Denis

%-
\setuplayout[grid=yes]
\showgrid
\showstruts

\definefont  [BigFont]  [Bold at 20pt] [28pt]

\definefontsize[e]  %   < added
\definebodyfontenvironment [12pt] [e=20pt]  %   < added

\definebodyfontenvironment [10pt] [e=15pt]  %   < added dm
\definebodyfontenvironment [10pt] [interlinespace=14pt]  %   < added dm
%\definefontfamily[mainface][rm][Noto Serif]
%   [tf=file:NotoSerif-SemiCondensed.ttf] % < added dm

\setupbodyfont[mainface,10pt] % < added dm

\unprotect
\unexpanded\def\section_command#1#2{%
   \framed [
width=\textwidth,
frame=off,
rulethickness=0pt,
offset=0pt,
loffset=-0pt,
before=,
location=top,
align=flushleft,]{#2}%
}


\setuphead [section] [
 style=\bfe,
 %style={\bfe\setupinterlinespace[line=17.5pt]},
 style={\bfe\setuplocalinterlinespace[line=17.5pt]},
 after=,
before=,
   command=\section_command,
]
\protect


\defineframed[myframed][
width=\textwidth,
frame=off,
rulethickness=0pt,
offset=0pt,
loffset=-0pt,
foregroundstyle=\bfe,%   < added
foregroundstyle={\bfe\setupinterlinespace[line=17.5pt]},
%   < dm, added; does work partially; struts are incorrect
foregroundstyle={\bfe\setuplocalinterlinespace[line=17.5pt]},   
%   < dm, added; does not work
strut=yes,   %   < added
before=,
location=top,
align=flushleft,]  

\starttext

\blank[force,3*line,depth]

\myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem ipsum 
dolor sit amet consectetur adipisicing elit}

asdfasdf

\page
\blank[force,3*line,depth]

\startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing elit 
Lorem ipsum dolor sit amet consectetur adipisicing elit]
   asdf
\stopsection

\stoptext%-




> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von
> denis.ma...@unibe.ch
> Gesendet: Sonntag, 27. Juni 2021 16:57
> An: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] First line of larger font paragraph on grid
> 
> Thanks, Garulfo. I don't use \definedfont in my real document so I should be
> able to port it to my use case. And now I've learned about foregroundstyle. (I
> was already a bit perplexed that \framed has no style key.)
> 
> Just out of curiousity, perhaps someone (Hans? Wolfgang?) knows more about
> the underlying issue?
> 
> Denis
> 
> > -Ursprüngliche Nachricht-
> > Von: ntg-context  Im Auftrag von Garulfo
> > Gesendet: Samstag, 26. Juni 2021 12:37
> > An: ntg-context@ntg.nl
> > Betreff: Re: [NTG-context] First line of larger font paragraph on grid
> >
> > To have the two pages similar
> >
> > There is something linked with the use of \definefont.
> > Don't know if it properly impacts the interlinespace for example.
> >
> > %--
> >
> > \setuplayout[grid=yes]
> > \showgrid
> >
> > \definefont  [BigFont]  [Bold at 20pt] [28pt]
> >
> > \definefontsize[e]  %   < added
> > \definebodyfontenvironment [12pt] [e=20pt]  %   < added
> >
> > \unprotect
> > \unexpanded\def\section_command#1#2{%
> >\framed [
> > width=\textwidth,
> > frame=off,
> > rulethickness=0pt,
> > offset=0pt,
> > loffset=-0pt,
> > before=,
> > location=top,
> > align=flushleft,]{#2}%
> > }
> >
> >
> > \setuphead [section] [
> >  style=\bfe,
> >  after=,
> > before={\blank[1*line]},
> >command=\section_command,
> > ]
> > \protect
> >
> >
> > \defineframed[myframed][
> > width=\textwidth,
> >

Re: [NTG-context] First line of larger font paragraph on grid

2021-06-27 Thread denis.maier
Thanks, Garulfo. I don't use \definedfont in my real document so I should be 
able to port it to my use case. And now I've learned about foregroundstyle. (I 
was already a bit perplexed that \framed has no style key.)

Just out of curiousity, perhaps someone (Hans? Wolfgang?) knows more about the 
underlying issue?

Denis

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Garulfo
> Gesendet: Samstag, 26. Juni 2021 12:37
> An: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] First line of larger font paragraph on grid
> 
> To have the two pages similar
> 
> There is something linked with the use of \definefont.
> Don't know if it properly impacts the interlinespace for example.
> 
> %--
> 
> \setuplayout[grid=yes]
> \showgrid
> 
> \definefont  [BigFont]  [Bold at 20pt] [28pt]
> 
> \definefontsize[e]  %   < added
> \definebodyfontenvironment [12pt] [e=20pt]  %   < added
> 
> \unprotect
> \unexpanded\def\section_command#1#2{%
>\framed [
> width=\textwidth,
> frame=off,
> rulethickness=0pt,
> offset=0pt,
> loffset=-0pt,
> before=,
> location=top,
> align=flushleft,]{#2}%
> }
> 
> 
> \setuphead [section] [
>  style=\bfe,
>  after=,
> before={\blank[1*line]},
>command=\section_command,
> ]
> \protect
> 
> 
> \defineframed[myframed][
> width=\textwidth,
> frame=off,
> rulethickness=0pt,
> offset=0pt,
> loffset=-0pt,
> foregroundstyle=\bfe,%   < added
> strut=yes,   %   < added
> before=,
> location=top,
> align=flushleft,]%   < removed dup "]"
> 
> \starttext
> 
> \blank[force,3*line,depth]
> 
> %\begingroup%   < removed
> %\BigFont   %   < removed
> \myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem
> ipsum dolor sit amet consectetur adipisicing elit}
> %\endgroup  %   < removed
> 
> asdfasdf
> 
> \page
> \blank[force,3*line,depth]
> 
> \startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing elit
> Lorem ipsum dolor sit amet consectetur adipisicing elit]
>asdf
> \stopsection
> 
> \stoptext
> 
> %--
> 
> 
> Le 25/06/2021 à 12:30, denis.ma...@unibe.ch a écrit :
> > Hi,
> >
> > I have some text in a larger font where the first line should be on
> > the grid. Therefore, I’ve tried to adapt the solution from the wiki:
> > https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the_
> > grid
> >  > _grid>
> >
> > The interesting thing is that the section command indeed places the
> > first line on the grid, but using \framed directly does not give the
> > desired results.
> >
> > I must be missing something obvious. Does anyone know a solution ?
> >
> > Thanks for your help,
> >
> > Denis
> >
> > ===
> >
> > \setuplayout[grid=yes]
> >
> > \showgrid
> >
> > \definefont  [BigFont]  [Bold at 20pt] [24pt]
> >
> > \unprotect
> >
> > \unexpanded\def\section_command#1#2{%
> >
> > \framed [
> >
> >     width=\textwidth,
> >
> >         frame=off,
> >
> >         rulethickness=0pt,
> >
> >         offset=0pt,
> >
> >         loffset=-0pt,
> >
> >     before=,
> >
> >     location=top,
> >
> >     align=flushleft,]{#2}%
> >
> > }
> >
> > \setuphead [section] [
> >
> >      style={\BigFont},
> >
> > after=,
> >
> >     before={\blank[1*line]},
> >
> >    command=\section_command,
> >
> > ]
> >
> > \protect
> >
> > \defineframed[myframed][
> >
> >         width=\textwidth,
> >
> >         frame=off,
> >
> >         rulethickness=0pt,
> >
> >         offset=0pt,
> >
> > loffset=-0pt,
> >
> >     before=,
> >
> >     location=top,
> >
> > align=flushleft,]]
> >
> > \starttext
> >
> > \blank[force,3*line,depth]
> >
> > \begingroup
> >
> > \BigFont
> >
> > \myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit
> > Lorem ipsum dolor sit amet consectetur adipisicing elit}
> >
> > \endgroup
> >
> > asdfasdf
> >
> > \page
> >
> > \blank[force,3*line,depth]
> >
> > \startsection [title=Lorem ipsum dolor sit amet consectetur
> > adipisicing elit Lorem ipsum dolor sit amet consectetur adipisicing
> > elit]
> >
> > asdf
> >
> > \stopsection
> >
> > \stoptext
> >
> > =
> >
> >
> >
> 
> __
> > _ If your question is of interest to others as well,
> > please add 

Re: [NTG-context] Align in setup header/footer

2021-06-25 Thread denis.maier
but you'll perhaps have to put the stuff inside a hbox first

\definehbox[pagenumber][12.5mm]

\setupfootertexts
[] [{\getmarking[chapter]}\hboxpagenumber{\hfill\pagenumber}]
[\hboxpagenumber{\pagenumber\hfill}{\getmarking[part]}][]


> -Ursprüngliche Nachricht-
> Von: Maier, Denis Christian (UB)
> Gesendet: Freitag, 25. Juni 2021 12:31
> An: ntg-context@ntg.nl
> Betreff: AW: [NTG-context] Align in setup header/footer
> 
> You can use \hfill
> 
> > -Ursprüngliche Nachricht-
> > Von: ntg-context  Im Auftrag von Jan U.
> > Hasecke
> > Gesendet: Freitag, 25. Juni 2021 12:23
> > An: ntg-context@ntg.nl
> > Betreff: Re: [NTG-context] Align in setup header/footer
> >
> >
> > Hi Denis,
> >
> > Am 25.06.21 um 09:50 schrieb denis.ma...@unibe.ch:
> > > Or, for more complex footers/headers you can use:
> > > \setupfootertexts
> > >  [left on odd page] % out
> > >  [right on odd page] % in
> > >  [right on even page] % in
> > >  [left on even page] % out
> >
> > In fact it is something like this
> >
> > \setupfootertexts
> >[margin]
> >[]
> >[\pagenumber]
> >[\pagenumber]
> >[]
> >
> > I want to align the number inside of this area to the right or the
> > left respectively.
> >
> > I only found setuplayouttext to style the area, except that there is
> > no key "align".
> >
> > juh
> >
> 
> > ___
> > If your question is of interest to others as well, please add an entry to 
> > the
> Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> > https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> 
> > ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Align in setup header/footer

2021-06-25 Thread denis.maier
You can use \hfill

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Jan U. Hasecke
> Gesendet: Freitag, 25. Juni 2021 12:23
> An: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] Align in setup header/footer
> 
> 
> Hi Denis,
> 
> Am 25.06.21 um 09:50 schrieb denis.ma...@unibe.ch:
> > Or, for more complex footers/headers you can use:
> > \setupfootertexts
> >  [left on odd page] % out
> >  [right on odd page] % in
> >  [right on even page] % in
> >  [left on even page] % out
> 
> In fact it is something like this
> 
> \setupfootertexts
>[margin]
>[]
>[\pagenumber]
>[\pagenumber]
>[]
> 
> I want to align the number inside of this area to the right or the left
> respectively.
> 
> I only found setuplayouttext to style the area, except that there is no key
> "align".
> 
> juh
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> 
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] First line of larger font paragraph on grid

2021-06-25 Thread denis.maier
Hi,

I have some text in a larger font where the first line should be on the grid. 
Therefore, I've tried to adapt the solution from the wiki: 
https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the_grid

The interesting thing is that the section command indeed places the first line 
on the grid, but using \framed directly does not give the desired results.

I must be missing something obvious. Does anyone know a solution ?

Thanks for your help,
Denis

===
\setuplayout[grid=yes]
\showgrid

\definefont  [BigFont]  [Bold at 20pt] [24pt]

\unprotect
\unexpanded\def\section_command#1#2{%
  \framed [
   width=\textwidth,
   frame=off,
   rulethickness=0pt,
   offset=0pt,
   loffset=-0pt,
   before=,
   location=top,
   align=flushleft,]{#2}%
}


\setuphead [section] [
style={\BigFont},
after=,
   before={\blank[1*line]},
  command=\section_command,
]
\protect

\defineframed[myframed][
   width=\textwidth,
   frame=off,
   rulethickness=0pt,
   offset=0pt,
   loffset=-0pt,
   before=,
   location=top,
   align=flushleft,]]

\starttext

\blank[force,3*line,depth]

\begingroup
\BigFont
\myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem ipsum 
dolor sit amet consectetur adipisicing elit}
\endgroup

asdfasdf

\page
\blank[force,3*line,depth]

\startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing elit 
Lorem ipsum dolor sit amet consectetur adipisicing elit]
  asdf
\stopsection

\stoptext
=



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

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


Re: [NTG-context] Align in setup header/footer

2021-06-25 Thread denis.maier
Addendum: I've probably got confused which parts of the footer are filled with 
the different arguments, but anyway... You get the idea.

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von
> denis.ma...@unibe.ch
> Gesendet: Freitag, 25. Juni 2021 09:50
> An: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] Align in setup header/footer
> 
> Hi,
> 
> what do you have in the footer?
> 
> Page numers?
> Then you can just use:
> \setuppagenumbering
>   [alternative=doublesided,
>   location={footer,right}]
> 
> Or, for more complex footers/headers you can use:
> \setupfootertexts
> [left on odd page] % out
> [right on odd page] % in
> [right on even page] % in
> [left on even page] % out
> 
> https://wiki.contextgarden.net/Command/setupheadertexts
> 
> I'm not sure I was understanding your question. Is this what you want?
> 
> Denis
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: ntg-context  Im Auftrag von Jan U.
> > Hasecke
> > Gesendet: Freitag, 25. Juni 2021 09:25
> > An: mailing list for ConTeXt users 
> > Betreff: [NTG-context] Align in setup header/footer
> >
> >
> > Dear all,
> >
> > while finetuning a layout I would like to change the align in
> > setupfootertext to right align or outer align as it is a doublesided layout.
> >
> > The default is afaics to align to the middle of the two pages.
> >
> > I would like to change this but there is no align key in setupfooter.
> >
> > TIA
> > juh
> >
> 
> > ___
> > If your question is of interest to others as well, please add an entry to 
> > the
> Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> > https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> 
> > ___
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> 
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Align in setup header/footer

2021-06-25 Thread denis.maier
Hi,

what do you have in the footer?

Page numers?
Then you can just use:
\setuppagenumbering
[alternative=doublesided,
location={footer,right}]

Or, for more complex footers/headers you can use:
\setupfootertexts
[left on odd page] % out
[right on odd page] % in
[right on even page] % in
[left on even page] % out

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

I'm not sure I was understanding your question. Is this what you want?

Denis


> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Jan U. Hasecke
> Gesendet: Freitag, 25. Juni 2021 09:25
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] Align in setup header/footer
> 
> 
> Dear all,
> 
> while finetuning a layout I would like to change the align in setupfootertext 
> to
> right align or outer align as it is a doublesided layout.
> 
> The default is afaics to align to the middle of the two pages.
> 
> I would like to change this but there is no align key in setupfooter.
> 
> TIA
> juh
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> 
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Heading for endnotes / grouped by chapter endnotes

2021-06-24 Thread denis.maier
Hi,

I have two questions regarding endnotes:

1. Is there a way to add a heading automatically to the endnotes placed with 
\placenotes[endnote]?

2. I reset the endnote number at each part. Is there a way to insert the title 
of the corresponding part heading to the endnotes?

I have searched the wiki and the mailing list, and I've found two relevant 
questions, but no answers.
https://www.mail-archive.com/ntg-context@ntg.nl/msg68490.html
https://www.mail-archive.com/ntg-context@ntg.nl/msg34163.html

Best,
Denis

===
\setuphead[part][placehead=yes]
\setupnotation
  [endnote]
  [way=bypart]

\starttext

\part{First Part}
asdf\endnote{asdf}

jklö\endnote{jklö}


\part{Second Part}

asdf\endnote{asdf}

jklö\endnote{jklö}


\placenotes[endnote]

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

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


Re: [NTG-context] Adjust Grid to last line textheight

2021-06-23 Thread denis.maier
I've tried adjusting interlinespacing, but it seems to make no difference :

==
\setupinterlinespace[
height=.72,
depth=.28,
top=2,
%top=0,
%top=5,
%top=1,
bottom=0,
%bottom=0.4,
%bottom=0,
%bottom=1,
%bottom=5,
line=2.8ex,
]

\setuplayout[grid=yes]
\showgrid
\starttext

\dorecurse{5}{\input knuth\par}

\stoptext
==

Even extreme values for top and bottom (e.g. 0 or 10) seem to make no 
difference at all.
What am I missing? Is that even the right place to make that adjustment ?

Denis

Von: ntg-context  Im Auftrag von 
denis.ma...@unibe.ch
Gesendet: Mittwoch, 23. Juni 2021 11:47
An: ntg-context@ntg.nl
Betreff: [NTG-context] WG: Adjust Grid to last line textheight

Hi,

I have to use grid typesetting and the grid has to be aligned to the last line 
of textheight. I have to replicate a layout made with Indesign where there 
seems to be a bit of additional spacing before the first line, whereas in 
ConTeXt that happens to be after the last line of the page (see attachment).

Is that possible?

I have already found the various grid snapping methods, but they seem to change 
how content is placed on the grid, not the placement of the grid itself.

===
\setuplayout[grid=yes]
\showgrid
\starttext

\input knuth

\stoptext
===

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

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


[NTG-context] WG: Adjust Grid to last line textheight

2021-06-23 Thread denis.maier
Hi,

I have to use grid typesetting and the grid has to be aligned to the last line 
of textheight. I have to replicate a layout made with Indesign where there 
seems to be a bit of additional spacing before the first line, whereas in 
ConTeXt that happens to be after the last line of the page (see attachment).

Is that possible?

I have already found the various grid snapping methods, but they seem to change 
how content is placed on the grid, not the placement of the grid itself.

===
\setuplayout[grid=yes]
\showgrid
\starttext

\input knuth

\stoptext
===

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

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


Re: [NTG-context] typescripts and variants

2021-06-23 Thread denis.maier
Hi,

> > Am 23.06.2021 um 08:43 schrieb Henning Hraban Ramm :
> >
> >
> >> Am 23.06.2021 um 00:17 schrieb denis.ma...@unibe.ch:
> >>
> >> Hi
> >> In my current project I need to use different variants if the Noto
> >> Serif font (Regular, Medium, Semi Condensed Bold, Regular ExtraBold.) Is
> my understanding of typescripts correct that I cannot have bold and extrabold
> in the same typescript? And that I need a typescript for regular and one for 
> the
> semicondensed variants?
> >
> > You can combine whatever you like in one typescript, but you’re restricted 
> > to
> six styles (regular, italic, slanted, bold, bold italic, bold slanted). You 
> can just
> “abuse” the italic or slanted styles for your other weights.
> 
> ... or use roman styles, if you don’t need roman.

Thanks for your help. 
After playing a bit more with the different variants for loading fonts it looks 
like I don't even need to use typescripts. \definefontfamily works just as good:

\definefontfamily[mainface][rm][Noto Serif]
\definefontfamily[mainface-semicond][rm][Noto Serif]
  [tf=file:NotoSerif-SemiCondensed.ttf,
  it=file:NotoSerif-SemiCondensedItalic.ttf,
  bf=file:NotoSerif-SemiCondensedBold.ttf,
  bi=file:NotoSerif-SemiCondensedBoldItalic.ttf]

But, do typescripts have any advantages over that approach?

Then, for fonts used only in specific contexts, you can also do something like
 
\definefont [TitleFont] [notoserifsemicondensedextrabold]
and use that with \TitleFont
But you will then also need \TitleMonoFont etc, whereas it seems easier to keep 
things consistent with \definefontfamily...

One thing I'm wondering about: Would it be possible to add a easy mechanism to 
switch to different variants of a font, say, to use the SemiCondensed variant 
or the ExtraCondensed or so? (Or does that already exist?)
And, what about adding more styles so that you could have Light, Medium, 
SemiBold, Bold, ExtraBold, Black etc. all defined in a single fontfamily? If 
that was available each font family would then define all the styles for one 
variant (SemiCondensed, ExtraCondensed, Condensed, each with 18 styles!)

My knowledge of fonts is quite limited so please excuse if that doesn't make 
sense or if I'm missing something obvious to others.

Best,
Denis

> 
> Hraban
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> 
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] typescripts and variants

2021-06-22 Thread denis.maier
Hi
 In my current project I need to use different variants if the Noto Serif font 
(Regular, Medium, Semi Condensed Bold, Regular ExtraBold.)
Is my understanding of typescripts correct that I cannot have bold and 
extrabold in the same typescript? And that I need a typescript for regular and 
one for the semicondensed variants?

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

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


Re: [NTG-context] Project structure: Specifying environment in component

2021-06-16 Thread denis.maier
I’ll look into this, and post to the list once I’ve made the changes so others 
can comment.

Denis

Von: ntg-context  Im Auftrag von jethro Reuel
Gesendet: Mittwoch, 9. Juni 2021 14:49
An: mailing list for ConTeXt users 
Betreff: Re: [NTG-context] Project structure: Specifying environment in 
component

Thanks. Maybe a change of how the wiki is worded is needed.


On 9 Jun 2021, at 12:07 PM, denis.ma...@unibe.ch 
wrote:

I’ve also struggled with this before as you can see if you search the mailing 
list.
My question: https://www.mail-archive.com/ntg-context@ntg.nl/msg97763.html
Wolfgang’s answer : 
https://www.mail-archive.com/ntg-context@ntg.nl/msg97775.html

We should probably change the wiki to make it clear that no inheritance of 
environments happens here.

Denis

Von: ntg-context 
mailto:ntg-context-boun...@ntg.nl>> Im Auftrag von 
mastermind_ x
Gesendet: Mittwoch, 9. Juni 2021 13:36
An: ntg-context@ntg.nl
Betreff: [NTG-context] Project structure: Specifying environment in component

Hello everyone,

I am creating a project of notes across different areas of mathematics I am 
studying and the structure looks like this:

env_notes.tex
project_notes.tex
geogroups/groups-prd_geometry-groups.tex
geogroups/groups-c_chapter1.tex



I am following this wiki: https://wiki.contextgarden.net/Project_structure



My question is: Why do I need to specify
\environment env_notes
before It works at the component level? The wiki didn’t say that. Plus it is 
already specified at the product level. Thanks.



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

maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Project structure: Specifying environment in component

2021-06-09 Thread denis.maier
I’ve also struggled with this before as you can see if you search the mailing 
list.
My question: https://www.mail-archive.com/ntg-context@ntg.nl/msg97763.html
Wolfgang’s answer : 
https://www.mail-archive.com/ntg-context@ntg.nl/msg97775.html

We should probably change the wiki to make it clear that no inheritance of 
environments happens here.

Denis

Von: ntg-context  Im Auftrag von mastermind_ x
Gesendet: Mittwoch, 9. Juni 2021 13:36
An: ntg-context@ntg.nl
Betreff: [NTG-context] Project structure: Specifying environment in component

Hello everyone,

I am creating a project of notes across different areas of mathematics I am 
studying and the structure looks like this:

env_notes.tex
project_notes.tex
geogroups/groups-prd_geometry-groups.tex
geogroups/groups-c_chapter1.tex


I am following this wiki: https://wiki.contextgarden.net/Project_structure


My question is: Why do I need to specify
\environment env_notes
before It works at the component level? The wiki didn’t say that. Plus it is 
already specified at the product level. Thanks.


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

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


Re: [NTG-context] where to break a long header

2021-06-04 Thread denis.maier
\startsection[title={A very \\ long title},list={A very long title}]

Von: ntg-context  im Auftrag von Sandra Snan 

Gesendet: Samstag, 5. Juni 2021 07:59:33
An: ntg-context@ntg.nl
Betreff: [NTG-context] where to break a long header

I had an unsually long header and it didn't look great:

https://ellen.idiomdrottning.org/sateotc1.png

A crlf fixes it:

https://ellen.idiomdrottning.org/sateotc2.png

But then that shows up in the table of contents so that's not a good
solution. What is the best practice for this situation?
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] quotes potruding out in the left margin

2021-06-04 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Wolfgang
> Schuster
> Gesendet: Freitag, 4. Juni 2021 10:08
> An: mailing list for ConTeXt users 
> Betreff: Re: [NTG-context] quotes potruding out in the left margin
> 
> Sandra Snan schrieb am 04.06.2021 um 09:52:
> > Oh, the example you just posted doesn't work on live.contextgarden,
> > let alone on my installation. The quotation marks still don't potrude.
> 
> I tested my example on the garden and got the expected output with the
> quotation marks in the margin (only partially but this is normal with the
> quality setting).
> 

I can confirm that this works. As Wolfgang notes protrusion is only partial 
with the default settings, but you can tweak it with \setupfontprotrusion (see 
below).
\setupfontprotrusion [quality] [left=2] is probably what you want since this 
puts the complete quotation mark into the margin.

I don't know what the numbers mean. Maybe someone can add to this.

Denis


%\setupfontprotrusion [quality] [left=0] % no protrusion on the left margin
\setupfontprotrusion [quality] [left=1] % default
%\setupfontprotrusion [quality] [left=1.5] % more protrustion
%\setupfontprotrusion [quality] [left=2] % even more protrustion
%\setupfontprotrusion [quality] [left=2.5] % too much protrusion

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

\setupquotation
  [method=font]

\setupalign
  [hz,hanging]

\showframe
  [text]
  [text]

\starttext

oh hi there

“you are so”

\quotation{you are so}

here here

\stoptext

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

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


[NTG-context] Understanding penalties for orphans and widows

2021-06-01 Thread denis.maier
Hi,

I've read in the wiki 
(https://wiki.contextgarden.net/Widows_and_orphans_control) that this setting 
can be used to keep at least two lines together:

\startsetups[grid][mypenalties]
\setdefaultpenalties
\setpenalties\widowpenalties{2}{1}
\setpenalties\clubpenalties {2}{1}
\stopsetups

After experimenting with the first argument (see below) it looks to me as if 
the wording on the wiki should be changed a bit, from  to  
(penalties1 gives me one full line and a second line that is almost full ; 
penalties2 results in two full lines with a third line that is almost full.).

Is my interpretation correct?

Denis

\setuppapersize[A6]
\setuplayout[lines=20]
\setupalign[line]

\showframe

\startsetups[penalties1]
\setdefaultpenalties
\setpenalties\widowpenalties{1}{1}
\stopsetups

\startsetups[penalties2]
\setdefaultpenalties
\setpenalties\widowpenalties{2}{1}
\stopsetups

\starttext

\setuplayout[setups=penalties1]

\samplefile{tufte}\par
Here we are writing some more words to see the effect.
Here we are writing some more words to see the effect.
Here we are writing some more words to see the effect.

\page
\setuplayout[setups=penalties2]

\samplefile{tufte}\par
Here we are writing some more words to see the effect.
Here we are writing some more words to see the effect.
Here we are writing some more words to see the effect.

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

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


Re: [NTG-context] itemize margins,

2021-06-01 Thread denis.maier
Von: ntg-context  Im Auftrag von Wolfgang Schuster
Gesendet: Dienstag, 1. Juni 2021 11:05
An: mailing list for ConTeXt users 
Betreff: Re: [NTG-context] itemize margins,

denis.ma...@ub.unibe.ch schrieb am 01.06.2021 
um 10:46:

Hi,

in the following example the second line of the quote is not lined up with the 
first line.

=
\starttext

\startitemize[n]
[
%right=),
%stopper=,
%width=2em,
%alternative=fit,
%alternative=left,
%alternative=intext,
%distance=1em,
%leftmargin=1em,
%itemalign=flushleft,
]

\startitem
\setupindenting[no]
\input knuth
\stopitem
\stoptext
==

I've played with different options, but I couldn't get the indents and margins 
right. What am I missing ? Any hints ?

You are adding a extra space in the first line at the end of the 
\setupindenting line.
Ah, of course. Thanks!


To get rid of the space add % after the setup (i.e. \setupindenting[no]%) or 
even better use the indenting key with \startitemize or \setupitemize (i.e. 
\startitemize[indneting=no]).


\startitemize[indenting=no] works perfectly.

Denis

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

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


[NTG-context] itemize margins,

2021-06-01 Thread denis.maier
Hi,

in the following example the second line of the quote is not lined up with the 
first line.

=
\starttext

\startitemize[n]
[
%right=),
%stopper=,
%width=2em,
%alternative=fit,
%alternative=left,
%alternative=intext,
%distance=1em,
%leftmargin=1em,
%itemalign=flushleft,
]

\startitem
\setupindenting[no]
\input knuth
\stopitem
\stoptext
==

I've played with different options, but I couldn't get the indents and margins 
right. What am I missing ? Any hints ?

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

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


Re: [NTG-context] specify a directory for tex files

2021-05-25 Thread denis.maier
Thanks for the explanation!

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Wolfgang
> Schuster
> Gesendet: Dienstag, 25. Mai 2021 12:06
> An: mailing list for ConTeXt users 
> Betreff: Re: [NTG-context] specify a directory for tex files
> 
> denis.ma...@ub.unibe.ch schrieb am 25.05.2021 um 11:44:
> >> -Ursprüngliche Nachricht-
> >> Von: ntg-context  Im Auftrag von
> Wolfgang
> >> Schuster
> >> Gesendet: Montag, 24. Mai 2021 21:04
> >> An: mailing list for ConTeXt users 
> >> Betreff: Re: [NTG-context] specify a directory for tex files
> >>
> >> Jeroen schrieb am 24.05.2021 um 20:44:
> >>> similar to this for figures
> >>>
> >>> \setupexternalfigures
> >>> [directory={./myfigures}]
> >>>
> >>> is there a way to specify a directory for tex files so with
> >>>
> >>> \input{myfile.tex}
> >>>
> >>> the file myfile.tex can be placed in a subdirectory for example
> >>> ./mytexfiles?
> >>
> >> \usepath[...]
> >>
> >> and
> >>
> >> \usesubpath[...]
> >>
> >
> > What's the difference between the two versions?
> 
> 
> When you have a document where all files are in folder two level deep like
> here you can use both commands to tell ConTeXt where to look for the files.
> 
> 
> /document
> |
> |   main.tex
> |
> |---chapter
> |   |
> |   |---file_system
> |   |   ntfs.tex
> |   |   fat32.tex
> |   |
> |   |---installation
> |   windows.tex
> |   linux.tex
> |
> |---images
>  windows.jpg
>  linux.jpg
>  macos.jpg
> 
> 
> The setup for the example above would be:
> 
>   \usepath[chapter]
> 
>   \usesubpath[file_system,installation]
> 
> 
> When you use this lookup limit the number of paths and subpaths because it
> slows compilation down, there reason for this is that ConTeXt tries path +
> subpath combinations until the requested file is found.
> 
> Wolfgang
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-
> context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] specify a directory for tex files

2021-05-25 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Wolfgang
> Schuster
> Gesendet: Montag, 24. Mai 2021 21:04
> An: mailing list for ConTeXt users 
> Betreff: Re: [NTG-context] specify a directory for tex files
> 
> Jeroen schrieb am 24.05.2021 um 20:44:
> > similar to this for figures
> >
> > \setupexternalfigures
> > [directory={./myfigures}]
> >
> > is there a way to specify a directory for tex files so with
> >
> > \input{myfile.tex}
> >
> > the file myfile.tex can be placed in a subdirectory for example
> > ./mytexfiles?
> 
> \usepath[...]
> 
> and
> 
> \usesubpath[...]
> 

What's the difference between the two versions?

Denis


> 
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-
> context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Language goodies -- hard line break the algorithm?

2021-05-12 Thread denis.maier
Hi,
testing the new language goodies feature for ligature prevention, I found that 
hard line breaks seem to interfere somehow with the ligature prevention 
mechanism:

==
\setuplanguage[de][ goodies={lang-de.llg}]
\startlanguageoptions[de]
auf|jubeln
\stoplanguageoptions
\mainlanguage[de]

\definefontfeature[default][default][dlig=yes,liga=yes]
\definefontfamily[times][rm][Times New Roman]
\setupbodyfont[times]

\starttext

aufjubeln
aufjubeln\\
auffliegen
auffliegen\\
begrifflich
begrifflich\\

\stoptext
==

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

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


[NTG-context] Ligatures blocking -- why block unspecified ligatures?

2021-05-12 Thread denis.maier
Hi,

I just ran into an issue with the \blockligatures mechanism. For some reason, 
the following examples replaces ffi with f|fi and ffl with f|fl although I have 
not specified them in \blockligatures:

==
\definefontfeature[default][default][dlig=yes,liga=yes]
\definefontfeature[default:block][default][blockligatures=yes]

% block certain ligatures globally, but not f|fl, f|fi
\blockligatures [ft,fft,fj,ffj,fk]

\definefontfamily[times][rm][Times New Roman]

\startbuffer[test]
fj\\
ffi\\
ffl\\
ff\\
fi
\stopbuffer

\starttext

\getbuffer[test]

\definedfont[Serif*default:block]
\getbuffer[test]

\switchtobodyfont[times]
\getbuffer[test]

% With Times New Roman, we can even see the bars in the output
\definedfont[Serif*default:block]
\getbuffer[test]

\stoptext
==

What am I missing?

(I am trying to block certain ligatures globally, ie. ft,fft,fj,ffj,fk, but fi, 
ffi, fl, fll are being dealt with in the language goodies file.)

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

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


Re: [NTG-context] Adjusting parameters for a single page

2021-05-11 Thread denis.maier

Von: ntg-context  Im Auftrag von luigi scarso
Gesendet: Dienstag, 11. Mai 2021 10:41
An: mailing list for ConTeXt users 
Betreff: Re: [NTG-context] Adjusting parameters for a single page



On Tue, May 11, 2021 at 10:29 AM 
mailto:denis.ma...@ub.unibe.ch>> wrote:
-Ursprüngliche Nachricht-
> Von: Hans Hagen mailto:j.ha...@xs4all.nl>>
> Gesendet: Dienstag, 11. Mai 2021 00:13
> An: mailing list for ConTeXt users 
> mailto:ntg-context@ntg.nl>>; Maier, Denis
> Christian (UB) mailto:denis.ma...@ub.unibe.ch>>
> Betreff: Re: [NTG-context] Adjusting parameters for a single page
>
> On 5/10/2021 5:15 PM, denis.ma...@ub.unibe.ch 
> wrote:
> > Hi everyone,
> >
> > I know it is possible to make local changes by enclosing text in
> > \start \stop pairs to make local changes. Then, there are also
> > commands that only affect the next/current paragraph, such as \looseness.
> >
> > But is there a similar mechanism for page-layout changes? For example
> > your penalty settings allow widows and orphans, but on one particular
> > page you want to change the penalties. Or, you use
> > \setupalign[height], but on one page you want to use
> > \setupalign[bottom] instead. Is there a way to do this ?
> it works per paragraph so then you need to adapt it for a specific paragraph

So, that means you cannot make changes to a page, but only to paragraph. If a 
paragraph goes over page boundaries, you cannot add stretch or shrink 
interlinespace for just one page... correct?

this looks more a otr technique, e.g.
 https://www.tug.org/TUGboat/tb11-1/tb27salomon.pdf
(or grep the context code for otr)


Thanks for the hint. I have TeX by Topic open at the moment :-)

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

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


Re: [NTG-context] Adjusting parameters for a single page

2021-05-11 Thread denis.maier
-Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Dienstag, 11. Mai 2021 00:13
> An: mailing list for ConTeXt users ; Maier, Denis
> Christian (UB) 
> Betreff: Re: [NTG-context] Adjusting parameters for a single page
> 
> On 5/10/2021 5:15 PM, denis.ma...@ub.unibe.ch wrote:
> > Hi everyone,
> >
> > I know it is possible to make local changes by enclosing text in
> > \start \stop pairs to make local changes. Then, there are also
> > commands that only affect the next/current paragraph, such as \looseness.
> >
> > But is there a similar mechanism for page-layout changes? For example
> > your penalty settings allow widows and orphans, but on one particular
> > page you want to change the penalties. Or, you use
> > \setupalign[height], but on one page you want to use
> > \setupalign[bottom] instead. Is there a way to do this ?
> it works per paragraph so then you need to adapt it for a specific paragraph

So, that means you cannot make changes to a page, but only to paragraph. If a 
paragraph goes over page boundaries, you cannot add stretch or shrink 
interlinespace for just one page... correct?


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

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


Re: [NTG-context] Adjusting parameters for a single page

2021-05-11 Thread denis.maier
Thanks, Hans, really interesting stuff.

> so, basically, you have a lot of control, all together some 36 parameters
> (pablo probably loves the somewhat secret on the fly adjustspacing step,
> stretch and shrink tweakability)
Any hints where I can find these 36 parameters?

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

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


Re: [NTG-context] Include PDF pages

2021-05-11 Thread denis.maier
https://wiki.contextgarden.net/Including_pages_from_PDF_documents


Von: ntg-context  Im Auftrag von MANUEL GONZALEZ 
SUAREZ
Gesendet: Dienstag, 11. Mai 2021 09:30
An: Context 
Betreff: [NTG-context] Include PDF pages

Hello everybody:


My query is as follows: in LaTeX there is the package "pdfpages" 
(https://www.ctan.org/pkg/pdfpages) that allows pages from a PDF file to be 
included in a TeX document. Is there a similar procedure that works in ConTeXt?

Thanks.
M. González.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Tracking overfull/underfull vboxes, widows/orphans

2021-05-10 Thread denis.maier
Hi,
some time ago Hans has added these trackers for overfull/underfull hboxes:


I'm wondering if there is something similar for vertical boxes?
I've found these trackers:
builders.vspacing
builders.vpacking
builders.page_vspacing
builders.collect_vspacing

But I don't really understand what they do. (Yes, I've tried them.)
Maybe someone can shed some light on this ? (RTFM is a perfectly fine answer, 
just need to know which manual...)

Then, would it be possible to add a tracker for widows/orphans?  (Or even for 
prevented widows/orphans ?)

Denis

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

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


[NTG-context] Adjusting parameters for a single page

2021-05-10 Thread denis.maier
Hi everyone,

I know it is possible to make local changes by enclosing text in \start \stop 
pairs to make local changes. Then, there are also commands that only affect the 
next/current paragraph, such as \looseness.
But is there a similar mechanism for page-layout changes? For example your 
penalty settings allow widows and orphans, but on one particular page you want 
to change the penalties. Or, you use \setupalign[height], but on one page you 
want to use \setupalign[bottom] instead. Is there a way to do this ?

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

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


Re: [NTG-context] weird word breaking in Win64

2021-05-08 Thread denis.maier
Looks like I can confirm this... see below. But it seems to depend on your PDF 
viewer. Results in Sumatra and Acrobat differ.

Denis


current version: 2021.05.06 23:35

Sumatra
Coming back to the use of typefaces in
electronic publishing: many of the new
typog‍ raphersreceivetheirknowledgeand
infor‍ mation about the rules of typog‍ ra-
phy from books, from com‍ puter mag‍ a-
zines or the instruction manuals which
theygetwiththepurchaseofaPCorsoft-
ware. There is not so much basic instruc-
tion, as of now, as there was in the old
days,showingthedifferencesbetweengood
and bad typographic design. Many peo-
plearejustfascinatedbytheirPC'stricks,
andthinkthatawidely--praisedprogram,
called up on the screen, will make every-
thing automatic from now on.

Acrobat

Coming back to the use of typefaces in
electronic publishing: many of the new
typog raphers receive their knowledge and
infor mation about the rules of typog raphy
from books, from com puter mag azines
or the instruction manuals which
they get with the purchase of a PC or software.
There is not so much basic instruction,
as of now, as there was in the old
days, showing the differences between good
and bad typographic design. Many people
are just fascinated by their PC's tricks,
and think that a widely--praised program,
called up on the screen, will make everything
automatic from now on.

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Pablo
> Rodriguez
> Gesendet: Samstag, 8. Mai 2021 13:33
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] weird word breaking in Win64
> 
> Dear list,
> 
> the following sample breaks some words not right in Win64 (I cannot
> reproduce it in Linux):
> 
>   \enabledirectives[fonts.injections.method=advance]
>   \setuppapersize[A6]
>   \definefontfamily[mainface][rm]
>   [TeX Gyre Pagella]
>   \setupbodyfont[mainface]
>   \starttext
> \input zapf
>   \stoptext
> 
> Copying text from latest Acrobat Reader DC, I get:
> 
>  Coming back to the use of typefaces in
>  electronic publishing: many of the new
>  typog raphers receive their knowledge and  infor mation about the rules of
> typog raphy  from books, from com puter mag azines  or the instruction
> manuals which  they get with the purchase of a PC or software.
>  There is not so much basic instruction,  as of now, as there was in the old
> days, showing the differences between good  and bad typographic design.
> Many people  are just fascinated by their PC's tricks,  and think that a 
> widely--
> praised program,  called up on the screen, will make everything  automatic
> from now on.
> 
> Lines 3-5 contain word breaks that make searching impossible.
> 
> This seems to be added by fonts.injections.method=advance.
> 
> Could anyone on Windows confirm this issue?
> 
> Many thanks for your help,
> 
> Pablo
> --
> http://www.ousia.tk
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-
> context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] setupalign[line]/setupalign[height] break \testpage

2021-05-06 Thread denis.maier
Hi everyone,

I've recently asked this question: 
https://www.mail-archive.com/ntg-context@ntg.nl/msg98293.html

To reiterate: Is there any way to add a \vfill on a page immediately before a
section heading?
On the mailing list I then found a possible solution :
\setuphead[section][aftersection=cmd]
So, I thought \testpage or \checkpage here could be a solution. However, the 
vertical stretching algorithm seems to interfere with \testpage in some way as 
the example below tries to illustrate. Can anyone confirm this? Is this a bug 
or am I missing something?


\setuppapersize[A5][A5]

% Activate this and \testpage stops working
%\setupalign[height]
%\setuptolerance[vertical,stretch]
%\setupinterlinespace[
%   stretch=0.001,
%   shrink=0.001,
%   ]
%

\showframe

\starttext

\section{Section}
\input knuth\par
\input knuth\par
\input knuth\par
\input ward
\input ward
\testpage[20] % This stops working as soon as vertical stretching is active
\input ward

\section{Section}
\input knuth\par

\stoptext


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

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


[NTG-context] conditionally add \vfill before section if at end of page

2021-05-04 Thread denis.maier
Hi,

I'm still playing/struggling with vertical glue to have pages of a constant 
height. The following settings give reasonable results:

=
\setuppapersize[A5][A5]

\setupalign[line]
\setuptolerance[vertical,stretch]
\setupinterlinespace[
stretch=0.001,
shrink=0.001,
]

\showframe

\starttext

\section{Section}
\input knuth\par
\input knuth\par
\input knuth\par
\input ward
\input ward
\input ward
%\vfill % can a \vfill be added automatically here?


\section{Section}
\input knuth\par

% here we don't have a \vfill as this is on the middle of the page
\section{Section}
\input knuth\par

\stoptext
==

However, I don't want the stretching if the next page starts with a section 
heading. Is there any way to add a \vfill on a page immediately before a 
section heading? \doifatpageborder \doifatpagestart or something similar ?

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

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


Re: [NTG-context] issue with Public Sans

2021-05-04 Thread denis.maier
Hi Pablo

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Pablo
> Rodriguez
> Gesendet: Samstag, 1. Mai 2021 13:00
> An: mailing list for ConTeXt users 
> Betreff: [NTG-context] issue with Public Sans
> 
> Dear listt,
> 
> I have problems with current latest (from 2021.04.29 23:09) to get proper
> character spacing using Public Sans
> (https://public-sans.digital.gov/):
> 
>   \definefontfamily[mainface][rm]
>   [Public Sans]
>   \setupbodyfont[mainface]
>   \starttext
>   \doloopoverlist{\rm,\it,\bf,\bi}
> {\startpar\recursestring\input zapf\stoppar}
>   \stoptext
> 
> Could anyone confirm this? I wonder whether the typeface itself is missing
> something.

Confirmed here.

I've also tried with --luatex, but that doesn't find the font at all. (Do I 
have to update the font database for luatex separately?)

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

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


Re: [NTG-context] calculating optimal height of textblock

2021-04-29 Thread denis.maier
One thing, I've noticed: 
Lines=40 seems to add more space than strictly necessary.

Why is that?

Example:

===
\setupbodyfont[10pt]

\definepapersize[test][width=140mm,height=208mm]
\setuppapersize[test][test]

\setuppagenumbering[location={footer,middle}]

\setuplayout[reset]
\setuplayout[backspace=17mm,
topspace=19mm,
header=0mm,
headerdistance=0mm,
footerdistance=4mm,
footer=5mm,
width=105mm,
%height=177mm, % does not suffice for a complete line
height=178mm, % enough for a complete line
%lines=40, % adds a bit of extra whitespace below the 
last line
rightmargin=0mm,
leftmargin=0mm,
]

% \setupalign[line]
% \setuptolerance[vertical,verytolerant,stretch]
% \setupinterlinespace[stretch=0.01]

\startsetups[mypenalties]
\setdefaultpenalties
\setpenalties\clubpenalties{2}{0}
\setpenalties\widowpenalties{2}{0}
\setpenalties\displaywidowpenalties{2}{0}
\stopsetups
\setuplayout[setups=mypenalties]

%\showframe
\showmakeup
\showsetups

\starttext

\dorecurse{5}{\input knuth\par}

\stoptext

===

> -Ursprüngliche Nachricht-
> Von: Maier, Denis Christian (UB)
> Gesendet: Donnerstag, 29. April 2021 10:03
> An: 'Hans Hagen' ; mailing list for ConTeXt users  cont...@ntg.nl>
> Betreff: AW: [NTG-context] calculating optimal height of textblock
> 
> Thanks, Hans. That's really helpful.
> 
> Denis
> 
> > -Ursprüngliche Nachricht-
> > Von: Hans Hagen 
> > Gesendet: Mittwoch, 28. April 2021 17:58
> > An: mailing list for ConTeXt users ; Maier, Denis
> > Christian (UB) 
> > Betreff: Re: [NTG-context] calculating optimal height of textblock
> >
> > On 4/28/2021 2:07 PM, denis.ma...@ub.unibe.ch wrote:
> >
> > > how do you usually calcultate your layouts? For example in this
> > > example, the third value for height is not really helpful as there
> > > will never be a complete line :
> >
> > you can use
> >
> >lines=40,
> >
> > instead of height
> >
> > Hans
> >
> > -
> >Hans Hagen | PRAGMA ADE
> >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> > -
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] calculating optimal height of textblock

2021-04-29 Thread denis.maier
Thanks, Hans. That's really helpful. 

Denis

> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Mittwoch, 28. April 2021 17:58
> An: mailing list for ConTeXt users ; Maier, Denis
> Christian (UB) 
> Betreff: Re: [NTG-context] calculating optimal height of textblock
> 
> On 4/28/2021 2:07 PM, denis.ma...@ub.unibe.ch wrote:
> 
> > how do you usually calcultate your layouts? For example in this
> > example, the third value for height is not really helpful as there
> > will never be a complete line :
> 
> you can use
> 
>lines=40,
> 
> instead of height
> 
> Hans
> 
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] calculating optimal height of textblock

2021-04-28 Thread denis.maier
Hi,

how do you usually calcultate your layouts? For example in this example, the 
third value for height is not really helpful as there will never be a complete 
line :

=
\setupbodyfont[10pt]

\definepapersize[test][width=140mm,height=208mm]
\setuppapersize[test][test]

\setuplayout[reset]
\setuplayout[backspace=17mm,
  topspace=19mm,
  header=0mm,
  footerdistance=4mm,
  footer=5mm,
  width=105mm,
  %height=174mm,
  height=178mm,
  %height=177mm, % does not suffice for 
a complete line
  rightmargin=0mm,
  leftmargin=0mm,
  ]

\startsetups[mypenalties]
\setdefaultpenalties
\setpenalties\clubpenalties{2}{0}
\setpenalties\widowpenalties{2}{0}
\setpenalties\displaywidowpenalties{2}{0}
\stopsetups
\setuplayout[setups=mypenalties]

%\showframe
\showmakeup
%\showsetups

\starttext

\dorecurse{5}{\input knuth\par}

\stoptext
=

How do you do this usually? Any best-practices? Hints? Trial and error seems to 
work ok, but maybe there is a more efficient method...

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

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


Re: [NTG-context] \setupalign[height] and \setupalign[line] in LMTX

2021-04-28 Thread denis.maier
Ok, after dabbling around a bit more, I can now come up with the following 
example



\setuppapersize[A5][A5]
\showframe

\setuptolerance[vertical,stretch]

%\setupalign[line]
%\setupinterlinespace[stretch=0.1] % vertical stretching seems to kick in for 
stretch !=0, no matter how small

\setupalign[height]
\setupinterlinespace[stretch=0.001] % vertical stretching seems to kick in for 
stretch !=0, no matter how small

\setupdelimitedtext[blockquote]
   [style={\switchtobodyfont[x]},
   spacebefore={medium,flexible},
   leftmargin=no]

\starttext

\dorecurse{10}{
\input knuth

\startblockquote
\input knuth
\stopblockquote

\input knuth
}

\stoptext



Two noteworthy things:

  1.  In LMTX you'll need \setupinterlinespace[stretch=X] with X not 0 for 
vertical to kick in.
  2.  \setupalign[line] insists to fill the last page completely.

Denis

Von: Maier, Denis Christian (UB)
Gesendet: Montag, 26. April 2021 11:34
An: 'mailing list for ConTeXt users' 
Betreff: AW: \setupalign[height] and \setupalign[line] in LMTX

Hi,

sorry to be such a nuisance, but i'd still love to hear if I'm missing 
something or if something is going off the rails in LMTX.

Best,
Denis


Von: Maier, Denis Christian (UB)
Gesendet: Donnerstag, 22. April 2021 15:07
An: 'mailing list for ConTeXt users' 
mailto:ntg-context@ntg.nl>>
Betreff: \setupalign[height] and \setupalign[line] in LMTX

Hi,

\setupalign[height] and \setupalign[line] seem to have no effect in a  LMTX. Do 
I need to change something?

Best,
Denis


```
\setuppapersize[A5][A5]
\showframe
%\setupalign[line]
\setupalign[height]

\setupdelimitedtext[blockquote]
   [
   
before={\setupindenting[yes]\tfx\setupinterlinespace},
   
spacebefore=medium,
   indentnext=no,
   leftmargin=no,
   rightmargin=no,
   ]


\starttext

\dorecurse{10}{
\input knuth

\startblockquote
\input knuth
\stopblockquote

\input knuth
}

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

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


Re: [NTG-context] Style options and setupinterlinespace

2021-04-27 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Aditya
> Mahajan
> Gesendet: Dienstag, 27. April 2021 05:49
> An: mailing list for ConTeXt users 
> Betreff: Re: [NTG-context] Style options and setupinterlinespace
> 
> On Mon, 26 Apr 2021, denis.ma...@ub.unibe.ch wrote:
> 
> > Wikified, as per Aditya's suggestion.
> 
> I expanded on the description to make it clearer (hopefully). 

Thanks. It's much clearer now.

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

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


Re: [NTG-context] Style options and setupinterlinespace

2021-04-26 Thread denis.maier
Wikified, as per Aditya's suggestion.

Denis

> -Ursprüngliche Nachricht-
> Von: Maier, Denis Christian (UB)
> Gesendet: Montag, 26. April 2021 22:50
> An: mailing list for ConTeXt users 
> Betreff: AW: [NTG-context] Style options and setupinterlinespace
> 
> Thanks everyone for your answers.
> In that case I'll change the wording in the wiki.
> 
> All best,
> Denis
> 
> > -Ursprüngliche Nachricht-
> > Von: ntg-context  Im Auftrag von Wolfgang
> > Schuster
> > Gesendet: Montag, 26. April 2021 19:28
> > An: mailing list for ConTeXt users 
> > Betreff: Re: [NTG-context] Style options and setupinterlinespace
> >
> > Aditya Mahajan schrieb am 26.04.2021 um 18:02:
> > >> Von: Maier, Denis Christian (UB)
> > >> Gesendet: Donnerstag, 22. April 2021 15:15
> > >> An: 'mailing list for ConTeXt users' 
> > >> Betreff: Style options and setupinterlinespace
> > >>
> > >> Hi,
> > >>
> > >> the wiki (https://wiki.contextgarden.net/Font_Switching) currently
> says:
> > >>
> > >>
> > >>> These quick font switches are meant for changing the font style,
> > >>> alternative, or size of a few words: they do not change the
> > >>> bodyfont, so they don't affect interline spacing or math font sizes.
> > >>> So, if you want to change the font size of an entire paragraph,
> > >>> use
> > >>>
> >
> \switchtobodyfont > >>> yfont> described below in Complete Font
> > >>>
> >
> Change > >>> hange>. However, it is fine to use them as style directives in
> > >>> hange>setup
> > >>> commands, that is, using them as an option for
> > >>>
> style=...
> > >>> in any setup command that accepts style option
> > >>  From this, I'd infer that a  or  should
> > >> change the
> > interline spacing as well. But it does not seem to be the case as the
> > example below shows.
> > > Using style=\tfx is roughly equivalent to typing `\tfx` at an
> > > appropriate
> > place. There is no automatic \setupinterlinespace after the style
> > value is executed.
> >
> > There is always the option to use \switchtobodyfont to change the font
> > size which affects also the linespacing but in this case one need
> > \setupinterlinespace after \tfx.
> >
> > In older versions (a few months ago) even \switchtobodyfont didn't
> > help here when you used the style-key to change the font size.
> >
> > Wolfgang
> >
> >
> __
> > _
> > If your question is of interest to others as well, please add an entry
> > to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > http://www.ntg.nl/mailman/listinfo/ntg-
> > context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive
> :
> > https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> __
> > _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Style options and setupinterlinespace

2021-04-26 Thread denis.maier
Thanks everyone for your answers.
In that case I'll change the wording in the wiki.

All best,
Denis

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Wolfgang
> Schuster
> Gesendet: Montag, 26. April 2021 19:28
> An: mailing list for ConTeXt users 
> Betreff: Re: [NTG-context] Style options and setupinterlinespace
> 
> Aditya Mahajan schrieb am 26.04.2021 um 18:02:
> >> Von: Maier, Denis Christian (UB)
> >> Gesendet: Donnerstag, 22. April 2021 15:15
> >> An: 'mailing list for ConTeXt users' 
> >> Betreff: Style options and setupinterlinespace
> >>
> >> Hi,
> >>
> >> the wiki (https://wiki.contextgarden.net/Font_Switching) currently says:
> >>
> >>
> >>> These quick font switches are meant for changing the font style,
> >>> alternative, or size of a few words: they do not change the
> >>> bodyfont, so they don't affect interline spacing or math font sizes.
> >>> So, if you want to change the font size of an entire paragraph, use
> >>>
> \switchtobodyfont >>> yfont> described below in Complete Font
> >>>
> Change >>> hange>. However, it is fine to use them as style directives in setup
> >>> commands, that is, using them as an option for
> >>> style=...
> >>> in any setup command that accepts style option
> >>  From this, I'd infer that a  or  should change the
> interline spacing as well. But it does not seem to be the case as the example
> below shows.
> > Using style=\tfx is roughly equivalent to typing `\tfx` at an appropriate
> place. There is no automatic \setupinterlinespace after the style value is
> executed.
> 
> There is always the option to use \switchtobodyfont to change the font size
> which affects also the linespacing but in this case one need
> \setupinterlinespace after \tfx.
> 
> In older versions (a few months ago) even \switchtobodyfont didn't help
> here when you used the style-key to change the font size.
> 
> Wolfgang
> 
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-
> context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Style options and setupinterlinespace

2021-04-26 Thread denis.maier
Hi again,

should I change the wiki or is the current behaviour a bug (that will 
eventually be corrected)?

Best,
Denis

Von: Maier, Denis Christian (UB)
Gesendet: Donnerstag, 22. April 2021 15:15
An: 'mailing list for ConTeXt users' 
Betreff: Style options and setupinterlinespace

Hi,

the wiki (https://wiki.contextgarden.net/Font_Switching) currently says:


> These quick font switches are meant for changing the font style, alternative, 
> or size of a few words: they do not change the bodyfont, so they don't affect 
> interline spacing or math font sizes. So, if you want to change the font size 
> of an entire paragraph, use 
> \switchtobodyfont 
> described below in Complete Font 
> Change. 
> However, it is fine to use them as style directives in setup commands, that 
> is, using them as an option for 
> style=... in any 
> setup command that accepts style option

>From this, I'd infer that a  or  should change the 
>interline spacing as well. But it does not seem to be the case as the example 
>below shows.

Best,
Denis

--
\definedelimitedtext[blockquoteA]
\setupdelimitedtext[blockquoteA]
   [
   style=tfx,
   
spacebefore=medium,
   ]

\definedelimitedtext[blockquoteB]
\setupdelimitedtext[blockquoteB]
   [
   
before={\tfx\setupinterlinespace},
   
spacebefore=medium,
   ]

\starttext

\input knuth

\startblockquoteA
\input knuth
\stopblockquoteA

\input knuth

\startblockquoteB
\input knuth
\stopblockquoteB

\input knuth

\stoptext
--

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

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


Re: [NTG-context] \setupalign[height] and \setupalign[line] in LMTX

2021-04-26 Thread denis.maier
Hi,

sorry to be such a nuisance, but i'd still love to hear if I'm missing 
something or if something is going off the rails in LMTX.

Best,
Denis


Von: Maier, Denis Christian (UB)
Gesendet: Donnerstag, 22. April 2021 15:07
An: 'mailing list for ConTeXt users' 
Betreff: \setupalign[height] and \setupalign[line] in LMTX

Hi,

\setupalign[height] and \setupalign[line] seem to have no effect in a  LMTX. Do 
I need to change something?

Best,
Denis


```
\setuppapersize[A5][A5]
\showframe
%\setupalign[line]
\setupalign[height]

\setupdelimitedtext[blockquote]
   [
   
before={\setupindenting[yes]\tfx\setupinterlinespace},
   
spacebefore=medium,
   indentnext=no,
   leftmargin=no,
   rightmargin=no,
   ]


\starttext

\dorecurse{10}{
\input knuth

\startblockquote
\input knuth
\stopblockquote

\input knuth
}

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

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


[NTG-context] setupalign[height] vs setupalign[line] in MKIV

2021-04-23 Thread denis.maier
Hi,

I've noticed a somewhat unexpected behaviour. MWE below.

\setupalign[line] adds an enormous amount of whitespace to fill a last page, 
but \setupalign[height] doesn't. Is that intended ?

Currently this only happens with mkiv. As stated in another mail, these options 
seem to have no effect at all under LMTX.

Best,
Denis




\setuppapersize[A5][A5]
\showframe
\setupdelimitedtext[blockquote]
   
[before={\switchtobodyfont[small]},
   
spacebefore={medium,flexible},]

\starttext

\setupalign[line] % this here causes the last page to be filled

\section{A section heading}

\input knuth\par

\page

\setupalign[height] %this here doesn't
\section{A section heading}

\input knuth\par

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

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


[NTG-context] Page building and vertical stretching

2021-04-22 Thread denis.maier
Hi,

in addition to my previous mails about \setupalign[height], a further question 
related to page building :
I'm trying to understand how ConTeXt builds pages, and how this can be 
influenced. Regarding the example below, the aim is to have pages that always 
end at the same place.
Now, how will ConTeXt use stretching? Blanks are set to flexible, and the 
interlinespacing is set to stretch. (But different values for blockquotes.)
In which order will ConTeXt proceed? Interlinespacing first, then blanks? Or 
the other way round? Or both at the same time?
And, can this be influenced somehow?

Best,
Denis


\setuppapersize[A5][A5]
\showframe

\setupblank[big,flexible]

\setupinterlinespace[stretch=0.03]
\setuptolerance[vertical,stretch]
\setupalign[height]

\setuphead
[section,subject]
[
before={\blank[2*big,flexible]},
after={\blank[big,flexible]},
]

\setupdelimitedtext[blockquote]
   [
   
before={\tfx\setupinterlinespace[stretch=0.05]},
   
spacebefore={medium,flexible},
   left=
   ]

\starttext

\input knuth

\section{A section heading}

\input knuth\par
\blank
\input knuth\par

\startblockquote
\input knuth\par
\stopblockquote

\input knuth\par

\startblockquote
\input knuth\par
\stopblockquote

\input knuth\par

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

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


[NTG-context] Style options and setupinterlinespace

2021-04-22 Thread denis.maier
Hi,

the wiki (https://wiki.contextgarden.net/Font_Switching) currently says:


> These quick font switches are meant for changing the font style, alternative, 
> or size of a few words: they do not change the bodyfont, so they don't affect 
> interline spacing or math font sizes. So, if you want to change the font size 
> of an entire paragraph, use 
> \switchtobodyfont 
> described below in Complete Font 
> Change. 
> However, it is fine to use them as style directives in setup commands, that 
> is, using them as an option for 
> style=... in any 
> setup command that accepts style option

>From this, I'd infer that a  or  should change the 
>interline spacing as well. But it does not seem to be the case as the example 
>below shows.

Best,
Denis

--
\definedelimitedtext[blockquoteA]
\setupdelimitedtext[blockquoteA]
   [
   style=tfx,
   
spacebefore=medium,
   ]

\definedelimitedtext[blockquoteB]
\setupdelimitedtext[blockquoteB]
   [
   
before={\tfx\setupinterlinespace},
   
spacebefore=medium,
   ]

\starttext

\input knuth

\startblockquoteA
\input knuth
\stopblockquoteA

\input knuth

\startblockquoteB
\input knuth
\stopblockquoteB

\input knuth

\stoptext
--

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

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


[NTG-context] \setupalign[height] and \setupalign[line] in LMTX

2021-04-22 Thread denis.maier
Hi,

\setupalign[height] and \setupalign[line] seem to have no effect in a  LMTX. Do 
I need to change something?

Best,
Denis


```
\setuppapersize[A5][A5]
\showframe
%\setupalign[line]
\setupalign[height]

\setupdelimitedtext[blockquote]
   [
   
before={\setupindenting[yes]\tfx\setupinterlinespace},
   
spacebefore=medium,
   indentnext=no,
   leftmargin=no,
   rightmargin=no,
   ]


\starttext

\dorecurse{10}{
\input knuth

\startblockquote
\input knuth
\stopblockquote

\input knuth
}

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

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


Re: [NTG-context] nbsp in XML (S01E01)

2021-04-21 Thread denis.maier
Re tilde: maybe the answer is in the entities section of the xml mkiv manual.

Denis




Von: ntg-context  im Auftrag von Jano Kula 

Gesendet: Mittwoch, 21. April 2021 23:09:55
An: mailing list for ConTeXt users
Betreff: Re: [NTG-context] nbsp in XML (S01E01)

On Wed, Apr 21, 2021 at 8:37 PM Hans van der Meer 
mailto:havdm...@ziggo.nl>> wrote:
Why tilde is displayed?

Wouldn't the simple answer not be: because XML is not TeX?

I see your point for tilde: with finalizers in mind I was already in the 
stomach, while mouth was looking at the menu. Teaser for S01E02: finalizers.

I still would expect unicode nbsp to be expandable, otherwise I would have to 
treat it somehow (no problem with that). Remember times when non 
expandable/shrinkable nbsp was the first clue the book was typeset in Word? 
I've checked it now and it's still the case.

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

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


Re: [NTG-context] xml processing in latest

2021-04-21 Thread denis.maier
Ah, now I see
ConTeXt  ver: 2021.04.20 18:45 LMTX  fmt: 2021.4.21  int: english/english
gives me the attached result.

Denis

> -Ursprüngliche Nachricht-
> Von: Maier, Denis Christian (UB)
> Gesendet: Mittwoch, 21. April 2021 10:34
> An: ntg-context@ntg.nl
> Betreff: AW: [NTG-context] xml processing in latest
> 
> Hi
> 
> What's the exact issue?
> 
> I get the same results on my TeXLive version and on the latext lmtx:
> ConTeXt  ver: 2020.01.26 18:34 MKIV beta  fmt: 2020.10.2  int: english/english
> ConTeXt  ver: 2021.04.18 18:12 LMTX  fmt: 2021.4.20  int: english/english
> 
> And even with --luatex
> ConTeXt  ver: 2021.04.18 18:12 MKIV  fmt: 2021.4.21  int: english/english
> 
> Always the result as attached.
> 
> Denis
> 
> 
> > -Ursprüngliche Nachricht-
> > Von: ntg-context  Im Auftrag von Thomas
> A.
> > Schmitz
> > Gesendet: Mittwoch, 21. April 2021 08:45
> > An: ntg-context@ntg.nl
> > Betreff: [NTG-context] xml processing in latest
> >
> >
> > Hi all,
> >
> > the latest has some strange problems with xml processing. The example
> > below shows an issue with itemize. In my real file, I also get pages
> > that are filled only two thirds and rugged right instead of justified,
> > but I haven't been able to reproduce this in a MWE. Maybe this one can
> > give a start; I assume it's some fundamental typo somewhere.
> >
> > All best
> >
> > Thomas
> >
> > \startbuffer[test]
> > 
> >test
> > 
> > 
> > one
> > 
> > 
> > two
> > 
> > 
> > 
> > \stopbuffer
> >
> > \startxmlsetups xml:testsetups
> >  \xmlsetsetup{#1}{*}{-}
> > \xmlsetsetup{#1}{document|p|numbered|item}{xml:*}
> > \stopxmlsetups
> >
> > \xmlregistersetup{xml:testsetups}
> >
> > \startxmlsetups xml:document
> > \xmlflush{#1}
> > \stopxmlsetups
> >
> > \startxmlsetups xml:p
> > \xmlflush{#1} \par
> > \stopxmlsetups
> >
> > \startxmlsetups xml:numbered
> > \startitemize [n]
> > \xmlflush{#1}
> > \stopitemize
> > \stopxmlsetups
> >
> > \startxmlsetups xml:item
> > \startitem
> > \xmlflush{#1}
> > \stopitem
> > \stopxmlsetups
> >
> > \starttext
> > \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 /
> > http://www.ntg.nl/mailman/listinfo/ntg-
> > context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive
> :
> > https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> >
> __
> > _


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

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


Re: [NTG-context] xml processing in latest

2021-04-21 Thread denis.maier
Hi

What's the exact issue? 

I get the same results on my TeXLive version and on the latext lmtx:
ConTeXt  ver: 2020.01.26 18:34 MKIV beta  fmt: 2020.10.2  int: english/english
ConTeXt  ver: 2021.04.18 18:12 LMTX  fmt: 2021.4.20  int: english/english

And even with --luatex
ConTeXt  ver: 2021.04.18 18:12 MKIV  fmt: 2021.4.21  int: english/english

Always the result as attached.

Denis


> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Thomas A.
> Schmitz
> Gesendet: Mittwoch, 21. April 2021 08:45
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] xml processing in latest
> 
> 
> Hi all,
> 
> the latest has some strange problems with xml processing. The example
> below shows an issue with itemize. In my real file, I also get pages that are
> filled only two thirds and rugged right instead of justified, but I haven't 
> been
> able to reproduce this in a MWE. Maybe this one can give a start; I assume 
> it's
> some fundamental typo somewhere.
> 
> All best
> 
> Thomas
> 
> \startbuffer[test]
> 
>test
>   
>   
>   one
>   
>   
>   two
>   
>   
> 
> \stopbuffer
> 
> \startxmlsetups xml:testsetups
>  \xmlsetsetup{#1}{*}{-}
>   \xmlsetsetup{#1}{document|p|numbered|item}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:testsetups}
> 
> \startxmlsetups xml:document
>   \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:p
>   \xmlflush{#1} \par
> \stopxmlsetups
> 
> \startxmlsetups xml:numbered
>   \startitemize [n]
>   \xmlflush{#1}
>   \stopitemize
> \stopxmlsetups
> 
> \startxmlsetups xml:item
>   \startitem
>   \xmlflush{#1}
>   \stopitem
> \stopxmlsetups
> 
> \starttext
>   \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 / http://www.ntg.nl/mailman/listinfo/ntg-
> context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _


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

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


  1   2   >