Re: [NTG-context] Have a cell span multiple columns with tabulate

2021-11-27 Thread Denis Maier via ntg-context
Thanks, Hraban. That's really helpful. I'll have a look at this feature.

Denis

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Henning
> Hraban Ramm via ntg-context
> Gesendet: Samstag, 27. November 2021 22:23
> An: ntg-context@ntg.nl
> Cc: Henning Hraban Ramm 
> Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate
> 
> Am 27.11.21 um 21:49 schrieb Denis Maier via ntg-context:
> > Hans added a short while ago a span feature to tabulate but it works
> > only for simple tables (e.g. single line cells).
> >
> > You mean every cell has to be a single line cell? Or the ones where
> > this span features applies ? That would be enough for me – at least ATM.
> >
> > How does that feature work? I couldn’t find information about it.
> 
> Now it’s documented:
> https://wiki.contextgarden.net/Tabulate
> 
> Hraban
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-
> context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Joey McCollum via ntg-context
I was afraid that might be the problem. I've described some of the intended
purpose of this code near the end of the "Checking for a macro in a string
without expanding it" thread on the mailing list, but I will get into more
detail here. I'm working on a ConTeXt implementation of citation style
language (CSL) locators, particularly for the SBL citation rendering
(although the code could easily be adapted for use in general or with other
bibliographic renderings). This would allow for a consistent,
language-sensitive syntax that could be used within citations or in any
part of a text and could accommodate changes in bibliographic style without
requiring the user to reformat all their page number citations. In SBL
style, for instance, volume, part, and page numbers are not prefixed by
abbreviations like "vol.", "pt." and "p.", but in other styles, they might
be. The locator syntax

```
\loc[vol=33,pt=1,p=86]
```

would be defined in the SBL rendering file to output

```
33.1:86
```

while in some other style, it might be defined to output

```
vol. 33, pt. 1, p. 86
```

To accommodate the use of these macros within citations, I've added
"loctext" (locator text) and "altloctext" (alternate locator text)
arguments to the set of parameters used by the \cite macro, because in some
bibliographic categories, different locators can be specified for different
parts of a citation (e.g., one for a passage in an ancient text and another
for the book reproducing it), and therefore cannot just be specified in the
"righttext" parameter. So now we can do something like

```
\cite[lefttext={See},altloctext={1.3},loctext={8:223},righttext={for
further details}][clementinehomilies]
```

to get

See *The Clementine Homilies* 1.3 (*ANF *8:223) for further details.

or

```
\cite[lefttext={See},loctext={\loc[p=8]},righttext={; but there are also
contradictory statements, e.g. \loc[p=12].}][Doe:Title]
```

to get

See Doe, *Title*, 8; but there are also contradictory statements, e.g. 12.


The main problem is determining when to include a comma before printing the
"loctext" and when not to include one. In the first example above, we don't
want a comma between *ANF* and 8:223 (SBL style does not add a comma
between a multivolume set abbreviation and a volume number), but in the
second example, we do want one between *Title *and 8. Similarly, we want to
remove the comma if the first locator in the loctext is a section marker
(§) or paragraph marker (¶). This is why I want to check the beginning of
the \currentloctext macro for the presence of a volume number (a number
followed by a colon), a section mark, or a paragraph mark.

While storing the locator parameters as btx parameters would allow for
another solution to this problem, it would complicate defining the \loc
macro in a way that would be suitable outside of citations or for multiple
uses in the same citation (notice how a second \loc invocation occurs in
the righttext of the second example above). Parsing the output of \loc
seemed like the simplest solution, but as you've pointed out, it has its
own difficulties. I'm inclined to try one of the TeX-based solutions you
describe above to avoid complicating other things, but if my description of
the intended use gives you any better ideas, please suggest them!

Thanks again!

Joey

On Sat, Nov 27, 2021 at 1:44 PM Hans Hagen  wrote:

> On 11/27/2021 6:13 PM, Joey McCollum wrote:
> > All right, I think I've solved the expansion problem I described before:
> > to ensure that the first input is expanded when it is passed to Lua, I
> > have to pass it as [==[#1]==], not "#1". But the updated MWE below still
> > does not seem to work, as the \DoIfPrefixElse macro is printing "NOP"
> > instead of "YES":
> >
> > ```
> >
> > \starttexdefinition loc [#1]
> >
> > \doifassignmentelse{#1} {
> >
> > % if an assignment, then parse and format accordingly
> >
> > \getparameters[loc][#1]
> >
> > % Was a section number specified?
> >
> > \doifdefined{locsec} {
> >
> > § \locsec
> >
> > }
> >
> > } {
> >
> > % otherwise, just print the input as-is
> >
> > #1
> >
> > }
> >
> > \stoptexdefinition
> >
> >
> >
> \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}
> >
> >
> > \def\currentbtxloctext{\loc[sec=31]}
> >
> >
> > \starttext
> >
> > \currentbtxloctext\blank
> >
> > \DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}
> >
> > \stoptext
> >
> > ```
> >
> > Indeed, if I add a simple \doifelse equality check, it looks like the
> > value I expect is not the same as what the macro produces, even though
> > they look identical:
> >
> > ```
> >
> > \starttexdefinition loc [#1]
> >  \doifassignmentelse{#1} {
> >  % if an assignment, then parse and format accordingly
> >  \getparameters[loc][#1]
> >  % Was a section number specified?
> >  \doifdefined{locsec} {
> >  § \locsec
> >  }
> >  } {
> >  % otherwise, just print the input as-is
> > 

Re: [NTG-context] Macro for a comma separated list of authors

2021-11-27 Thread Andres Conrado Montoya via ntg-context
Gracias, Jairo! This works great. I will go ahead and document it on the
wiki, if that's Ok.

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

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


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

maillist : ntg-context@ntg.nl / 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] Have a cell span multiple columns with tabulate

2021-11-27 Thread Henning Hraban Ramm via ntg-context

Am 27.11.21 um 21:49 schrieb Denis Maier via ntg-context:
Hans added a short while ago a span feature to tabulate but it works 
only for simple tables (e.g. single line cells).


You mean every cell has to be a single line cell? Or the ones where this 
span features applies ? That would be enough for me – at least ATM.


How does that feature work? I couldn’t find information about it.


Now it’s documented:
https://wiki.contextgarden.net/Tabulate

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

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


Re: [NTG-context] Typographical quotes

2021-11-27 Thread Henning Hraban Ramm via ntg-context

Am 27.11.21 um 18:40 schrieb Aditya Mahajan via ntg-context:

On Sat, 27 Nov 2021, Wolfgang Schuster via ntg-context wrote:

The option is no longer part of the default feature set.


Personally, I think that that is a bit extreme. An apostrophe is a really 
common construct and I suspect that this change in default will mean that 
almost everyone needs to add tlig in their documents. We may perhaps need a 
'sensible-defaults' module :-)


Nothing against such a module, but I think it’s wrong to expect 
automatical text replacements. If I type ' or " or -- I don’t want that 
replaced, even if it may be traditional TeX behavior.


Is it too much to remember a few shortkeys for typographical glyphs?

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

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


Re: [NTG-context] Have a cell span multiple columns with tabulate

2021-11-27 Thread Denis Maier via ntg-context


Von: Jean-Philippe Rey 
Gesendet: Samstag, 27. November 2021 19:31
An: Maier, Denis Christian (UB) 
Cc: ntg-context@ntg.nl
Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate

Denis,

I have used natural tables that span multiple pages. However, if I am right, 
each row must be contained on a single page. That may be an issue depending on 
your use cases.

Best,

Well, I guess that must have been the reason why I chose tabulate.

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] Have a cell span multiple columns with tabulate

2021-11-27 Thread Denis Maier via ntg-context
Looks like Outlook messed up the formatting in my last message ...

Von: ntg-context  Im Auftrag von Denis Maier via 
ntg-context
Gesendet: Samstag, 27. November 2021 18:22
An: wolfgang.schuster.li...@gmail.com; ntg-context@ntg.nl; ntg-context@ntg.nl
Cc: Maier, Denis Christian (UB) 
Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate


Von: Wolfgang Schuster 
mailto:wolfgang.schuster.li...@gmail.com>>
Gesendet: Samstag, 27. November 2021 18:11
An: mailing list for ConTeXt users 
mailto:ntg-context@ntg.nl>>; Denis Maier via ntg-context 
mailto:ntg-context@ntg.nl>>
Cc: 
jean-philippe@centralesupelec.fr;
 Maier, Denis Christian (UB) mailto:denis.ma...@unibe.ch>>
Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate

Denis Maier via ntg-context schrieb am 27.11.2021 um 17:45:
Bonjour Jean-Philippe

Thank you for your response. That sounds very promising. I don’t remember why I 
didn’t use natural tables when I’ve started setting things up for this journal. 
I think I’d might have had something to do with tables that break across pages. 
(At least, this is what https://wiki.contextgarden.net/Tables_Overview 
currently says: extremetables are said to be better when page breaking is 
involved.)
Have you ever noticed problems in that area?

Hans added a short while ago a span feature to tabulate but it works only for 
simple tables (e.g. single line cells).


You mean every cell has to be a single line cell? Or the ones where this span 
features applies ? That would be enough for me – at least ATM.
How does that feature work? I couldn’t find information about it.

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] Typographical quotes

2021-11-27 Thread Aditya Mahajan via ntg-context
On Sat, 27 Nov 2021, Hans Hagen wrote:

> On 11/27/2021 6:40 PM, Aditya Mahajan via ntg-context wrote:
> > On Sat, 27 Nov 2021, Wolfgang Schuster via ntg-context wrote:
> > 
> > > Jean-Philippe Rey via ntg-context schrieb am 27.11.2021 um 16:21:
> > > > Dear list,
> > > > 
> > > > When typing a straight quotation mark, I used to get a curly apostrophe.
> > > > But
> > > with a recent version of ConTeXt, I now get a straight apostrophe. Is
> > > there a
> > > new option to convert automatically straight into curly apostrophes ?
> > > > 
> > > > \starttext
> > > > John's
> > > > \stoptext
> > > 
> > > The option is no longer part of the default feature set.
> > 
> > Personally, I think that that is a bit extreme. An apostrophe is a really
> > common construct and I suspect that this change in default will mean that
> > almost everyone needs to add tlig in their documents. We may perhaps need a
> > 'sensible-defaults' module :-)
> we entered the unicode world and left ascii space so for instance the ugly
> enter `` '' and expect english double quotes is also a not-done now, nor are
> !` and ?` for the spacing rotated ! and ?; i can't find the font right now but
> there were with interesting space-something ligatures that only didn't show up
> because tex has no space.

I am okay with removing all these vestiges of TeX. But, I still think that the 
following should work okay:

Let's try blah blah ...

I could have entered it as

Let’s try blah blah ..

but it is not that natural to me. 

> now, there are more tex traditions that context doesn't support; take this
> plain definition (there are many) dedicated to math users:

I am not opposed to remove 8bit TeX hacks. I was simply objecting for removing 
the apostrophe mapping. For example, you used it in the sentence above (in 
“don't”)!

> Anyway, it's easier to enabel a feature that to disable one when side effects
> of font handling kicks in happen.

I agree. Maybe I'll just add a imap in vim to map ' to ’ and forget about it

Aditya
___
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] Typographical quotes

2021-11-27 Thread Hans Hagen via ntg-context

On 11/27/2021 6:40 PM, Aditya Mahajan via ntg-context wrote:

On Sat, 27 Nov 2021, Wolfgang Schuster via ntg-context wrote:


Jean-Philippe Rey via ntg-context schrieb am 27.11.2021 um 16:21:

Dear list,

When typing a straight quotation mark, I used to get a curly apostrophe. But

with a recent version of ConTeXt, I now get a straight apostrophe. Is there a
new option to convert automatically straight into curly apostrophes ?


\starttext
John's
\stoptext


The option is no longer part of the default feature set.


Personally, I think that that is a bit extreme. An apostrophe is a really 
common construct and I suspect that this change in default will mean that 
almost everyone needs to add tlig in their documents. We may perhaps need a 
'sensible-defaults' module :-)
we entered the unicode world and left ascii space so for instance the 
ugly enter `` '' and expect english double quotes is also a not-done 
now, nor are !` and ?` for the spacing rotated ! and ?; i can't find the 
font right now but there were with interesting space-something ligatures 
that only didn't show up because tex has no space.


anyway, these kind of auto font dependent remappings and ligatures are 
kind of tricky because they depend on the font and as such are a rather 
specific 8 bit tex thing ... also, to some extend


now, there are more tex traditions that context doesn't support; take 
this plain definition (there are many) dedicated to math users:


\mathcode`\^^D="225E % \land

which gives

\starttext
$^^D$
\stoptext

and as it's plain it's documented and in the tex book so users can 
expect it. It's for those who can afford a 
https://www.artlebedev.com/optimus/maximus/ (i don't have one and it's 
no longer for sale, alas).


Anyway, it's easier to enabel a feature that to disable one when side 
effects of font handling kicks in happen.


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] Typographical quotes

2021-11-27 Thread Jean-Philippe Rey via ntg-context
> Le 27 nov. 2021 à 17:59, Wolfgang Schuster 
>  a écrit :
> 
> Jean-Philippe Rey via ntg-context schrieb am 27.11.2021 um 16:21:
>> Dear list,
>> 
>> When typing a straight quotation mark, I used to get a curly apostrophe. But 
>> with a recent version of ConTeXt, I now get a straight apostrophe. Is there 
>> a new option to convert automatically straight into curly apostrophes ?
>> 
>> \starttext
>> John's
>> \stoptext
> 
> The option is no longer part of the default feature set. To enable the 
> feature add "trep=yes" to the default features.
> 
> \definefontfeature [default] [default] [trep=yes]

Thanks a lot Wolfgang. Where can we find the current default feature set ?

-- 
Jean-Philippe Rey
jean-philippe@centralesupelec.fr 

91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

___
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] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Hans Hagen via ntg-context

On 11/27/2021 6:13 PM, Joey McCollum wrote:
All right, I think I've solved the expansion problem I described before: 
to ensure that the first input is expanded when it is passed to Lua, I 
have to pass it as [==[#1]==], not "#1". But the updated MWE below still 
does not seem to work, as the \DoIfPrefixElse macro is printing "NOP" 
instead of "YES":


```

\starttexdefinition loc [#1]

\doifassignmentelse{#1} {

% if an assignment, then parse and format accordingly

\getparameters[loc][#1]

% Was a section number specified?

\doifdefined{locsec} {

§ \locsec

}

} {

% otherwise, just print the input as-is

#1

}

\stoptexdefinition


\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}


\def\currentbtxloctext{\loc[sec=31]}


\starttext

\currentbtxloctext\blank

\DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}

\stoptext

```

Indeed, if I add a simple \doifelse equality check, it looks like the 
value I expect is not the same as what the macro produces, even though 
they look identical:


```

\starttexdefinition loc [#1]
     \doifassignmentelse{#1} {
         % if an assignment, then parse and format accordingly
         \getparameters[loc][#1]
         % Was a section number specified?
         \doifdefined{locsec} {
             § \locsec
         }
     } {
         % otherwise, just print the input as-is
         #1
     }
\stoptexdefinition

\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}

\def\currentbtxloctext{\loc[sec=31]}

\starttext
     § 31\blank%the raw text we expect
     \currentbtxloctext\blank%the text as produced by the macro
     \doifelse{\currentbtxloctext}{§ 31}{YES}{NOP}\blank% should output 
YES, but doesn't
     \DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}\blank% should 
output YES, but doesn't

\stoptext

```

What am I missing here?
Expansion hell ... and i fear that you draw yourself into more and more 
trouble with this approach (which is why you don't find that kind of 
hackery in the core unless we're real desperate) so maybe try to explain 
what the real problem is that needs to be solved. Parsing tex is seldom 
a solution (at least not in context).


You can add:

\edef\Whatever{\currentbtxloctext}\meaning\Whatever
\doifelse{\currentbtxloctext}{§ 31}{YES}{NOP}\blank

and see what comes back. Now, as always in tex, there's of course a 
solution because after all it's a programming language too (and at some 
point these solutions start looking so complex that one enters guru state)


\starttexdefinition loc [#1]
\beginlocalcontrol
\doifassignmentelse{#1} {
\getparameters[loc][#1]
\doifdefinedelse{locsec} {
\endlocalcontrol
§ \locsec
} {
\endlocalcontrol
}
} {
\endlocalcontrol
#1
}
\stoptexdefinition

a curious mix between a fully expanded result, using protected macros 
and hiding what tex does but hard to explain


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] Have a cell span multiple columns with tabulate

2021-11-27 Thread Jean-Philippe Rey via ntg-context
Denis,

I have used natural tables that span multiple pages. However, if I am right, 
each row must be contained on a single page. That may be an issue depending on 
your use cases.

Best,

> Le 27 nov. 2021 à 17:45, denis.ma...@unibe.ch a écrit :
> 
> Bonjour Jean-Philippe
>  
> Thank you for your response. That sounds very promising. I don’t remember why 
> I didn’t use natural tables when I’ve started setting things up for this 
> journal. I think I’d might have had something to do with tables that break 
> across pages. (At least, this is 
> whathttps://wiki.contextgarden.net/Tables_Overview 
>  currently says: 
> extremetables are said to be better when page breaking is involved.)
> Have you ever noticed problems in that area?
>  
> Best,
> Denis
>  
> Von: Jean-Philippe Rey  
> Gesendet: Samstag, 27. November 2021 17:36
> An: mailing list for ConTeXt users 
> Cc: Maier, Denis Christian (UB) 
> Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate
>  
> Dear Denis,
> 
> 
> Le 27 nov. 2021 à 13:25, Denis Maier via ntg-context  > a écrit :
>  
> Hi,
>  
> I’m using tabulate for parallel texts (source and translation next to each 
> other). The top of each table should consist of only one cell covering both 
> columns with centered content. Is that possible?
>  
> A HTML equivalent will look roughly like this:
>  
> 
>   
> Manuscript XY 
>   
>   
> Some text in Greek or Hebrew or whatever
> This is the translation
>   
> 
>  
> With ConteXt I’d like to do something like this
>  
> \starttabulate[|p(1.2cm)|p(1.2cm)|]
>   \NC Manuscript XY \NR
>   \NC  Some text in Greek or Hebrew or whatever
>   \NC  This is the translation \NC \NR
>  
> \stoptabulate
>  
> This compiles (interestingly?), but the cells at the top aren’t merged.
>  
> Any ideas ?
>  
> I know that natural tables offer more in this regard, but those seem not to 
> be so well suited for parallel texts.
>  
> I switched to natural tables a long time ago and that's how I would do it:
>  
> \starttext
> \bTABLE[width=8cm, frame=off]
> \setupTABLE[c][1][roffset=0.5em]
> \setupTABLE[c][2][loffset=0.5em]
> \bTR
>   \bTD[nc=2, align=center, bottomframe=on] Manuscript XY \eTD
> \eTR\bTR
> \bTD
>   Some text in Greek or Hebrew or whatever.
>   
>   The text can comprise multiple paragraphs.
>   Or even lists and other goodies :
>   \startitemize[intro, packed]
>   \item first item
>   \item second item
>   \stopitemize
> \eTD\bTD
>   This is the translation
> \eTD
> \eTR
> \eTABLE
> \stoptext
>  
> I haven't seen drawbacks with parallel texts (yet) and I found natural tables 
> very flexible.
>  
> Hope it helps,
> 
> -- 
> Jean-Philippe Rey
> jean-philippe@centralesupelec.fr 
> 
> 91192 Gif-sur-Yvette Cedex - France
> Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51


-- 
Jean-Philippe Rey
jean-philippe@centralesupelec.fr 

91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

___
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] Typographical quotes

2021-11-27 Thread Aditya Mahajan via ntg-context
On Sat, 27 Nov 2021, Wolfgang Schuster via ntg-context wrote:

> Jean-Philippe Rey via ntg-context schrieb am 27.11.2021 um 16:21:
> > Dear list,
> >
> > When typing a straight quotation mark, I used to get a curly apostrophe. But
> with a recent version of ConTeXt, I now get a straight apostrophe. Is there a
> new option to convert automatically straight into curly apostrophes ?
> >
> > \starttext
> > John's
> > \stoptext
> 
> The option is no longer part of the default feature set. 

Personally, I think that that is a bit extreme. An apostrophe is a really 
common construct and I suspect that this change in default will mean that 
almost everyone needs to add tlig in their documents. We may perhaps need a 
'sensible-defaults' module :-)

Aditya

___
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] Have a cell span multiple columns with tabulate

2021-11-27 Thread Denis Maier via ntg-context

Von: Wolfgang Schuster 
Gesendet: Samstag, 27. November 2021 18:11
An: mailing list for ConTeXt users ; Denis Maier via 
ntg-context 
Cc: jean-philippe@centralesupelec.fr; Maier, Denis Christian (UB) 

Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate

Denis Maier via ntg-context schrieb am 27.11.2021 um 17:45:

Bonjour Jean-Philippe

Thank you for your response. That sounds very promising. I don’t remember why I 
didn’t use natural tables when I’ve started setting things up for this journal. 
I think I’d might have had something to do with tables that break across pages. 
(At least, this is what https://wiki.contextgarden.net/Tables_Overview 
currently says: extremetables are said to be better when page breaking is 
involved.)
Have you ever noticed problems in that area?

Hans added a short while ago a span feature to tabulate but it works only for 
simple tables (e.g. single line cells).

You mean every cell has to be a single line cell? Or the ones where this span 
features applies ? That would be enough for me – at least ATM.
How does that feature work? I couldn’t find information about it.



A big feature of tabulate is that cells can be split at page breaks while cells 
in natural tables and extreme tables are limited to a single page.

Yes, that sounds like the reason for using tabulate back then.


Wolfgang


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

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


Re: [NTG-context] Checking for a Unicode prefix of a Unicode string

2021-11-27 Thread Joey McCollum via ntg-context
All right, I think I've solved the expansion problem I described before: to
ensure that the first input is expanded when it is passed to Lua, I have to
pass it as [==[#1]==], not "#1". But the updated MWE below still does not
seem to work, as the \DoIfPrefixElse macro is printing "NOP" instead of
"YES":

```

\starttexdefinition loc [#1]

\doifassignmentelse{#1} {

% if an assignment, then parse and format accordingly

\getparameters[loc][#1]

% Was a section number specified?

\doifdefined{locsec} {

§ \locsec

}

} {

% otherwise, just print the input as-is

#1

}

\stoptexdefinition


\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}


\def\currentbtxloctext{\loc[sec=31]}


\starttext

\currentbtxloctext\blank

\DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}

\stoptext
```

Indeed, if I add a simple \doifelse equality check, it looks like the value
I expect is not the same as what the macro produces, even though they look
identical:

```

\starttexdefinition loc [#1]
\doifassignmentelse{#1} {
% if an assignment, then parse and format accordingly
\getparameters[loc][#1]
% Was a section number specified?
\doifdefined{locsec} {
§ \locsec
}
} {
% otherwise, just print the input as-is
#1
}
\stoptexdefinition

\def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find([==[#2]==],"^"..[==[#1]==]))}}

\def\currentbtxloctext{\loc[sec=31]}

\starttext
§ 31\blank%the raw text we expect
\currentbtxloctext\blank%the text as produced by the macro
\doifelse{\currentbtxloctext}{§ 31}{YES}{NOP}\blank% should output YES,
but doesn't
\DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}\blank% should output
YES, but doesn't
\stoptext
```

What am I missing here?

Joey

On Fri, Nov 26, 2021 at 11:57 AM Joey McCollum 
wrote:

> Thanks! Invoking string.find(str,"^"..pre) is certainly much easier. This
> sort of thing would be a nice general-purpose helper function. Denis Maier
> and I should have a "wish list" of desired helpers and features (mostly
> related to bibliographies/publication support) ready for you (and Alan)
> sometime soon.
>
> But for now, it looks like I still need to work out errors that arise when
> I pass a macro as the "str" input to be searched. I've defined a \loc macro
> that accepts an assignment and outputs a formatted string, and later, I
> want to check if this macro (after it has been fully expanded) starts with
> a certain prefix. A minimal (non-)working example follows:
>
> ```
>
> \starttexdefinition loc [#1]
>
> \doifassignmentelse{#1} {
>
> % if an assignment, then parse and format accordingly
>
> \getparameters[loc][#1]
>
> % Was a section number specified?
>
> \doifdefined{locsec} {
>
> § \locsec\btxcomma
>
> }
>
> } {
>
> % otherwise, just print the input as-is
>
> #1
>
> }
>
> \stoptexdefinition
>
>
>
> \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}}
>
>
> \def\currentbtxloctext{\loc[sec=31]}
>
>
> \starttext
>
> \DoIfPrefixElse{§}{\currentbtxloctext}{YES}{NOP}
>
> \stoptext
> ```
>
> Lua is throwing an "invalid escape sequence near '"\l'" error, which is
> presumably because the macro \loc[sec=31] is not being expanded. How do I
> fix this?
>
> Thanks!
>
> Joey
>
> On Fri, Nov 26, 2021 at 3:46 AM Hans Hagen via ntg-context <
> ntg-context@ntg.nl> wrote:
>
>> On 11/26/2021 7:42 AM, Joey McCollum via ntg-context wrote:
>> > I wasn't aware of a general-purpose "doifstartswith" macro in ConTeXt
>> > (the \doifnextcharelse macro only works one character at a time, and
>> the
>> > \doifinstring macros may capture substrings that are not prefixes), and
>> > I'd like to develop one for something I'm working on. I've been trying
>> > to do this in Lua, as that seemed like the most natural approach.
>> > Normally, something like this would work fine as a foundation:
>> >
>> > ```
>> >function isprefix(prefix, str)
>> >  if string.sub(str, 1, string.len(prefix)) == prefix then
>> >return true
>> >  end
>> >  return false
>> >end
>> > ```
>>
>> how about
>>
>> if string.find(str,"^"..prefix) then
>>
>> in:
>>
>> \starttext
>>
>>
>> \def\DoIfPrefixElse#1#2{\ctxlua{commands.doifelse(string.find("#2","^".."#1"))}}
>>
>> \DoIfPrefixElse{pre}{prefix}{YES}{NOP}
>> \DoIfPrefixElse{pre}{suffix}{YES}{NOP}
>>
>> \stoptext
>>
>> utf strings are just sequences of bytes so matching works
>>
>> when you want to do more in lua you can decide for
>>
>> \startluacode
>> interfaces.implement {
>>  name  = "DoIfPrefixElse",
>>  arguments = { "argument", "argument" },
>>  actions   = function(pre,str)
>>  commands.doifelse(string.find(str,"^"..pre))
>>  end
>> }
>> \stopluacode
>>
>> \DoIfPrefixElse{pre}{prefix}{YES}{NOP}
>> \DoIfPrefixElse{pre}{suffix}{YES}{NOP}
>>
>> but in any case: make sure that you don't clash with built in ...
>>
>> if needed i can make a set of fast(er) ones but someone 

Re: [NTG-context] Have a cell span multiple columns with tabulate

2021-11-27 Thread Wolfgang Schuster via ntg-context

Denis Maier via ntg-context schrieb am 27.11.2021 um 17:45:


Bonjour Jean-Philippe

Thank you for your response. That sounds very promising. I don’t 
remember why I didn’t use natural tables when I’ve started setting 
things up for this journal. I think I’d might have had something to do 
with tables that break across pages. (At least, this is what 
https://wiki.contextgarden.net/Tables_Overview currently says: 
extremetables are said to be better when page breaking is involved.)


Have you ever noticed problems in that area?



Hans added a short while ago a span feature to tabulate but it works 
only for simple tables (e.g. single line cells).


A big feature of tabulate is that cells can be split at page breaks 
while cells in natural tables and extreme tables are limited to a single 
page.


Wolfgang

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

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


Re: [NTG-context] Typographical quotes

2021-11-27 Thread Wolfgang Schuster via ntg-context

denis.ma...@unibe.ch schrieb am 27.11.2021 um 18:04:

Thanks. What does trep stand for?


trep = TeX replacement

tlig = TeX ligatures

Wolfgang

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

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


Re: [NTG-context] Typographical quotes

2021-11-27 Thread Denis Maier via ntg-context
Thanks. What does trep stand for?

Denis

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Wolfgang
> Schuster via ntg-context
> Gesendet: Samstag, 27. November 2021 18:00
> An: mailing list for ConTeXt users ; Jean-Philippe Rey
> via ntg-context 
> Cc: Wolfgang Schuster 
> Betreff: Re: [NTG-context] Typographical quotes
> 
> Jean-Philippe Rey via ntg-context schrieb am 27.11.2021 um 16:21:
> > Dear list,
> >
> > When typing a straight quotation mark, I used to get a curly apostrophe.
> But with a recent version of ConTeXt, I now get a straight apostrophe. Is
> there a new option to convert automatically straight into curly apostrophes ?
> >
> > \starttext
> > John's
> > \stoptext
> 
> The option is no longer part of the default feature set. To enable the feature
> add "trep=yes" to the default features.
> 
> \definefontfeature [default] [default] [trep=yes]
> 
> \starttext
> John's
> \stoptext
> 
> 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] Typographical quotes

2021-11-27 Thread Wolfgang Schuster via ntg-context

Jean-Philippe Rey via ntg-context schrieb am 27.11.2021 um 16:21:

Dear list,

When typing a straight quotation mark, I used to get a curly apostrophe. But 
with a recent version of ConTeXt, I now get a straight apostrophe. Is there a 
new option to convert automatically straight into curly apostrophes ?

\starttext
John's
\stoptext


The option is no longer part of the default feature set. To enable the 
feature add "trep=yes" to the default features.


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

\starttext
John's
\stoptext

Wolfgang

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

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


Re: [NTG-context] Typographical quotes

2021-11-27 Thread Denis Maier via ntg-context
Oh, but I’m still on ConTeXt  ver: 2021.10.24 21:45
I’ll need to check after an update.

Denis

Von: Maier, Denis Christian (UB)
Gesendet: Samstag, 27. November 2021 17:47
An: 'mailing list for ConTeXt users' 
Cc: Jean-Philippe Rey 
Betreff: AW: [NTG-context] Typographical quotes

Same here, but I get correct results with the –luatex flag

Denis

Von: ntg-context 
mailto:ntg-context-boun...@ntg.nl>> Im Auftrag von 
Jean-Philippe Rey via ntg-context
Gesendet: Samstag, 27. November 2021 16:22
An: ntg-context@ntg.nl
Cc: Jean-Philippe Rey 
mailto:jean-philippe@centralesupelec.fr>>
Betreff: [NTG-context] Typographical quotes

Dear list,

When typing a straight quotation mark, I used to get a curly apostrophe. But 
with a recent version of ConTeXt, I now get a straight apostrophe. Is there a 
new option to convert automatically straight into curly apostrophes ?

\starttext
John's
\stoptext

gives


where I used to get

Here is my log file

resolvers   | formats | executing runner 'run luametatex format': 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin/luametatex
 --jobname="./mfe-quote.tex" 
--fmt=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
 
--lua=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
  --c:currentrun=1 --c:fulljobname="./mfe-quote.tex" 
--c:input="./mfe-quote.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:texmfbinpath="/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin"
system  >
system  > ConTeXt  ver: 2021.11.19 09:31 LMTX  fmt: 2021.11.22  int: 
english/english
system  >
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './mfe-quote', input './mfe-quote.tex', 
result './mfe-quote'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './mfe-quote.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
backend > xmp > using file 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 1, order 2, name './mfe-quote.tex'
mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.013 seconds, 0 scans with 
scantime 0.000 seconds, 0 shared scans, 9 found files, scanned paths: 
mkiv lua stats  > stored bytecode data: 499 modules (0.248 sec), 99 tables 
(0.013 sec), 598 chunks (0.260 sec)
mkiv lua stats  > traced context: maxstack: 1607, freed: 0, unreachable: 1607
mkiv lua stats  > cleaned up reserved nodes: 71 nodes, 9 lists of 435
mkiv lua stats  > node memory usage: 6 attribute, 3 attribute_list, 1 glue, 58 
glue_spec, 3 kern, 2 penalty, 2 temp
mkiv lua stats  > node list callback tasks: 12 unique task lists, 7 instances 
(re)created, 45 calls
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: file: 57, saved: 146, direct: 2, function: 973, 
value: 1, message: 0, bytecode: 598, late 0, total: 1777 (0 per page)
mkiv lua stats  > randomizer: initialized with value 0.051172108195605
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > loaded fonts: 2 files: latinmodern-math.otf, 
lmroman12-regular.otf
mkiv lua stats  > font engine: otf 3.119, afm 1.513, tfm 1.000, 7 instances, 3 
shared in backend, 3 common vectors, 0 common hashes, load time 0.151 seconds
mkiv lua stats  > font embedding time: 0.002 seconds, 1 fonts
mkiv lua stats  > result saved in file: mfe-quote.pdf, compresslevel 1, 
objectcompresslevel 3
mkiv lua stats  > positions: 4 collected, 0 deltas, 0 shared partials, 0 
partial entries
mkiv lua stats  > used platform: osx-64, type: unix, binary subtree: 
texmf-osx-64
mkiv lua stats  > used engine: luametatex version: 2.093, functionality level: 
2027, format id: 603, compiler: clang
mkiv lua stats  > tex properties: 740046 hash slots used of 2097152, 46674 
control sequences, approximate memory usage: 29 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 55 

Re: [NTG-context] Typographical quotes

2021-11-27 Thread Denis Maier via ntg-context
Same here, but I get correct results with the –luatex flag

Denis

Von: ntg-context  Im Auftrag von Jean-Philippe Rey 
via ntg-context
Gesendet: Samstag, 27. November 2021 16:22
An: ntg-context@ntg.nl
Cc: Jean-Philippe Rey 
Betreff: [NTG-context] Typographical quotes

Dear list,

When typing a straight quotation mark, I used to get a curly apostrophe. But 
with a recent version of ConTeXt, I now get a straight apostrophe. Is there a 
new option to convert automatically straight into curly apostrophes ?

\starttext
John's
\stoptext

gives


where I used to get

Here is my log file

resolvers   | formats | executing runner 'run luametatex format': 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin/luametatex
 --jobname="./mfe-quote.tex" 
--fmt=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
 
--lua=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
  --c:currentrun=1 --c:fulljobname="./mfe-quote.tex" 
--c:input="./mfe-quote.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:texmfbinpath="/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin"
system  >
system  > ConTeXt  ver: 2021.11.19 09:31 LMTX  fmt: 2021.11.22  int: 
english/english
system  >
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './mfe-quote', input './mfe-quote.tex', 
result './mfe-quote'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './mfe-quote.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
backend > xmp > using file 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 1, order 2, name './mfe-quote.tex'
mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.013 seconds, 0 scans with 
scantime 0.000 seconds, 0 shared scans, 9 found files, scanned paths: 
mkiv lua stats  > stored bytecode data: 499 modules (0.248 sec), 99 tables 
(0.013 sec), 598 chunks (0.260 sec)
mkiv lua stats  > traced context: maxstack: 1607, freed: 0, unreachable: 1607
mkiv lua stats  > cleaned up reserved nodes: 71 nodes, 9 lists of 435
mkiv lua stats  > node memory usage: 6 attribute, 3 attribute_list, 1 glue, 58 
glue_spec, 3 kern, 2 penalty, 2 temp
mkiv lua stats  > node list callback tasks: 12 unique task lists, 7 instances 
(re)created, 45 calls
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: file: 57, saved: 146, direct: 2, function: 973, 
value: 1, message: 0, bytecode: 598, late 0, total: 1777 (0 per page)
mkiv lua stats  > randomizer: initialized with value 0.051172108195605
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > loaded fonts: 2 files: latinmodern-math.otf, 
lmroman12-regular.otf
mkiv lua stats  > font engine: otf 3.119, afm 1.513, tfm 1.000, 7 instances, 3 
shared in backend, 3 common vectors, 0 common hashes, load time 0.151 seconds
mkiv lua stats  > font embedding time: 0.002 seconds, 1 fonts
mkiv lua stats  > result saved in file: mfe-quote.pdf, compresslevel 1, 
objectcompresslevel 3
mkiv lua stats  > positions: 4 collected, 0 deltas, 0 shared partials, 0 
partial entries
mkiv lua stats  > used platform: osx-64, type: unix, binary subtree: 
texmf-osx-64
mkiv lua stats  > used engine: luametatex version: 2.093, functionality level: 
2027, format id: 603, compiler: clang
mkiv lua stats  > tex properties: 740046 hash slots used of 2097152, 46674 
control sequences, approximate memory usage: 29 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 55 MB, ctx: 53 
MB, max: 53 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.500 seconds, 1 processed pages, 1 shipped pages, 
1.998 pages/second

resolvers   | formats | executing runner 'run luametatex format': 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin/luametatex
 --jobname="./mfe-quote.tex" 

Re: [NTG-context] Have a cell span multiple columns with tabulate

2021-11-27 Thread Denis Maier via ntg-context
Bonjour Jean-Philippe

Thank you for your response. That sounds very promising. I don’t remember why I 
didn’t use natural tables when I’ve started setting things up for this journal. 
I think I’d might have had something to do with tables that break across pages. 
(At least, this is what https://wiki.contextgarden.net/Tables_Overview 
currently says: extremetables are said to be better when page breaking is 
involved.)
Have you ever noticed problems in that area?

Best,
Denis

Von: Jean-Philippe Rey 
Gesendet: Samstag, 27. November 2021 17:36
An: mailing list for ConTeXt users 
Cc: Maier, Denis Christian (UB) 
Betreff: Re: [NTG-context] Have a cell span multiple columns with tabulate

Dear Denis,


Le 27 nov. 2021 à 13:25, Denis Maier via ntg-context 
mailto:ntg-context@ntg.nl>> a écrit :

Hi,

I’m using tabulate for parallel texts (source and translation next to each 
other). The top of each table should consist of only one cell covering both 
columns with centered content. Is that possible?

A HTML equivalent will look roughly like this:


  
Manuscript XY 
  
  
Some text in Greek or Hebrew or whatever
This is the translation
  


With ConteXt I’d like to do something like this

\starttabulate[|p(1.2cm)|p(1.2cm)|]
  \NC Manuscript XY \NR
  \NC  Some text in Greek or Hebrew or whatever
  \NC  This is the translation \NC \NR
\stoptabulate

This compiles (interestingly?), but the cells at the top aren’t merged.

Any ideas ?

I know that natural tables offer more in this regard, but those seem not to be 
so well suited for parallel texts.

I switched to natural tables a long time ago and that's how I would do it:

\starttext
\bTABLE[width=8cm, frame=off]
\setupTABLE[c][1][roffset=0.5em]
\setupTABLE[c][2][loffset=0.5em]
\bTR
  \bTD[nc=2, align=center, bottomframe=on] Manuscript XY \eTD
\eTR\bTR
\bTD
  Some text in Greek or Hebrew or whatever.

  The text can comprise multiple paragraphs.
  Or even lists and other goodies :
  \startitemize[intro, packed]
  \item first item
  \item second item
  \stopitemize
\eTD\bTD
  This is the translation
\eTD
\eTR
\eTABLE
\stoptext

I haven't seen drawbacks with parallel texts (yet) and I found natural tables 
very flexible.

Hope it helps,

--
Jean-Philippe Rey
jean-philippe@centralesupelec.fr
91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

___
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] Have a cell span multiple columns with tabulate

2021-11-27 Thread Jean-Philippe Rey via ntg-context
Dear Denis,

> Le 27 nov. 2021 à 13:25, Denis Maier via ntg-context  a 
> écrit :
> 
> Hi,
>  
> I’m using tabulate for parallel texts (source and translation next to each 
> other). The top of each table should consist of only one cell covering both 
> columns with centered content. Is that possible?
>  
> A HTML equivalent will look roughly like this:
>  
> 
>   
> Manuscript XY 
>   
>   
> Some text in Greek or Hebrew or whatever
> This is the translation
>   
> 
>  
> With ConteXt I’d like to do something like this
>  
> \starttabulate[|p(1.2cm)|p(1.2cm)|]
>   \NC Manuscript XY \NR
>   \NC  Some text in Greek or Hebrew or whatever
>   \NC  This is the translation \NC \NR
>  
> \stoptabulate
>  
> This compiles (interestingly?), but the cells at the top aren’t merged.
>  
> Any ideas ?
>  
> I know that natural tables offer more in this regard, but those seem not to 
> be so well suited for parallel texts.

I switched to natural tables a long time ago and that's how I would do it:

\starttext
\bTABLE[width=8cm, frame=off]
\setupTABLE[c][1][roffset=0.5em]
\setupTABLE[c][2][loffset=0.5em]
\bTR
\bTD[nc=2, align=center, bottomframe=on] Manuscript XY \eTD
\eTR\bTR
\bTD
Some text in Greek or Hebrew or whatever.

The text can comprise multiple paragraphs.
Or even lists and other goodies :
\startitemize[intro, packed]
\item first item
\item second item
\stopitemize
\eTD\bTD
This is the translation
\eTD
\eTR
\eTABLE
\stoptext
 
I haven't seen drawbacks with parallel texts (yet) and I found natural tables 
very flexible.

Hope it helps,


-- 
Jean-Philippe Rey
jean-philippe@centralesupelec.fr 

91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

___
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] Typographical quotes

2021-11-27 Thread Jean-Philippe Rey via ntg-context
Dear list,

When typing a straight quotation mark, I used to get a curly apostrophe. But 
with a recent version of ConTeXt, I now get a straight apostrophe. Is there a 
new option to convert automatically straight into curly apostrophes ?

\starttext
John's
\stoptext

gives


GraphiqueCollé-1.pdf
Description: Adobe PDF document


where I used to get



GraphiqueCollé-2.pdf
Description: Adobe PDF document

Here is my log file

resolvers   | formats | executing runner 'run luametatex format': 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin/luametatex
 --jobname="./mfe-quote.tex" 
--fmt=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
 
--lua=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
  --c:currentrun=1 --c:fulljobname="./mfe-quote.tex" 
--c:input="./mfe-quote.tex" --c:kindofrun=1 --c:maxnofruns=9 
--c:texmfbinpath="/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin"
system  > 
system  > ConTeXt  ver: 2021.11.19 09:31 LMTX  fmt: 2021.11.22  int: 
english/english
system  > 
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './mfe-quote', input './mfe-quote.tex', 
result './mfe-quote'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './mfe-quote.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
backend > xmp > using file 
'/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 1, order 2, name './mfe-quote.tex'
mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.013 seconds, 0 scans with 
scantime 0.000 seconds, 0 shared scans, 9 found files, scanned paths: 
mkiv lua stats  > stored bytecode data: 499 modules (0.248 sec), 99 tables 
(0.013 sec), 598 chunks (0.260 sec)
mkiv lua stats  > traced context: maxstack: 1607, freed: 0, unreachable: 1607
mkiv lua stats  > cleaned up reserved nodes: 71 nodes, 9 lists of 435
mkiv lua stats  > node memory usage: 6 attribute, 3 attribute_list, 1 glue, 58 
glue_spec, 3 kern, 2 penalty, 2 temp
mkiv lua stats  > node list callback tasks: 12 unique task lists, 7 instances 
(re)created, 45 calls
mkiv lua stats  > used backend: pdf
mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: file: 57, saved: 146, direct: 2, function: 973, 
value: 1, message: 0, bytecode: 598, late 0, total: 1777 (0 per page)
mkiv lua stats  > randomizer: initialized with value 0.051172108195605
mkiv lua stats  > loaded patterns: en::1, load time: 0.000
mkiv lua stats  > loaded fonts: 2 files: latinmodern-math.otf, 
lmroman12-regular.otf
mkiv lua stats  > font engine: otf 3.119, afm 1.513, tfm 1.000, 7 instances, 3 
shared in backend, 3 common vectors, 0 common hashes, load time 0.151 seconds 
mkiv lua stats  > font embedding time: 0.002 seconds, 1 fonts
mkiv lua stats  > result saved in file: mfe-quote.pdf, compresslevel 1, 
objectcompresslevel 3
mkiv lua stats  > positions: 4 collected, 0 deltas, 0 shared partials, 0 
partial entries
mkiv lua stats  > used platform: osx-64, type: unix, binary subtree: 
texmf-osx-64
mkiv lua stats  > used engine: luametatex version: 2.093, functionality level: 
2027, format id: 603, compiler: clang
mkiv lua stats  > tex properties: 740046 hash slots used of 2097152, 46674 
control sequences, approximate memory usage: 29 MB
mkiv lua stats  > lua properties: engine: lua 5.4, used memory: 55 MB, ctx: 53 
MB, max: 53 MB, symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.500 seconds, 1 processed pages, 1 shipped pages, 
1.998 pages/second

resolvers   | formats | executing runner 'run luametatex format': 
/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-osx-64/bin/luametatex
 --jobname="./mfe-quote.tex" 
--fmt=/Users/jprey/Applications/ConTeXt/Current/osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
 

Re: [NTG-context] Math prime issues for some fonts

2021-11-27 Thread Hans Hagen via ntg-context

On 11/26/2021 10:05 PM, Mikael Sundqvist via ntg-context wrote:

Hi Jack,

I've been working with Hans on math in general and primes in
particular in the last week. I do not understand all the details, but
I think primes are handled differently now, and that one essentially
need to have some tuning in goodie files (the reason is that they are
done differently in different fonts, and that there was not simple
one-fits-all solution). We have not touched eulernova yet.

It's not easy to explain in a few sentences so here we go.

In unicode, math is a script. There are plenty scripts supported and 
unicode supports their properties. Unicode tries to avoid duplicates 
but we have an latin A and a greek A, and we have plenty of nukta in 
indic scripts even if the shapes are the same. In math however, for some 
reason, we have ended up with some math code points being shared. So, we 
don't have a small italic h (because every italic h is supposed to be 
plank constant) and we don't have primes because minutes are primes. 
Maybe today some strong arguing could avoid those anomalities but i fear 
that we're stuck with it forever now (math legacy stuff etc).


This results of for instance holes in math alphabets (less such holes in 
other scripts) that every application has to deal with and we end up 
with symbols that depending on their usage need some interpretation and 
handling. Btw, a side effect is that where an one can distinguish 
between f as variable or function by using an indicator this is not 
possible with h so in copy/paste or interpretation one has to guess what 
it is. The same is true for prime like symbols: are they minutes or primes.


So, as the unicode slot for a prime is used for minutes (in text) the 
symbols in a font ends up as superscript but in math text mode it would 
not be in the right spot. Keep in mind that we have specific math fonts 
so ther ei sno real reason for not making primes consistent in text, 
script and scriptscript (ssty features): it simply is not done which in 
turn is probably a side effect of cmr being uses as template even if for 
other properties cmr fundamentally differs from open type math fonts.


Anyway, in the traditional tex approach to primes, the prime symbol is 
taken from the script variant, where is has a different size (or not), 
different boundingbox (or not) and/or is already raised (or not). Also, 
in tex the ' is made into an "active in math mode" character (one of 
few, an dit might even be that the reason for active math characters is 
in primes) in order to ease input. It effectively being a macro means 
that it can do some lookahead in order to (1) position itself as well as 
(2) make it possible to be followed by a superscript and/or subscript.


And, because the way math is coded and dealt with in tex basically has 
been chisseled in stone early after tex showed up, that situation is 
supposed to be dealt with: a multi-purpose shape with somewhat weird 
properties, parsing preferably in a robust way, positioning in a 
superscript like position (before or after a script), i fpossible 
intercepting interference etc. And ... all that is resembled in unicode 
math as well as all these math fonts out there.


But it is not the way i want to deal with it in context, also because 
there is even more involved (which i happily let you guess about). I 
want clean solution with no fancy (and somewhat obscure) tex macro doing 
magic that only a few are supposed to understand.


When we started with luatex, and thereby mkiv, we immediately went full 
unicode math (also with old fonts) and primes (plus a few other things) 
were a pain in the butt from the start due to fonts. For more than a 
decade I tried to catch this automagically by runtime patching and that 
works ok for most fonts but as recently more opentype math fonts showed 
up, some actually more opentypish than what we had, the decision was 
made to delegate this to the goodies mechanism than Mikael refers to. It 
means that we can control individual fonts (and users can patch that 
themselves if needed) because in the end, as always with fonts, scripts, 
languages and probably most of tex, heuristics tend to fail and clash.


It means that, as Wolfgang explained, you need to specify a goodie file 
with \definefontfamily (could be your own copy with personal 
preferences). Just for the record, some more is done on goodies and some 
more runtime patching might move that goodie control. It actually does 
mean that when a font (if ever) gets updated we need to check things 
which is why a mismatch in version will be reported on your console. 
Among the things we still need to discuss are if we wil freeze fonts in 
the distribution (only explicit updates) and if we drop official support 
for obsolete or (just) bad (looking) math fonts.


So to summarize: with primes we have to deal with (1) frozen tex math 
expectations that won't change (although in context we're free to do 
so), which (2) have 

[NTG-context] Have a cell span multiple columns with tabulate

2021-11-27 Thread Denis Maier via ntg-context
Hi,

I'm using tabulate for parallel texts (source and translation next to each 
other). The top of each table should consist of only one cell covering both 
columns with centered content. Is that possible?

A HTML equivalent will look roughly like this:


  
Manuscript XY 
  
  
Some text in Greek or Hebrew or whatever
This is the translation
  


With ConteXt I'd like to do something like this

\starttabulate[|p(1.2cm)|p(1.2cm)|]
  \NC Manuscript XY \NR
  \NC  Some text in Greek or Hebrew or whatever
  \NC  This is the translation \NC \NR
\stoptabulate

This compiles (interestingly?), but the cells at the top aren't merged.

Any ideas ?

I know that natural tables offer more in this regard, but those seem not to be 
so well suited for parallel texts.

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] Math prime issues for some fonts

2021-11-27 Thread Wolfgang Schuster via ntg-context

Jack Hill schrieb am 26.11.2021 um 19:53:

On Fri, 26 Nov 2021 at 17:39, Wolfgang Schuster
 wrote:

Jack Hill via ntg-context schrieb am 26.11.2021 um 18:18:

Hi list,

When I run this test code

[...]

on my machine, the prime symbols are being placed too high (except for
latin modern which is normal).
Running the same code on the wiki gives the correct output though.
Does anyone else get the same output? Screenshot attached.

Use \definetypeface to load/set the math fonts.

\starttext

\starttabulate[|l|c|]
\FL
\BC Font name  \BC Math prime\NC\NR
\ML
\NC Latin Modern Roman \NC\m{x'} \NC\NR
\NC TeX Gyre Termes\NC \switchtobodyfont[termes]  \m{x'} \NC\NR
\NC TeX Gyre Pagella   \NC \switchtobodyfont[pagella] \m{x'} \NC\NR
\NC TeX Gyre Bonum \NC \switchtobodyfont[bonum]   \m{x'} \NC\NR
\NC TeX Gyre Schola\NC \switchtobodyfont[schola]  \m{x'} \NC\NR
\NC STIX Two   \NC \switchtobodyfont[stixtwo] \m{x'} \NC\NR
\BL
\stoptabulate

\stoptext

Wolfgang

Thanks, \definetypeface fixes it. Should I not be using \definefontfamily?
I've just checked eulernova and the prime is still too high for this font.

\switchtobodyfont[eulernova]
\starttext
\m{x'}
\stoptext


To set the math font \definetypeface is the better choice because 
ConTeXt loads patches for most math fonts to improve the spacing for 
primes etc.


You can use \definefontfamily to set the math font but then you have to 
load these patches yourself (\definefontfamily [...] [...] [...] 
[extras=...,goodies=...]). For a few fonts these patches are loaded 
automatically but the system is not always up to date.


What I suggest is to use \definefontfamily to select your text fonts 
(serif, sans and mono) in combination with \definetypeface for the math 
font. One reason where \definefontfamily is the better choice for the 
math font is when you try to use fallbacks for the math font (e.g. to 
have sans serif letters in math mode).


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
___