Re: [NTG-context] Indexing redux

2021-08-26 Thread Rik Kabel via ntg-context


On 8/26/2021 03:26, Taco Hoekwater wrote:

Hi Rik,


On 26 Aug 2021, at 03:14, Rik Kabel via ntg-context  wrote:

List,

I am trying to create an index with both "see" and "see also" cross-reference entries.[1] At this 
point, ConTeXt provides basic support for "see" entries via the \seeREGISTER command (it does not properly 
support references to sub-entries) and it provides no support at all for "see also" entries.

Can somebody suggest a way to generate these entries? Perhaps a way of 
inserting entries into the index before it is formatted, in the manner of 
\writetolist or \writebetweenlist? (MkII has \writetoregister, but that did not 
carry forward and I do not know if it would have helped here.)


Since strc-reg.mkiv starts with a number of ’todo’ comments, I think your best 
bet is to create an
actual functional example along with an explanation of what you want the 
typeset result to look
like in the cases where it is not doing what you want.

Generally, explicit examples / test files are the best way to get replies to 
questions
(either by Hans or anyone else).


The following produces what I am looking for, and a bit more. Page 3 of 
the output shows what I would like to see, page 4 is the generated 
index. I don't really need the "see under" and "see also under" 
variants, but they would be nice to have. I am indifferent to having 
stops before "see also"s. I would like to be able to turn checking on or 
off, so that generic directives (in the example, see also specific 
breeds) will not generate an error, while the Ford Prefect example will 
generate an error.



   \defineprocessor[also][color=blue]
   \defineprocessor[under][color=green]
   \defineprocessor[alsounder][color=orange]
   \define\seealsoindex\seeindex
   \define\seealsounderindex\seeindex
   \define\seeunderindex\seeindex
   \setupinteraction [state=start]
   \setupregister    [index][balance=no,check=no]

   %% seeindex entries may start on the same line as their head entry
   \seeindex {dog breeds+Wiener dog}{dog breeds+Dachshund}
   %%  The next example should not work,
   %%    since there is no main entry /Adams, Douglas/
   \seeindex {Prefect, Ford}{Adams, Douglas}

   %%  When referring to a subentry, the target must be a subentry,
   %%    but should display as if a main entry. The next example
   %%    should point to the /Adams+Douglas/ subentry, but it
   %%    should be formatted as if it were /Adams, Douglas/
   \seeindex {Dent, Arthur}{Adams+Douglas}

   %% The following two work as expected
   \seeindex {Matilda effect}{obliteration}
   \seeindex {Marut, Ret}{Traven, B.}

   %% seealso should be placed after as a subentry after real page
   references
   %% seealso should have an appropriate label (default English /see also/)
   \seealsoindex {pseudepigraphy}{also->obliteration}
   \seealsoindex {dog breeds}{also->breeding programs}
   \seealsoindex {dog breeds}{also->specific breeds}
   %% seealsounder is like seealso except that it refers to a main entry
   \seealsounderindex{Coton de Tulear}{alsounder->dog breeds}
   %% seeunder also is like seealso except that it refers to a main entry
   \seeunderindex    {Weimaraner}{under->dog breeds}
   \starttext
 Stuff
 \index{obliteration}
 \index{Adams+Douglas}\index{Adams+John}
 \index{Beagle}
 \index{dog breeds+Beagle}
 \index{dog breeds+Coton de Tulear}
 \index{dog breeds+Dachshund}
 \index{dog breeds+Weimaraner}
   \page
 More stuff
 \index{Adams+John Quincy}
 \index{misquotation}
 \index{pseudepigraphy}
 \index{Traven, B.}
 \index{Beagle}
 \index{Coton de Tulear}
 \index{breeding programs}
   \page
   \definedescription[Index][headstyle=bold,alternative=top,inbetween=]
   \startIndex{a}
 Adams\par
 \quad \reference[AdamsDouglas]{Adams, Douglas}Douglas\quad 1\par
 \quad John\quad 1\par
 \quad John Quincy\quad 2\par
   \stopIndex
   \startIndex{b}
 Beagle\quad 1, 2\par
 \reference[breedingprograms]{breeding programs}breeding
   programs\quad 2
   \stopIndex
   \startIndex{c}
 Coton de Tulear\quad 2.\par
 \quad {\em See also under} \in[dogbreeds]
   \stopIndex
   \startIndex{d}
 \reference[DentArthur]{Dent, Arthur}Dent, Arthur {\em see}
   \in[AdamsDouglas]\par
 \reference[dogbreeds]{dog breeds}dog breeds\par
 \quad \reference[dbBeagle]{dog breeds, Beagle}Beagle\quad 1\par
 \quad \reference[dbCoton]{dog breeds, Coton}Coton de
   Tulear\quad 1\par
 \quad \reference[dbDachshund]{dog breeds,
   Dachshund}Dachshund\quad 1\par
 \quad \reference[dbWeimaraner]{dog breeds,
   Weimarane

Re: [NTG-context] Indexing redux

2021-08-26 Thread Taco Hoekwater via ntg-context
Hi Rik,

> On 26 Aug 2021, at 03:14, Rik Kabel via ntg-context  
> wrote:
> 
> List,
> 
> I am trying to create an index with both "see" and "see also" cross-reference 
> entries.[1] At this point, ConTeXt provides basic support for "see" entries 
> via the \seeREGISTER command (it does not properly support references to 
> sub-entries) and it provides no support at all for "see also" entries.
> 
> Can somebody suggest a way to generate these entries? Perhaps a way of 
> inserting entries into the index before it is formatted, in the manner of 
> \writetolist or \writebetweenlist? (MkII has \writetoregister, but that did 
> not carry forward and I do not know if it would have helped here.)


Since strc-reg.mkiv starts with a number of ’todo’ comments, I think your best 
bet is to create an
actual functional example along with an explanation of what you want the 
typeset result to look 
like in the cases where it is not doing what you want.

Generally, explicit examples / test files are the best way to get replies to 
questions 
(either by Hans or anyone else).

Best wishes,
Taco

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



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

maillist : ntg-context@ntg.nl / 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] Indexing redux

2021-08-25 Thread Rik Kabel via ntg-context

List,

I am trying to create an index with both "see" and "see also" 
cross-reference entries.[1] At this point, ConTeXt provides basic 
support for "see" entries via the \seeREGISTER command (it does not 
properly support references to sub-entries) and it provides no support 
at all for "see also" entries.


Can somebody suggest a way to generate these entries? Perhaps a way of 
inserting entries into the index before it is formatted, in the manner 
of \writetolist or \writebetweenlist? (MkII has \writetoregister, but 
that did not carry forward and I do not know if it would have helped here.)


I had brought this up to no response a couple of years ago.[2] I am 
hopeful that LMTX may offer a chance to get support for improved 
indexing, and in particular for "see" and "see also" entries.


[1] For definitions and usage of "see" entries, see 
https://docs.oasis-open.org/dita/v1.1/OS/langspec/langref/index-see.html. 
For "see also" entries, see 
https://docs.oasis-open.org/dita/v1.1/OS/langspec/langref/index-see-also.html. 
For a deeper dive, see the publicly available University of Chicago 
Manual of Style version 15 guide, chapter 18, available at 
https://press.uchicago.edu/Misc/Chicago/CHIIndexingComplete.pdf, or more 
recent versions not yet freely available online.


[2] See "Possible seeindex enhancement" at 
https://www.mail-archive.com/ntg-context@ntg.nl/msg89470.html.


--
Rik


___
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] numbered exercises

2021-08-25 Thread Henning Hraban Ramm via ntg-context

> Am 25.08.2021 um 00:19 schrieb Aditya Mahajan via ntg-context 
> :
> 
> On Tue, 24 Aug 2021, Henning Hraban Ramm via ntg-context wrote:
> 
>>> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
>>> :
>>> 
>>> Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 20:31:
>>>> Hi, I’m typesetting a textbook that contains numbered and indented 
>>>> exercises. They must not float.
>>>> 
>>>> Which structure should I use for them? There must be an easy answer, but I 
>>>> draw a blank.
>>> 
>>> Use an enumeration.
>> 
>> Thank you, but how can I define a title/caption for the enumeration and its 
>> reference?
> 
> http://www.ntg.nl/maps/36/09.pdf

Thank you, that also answers my last question.

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] numbered exercises

2021-08-24 Thread Aditya Mahajan via ntg-context
On Tue, 24 Aug 2021, Henning Hraban Ramm via ntg-context wrote:

> > Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
> > :
> > 
> > Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 20:31:
> >> Hi, I’m typesetting a textbook that contains numbered and indented 
> >> exercises. They must not float.
> >> 
> >> Which structure should I use for them? There must be an easy answer, but I 
> >> draw a blank.
> > 
> > Use an enumeration.
> 
> Thank you, but how can I define a title/caption for the enumeration and its 
> reference?

http://www.ntg.nl/maps/36/09.pdf

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] numbered exercises

2021-08-24 Thread Henning Hraban Ramm via ntg-context

> Am 24.08.2021 um 21:34 schrieb Wolfgang Schuster via ntg-context 
> :
> 
> Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 21:26:
>>> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
>>> :
>>> 
>>> Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 20:31:
>>>> Hi, I’m typesetting a textbook that contains numbered and indented 
>>>> exercises. They must not float.
>>>> 
>>>> Which structure should I use for them? There must be an easy answer, but I 
>>>> draw a blank.
>>> 
>>> Use an enumeration.
>> Thank you, but how can I define a title/caption for the enumeration and its 
>> reference?
> 
> 
> \defineenumeration
>  [Exercise]
>  [text=Exercise,
>   title=yes,
>   titleleft=,
>   titleright=,
>   way=bytext,
>   margin=1em]
> 
> \starttext
> 
> \samplefile{lorem}
> 
> \startExercise [title={Something to do},reference=ex:something]
> \samplefile{lorem}
> \stopExercise
> 
> \stoptext

Thank you, I didn’t even try, since the wiki looked like it wasn’t possible. 
Sorry!
I’ll wikify that.

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] numbered exercises

2021-08-24 Thread Gavin via ntg-context
> On Aug 24, 2021, at 1:26 PM, Henning Hraban Ramm via ntg-context 
>  wrote:
>> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
>> :
>> Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 20:31:
>>> Hi, I’m typesetting a textbook that contains numbered and indented 
>>> exercises. They must not float.
>>> 
>>> Which structure should I use for them? There must be an easy answer, but I 
>>> draw a blank.
>> 
>> Use an enumeration.
> 
> Thank you, but how can I define a title/caption for the enumeration and its 
> reference?
> 

Hi Hraban,

Here’s an example from my textbook which might be helpful. I use this 
enumeration for example problems, but exercises could be similar. You have 
access to the rest of the textbook, so feel free to grab anything useful.

-Gavin


In the environment file:

% Example Problems
\defineenumeration[example]
\setupenumeration[example][
margin=no,
headstyle=\ss\sc,
text=Example, % This text is part of the number, e.g. "Example 2.3"
style=\ss,
alternative=serried,
title=no, % This would be a title after the number
prefix=yes, % Turns on the prefix
prefixsegments=chapter, % makes the prefix the chapter number
way=bychapter, % Numbers within each chapter
%margin=standard, % Indents block on the left
width=fit, % Makes the space between the number and the question a good 
size
indentnext=no,
]
\definedelimitedtext[solution][
spacebefore=medium,
spaceafter=medium,
style=\rm\it,
leftmargin=standard, % Indents block on the left
rightmargin=yes, % Indents block on the right
indentnext = no,
]


In the text:

\startexample[ex:organ]
What interval is produced by two consecutive thirds?
\startsolution
We wish to add a third to a third.
\startformula
\text{3rd} + \text{3rd} = 2\units{steps} + 2\units{steps} = 
4\units{steps} = \text{5th}
\stopformula
Two thirds produce a fifth.
\stopsolution
\stopexample


___
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] numbered exercises

2021-08-24 Thread Wolfgang Schuster via ntg-context

Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 21:26:



Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
:

Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 20:31:

Hi, I’m typesetting a textbook that contains numbered and indented exercises. 
They must not float.

Which structure should I use for them? There must be an easy answer, but I draw 
a blank.


Use an enumeration.


Thank you, but how can I define a title/caption for the enumeration and its 
reference?



\defineenumeration
  [Exercise]
  [text=Exercise,
   title=yes,
   titleleft=,
   titleright=,
   way=bytext,
   margin=1em]

\starttext

\samplefile{lorem}

\startExercise [title={Something to do},reference=ex:something]
\samplefile{lorem}
\stopExercise

\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] numbered exercises

2021-08-24 Thread Henning Hraban Ramm via ntg-context


> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
> :
> 
> Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 20:31:
>> Hi, I’m typesetting a textbook that contains numbered and indented 
>> exercises. They must not float.
>> 
>> Which structure should I use for them? There must be an easy answer, but I 
>> draw a blank.
> 
> Use an enumeration.

Thank you, but how can I define a title/caption for the enumeration and its 
reference?

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
___


[NTG-context] numbered exercises

2021-08-24 Thread Henning Hraban Ramm via ntg-context
Hi, I’m typesetting a textbook that contains numbered and indented exercises. 
They must not float.

Which structure should I use for them? There must be an easy answer, but I draw 
a blank.

At the moment I’m using heads, derived from 'section', but the exercises should 
have independent numbers, and I’m unsure how I should setup the indentation. 
With 'narrower' the numbered titles would be difficult.


\setuplabeltext[en][Exercise=Exercise~]

\definehead[Exercise][section]
\setuphead[Exercise][
  bodypartlabel=Exercise,
  number=yes,
  ownnumber=yes, % ??
  way=bytext, % ??
]

\starttext

\startExercise[title={Something to do},reference=ex:something]

This can have several paragraphs and maybe images etc.

\stopExercise

\stoptext



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] Short forms and abbreviations in bibliography

2021-08-22 Thread Joey McCollum via ntg-context
Just continuing to talk my way through the inner workings of the ConTeXt
Publication modules. It looks like three "long" citation forms are defined
in publ-imp-cite.mkvi:

\startsetups btx:cite:listelement
\fastsetup{\s!btx:\s!cite:concat}
\fastsetup{\s!btx:\s!cite:lefttext}
\ifx\currentbtxfirst\empty
\fastsetup{\s!btx:\s!cite:\s!empty}
\else
   \texdefinition {\s!btx:\s!cite:inject} {
   \btxcitereference
   \currentbtxfirst
   }
\fi
\fastsetup{\s!btx:\s!cite:righttext}
\stopsetups

\startsetups \s!btx:\s!cite:entry
\fastsetup{\s!btx:\s!cite:concat}
\fastsetup{\s!btx:\s!cite:lefttext}
\btxhandleciteentry
\fastsetup{\s!btx:\s!cite:righttext}
\stopsetups

\startsetups \s!btx:\s!cite:footnote
\startfootnote
\fastsetup{btx:cite:entry}
\stopfootnote
\stopsetups

Intuitively, I would expect btx:cite:listelement [why not
\s!btx:\s!cite:listelement?] to handle rendering a bibliographic entry for
the bibliography proper (i.e., the list typically placed at the end of a
document), while \s!btx:\s!cite:entry would handle in-text citations. The
third setup, \s!btx:\s!cite:footnote, simply renders the "entry"-style
citation in a footnote.

But as far as I can tell, the "listelement" setup is never used outside of
publ-imp-cite.mkvi. Only the "entry" setup appears to be used. Meanwhile,
the \btxcitereference and  \btxhandleciteentry macros (invoked in these
setups) appear to be defined in publ-ini.mkiv:

\unexpanded\def\btx_cite_reference_inject
  {\ifconditional\c_btx_cite_reference_injected
   \else
 \dontleavehmode
 \iftrialtypesetting \else
   \ifx\currentbtxbacklink\empty
 % can be made empty when combining author / year
   \else\ifnum\currentbtxbacklink>\zerocount
 \btx_cite_reference_inject_indeed
 \settrue\c_btx_cite_reference_injected
   \fi\fi
 \fi
  \fi}

...

\let\btxcitereference\btx_cite_reference_inject

...

\unexpanded\def\btxhandleciteentry
  {\dontleavehmode
   \begingroup
   \def\currentbtxcitealternative{entry}%
   \setbtxparameterset\s!cite\currentbtxcitealternative % needs checking
   \btxcitereference
   \btx_entry_inject
   \endgroup}

My next step will be to figure out what these are doing, but I'm still not
sure if the module accommodates rendering in-text "entry" citations
differently than citations in the list.

Joey

On Mon, Aug 9, 2021 at 8:55 AM Joey McCollum 
wrote:

> Henning's suggestion for abbreviations should work fine for that issue. I
> could simply use the shorthand in the "series" and "journal" fields and set
> up the appropriate \abbreviation calls in the document or environment.
>
> As for the larger issue of bibliographies, I've started working on
> publ-imp-sbl.lua and publ-imp-sbl.mkvi files. I knew I would need this for
> my own project soon, and I felt it would be useful to myself and the
> ConTeXt community if I could at least get a rudimentary version working.
> I'm presently using the reference for examples from the *SBL Handbook of
> Style*, 2nd edition, available at
> https://github.com/dcpurton/biblatex-sbl/blob/master/test/biblatex-sbl-examples.ref.txt
> .
>
> Like you say, some parts are tricky. SBL uses "entry"-style citations by
> default and doesn't seem to make use of other common alternatives (such as
> "authoryear"). I can think of some existing alternatives that might get
> used in specific cases (e.g., "author", "title"), but the
> recommended shorthand has the form "shortauthor, shorttitle" (i.e., the
> last name(s) of the author(s) only, followed by a comma and a shortened
> form of the title as specified in the "shorttitle" field). I could make
> this the sbl style's implementation of the "short" alternative, since the
> LaTeX-style bracketed number references are foreign to SBL style anyway,
> but if would be preferable just to introduce another alternative (something
> like "authortitle"), then I could also try to do that.
>
> For my immediate purposes, I won't need much more than the @book,
> @article, @inbook, and @incollection entries, so my focus will be on
> getting those right, but if anyone is interested in helping, I'll gladly
> take help. (But it would probably be better to discuss the details in a
> separate e-mail thread.)
>
> Joey
>
> On Mon, Aug 9, 2021 at 4:12 AM Denis Maier via ntg-context <
> ntg-context@ntg.nl> wrote:
>
>>
>>
>> > -Ursprüngliche Nachricht-
>> > Von: ntg-context  Im Auftrag von Henning
>> > Hraban Ramm via ntg-context
>> > Gesendet: Samstag, 7. August 2021 22:40
>> > An: mailing list for ConTeXt users 
>> > Cc: Henning Hraban Ramm 
>> > 

[NTG-context] different preffixsegments for different reference formats

2021-08-21 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \definereferenceformat[itsc][in]
  \setupreferencestructureprefix[itsc][default]
[prefixsegments=section]
  \chapter{Chapter}
  \section[b]{Section}
  \itsc[b] and \in[b]
  \stoptext

How can I get that \itsc gets "prefixsegments=section" without affecting
to \in?

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
___


Re: [NTG-context] Unicode normalization and Hebrew in ConTeXt

2021-08-18 Thread Hans Hagen via ntg-context

On 8/17/2021 9:46 PM, Joey McCollum wrote:
Thankfully, it looks like this was just a problem with my implementation 
of the OpenType feature and not with ConTeXt's handling of it! (I 
worried that it might be ConTeXt when I saw that XeLaTeX was handing the 
feature correctly.) Hans graciously helped me identify the problem, and 
everything looks good now!
Just for the record: one can best try to make a font as robust as 
possible and not rely on side effects (ambiguous cases). When Idris and 
I tested some shapers we found that there can be inconsistent results 
(fwiw, in a rather complex font context agreed more often with uniscribe 
than xetex, but in the end on ehas to make the font okay for all i guess).


When we started with opentype (luatex showed up in 2005) we took 
uniscribe as reference so that is our benchmark. And lack of specs made 
us figure out things stepwise. Now, if something works in one shaper and 
not in another it can of course be due to bugs but it can also be that 
the spec is simply fuzzy and choices have been made. There is then the 
danger that eventually bugs become features (I assume the amount of 
leverage matters here, and tex has zero) which then settles it (kind of) 
but that doesn't man that one should gamble on it.


The same is true for fontnames: don't rely too much on the heuristics 
hard coded in programs (e.g. fontforge has some for font names, 
properties, glyph names, and although that is nice for recovery, it also 
makes other usage hard because fighting fuzzy heuristics is hard once 
information is lost).


Btw, a side effect of your 'issue' is that I found a way to save some 
memory for some fonts (for now only in lmtx) at the cost of hopefully 
little extra runtime.


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] Unicode normalization and Hebrew in ConTeXt

2021-08-16 Thread Joey McCollum via ntg-context
Hans,

Sorry to bring this up after over a year, but I just noticed something that
doesn't seem right. I implemented some contextual substitutions in my own
fork of the Keter YG Hebrew font (.ttf file attached) under the "dlig"
feature that should do the following two things:

   1. If a *shin *with a *sin *dot (שׂ) is pointed with a *holam *(the
   vowel point placed high and on the left), then the *shin*, *sin *dot,
   and *holam *are combined into a single ligature that depicts the *sin *dot
   and *holam *merged into a single point.
   2. If a *shin *with a *shin *dot (שׁ) follows another letter pointed
   with a *holam *(except for *vav*, which must be pointed with a *holam
   haser*), then the shin and shin dot are replaced with a ligature that
   moves the *shin* dot a bit to the right (so that it appears to be merged
   with the preceding *holam*), and the combination of the preceding letter
   and the actual holam is changed to just the preceding letter (thus
   effectively stripping the old *holam*).

I've tested both of these features in FontForge, and they work as expected
there. Likewise, if I test them in the following XeLaTeX script, XeLaTeX
handles both rules correctly:

```
\documentclass{article}
%Set fonts and font features:
\usepackage{fontspec}
\setmainfont[Path=../fonts/KeterYG/, UprightFont = *-Medium, Script=Hebrew,
Ligatures=Discretionary]{KeterYG} % I'm using a local copy of the attached
font
\begin{document}
שֹׂבַע

עָשׂוֹר

קֹשֶׁט

שֹׁשַׁנִּים

עָשׂוֹר

מֹשֶׁה

שַׁלֹשׁ
\end{document}
```

But in ConTeXt, only rule (1) above works as expected. Here is a minimal
(non-)working example:

```

\starttypescriptcollection[keteryg]

\starttypescript[serif][keteryg]

\definefontsynonym[Serif][file:../fonts/KeterYG/KeterYG-Medium.ttf][features=hebrew]
% use a local copy of the attached font, with all the necessary Hebrew
features (this includes dlig by default)

\stoptypescript


\starttypescript[keteryg]

\definetypeface[keteryg][rm][serif][keteryg][default]

\stoptypescript

\stoptypescriptcollection


%Set up the main font:

\setupbodyfont[keteryg]

%Set up right-to-left alignment:

\setupalign[r2l]

\starttext

שֹׂבַע

עָשׂוֹר

קֹשֶׁט

שֹׁשַׁנִּים

עָשׂוֹר

מֹשֶׁה

שַׁלֹשׁ

\stoptext
```

In examples 3, 4, 6, and 7, the *holam *dot still appears before the *shin*
-with-merged-*shin*-dot-and-*holam *ligature, when it should be absent. (I
realize that it may be difficult to tell; in the last two examples, the
presence of two dots is easier to make out.)

Do you have any idea why this might be happening in ConTeXt? Does the glyph
reordering in font-imp-combining.lua take place before any OpenType
features in the font are applied?

Thanks again!

Joey

On Thu, Apr 30, 2020 at 4:17 PM Joey McCollum 
wrote:

> Okay! I have not figured out how to add a new page to the wiki, but I was
> able to add a section to the end of the "Arabic and Hebrew" page (
> https://www.contextgarden.net/Arabic_and_Hebrew) discussing the issue,
> providing a test, and briefly describing the fix.
>
> Joey
>
> On Thu, Apr 30, 2020 at 11:14 AM Hans Hagen  wrote:
>
>> On 4/30/2020 4:28 PM, Joey McCollum wrote:
>> > Thanks so much, Hans! I should be able to add a wiki page summarizing
>> > the tests before the end of the week.
>> >
>> > For reference purposes, do you know which version of ConTeXt has (or
>> > will have) this update included?
>> todays upload
>>
>>
>> -
>>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] JavaScript in multimedia PDF

2021-08-11 Thread Michal Vlasák via ntg-context
More context is in previous messages, but here is the patch for ConTeXt
to make scripting multimedia possible:

--- a/tex/context/base/mkxl/lpdf-wid.lmt
+++ b/tex/context/base/mkxl/lpdf-wid.lmt
@@ -649,6 +649,7 @@ local function insertrenderingwindow(specification)
 Subtype = pdfconstant("Screen"),
 P   = pdfreference(pdfpagereference(page)),
 A   = a, -- needed in order to make the annotation clickable 
(i.e. don't bark)
+T   = pdfunicode(label), -- title (for JS)
 Border  = bs,
 C   = bc,
 AA  = actions,
@@ -693,7 +694,7 @@ local function insertrendering(specification)
  -- }
  -- }
 local parameters = pdfdictionary {
-Type = pdfconstant(MediaPermissions),
+Type = pdfconstant("MediaPermissions"),
 TF   = pdfstring("TEMPALWAYS"), -- TEMPNEVER TEMPEXTRACT 
TEMPACCESS TEMPALWAYS / needed for acrobat/wmp
 }
 local descriptor = pdfdictionary {
@@ -723,7 +724,7 @@ local function insertrendering(specification)
 local rendition = pdfdictionary {
 Type = pdfconstant("Rendition"),
 S= pdfconstant("MR"),
-N= label,
+N= pdfunicode(label),
 C= pdfreference(pdfflushobject(clip)),
 }
 mf[label] = pdfreference(pdfflushobject(rendition))
@@ -761,6 +762,20 @@ function codeinjections.processrendering(label)
 end
 end

+-- needed mapping for access from JS
+local function flushrenderings()
+if next(mf) then
+    local r = pdfarray()
+for label, reference in sortedhash(mf) do
+r[#r+1] = pdfunicode(label)
+r[#r+1] = reference -- already a reference
+end
+
lpdf.addtonames("Renditions",pdfreference(pdfflushobject(pdfdictionary{ Names = 
r })))
+end
+end
+
+lpdf.registerdocumentfinalizer(flushrenderings,"renderings")
+
 function codeinjections.insertrenderingwindow(specification)
 local label = specification.label
 codeinjections.processrendering(label)

The patch is also be available here
https://github.com/vlasakm/context-mirror/commit/99f81beae0d13f1aecc20be187ada9eb88a2aa68
until it is applied (for full file download, which is available under
the three dots next to the file name).

The created Screen annotation will be given the title, that corresponds
to the second \placerenderingwindow parameter. So here:

\definerenderingwindow[soundplace]
  [width=0pt, height=0pt]

\useexternalrendering[mainsound][audio/mp3][sound.mp3][embed=yes]

\placerenderingwindow[soundplace][mainsound]

both the screen annotation and rendition are available under the name
"mainsound". The name "soundplace" can be anything (even "mainsound"),
it doesn't propagate to the PDF file in any way.

And here is the patch required to make Pablo's example work:

--- a/pablo.tex
+++ b/pablo.tex
@@ -7,8 +7,10 @@
 function GoToFirstSlide(label) {
 this.pageNum = 0 ;
 var rendition = this.media.getRendition(label) ;
+var screen = this.media.getAnnot({nPage: 0, cAnnotTitle: label}) ;
 var player = app.media.openPlayer({
 rendition: rendition,
+annot: screen,
   });
 }

The second possibility I proposed previously is not as general, and
implementing it is not worth, until it is really needed (which I presume
won't happen).

Michal Vlasák
___
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] JavaScript in multimedia PDF

2021-08-10 Thread Michal Vlasák via ntg-context
On Mon Aug 9, 2021 at 8:32 AM CEST, Pablo Rodriguez via ntg-context wrote:
> On 8/8/21 11:00 PM, Michal Vlasák via ntg-context wrote:
> > Is there a newer document than "JavaScript for Acrobat API Reference"
> > (May 2015)?
>
> Well, the link you provided
> (https://mailman.ntg.nl/pipermail/ntg-context/2021/103023.html) is from
> February 2021:
>
> https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsapiref.pdf
>
> Here is the guide to developers (from the same date):
>
> https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsdevguide.pdf

Thank you, I didn't realize that they updated the document after I
saved it. The (public) update also must have been more recently than
in February (I think the 2015 one was still up in May).

I wasn't every of the guide. It seems nice.

> I get exactly the same results: screen object, but null rendition.
>
> I have no idea what it is needed here.

Sorry, in the last mail I forgot to mention one idea I had. But now I
had time to try it, and in the end came up with three different ways to
get it working (at least the multimedia part, didn't test the rest).

It turns out, that Acrobat Reader ignores the names assigned to the
Renditions -- that's why it can't be found by name (this is not
complaint with the spec). But there is another mapping of Rendition
names and objects -- the "Renditions" name tree, that maps Unicode
encoded names of renditions to the respective objects. After generating
the name tree, the method "getRendition" works correctly. This is the
possibility number one -- generate the name tree.

Another possibility uses the fact, that the "openPlayer" method needs to
know which Rendition (what to play) and Screen annotation (where to
play) to target. While in ordinary JavaScript actions one needs to
specify them manually (because there is no context), in _Rendition_ PDF
actions (that can also execute JavaScript) there is a context -- the
action specifies the annotation and rendition at the PDF dictionary
level. So possibility number two is to use JavaScript Rendition actions.

Lastly, possibility number three. If one can't play the multimedia with
JavaScript, there still is a plain (no JavaScript) Rendition action,
that can do this -- "/OP 0" (StartRendering in ConTeXt). Also one can
chain several PDF actions one after the other. So if we first play the
Rendition through this ordinary Rendition action, then we can chain
arbitrary JavaScript after it. The order is important here, because the
second action doesn't start until first one is finished (which you may
or not desire, so feel free to swap the order).

All three possibilities work in Acrobat Reader 2021.005.20060. Depending
on the length of your audio, you may be interested in the fact, that
Acrobat Reader starts playing the audio from the start, if it didn't
finish it before. And also supports only embedded files.

Foxit Reader 11.0.1.49938 supports only the second and third way. It
also starts playing the same audio multiple times if started multiple
times (the same track plays multiple times over itself). All three file
types are supported, though I only check embedded and external files
(not URL files).

There are probably functions in the JS API to achieve better control and
consequently the same behaviour in both viewers, but I didn't look.

The first two ways are not currently possible in ConTeXt. The last one
should work, because ConTeXt should support chaining actions with
/Next, although I would have to check what is the user interface
(implementation is in lpdf.action).

I however, have a proof of concept in OpTeX, that uses the package from
my thesis (but I had to extend it for the Unicode encoded Rendition name
tree). To compile, you would need OpTeX and the updated "pdfextra.opm"
from
https://raw.githubusercontent.com/vlasakm/pdfextra/master/pdfextra.opm.
But the compiled PDF from the below example is attached.

With the proof of concept, and real world PDF document available, we
should probably get the functionality into ConTeXt. First way should
work if the name tree is added (I will look into that), but also needs a
better way to refer to the screen annotations, than what I am using
below (which maybe means more book keeping, have to check). The second
way would need a new executer and its shortcut, maybe something used
like this:

\goto{...}[JSRendition{, }]

But I presume that more book keeping will be necessary.

The third way should hopefully already work.

Also, beware that both in my example, and in ConTeXt, multimedia
insertion produces whatsits, which especially when inserted with zero
dimensions like here for audio, may cause surprising interactions when
around normal typsetting content. Putting the whatsit insertion in a
page background is a way to keep it away. "back-swf.mkiv" suggests:

\setupbac

[NTG-context] footnote interaction in titles

2021-08-09 Thread Adam Reviczky via ntg-context
Hi,

I probably shouldn't use footnotes within titles, but I am misusing the
title elements for a quick interview style document (I use them in the ToC).

One thing I have noticed is that interaction style (color and styles) are
not applied in the footnote and footnote numbering.
Is that a side effect or intended like that?

A half-workaround is to apply the styles directly, but not sure how I can
force the numbering style (same-page reference).

See MWE:

\setupinteraction[state=start]
\starttext
\startchapter[title={Long question with footnote \footnote{see: \goto{
https://wiki.contextgarden.net}[url(https://wiki.contextgarden.net)]}
and with a workaround \footnote{see: \goto{\bf\startcolor[darkgreen]
https://wiki.contextgarden.net\stopcolor}[url(https://wiki.contextgarden.net
)]}?}]
\input knuth
\footnote{see: \goto{https://wiki.contextgarden.net}[url(
https://wiki.contextgarden.net)]}
\stopchapter
\stoptext

It is not crucial, and if the behaviour is intended as such because of the
title element, that is fine, I am just curious.

Thanks,
Adam
___
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] Short forms and abbreviations in bibliography

2021-08-09 Thread Joey McCollum via ntg-context
Henning's suggestion for abbreviations should work fine for that issue. I
could simply use the shorthand in the "series" and "journal" fields and set
up the appropriate \abbreviation calls in the document or environment.

As for the larger issue of bibliographies, I've started working on
publ-imp-sbl.lua and publ-imp-sbl.mkvi files. I knew I would need this for
my own project soon, and I felt it would be useful to myself and the
ConTeXt community if I could at least get a rudimentary version working.
I'm presently using the reference for examples from the *SBL Handbook of
Style*, 2nd edition, available at
https://github.com/dcpurton/biblatex-sbl/blob/master/test/biblatex-sbl-examples.ref.txt
.

Like you say, some parts are tricky. SBL uses "entry"-style citations by
default and doesn't seem to make use of other common alternatives (such as
"authoryear"). I can think of some existing alternatives that might get
used in specific cases (e.g., "author", "title"), but the
recommended shorthand has the form "shortauthor, shorttitle" (i.e., the
last name(s) of the author(s) only, followed by a comma and a shortened
form of the title as specified in the "shorttitle" field). I could make
this the sbl style's implementation of the "short" alternative, since the
LaTeX-style bracketed number references are foreign to SBL style anyway,
but if would be preferable just to introduce another alternative (something
like "authortitle"), then I could also try to do that.

For my immediate purposes, I won't need much more than the @book, @article,
@inbook, and @incollection entries, so my focus will be on getting those
right, but if anyone is interested in helping, I'll gladly take help. (But
it would probably be better to discuss the details in a separate e-mail
thread.)

Joey

On Mon, Aug 9, 2021 at 4:12 AM Denis Maier via ntg-context <
ntg-context@ntg.nl> wrote:

>
>
> > -Ursprüngliche Nachricht-
> > Von: ntg-context  Im Auftrag von Henning
> > Hraban Ramm via ntg-context
> > Gesendet: Samstag, 7. August 2021 22:40
> > An: mailing list for ConTeXt users 
> > Cc: Henning Hraban Ramm 
> > Betreff: Re: [NTG-context] Short forms and abbreviations in bibliography
> >
> >
> >
> > > Am 07.08.2021 um 21:53 schrieb Joey McCollum via ntg-context  > cont...@ntg.nl>:
> > >
> > > A separate list of abbreviations would then list "LSAWS" alongside
> "Linguistic
> > Studies in Ancient West Semitic" (and likewise for other journal/series
> > abbreviations).
> >
> > Regarding abbreviations have a look at
> > https://wiki.contextgarden.net/Command/definesynonyms
> >
> > It should be as easy as
> >
> > \abbreviation{LSAWS}{Linguistic Studies in Ancient West Semitic}
> >
> > The full name of \quote{LSAWS} is \infull{LSAWS}.
> >
> > \placelistofabbreviations
> >
> >
> > I had a case where mostly abbreviations were used in the text but the
> full name
> > should appear in the index.
> > I can provide the setup (including Lua functions), if it might help you.
> >
> >
> > Can’t help with bibliographies, sorry.
>
> SBL is a tricky beast anyway. There were some discussions regarding
> implementing Chicago Manual of Style a couple of weeks ago. Develelopments
> on that front could also be useful for SBL. Don't know what came out of
> this though.
>
> 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
>
> ___
>
___
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] JavaScript in multimedia PDF

2021-08-09 Thread Pablo Rodriguez via ntg-context
On 8/8/21 11:00 PM, Michal Vlasák via ntg-context wrote:
> On Sun Aug 8, 2021 at 8:22 PM CEST, Pablo Rodriguez via ntg-context wrote:
>> I don’t know why I get the following message:
>>
>> TypeError: a.doc is undefined
>>
>> It seems to be caused by "app.media.openPlayer", but the code is copied
>> from the documentation Adobe released early this year.
>
> Is there a newer document than "JavaScript for Acrobat API Reference"
> (May 2015)?

Well, the link you provided
(https://mailman.ntg.nl/pipermail/ntg-context/2021/103023.html) is from
February 2021:

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsapiref.pdf

Here is the guide to developers (from the same date):

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsdevguide.pdf

> Anyways, I thought that the culprit is that you only specify the
> rendition (what to play) and not screen (where to play):
>
>
>  function GoToFirstSlide(label) {
>  this.pageNum = 0 ;
>  var rendition = this.media.getRendition(label) ;
> +var screen = this.media.getAnnots({ nPage: 0})[0];
>  var player = app.media.openPlayer({
>  rendition: rendition,
> +annot: screen,
>});
>  }
>
> But as it turns out, while the screen query succesfully returns an
> object, the rendition query returns null.
>
> The PDF 1.7 standard specifies that the name (/N) of Rendition PDF
> object should be Unicode, but that doesn't seem to make it work either,
> as does deleting the name of the media clip (which was the same).
>
> (But I now get "Invalid arguments" error for the "app.media.openPlayer"
> call, which is kind of expected.)
>
> Can you confirm, that "rendition" is null on your side as well?
>
> console.println(rendition);
> console.println(screen);
> console.show();

I get exactly the same results: screen object, but null rendition.

I have no idea what it is needed here.

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
___


Re: [NTG-context] JavaScript in multimedia PDF

2021-08-08 Thread Michal Vlasák via ntg-context
On Sun Aug 8, 2021 at 8:22 PM CEST, Pablo Rodriguez via ntg-context wrote:
> I don’t know why I get the following message:
>
> TypeError: a.doc is undefined
>
> It seems to be caused by "app.media.openPlayer", but the code is copied
> from the documentation Adobe released early this year.

Is there a newer document than "JavaScript for Acrobat API Reference"
(May 2015)?

Anyways, I thought that the culprit is that you only specify the
rendition (what to play) and not screen (where to play):


 function GoToFirstSlide(label) {
 this.pageNum = 0 ;
 var rendition = this.media.getRendition(label) ;
+var screen = this.media.getAnnots({ nPage: 0})[0];
 var player = app.media.openPlayer({
 rendition: rendition,
+annot: screen,
   });
 }

But as it turns out, while the screen query succesfully returns an
object, the rendition query returns null.

The PDF 1.7 standard specifies that the name (/N) of Rendition PDF
object should be Unicode, but that doesn't seem to make it work either,
as does deleting the name of the media clip (which was the same).

(But I now get "Invalid arguments" error for the "app.media.openPlayer"
call, which is kind of expected.)

Can you confirm, that "rendition" is null on your side as well?

console.println(rendition);
console.println(screen);
console.show();


Michal Vlasák
___
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] Short forms and abbreviations in bibliography

2021-08-07 Thread Joey McCollum via ntg-context
Hi,

It is a common practice to use short forms of titles for bibliographic
entries after they are cited the first time. Another practice is to use
abbreviations for journal names and book series (generally for citations in
the text, but possibly also in the references list), with a separate "List
of Abbreviations" provided to cross-reference the abbreviations and full
names. I think that these practices could be accommodated with multiple
bibliographies that contain short and long forms for corresponding entries,
but I wanted to ask: is there a simpler or preferred way to do this in
ConTeXt?

To illustrate what I mean, the biblatex-sbl package (
https://github.com/dcpurton/biblatex-sbl), which implements the SBL
citation style for (Xe)LaTeX, handles this using additional fields like
"shorttitle," "shortjournal," and "shortseries," so for the BibTeX-style
bibliographic entry

@book{Blau2010,
author = {Joshua Blau},
title = {Phonology and Morphology of Biblical Hebrew},
shorttitle = {Phonology},
series = {Linguistic Studies in Ancient West Semitic},
shortseries = {LSAWS},
volume = {2},
location = {Winona Lake, IN},
publisher = {Eisenbrauns},
year = {2010}
}

the initial in-text citation (in SBL style) would look something like

Joshua Blau, *Phonology and Morphology of Biblical Hebrew*, LSAWS 2 (Winona
Lake, IN: Eisenbrauns, 2010),

while subsequent in-text citations would look like

Blau, *Phonology*.

A separate list of abbreviations would then list "LSAWS" alongside
"Linguistic Studies in Ancient West Semitic" (and likewise for other
journal/series abbreviations).

Thank you!

Joey
___
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] \note[xx] gives unknown reference for \startfootnote, ok for \footnote

2021-08-05 Thread Hans Hagen via ntg-context

On 8/5/2021 5:07 AM, Rik Kabel via ntg-context wrote:

The following example:

\starttext

abc\footnote[fn:abc]{footnote abc}\ abc

def
\startfootnote[fn:def]
  footnote def
\stopfootnote
\ def

No problem here: abc\note[fn:abc]

Problem appears here: def\note[fn:def]

\stoptext

Generates a missing reference error for a reference provided on 
\startfootnote (and \startendnote) accessed by \note:


references  > start missing references
references  >    1  [][fn:def]
references  > stop missing references

ConTeXt  ver: 2021.08.04 17:51 LMTX  fmt: 2021.8.4

There was no problem with previous versions.

fixed in next upload


-
  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] \note[xx] gives unknown reference for \startfootnote, ok for \footnote

2021-08-04 Thread Rik Kabel via ntg-context

The following example:

   \starttext

   abc\footnote[fn:abc]{footnote abc}\ abc

   def
   \startfootnote[fn:def]
 footnote def
   \stopfootnote
   \ def

   No problem here: abc\note[fn:abc]

   Problem appears here: def\note[fn:def]

   \stoptext

Generates a missing reference error for a reference provided on 
\startfootnote (and \startendnote) accessed by \note:


   references  > start missing references
   references  >    1  [][fn:def]
   references  > stop missing references

ConTeXt  ver: 2021.08.04 17:51 LMTX  fmt: 2021.8.4

There was no problem with previous versions.

--
Rik

___
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] multimedia PDF in ConTeXt

2021-07-31 Thread Pablo Rodriguez via ntg-context
On 7/30/21 11:57 PM, Michal Vlasák via ntg-context wrote:
> On Fri Jul 30, 2021 at 8:53 PM CEST, Pablo Rodriguez via ntg-context wrote:
>> [...]
>> Although I don’t read Czech, just out of curiosity, is your bachelor
>> thesis available on the net, Michal? Thanks to theses.cz, I found
>> https://is.muni.cz/th/t8qpp/DP_Vlasak_Michal_2015.pdf (only a name
>> coincidence, I guess).
>
> Sorry, should have shared the link at the first place.
>
> https://dspace.cvut.cz/handle/10467/95065

Many thanks for your fast reply and the link to your thesis, Michal.

>> [...]
>> Is there no way to have the video as an embedded file in the PDF
>> document? (I mean, that the file is listed when the attachment panel is
>> displayed.)
>
> Currently, only attachments are added as "embedded files" (either as
> "hidden", ending up in /EmbeddedFiles, or as "annotation" ending up as
> /FileAttachment annotation).
>
> Maybe "codeinjections.embedfile" can have the option to force the
> reference, so that the file also ends up in /EmbeddedFiles? Should it be
> default for all \externalrenderings?
> [...]
> --- a/tex/context/base/mkxl/lpdf-wid.lmt
> +++ b/tex/context/base/mkxl/lpdf-wid.lmt
> [...]

Many thanks for the patch.

It would be also great to have an option not to list some files as
embedded (adding a option "list" to "\useexternalrendering" such as in
"\useexternalrendering[myvideo][video/mp4][video.mp4][embed=yes, list=no]").

Being the default to yes, I’m thinking of cases where there is a risk
distributing the multimedia file without the embedding document, because
of the lack of context (no pun indented)

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
___


Re: [NTG-context] multimedia PDF in ConTeXt

2021-07-30 Thread Michal Vlasák via ntg-context
On Fri Jul 30, 2021 at 8:53 PM CEST, Pablo Rodriguez via ntg-context wrote:
> Hi Michal and Hans,
>
> many thanks for your patch to fix multimedia objects in PDF and your
> extremely interesting and in-depth explanation about multimedia in PDF.
> Many thanks to Hans for the release of an updated latest with also
> updated documentation.
>
> Although I don’t read Czech, just out of curiosity, is your bachelor
> thesis available on the net, Michal? Thanks to theses.cz, I found
> https://is.muni.cz/th/t8qpp/DP_Vlasak_Michal_2015.pdf (only a name
> coincidence, I guess).

Sorry, should have shared the link at the first place.

https://dspace.cvut.cz/handle/10467/95065

(PLNY_TEXT) links to the full text.

(PRILOHA) is almost all files I had for the thesis. Most notably the
testing files I used. (Some were handcoded, so no sources, but these
should be readable in text editors).

> Using your sample, I have two questions:
>
> \starttext
> \setupinteraction[state=start]
>
> \useexternalrendering[myvideo][video/mp4][video.mp4][embed=yes]
>
> \definerenderingwindow[myrenderingwindow]
> [width=\textwidth, height=\textwidth]
>
> \placerenderingwindow[myrenderingwindow][myvideo]
> \stoptext
>
> Is there no way to have the video as an embedded file in the PDF
> document? (I mean, that the file is listed when the attachment panel is
> displayed.)

Currently, only attachments are added as "embedded files" (either as
"hidden", ending up in /EmbeddedFiles, or as "annotation" ending up as
/FileAttachment annotation).

Maybe "codeinjections.embedfile" can have the option to force the
reference, so that the file also ends up in /EmbeddedFiles? Should it be
default for all \externalrenderings?

My try:

https://github.com/contextgarden/context-mirror/commit/681c36d0ecfd30c05ed588eb0f37a06dd19f3492

(the full file can be located by clicking on the three dots after the
file name, then "View file" and then "Raw", resulting in:

https://github.com/contextgarden/context-mirror/blob/681c36d0ecfd30c05ed588eb0f37a06dd19f3492/tex/context/base/mkxl/lpdf-wid.lmt,

Patch can be obtained by adding .diff to the URL:

https://github.com/contextgarden/context-mirror/commit/681c36d0ecfd30c05ed588eb0f37a06dd19f3492.diff

I will probably not keep the commit on GitHub forever, it just seems
like a nice way to send quick patches -- it is visual and allows full
file/patch download. So this time full patch also included below for
future reference.)

Michal


--- a/tex/context/base/mkxl/lpdf-wid.lmt
+++ b/tex/context/base/mkxl/lpdf-wid.lmt
@@ -259,7 +259,7 @@ local function flushembeddedfiles()
 for tag, reference in sortedhash(filestreams) do
 if not reference then
 report_attachment("unreferenced file, tag %a",tag)
-elseif referenced[tag] == "hidden" then
+    elseif referenced[tag] == "hidden" or referenced[tag] == "forced" 
then
 e[#e+1] = pdfstring(tag)
 e[#e+1] = reference -- already a reference
 f[#f+1] = reference -- collect all file description references
@@ -369,6 +369,9 @@ function codeinjections.embedfile(specification)
 }
 local r = pdfreference(pdfflushobject(d))
 filestreams[hash] = r
+if specification.forcereference == true then
+referenced[hash] = "forced"
+end
 return r
 end
 end
@@ -705,9 +708,10 @@ local function insertrendering(specification)
 descriptor = pdfreference(pdfflushobject(descriptor))
 elseif option[v_embed] then
 descriptor = codeinjections.embedfile {
-file = filename,
-mimetype = mimetype, -- yes or no
-compress = false,
+file   = filename,
+mimetype   = mimetype, -- yes or no
+compress   = false,
+forcereference = true,
 }
 end
 local clip = pdfdictionary {
___
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] Adobe Acrobat accessibility criteria

2021-07-27 Thread Connor P. Jackson via ntg-context
My prior message got stuck in Moderation Limbo because I attached a PDF, so
resending without the attachments:

Apologies, I realized about an hour after I hit send that I should have
submitted an MRE! Here is an MRE adapted from the wiki page on PDF/A
<https://wiki.contextgarden.net/PDF/A>:

---

\setupinteraction[title=MyTitle,state=start]


\setupinteractionscreen[option={title}]


\setupbackend[

format={pdf/a-1a:2005},

profile={default_cmyk.icc,default_rgb.icc,default_gray.icc},

intent=ISO coated v2 300\letterpercent\space (ECI)]


%% Tagged PDF

%% method=auto ==> default tags by Adobe

\setupbackend[export=yes]

\setupstructure[state=start,method=auto]


\starttext


\chapter[chap:testing]{Testing}


Here is some text


\useURL[url1][https://xkcd.org][][Here is a link to xkcd]\from[url1]


\stoptext

---

Including \setupinteractionscreen[option={title}] fixed the title issue
(#1)! Thanks for that. I will add that to my default template.


And to see #s 2 and 3, I can send a PDF where I have fixed those errors in
Adobe Acrobat—adding a link-OBJR tag and setting the Tab Order. Is there a
preferred method since the listserv doesn’t seem to like large attachments?

Thanks!

Connor

On Jul 27, 2021 at 12:35:28 AM, Hans Hagen  wrote:

> On 7/27/2021 3:11 AM, Connor P. Jackson via ntg-context wrote:
>
> Hello ConTeXt friends,
>
>
> I am newly exploring ConTeXt in search of a better way to produce
>
> PDF/UA-1 accessible and PDF/A compliant documents programmatically. From
>
> my early experiments, ConTeXt docs appear to fully satisfy the veraPDF
>
> validator, but Adobe Acrobat’s Accessibility Checker has three qualms
>
> with ConTeXt-produced documents:
>
>
>  1. The document is configured to display the file name rather than the
>
> title in the top of the window (DisplayDocTitle == True is what I
>
> think is required). See here
>
> <https://www.w3.org/TR/WCAG20-TECHS/PDF18.html>.
>
>
> Does this work at your end?
>
> \setupinteraction
>   [title=MyTitle,state=start]
>
> \setupinteractionscreen
>   [option={title}]
>
> \starttext
> test
> \stoptext
>
>
>  2. "Tagged Annotations" fails, suggesting that the document’s links are
>
> not properly tagged. I believe the issue is missing "Link - OBJR”
>
> (object reference) tags. See here
>
> <
> https://amp.levelaccess.net/public/standards/view_best_practice.php?violation_id=807
> >,
>
> here <https://www.w3.org/TR/WCAG20-TECHS/PDF11.html>, and here
>
> <http://verapdf.org>.
>
>  3. "Tab Order" fails, I believe because ConTeXt does not specify that
>
> the tab order should follow the Document Structure, so Acrobat reads
>
> it as unspecified. See here
>
> <https://www.w3.org/TR/WCAG20-TECHS/PDF3.html>.
>
>
>
> Is there something I could be doing to correct these issues in my
>
> ConTeXt documents? Or is this a change that would have to be made within
>
> ConTeXt itself? I know that Adobe is not the definitive arbiter of what
>
> an “accessible” PDF looks like, but for many organizations, passing the
>
> Acrobat accessibility checker is a prerequisite, so it seems worthwhile
>
> to me to make ConTeXt capable of it.
>
> Most fo this is rather trivial but we need examples (mwe) and expected
> result (in only have an old acrobat x pro and the latest reader, so
> maybe i can't check all the latest greatest fancy features).
>
> 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] Adobe Acrobat accessibility criteria

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

On 7/27/2021 3:11 AM, Connor P. Jackson via ntg-context wrote:

Hello ConTeXt friends,

I am newly exploring ConTeXt in search of a better way to produce 
PDF/UA-1 accessible and PDF/A compliant documents programmatically. From 
my early experiments, ConTeXt docs appear to fully satisfy the veraPDF 
validator, but Adobe Acrobat’s Accessibility Checker has three qualms 
with ConTeXt-produced documents:


 1. The document is configured to display the file name rather than the
title in the top of the window (DisplayDocTitle == True is what I
think is required). See here
<https://www.w3.org/TR/WCAG20-TECHS/PDF18.html>.


Does this work at your end?

\setupinteraction
  [title=MyTitle,state=start]

\setupinteractionscreen
  [option={title}]

\starttext
test
\stoptext



 2. "Tagged Annotations" fails, suggesting that the document’s links are
not properly tagged. I believe the issue is missing "Link - OBJR”
(object reference) tags. See here

<https://amp.levelaccess.net/public/standards/view_best_practice.php?violation_id=807>,
here <https://www.w3.org/TR/WCAG20-TECHS/PDF11.html>, and here
<http://verapdf.org>.
 3. "Tab Order" fails, I believe because ConTeXt does not specify that
the tab order should follow the Document Structure, so Acrobat reads
it as unspecified. See here
<https://www.w3.org/TR/WCAG20-TECHS/PDF3.html>. 



Is there something I could be doing to correct these issues in my 
ConTeXt documents? Or is this a change that would have to be made within 
ConTeXt itself? I know that Adobe is not the definitive arbiter of what 
an “accessible” PDF looks like, but for many organizations, passing the 
Acrobat accessibility checker is a prerequisite, so it seems worthwhile 
to me to make ConTeXt capable of it.
Most fo this is rather trivial but we need examples (mwe) and expected 
result (in only have an old acrobat x pro and the latest reader, so 
maybe i can't check all the latest greatest fancy features).


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] Adobe Acrobat accessibility criteria

2021-07-26 Thread Connor P. Jackson via ntg-context
Hello ConTeXt friends,

I am newly exploring ConTeXt in search of a better way to produce PDF/UA-1
accessible and PDF/A compliant documents programmatically. From my early
experiments, ConTeXt docs appear to fully satisfy the veraPDF validator,
but Adobe Acrobat’s Accessibility Checker has three qualms with
ConTeXt-produced documents:


   1. The document is configured to display the file name rather than the
   title in the top of the window (DisplayDocTitle == True is what I think is
   required). See here <https://www.w3.org/TR/WCAG20-TECHS/PDF18.html>.
   2. "Tagged Annotations" fails, suggesting that the document’s links are
   not properly tagged. I believe the issue is missing "Link - OBJR” (object
   reference) tags. See here
   
<https://amp.levelaccess.net/public/standards/view_best_practice.php?violation_id=807>,
   here <https://www.w3.org/TR/WCAG20-TECHS/PDF11.html>, and here
   <http://verapdf.org>.
   3. "Tab Order" fails, I believe because ConTeXt does not specify that
   the tab order should follow the Document Structure, so Acrobat reads it as
   unspecified. See here <https://www.w3.org/TR/WCAG20-TECHS/PDF3.html>.


Is there something I could be doing to correct these issues in my ConTeXt
documents? Or is this a change that would have to be made within
ConTeXt itself? I know that Adobe is not the definitive arbiter of what an
“accessible” PDF looks like, but for many organizations, passing the
Acrobat accessibility checker is a prerequisite, so it seems worthwhile to
me to make ConTeXt capable of it.

Many thanks!

Connor Jackson
___
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] Multimedia, PDF and ConTeXt

2021-07-26 Thread Michal Vlasák via ntg-context
Dear ConTeXt community,

recently, as part of my bachelor thesis, I looked into the state of
multimedia (audio, video, 3D) and other relatively obscure PDF
features, with the connection to TeX.

I already put off this write up long enough. Hopefully it clarifies
things that might influence the current uncertainty about these features
and their presence in ConTeXt (see abstract of Hans' talk for upcoming
ConTeXt meeting, chapter 8 of "On and on" and remarks in files like
"lpdf-wid.lmt").

The following text discusses the options for including multimedia in PDF
files from ConTeXt. First the different PDF mechanisms are introduced
and compared, then their support in ConTeXt is summarized. My ideas
for future steps are also included. Patch to fix some bugs is also
below. Lastly I link to some resources regarding the topic.

The various versions of the PDF standard have over the years developed
several ways of including "multimedia" in PDF files. The simplest are
XObjects which allow raster and vector graphics -- this is a well known
and well supported feature in both PDF writers and viewers. However,
later revisions of the PDF standard added what is essentially five
different mechanisms for including video, audio or 3D files (each
mechanism supports a different subset of these three). For evaluating
these mechanisms from perspective of ConTeXt it is possible to devise
the following criteria:

 - support in PDF standard (deprecation, etc.),
 - supported media types (audio, video[+optional audio], 3D),
 - support of different source types (embedded file, external file, URL)
 - what is possible to achieve ("usefulness") and at what cost
   ("complexity"),
 - current support in ConTeXt,
 - and the most important: support in PDF viewers.

Perhaps the "source types" need a bit of explanation. Essentially all
file references from PDF can be one of three types:

 - Embedded file. The referenced file is *in* the PDF file, this means
   that it can also be compressed as part of it (not very useful for
   multimedia though). This is nice because the result is integral --
   the media file can't get lost and there is only a single file to
   distribute.
 - URL file. The reference to the file is solely the URL. Takes almost
   no space at all in the PDF file, but means that the availability of
   the media file and PDF file are not tied.
 - External file. A file path is included in the PDF file. The file
   doesn't have to be available over the internet, but has to be
   distributed along with the PDF file (and the relative path has to
   match).

The "usefulness" aspect includes the possibility of interaction or
scripting. E.g. using media player buttons ("controls"), scripting with
JavaScript or some control with PDF actions (\goto, and triggers like
page open which allow auto-play).

The viewers I tested were: Acrobat Reader DC, Foxit Reader, Sumatra PDF
on Windows and Evince, Okular, Xpdf, MuPDF, Firefox and Google Chrome on
Linux.

Now to the different mechanisms:

1) Sound objects

 - First appeared in PDF 1.2 (1996), but had since been deprecated (PDF
   1.5, 2003) and became unsupported (PDF 2.0, 2017).

 - Only audio is supported.

 - "Raw" and in practice uncompressed PCM audio can be embedded (i.e.
   ".wav" format without the metadata).
   Otherwise an external file may be used (this one has to be in a real
   audio format - like ".wav" - i.e. with metadata).

 - Users usually don't have raw audio. So embedding requires
   preprocessing. Some control using PDF actions is possible.

 - Not supported in ConTeXt.

 - None of the viewers supports the external files. Only Acrobat Reader
   supports the embedded raw audio.

2) Movie objects

 - First appeared in PDF 1.2 (1996), but had since been deprecated (PDF
   1.5, 2003) and became unsupported (PDF 2.0, 2017).

 - Both video and audio is supported.

 - Any source (embedded, external and URL file).

 - In all regards superior to sound objects. Is still relatively simple
   and allows some customization and control (media player controls, PDF
   actions).

 - This is the backing mechanism for including video and audio in
   ConTeXt (\externalfigure, \useexternalsoundtrack).

 - Supported only in Evince and Okular (with their usual quirks, see
   below). Notably Acrobat Reader does no longer support this mechanism.

3) Multimedia ("Renditions")

 - First appeared in PDF 1.5 (2003). Adobe Acrobat considers them
   "legacy".

 - Both video and audio supported (as well as other unspecified types of
   multimedia, like images and Flash, but not really, see below).

 - In theory all source types should be possible.

 - This mechanism was supposed to replace sound and movie objects. Hence
   their deprecation. The mechanism is complex (the spec is 10 times
   longer than that for movie objects). It expects the PDF viewers to
   work wi

[NTG-context] Getting the local float reference within a float and reuse (?) it later (\somelocalfloat?)

2021-07-22 Thread Benjamin Buchmuller
Hi, 

Is there a more convenient way to get the current reference label (stably) from 
within a float? For example, I would like to make an "image credits" section at 
the end of a document, so I do something similar to:

\defineblock[credits]

\starttext

\section[sec:topic]{Topic}

\startplacefigure
[
title={Awesome figure. Image credits in \about[sec:credits].},
    reference=fig:awesome,
]

\begincredits
\in{Figure}[fig:awesome] in \in{Section}[sec:topic] was not created by me.
\endcredits
\stopplacefigure

\section[sec:credits]{Appendix}

\useblocks[credits]

\stoptext

The block mechanism comes in really handy here, especially since I have more to 
show at the end than just the credits. However, each time I add another figure, 
I have to replace the references appropriately. So, I was wondering how about 
exploiting some pointers:

\begincredits
\somelocalfloat[figure][current] in Section \someheadnumber[section][current] 
was not created by me.
\endcredits
\processblocks[credits] % expected \someheadnumber to evaluate to 1?
\stopplacefigure

Yet, even if asked to be processed within the first section, \someheadnumber 
evaluates at the end to "2" (should be "1" in my opinion)? This is independent 
of calling it from within the float or the main text. I guess, my understanding 
of "processblocks" is wrong in this respect.

% \begincredits
% This is the call from the text \someheadnumber[section][current]
% \endcredits
%
% \processblocks[credits]

Further, \somelocalfloat doesn't show anything. What does it do?

Two probably not really urgent questions as I can live with putting the 
explicit names, but maybe there is an even better approach that comes in handy 
in more circumstances.

Thanks in advance!


Benjamin
___
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] TikZ in buffers: My struggle with \definestartstop

2021-07-08 Thread Gavin
Thanks Hans!

That works great. I understand it all and it is working in my book, so even 
better. I did not know you could \typsetbuffer[a,b,c]. I will be using that 
again.

In case anyone finds this in the future, trying to solve a similar issue, my 
final version is below, including my \marginTikZ command.

Gavin


\setuppapersize[letter]

\setuplayout[
  backspace=90pt, % Horizontal layout
  leftmargin=36pt, % 1/2 in
  leftmargindistance=9pt, % 3/8 in
  width=306pt, % 4 1/4 in
  rightmargindistance=27pt, % 3/8 in
  rightmargin=144pt,  % 2 in
]

\startbuffer[starttikz]
   \usemodule[tikz]% Lots of setup can go here!
   \startTEXpage
   \starttikzpicture
\stopbuffer

\startbuffer[stoptikz]
   \stoptikzpicture
   \stopTEXpage
\stopbuffer

\define[2]\marginTikZ{
  \startplacefigure[location=margin, reference=fig:#1, title={#2}]
\typesetbuffer[starttikz,#1,stoptikz]
  \stopplacefigure
}

\starttext

\startbuffer[BlueCircle]
 \draw[thick,blue] (0,0) circle (2cm)node{Ti{\it k}Z!};
\stopbuffer

\marginTikZ{BlueCircle}{Ti{\it k}Z drew this blue circle\dots slowly.}

\startbuffer[RedCircle]
 \draw[thick,red] (0,0) circle (2cm)node{Ti{\it k}Z!};
\stopbuffer

\marginTikZ{RedCircle}{Ti{\it k}Z drew this red circle\dots slowly.}

Take a look at the blue circle in \in{figure}[fig:BlueCircle] and the red 
circle in \in{figure}[fig:RedCircle]

\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] TikZ in buffers: My struggle with \definestartstop

2021-07-08 Thread Hans Hagen

On 7/8/2021 7:55 PM, Gavin wrote:

Hello,

I have a book containing many margin figures drawn with TikZ, which is very 
slow. By putting the TikZ code in a buffer and using \typesetbuffer only 
altered TikZ code is executed on each run, saving tremendous time. This means 
the code containsmany constructions like this, which I would like to simplify:

\startbuffer[BlueCircle]
   \usemodule[tikz]% Actually this is many lines to load environments, define 
fonts, etc.
   \startTEXpage
 \starttikzpicture
   \draw[thick,blue] (0,0) circle (1.5cm)node{Ti{\it k}Z!};
 \stoptikzpicture
   \stopTEXpage
\stopbuffer

\placefigure[margin][fig:BlueCircle] % location, label
   {Ti{\it k}Z drew this blue circle\dots slowly.}   % caption text
{\hbox{\typesetbuffer[BlueCircle]}}

My plan is to replace the first block with a new \startTikZbuffer…\stop…, which 
is defined using \definestartstop to include all of the stuff around the TikZ 
code. Then I will replace the second block with a new command, \marginTikZ, 
which has three arguments: a label, a caption, and the TikZ code. This command 
will use my new \startTikZbuffer to create the buffer before using \placefigure 
to put it in the margin. Only the \marginTikZ command will appear throughout 
the book.

I’d like to do this in two steps because I will also have \textTikZ and 
\wideTikZ for diagrams in the text block and diagrams spanning the full page 
with. All of these can use the same \startTikZbuffer. However, I cannot get the 
\startTikZbuffer to work as expected.

I put a small working example below. Removing the “This method works” block and adding the 
"This method fails” block causes the an error that I cannot decipher: "Use of 
\page_fitting_start doesn't match its definition."

Any advice is appreciated. Maybe I am doing this entirely the wrong way.

A couple notes: I considered using \definebuffer, but this doesn’t allow me to 
create named buffers, which seems like a deal breaker. I considered using 
\definefloat, but it don’t allow me include before and after commands, as far 
as I can tell.

\starttext

\input knuth

\startbuffer[starttikz]
\usemodule[tikz]
\startTEXpage
\starttikzpicture
\stopbuffer

\startbuffer[stoptikz]
\stoptikzpicture
\stopTEXpage
\stopbuffer

\protected\def\MyTikzBuffer#1{\typesetbuffer[starttikz,BlueCircle,stoptikz]}

\startbuffer[BlueCircle]
  \draw
[thick,blue] (0,0) circle (1.5cm)node{Ti{\it k}Z!};
\stopbuffer

\startplacefigure[location=margin,reference=fig:BlueCircle,title={Example A.}]
\typesetbuffer[starttikz,BlueCircle,stoptikz]
\stopplacefigure

\startplacefigure[location=margin,reference=fig:BlueCircle,title={Example B.}]
\MyTikzBuffer{BlueCircle}
\stopplacefigure

\input knuth

\stoptext


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

maillist : ntg-context@ntg.nl / 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] new lmtx upload

2021-07-06 Thread Hans Hagen

Hi,

I upgrsded lmtx. A few small things (emntioned already) at the tex end 
but Alan and I are now in metafun mode.


I (finally) adpated lmtx to delegated mplib logging, so

\startMPcode{doublefun}
tracingall ; fill fullcircle scaled 3cm withcolor "darkmagenta" ;
\stopMPcode

should work. Just in case someone keeps an eye on the metafun code and 
wonders what 'records' are, here is an example:


\starttext

\startMPcode

record FooA ; interim FooA := newrecord [
name = "FooA"
index = 123
] ;

record FooB ; interim FooB := newrecord [
name = "FooB"
index = 456
] ;

record FooC ; interim FooC := newrecord [
name  = "FooC"
index = 789,
crap  = [
more = "MORE"
]
] ;

draw textext(getrecord(FooA).name)  rotated -45 withcolor 
"darkred"   ;
draw textext(getrecord(FooB).name)  rotated   0 withcolor 
"darkgreen" ;
draw textext(getrecord(FooC).name)  rotated  45 withcolor 
"darkblue"  ;
draw textext(getrecord(FooC).crap.more) rotated  90 withcolor 
"darkgray"  ;


begingroup;

interim FooC := newrecord [
name  = "FooC"
index = 789,
crap  = [
more = "NESTED 1"
]
] ;

draw textext(getrecord(FooC).crap.more) shifted (0,-1cm) 
withcolor "darkgray" ;

draw textext(FooC) shifted (2cm,-1cm) withcolor "darkgray" ;

begingroup;

interim FooC := newrecord [
crap  = [
more = "NESTED 2"
]
] ;

draw textext(getrecord(FooC).index) shifted (4cm,-2cm) 
withcolor "darkgray" ;
draw textext(getrecord(FooC).crap.more) shifted (0,-2cm) 
withcolor "darkgray" ;

draw textext(FooC) shifted (2cm,-2cm) withcolor "darkgray"  ;

endgroup;

endgroup;

draw textext(getrecord(FooC).crap.more) shifted (0,-3cm) withcolor 
"darkgray" ;

draw textext(FooC) shifted (2cm,-3cm) withcolor "darkgray"  ;

record FooD ; interim FooD := newrecord [
name = "FooD"
list = { 11, 22, 33, 44 }
] ;

for i=1 upto getrecord FooD.list[] :
draw textext(getrecord(FooD).list[i]) shifted (i*cm,-5cm) 
withcolor "darkgray" ;

endfor ;
for i=1 upto getrecord FooD.#list :
draw textext(getrecord(FooD).list[i]) shifted (5cm+i*cm,-5cm) 
withcolor "darkred" ;

endfor ;

numeric v ;
for i=1 upto 1 :
v := 0 ;
for j=1 upto 4 :
v := v + getrecord FooD.list[j] ;
endfor ;
endfor ;
draw textext(v) shifted (12cm,-5cm) withcolor "darkgray"  ;

interim FooD := setrecord [
name = "FooD"
tsil = { 44, 33, 22, 11 }
] ;

for i=1 upto getrecord FooD.#list :
draw textext(getrecord FooD.list[i]) shifted (5cm+i*cm,-6cm) 
withcolor "darkgreen" ;

endfor ;
for i=1 upto getrecord FooD.#tsil :
draw textext(getrecord FooD.tsil[i]) shifted (5cm+i*cm,-7cm) 
withcolor "darkgray" ;

endfor ;

tracingall ;

draw textext(getrecord FooD.list[2]) shifted (5cm,-8cm) withcolor 
"darkmagenta" ;


\stopMPcode

\startluacode
inspect(metapost.getrecord("FooA"))
inspect(metapost.getrecord("FooB"))
inspect(metapost.getrecord("FooC"))
inspect(metapost.getrecord("FooD"))
\stopluacode

\stoptext

So, one can store structured data at the mp end, use it there, and 
access it also from lua (after all it's done in lua). It honors metapost 
grouping (which is what interim does with internals, and records use 
metapost internals as reference).


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] randomizer line-breaking

2021-06-08 Thread Steffen Wolfrum


> Am 07.06.2021 um 17:59 schrieb Hans Hagen :
> 
> On 6/7/2021 5:44 PM, Steffen Wolfrum wrote:
>>> Am 07.06.2021 um 16:39 schrieb Hans Hagen :
>>> 
>>> Not that I know of ... but you can run wiht --keeptuc and see if there are 
>>> differences in the tuc file that create some oscillation.
>> Ok. Each run now creates 4 additional files:
>> file_name-tuc-02.tmp
>> file_name-tuc-03.tmp
>> file_name-tuc-04.tmp
>> file_name-tuc-05.tmp
>> Is this right?
> indeed and you can compare them to get some clue about what changes
> 
> normally you get one so your style somehow triggers differences


Besides plenty of numbers that differ, there are also entire lines that differ:

One frequent difference for examples is line 2 (macros) and 3 (randomseed) in 
this:

utilitydata.job.variables.collected={
["macros"]={},
["randomseed"]=0x1.c14cd54cp-1,
["sectionblockorder"]={ "frontpart", "bodypart", "backpart" },


Another difference that pops up 1000 times is this line
["used"]="fit",

in situation like this:
utilitydata.structures.references.collected={
["02"]={
 ["*101"]={
  ["metadata"]=678,
  ["references"]={
   ["block"]="bodypart",
   ["internal"]=102,
   ["prefix"]="02",
   ["realpage"]=16,
   ["reference"]="*101",
   ["section"]=3,
   ["used"]="fit",
   ["view"]="fit",
   ["x"]=25526152,
   ["y"]=36448045,
  },
 },



Does this help?

PS: The entire problem began when I started using hyphenation-exceptions...

Steffen
___
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] different prefixsegments for \in

2021-06-04 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \setupreferencestructureprefix
[default]
[prefixsegments=*:*]
  \starttext
  \section{One Section}
  \subsection[sec0]{Subsection}
  As told in \in[sec0] and \in[sec1]…
  \section{Another Section}
  \subsection[sec1]{Subsection}
  …
  \stoptext

The output reads:

  As told in 1.1 and 2.1…

I would like to be able to supress the section number in the reference,
if the current section is the same as the referenced one.

I mean, I would like that the output reads:

  As told in 1 and 2.1…

Which would be the way to do it automatically?

BTW, in my real--world document, I need to remove part and chapter
numbers from the reference when in the same part and chapter (when
compiling XML sources).

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
___


Re: [NTG-context] Converting footnotes to endnotes

2021-06-03 Thread Idris Samawi Hamid ادريس سماوي حامد
On Thu, 03 Jun 2021 14:17:15 -0600, Wolfgang Schuster  
 wrote:



\setupnote
  [footnote]
  [location=none]


That did the trick; many thanks!

==
\setupnote
  [footnote]
  [location=none]

\starttext
\startsection[title={},reference={}]
\input ward
\startfootnote
\input ward
\stopfootnote{}
\input ward
\startfootnote
\input ward
\stopfootnote{}
\stopsection

\startsection[title={},reference={}]
\input ward
\startfootnote
\input ward
\stopfootnote{}
\input ward
\startfootnote
\input ward
\stopfootnote{}
\stopsection

\startsubject[title={},reference={}]
\placenotes [footnote]
\stopsubject
\stoptext
==

Best wishes
Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
___
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] Converting footnotes to endnotes

2021-06-03 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

Generally, I do not use endnotes - see Robert Bringhurst's criticisms of  
endnotes in typography - but a publisher is demanding them. Converting  
footnotes to endnotes must be quite simple yet I'm missing it:


\setupnotation[footnote]
[way=bychapter]

% \setupnote[footnote]
% [way=bychapter]

\starttext
\startsection[title={},reference={}]
\input ward
\startfootnote
\input ward
\stopfootnote{}
\input ward
\startfootnote
\input ward
\stopfootnote{}
\stopsection

\startsection[title={},reference={}]
\input ward
\startfootnote
\input ward
\stopfootnote{}
\input ward
\startfootnote
\input ward
\stopfootnote{}
\stopsection

\startsubject[title={},reference={}]
\placenotes [footnote]
\stopsubject
\stoptext

What's the best way to convert the above to endnotes? Thank you in advance!

Best wishes
Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
___
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] Side-by-side environment

2021-05-31 Thread Werner Hennrich

Hello Tommy,
xtable is quite versatile and can do a lot of things -
place your cells next to each other by putting them into the same row.

If you haven't yet, this might be a good moment to skim through the
xtables manual
<https://www.pragma-ade.com/general/manuals/xtables-mkiv.pdf> and play
around,
for the full list of options refer to the commands reference
<http://www.pragma-ade.com/general/qrcs/setup-en.pdf>.

All the best!
Werner



Am 31.05.21 um 09:52 schrieb Tommaso Gordini:

Hello everybody.

Some time ago, Wolfgang helped me write an environment to have code
above and typeset output below.
I'll glue you a MWE below.

\mainlanguage [it]

\setupbodyfont [modern]


\defineuserdata

[example]

[alternative=example]


\defineuserdataalternative

[example]

[renderingsetup=userdata:example]


\startsetups [userdata:example]

\blank

\startembeddedxtable
[width=\textwidth,strut=no,offset=1ex,framecolor=black,rulethickness=0.5pt]

  \startxrow [corner=03,align=normal]

    \startxcell

      \typebuffer [userdata] [option=tex]

    \stopxcell

  \stopxrow

  \startxrow [corner=01,align=normal]

    \startxcell

      \getuserdata

    \stopxcell

  \stopxrow

\stopembeddedxtable

\blank

\stopsetups


\starttext


\startuserdata [example]

\starttext

C’era una volta un re\dots

\stoptext

\stopuserdata


\stoptext


Now, the question: Can the code to be improved? How can I modify the
code to have the example typeset to the right of the box? I would like
the box to be 0.5\textwidth wide.

Thanks in advance
Tommy

___
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] How to write readable source files?

2021-05-29 Thread Hans Hagen

On 5/29/2021 5:03 PM, Nicola wrote:

On 2021-04-25, Hans Hagen  wrote:

If there is a way to automatically get a list of all ConTeXt commands
and options (and, ideally, MetaFun defs, types, and other keywords), I'd
be happy to improve omni-completion for ConTeXt in Vim.

All is in xml files (i-*.xml) in the distribution maintained by
Wolfgang. We ship with this for editors:


dir t:\texmf\context\data


04/21/2021  11:40 AM  scite
04/21/2021  11:40 AM  textadept
04/21/2021  11:40 AM  texworks
04/21/2021  11:40 AM  vscode

these lists are generated by mtx-interface so we can add more if needed


Could you please elaborate on the (automatic?) data flow from ConTeXt's
source files to data files for each application? Is it:

source code -> XML -> .lua -> mtx-interface -> data?

In particular, it is not clear to me how i-*.xml files are related to
mtx-interface, as the latter does not use them directly, AFAICS.


for sure it does

in the early days of context mkii we had \startsetups kind of 
definitions that got filtered from the source but when xml support was 
built that moved to an xml file


then Wolfgang did an excellent job on checking each xml snippet and 
added many more and these i-* files showed up, we extended the xml a 
bit, redid the rendering of these lists etc


wolfgang is in charge of this so when something specific in the files is 
needed ...



Anyway, mtx-interface seems exactly what I am looking for, and I would
like to use it to generate ConTeXt keywords for Vim. Can I patch that
script?


basically we only need

function flushers.vim(collected)
end


For MetaFun keywords I don't know yet: do those XML files contain enough
information about the content of all mp-* source files? E.g., the fact
that `hlingrid` is a def? Looking at the Scite files, I see only
internals and commands, and they seem to cover only the "main" MetaFun
names.


it is still on the agenda to make xml files for metafun but there is no 
timeline for that


now, when it comes to highlighting, the reference is the scite one 
(which supports several of the languages that we use, and also supports 
mixed lua/mp/tex/... lexing) ... right from the start the way it shows 
up in an editor determined how the user interface evolved ... believe it 
or not, but for a long time we used texedit (written in modula, was 
pretty ok in 640K mem, also fast and one could scroll files in the 
sidebar and see them instantly; it used the character based windowing 
i'd written as a student for terminals connected to a dec vax .. just 
for fun ... i'm that old) ... when modula disappeared i actually rewrote 
that one in perl/tk and it still works but then decided to use scite


anyway, so scite is still my reference (i looked to vscode but seeing 
all this extra stuff, the need for 'servers', the lack of simply running 
a command based on suffix ... not now)


that said, we can support whatever editor one uses makes much sense (one 
should really use the editor, word processor, operating system etc one 
feels most comfortable with) so just make a prototype (or tell me what 
kind of lists you need, because it's rather trivial to generate them)



I have used a custom script in the past for fine-grained keyword
extraction from MetaFun's source code. By fine-grained, I mean that the
output contains information about the kind of keyword (def, primary def,
vardef, constant, variable, etc.) I could update it to Lua and mp-*.mpxl
if that interests you—unless that has already been done, of course.
just look at the files in the scite path ... much info is available, for 
context it comes from the xml files, for the tex engine and meta* it 
comes from mult* lua files


adding more detail (not sure if distinguishing between def and vardef 
makes sense ... we more use the 'primitive', 'lowlevel', 'interface' 
kind of grouping


let's see what Wolfgang thinks of it ...

Hans

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

maillist : ntg-context@ntg.nl / 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] BibTeX inproceedings entries not rendered correctly in APA style

2021-05-28 Thread Rik Kabel


On 5/28/2021 16:33, Alan Braslau wrote:

On Fri, 28 May 2021 19:52:19 - (UTC)
Nicola  wrote:


If there is no publisher, then @unpublished is a better category.
APA explicitly, and for good reason, accounts for self-publishing,
indicating that the Author was the publisher.

Ah ok, that explains the output I was obtaining. So, I am using the
wrong bibliographic style for my purposes. In practice, at least in
Computer Science, publishers (and also editors) are often omitted in
references (it's more a "don't care", rather than a "don't know"
thing, though).


If a publisher does not exist, was it published?

If the publisher is unknown, then why not state that:
publisher="unknown publisher", or whatever?

Strictly speaking, your reasoning makes perfect sense, and I am all
for enforcing constraints if a given bibliographic style requires
them. But then, there might be alternatives for when one does not
need to adhere to those styles. Does ConTeXt (LMTX) currently provide
anything else besides apa and aps?

I have read the BibTeX manual looong time ago, but I remember that
there were mandatory and optional fields for each reference type. My
memory may fail me, but I think that Editor and Publisher were not
mandatory fields for inproceedings and article (I think Publisher is
mandatory for book). Is there a bibliographic style in ConTeXt that
follows those rules?

Bibliography management is very sophisticated in ConTeXt (much more
than LaTeX) and I have not grasped all of its details yet. It seems
to me that it has also evolved quite a bit in recent years. So, the
"ConTeXt way" of doing bibliographies still eludes me to some extent.

In writing the ConTeXt bibliography system, we tried to base this on
references, indeed following the original bibtex manual for its
definitions. The APA style follows the APA style guide as best as
possible.

The APS style is intended as a simple example of a numbered
bibliography minimalist style.

Multiple other styles exist out there, more or less well defined. The
problem is that most of them are not very rigorous, and they are
greatly abused. Many publishers follow their own (quirky) bibliography
styles.

The Context system started out as sort of a database handling
subsystem, useful in publishing. It is entirely tune-able, through
setups and parameters. However, the system is complex, so the
customization is not quite as easy as originally intended. Note that
the original bibtex system was conceived in order to have this
configurability, however few were those who mastered writing
bibliography styles, and even carefully crafted styles, for example as
implemented by the APS RevTeX, were buggy and had a number of known,
serious limitations requiring manual intervention.

We could, and have had the intention of, writing other bibliography
styles. But there must be a motivation as well as a clearly defined
specification, for otherwise we will be heading down a rabbit hole of
differing expectations and endless tweaking.

As to "don't care" concerning publishers, this is not very academic.
Indeed, many famous books have been published by various publishers, in
particular for different markets. It is important to say, for each one
might be slightly different, have different pagination for example, and
even certain edits of the text. One might also not pay attention to the
edition, but this too can lead to major differences (even, and
especially in computer science).


Thomas Schmitz, one of the originators of the bibliography project,
will tell you to take the APA style as a model, and then modify it as
you wish to your own needs. I further took this to heart, trying to
write the macros as somewhat standard definitions that one could modify
as needed without breaking the entire system.

And then there are clearly bugs that can be fixed. In the case of a
missing publisher, it is not simply left blank because the APA style
explicitly tells us to put "Author" when there is no defined publisher,
so this is a feature, not a bug.

Alan


The APA does not attempt to define bibliographies. It defines reference 
lists (and more specifically, reference lists for APA journal articles), 
and there is a difference. The reference list, as defined in the APA 
guide, simply exists to point the reader to the cited document (whatever 
'document' might mean). Bibliographies, as the APA guide acknowledges, 
can be much richer, although they do not say it that way.


Looking at the 6th edition of the APA guide (I have not reviewed the 7th 
edition guide, but as far as I know ConTeXt used the 6th edition), I 
note that example 36, a symposium contribution, does not have a 
publisher name. However, it does appear that ConTeXt would require a 
publisher for this and the following examples which have a DOI but no 
publisher. This may be an error, but whether on the part of the APA or 
ConTeXt or both I cannot say.


For books, the 

Re: [NTG-context] BibTeX inproceedings entries not rendered correctly in APA style

2021-05-28 Thread Alan Braslau
On Fri, 28 May 2021 19:52:19 - (UTC)
Nicola  wrote:

> > If there is no publisher, then @unpublished is a better category.
> > APA explicitly, and for good reason, accounts for self-publishing,
> > indicating that the Author was the publisher.  
> 
> Ah ok, that explains the output I was obtaining. So, I am using the
> wrong bibliographic style for my purposes. In practice, at least in
> Computer Science, publishers (and also editors) are often omitted in
> references (it's more a "don't care", rather than a "don't know"
> thing, though).
> 
> > If a publisher does not exist, was it published?
> >
> > If the publisher is unknown, then why not state that:
> > publisher="unknown publisher", or whatever?  
> 
> Strictly speaking, your reasoning makes perfect sense, and I am all
> for enforcing constraints if a given bibliographic style requires
> them. But then, there might be alternatives for when one does not
> need to adhere to those styles. Does ConTeXt (LMTX) currently provide
> anything else besides apa and aps?
> 
> I have read the BibTeX manual looong time ago, but I remember that
> there were mandatory and optional fields for each reference type. My
> memory may fail me, but I think that Editor and Publisher were not
> mandatory fields for inproceedings and article (I think Publisher is
> mandatory for book). Is there a bibliographic style in ConTeXt that
> follows those rules?
> 
> Bibliography management is very sophisticated in ConTeXt (much more
> than LaTeX) and I have not grasped all of its details yet. It seems
> to me that it has also evolved quite a bit in recent years. So, the
> "ConTeXt way" of doing bibliographies still eludes me to some extent.

In writing the ConTeXt bibliography system, we tried to base this on
references, indeed following the original bibtex manual for its
definitions. The APA style follows the APA style guide as best as
possible.

The APS style is intended as a simple example of a numbered
bibliography minimalist style.

Multiple other styles exist out there, more or less well defined. The
problem is that most of them are not very rigorous, and they are
greatly abused. Many publishers follow their own (quirky) bibliography
styles.

The Context system started out as sort of a database handling
subsystem, useful in publishing. It is entirely tune-able, through
setups and parameters. However, the system is complex, so the
customization is not quite as easy as originally intended. Note that
the original bibtex system was conceived in order to have this
configurability, however few were those who mastered writing
bibliography styles, and even carefully crafted styles, for example as
implemented by the APS RevTeX, were buggy and had a number of known,
serious limitations requiring manual intervention.

We could, and have had the intention of, writing other bibliography
styles. But there must be a motivation as well as a clearly defined
specification, for otherwise we will be heading down a rabbit hole of
differing expectations and endless tweaking.

As to "don't care" concerning publishers, this is not very academic.
Indeed, many famous books have been published by various publishers, in
particular for different markets. It is important to say, for each one
might be slightly different, have different pagination for example, and
even certain edits of the text. One might also not pay attention to the
edition, but this too can lead to major differences (even, and
especially in computer science).


Thomas Schmitz, one of the originators of the bibliography project,
will tell you to take the APA style as a model, and then modify it as
you wish to your own needs. I further took this to heart, trying to
write the macros as somewhat standard definitions that one could modify
as needed without breaking the entire system.

And then there are clearly bugs that can be fixed. In the case of a
missing publisher, it is not simply left blank because the APA style
explicitly tells us to put "Author" when there is no defined publisher,
so this is a feature, not a bug.

Alan
___
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] BibTeX inproceedings entries not rendered correctly in APA style

2021-05-28 Thread Nicola
On 2021-05-28, Alan Braslau  wrote:
> On Fri, 28 May 2021 13:02:10 -0400 (EDT)
> Aditya Mahajan  wrote:
>
>> > If you have not defined a publisher, how should ANY format place the
>> > undefined publisher's name?
>>
>> Simply leave it blank?
>
> If there is no publisher, then @unpublished is a better category. APA
> explicitly, and for good reason, accounts for self-publishing,
> indicating that the Author was the publisher.

Ah ok, that explains the output I was obtaining. So, I am using the
wrong bibliographic style for my purposes. In practice, at least in
Computer Science, publishers (and also editors) are often omitted in
references (it's more a "don't care", rather than a "don't know" thing,
though).

> If a publisher does not exist, was it published?
>
> If the publisher is unknown, then why not state that:
> publisher="unknown publisher", or whatever?

Strictly speaking, your reasoning makes perfect sense, and I am all for
enforcing constraints if a given bibliographic style requires them. But
then, there might be alternatives for when one does not need to adhere
to those styles. Does ConTeXt (LMTX) currently provide anything else
besides apa and aps?

I have read the BibTeX manual looong time ago, but I remember that there
were mandatory and optional fields for each reference type. My memory
may fail me, but I think that Editor and Publisher were not mandatory
fields for inproceedings and article (I think Publisher is mandatory for
book). Is there a bibliographic style in ConTeXt that follows those
rules?

Bibliography management is very sophisticated in ConTeXt (much more than
LaTeX) and I have not grasped all of its details yet. It seems to me
that it has also evolved quite a bit in recent years. So, the "ConTeXt
way" of doing bibliographies still eludes me to some extent.

Nicola

___
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] styling references

2021-05-28 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \starttext
  \startitemize
  \dorecurse{15}
{\item[\recurselevel]whatever}
  \stopitemize

  As exposed in \in{item}[9]...
  \stoptext

How can I add style to the item reference (9)?

I mean, how can I get “As exposed in item {\em 9}”?

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
___


Re: [NTG-context] TeX capacity exceeded

2021-05-19 Thread Hans Hagen

On 5/17/2021 11:43 PM, Thomas A. Schmitz wrote:


Hi all,

I have a rather large (almost 120,000 lines) xml file, processing pulls 
in another large xml file. The project compiles under mkiv; with lmtx, I 
get


tex error   > tex error on line 8 in file : TeX capacity exceeded, 
sorry [reference count=32767]

Can you check the latest upload? You should be able to go way higher.

If you're worried about your lua macros performance you can always run 
with:


  --profile

and look at the luatex-profile.log file ... it gives a rough impression. 
be prepared for a slow run (although the latest greatest lmtx should 
perform some 2.5 times better when profiling).


There's also a new (yet unofficial) feature:

\starttext

\setupfonts
  [serif=dejavuserif*default,
   sans=dejavusans,
   mono=dejavusansmono]

   {AAA\char1234 AAA}
   {\ss BBB\char1234 BBB}\par
   {AA}
   {\ss BB}\par

   \dorecurse{1000}{ \char1234 }

\stoptext

You can set up a list of 'quick and dirty fallback' fonts (you can set a 
sequence for each style). This doesn't replace the normal fallback 
mechanisms but can be handy as catch.


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] TeX capacity exceeded

2021-05-18 Thread Hans Hagen

On 5/17/2021 11:43 PM, Thomas A. Schmitz wrote:


Hi all,

I have a rather large (almost 120,000 lines) xml file, processing pulls 
in another large xml file. The project compiles under mkiv; with lmtx, I 
get


tex error   > tex error on line 8 in file : TeX capacity exceeded, 
sorry [reference count=32767]


This is not the normal memory consumption that bothers you

\enabletrackers[system.usage]

will show you more detail. Normally the default context configuration 
will provide enough. In lmts memory is abit more dynamic so we start otu 
smaller and then stepwise grow. And one can configure even more 
(actually i just updated some configuration options for that).


Anyway: this more smells like some nesting going wrong and therefore 
excessive token sharing



 \reallanguagetag

just twenty pages shy of the end of the document.

There is an error log with this content:

return {
  ["errortype"]=3,
  ["filename"]="",
  ["lastcontext"]="\n\n\n \\reallanguagetag \n    \n 
\\reallanguagetag #1->\\ifcsname \\??languagelinked #1\n    \\endcsname 
\\lastnamedcs \\else #1\\fi \n \\setusedlanguage #1->\\edef 
\\currentusedlanguage {\\reallanguagetag {#1}\n    }\\ifempty 
\\currentusedlanguage \\let \\currentusedlanguage \\currentlanguage 
\\always\\let \\usedlanguageparameter \\languageparameter \\orelse \\ifx 
\\currentusedlanguage \\v!global \\let \\currentusedlanguage\n\n 
\\typo_delimited_push ...\\currentdelimitedtext {#1}\\edef 
\\m_delimited_argument {#2}\\ifempty \\m_delimited_argument 
\\typo_delimited_set_language_nop \n    \\else 
\\typo_delimited_set_language_yes \\fi \\let 
\\currentparentdelimitedtext \\currentdelimitedtext \\global \\advance 
\\c_typo...\n\n \\delimitedtext [#1]#*[#2]->\\dontleavehmode 
\\typo_delimited_push {#1}{#2}\n    \\edef \\p_delimited_method 
{\\delimitedtextparameter \\c!method }\\ifx \\p_delimited_method 
\\v!font \\expandafter \\typo_delimited_fontdriven \\else \\expandafter 
\\typo_delimited_other \\fi \n\n \n 
{\n...\n\n \n    ",

  ["lastluaerror"]="",
  ["lasttexerror"]="TeX capacity exceeded, sorry [reference count=32767]",
  ["lasttexhelp"]="If you really absolutely need more capacity, you can 
ask a wizard to enlarge me.",

  ["linenumber"]=8,
  ["offset"]=10,
  ["skiplinenumber"]=8,
}

  In mkiv, these are the stats at the end of the run:


mwe ...

mkiv lua stats  > used config file: 
selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/mnt/shared/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e 

mkiv lua stats  > resource resolver: loadtime 0.009 seconds, 1 scans 
with scantime 0.005 seconds, 0 shared scans, 27 found files, scanned 
paths: /home/tas/texmf
mkiv lua stats  > stored bytecode data: 455 modules (0.122 sec), 96 
tables (0.007 sec), 551 chunks (0.130 sec)
mkiv lua stats  > traced context: maxstack: 1422, freed: 2, unreachable: 
1420

mkiv lua stats  > cleaned up reserved nodes: 63 nodes, 9 lists of 442
mkiv lua stats  > node memory usage: 17 attribute, 4 attribute_list, 1 
glue, 51 glue_spec, 3 kern, 2 penalty, 2 temp, 2 user_defined
mkiv lua stats  > node list callback tasks: 8 unique task lists, 9336 
instances (re)created, 177413 calls

mkiv lua stats  > h-node processing time: 4.800 seconds including kernel
mkiv lua stats  > attribute processing time: 0.617 seconds front- and 
backend

mkiv lua stats  > driver time: 0.886 seconds
mkiv lua stats  > used backend: pdf (backend for directly generating pdf 
output)

mkiv lua stats  > jobdata time: 0.161 seconds saving, 0.052 seconds loading
mkiv lua stats  > callbacks: internal: 261417, file: 319, direct: 3, 
late: 31831, function 200128, total: 493698 (464 per page)

mkiv lua stats  > randomizer: resumed with value 0.47143577262518
mkiv lua stats  > positions: 9535 collected, 9535 regular, 0 special
mkiv lua stats  > v-node processing time: 0.401 seconds
mkiv lua stats  > result saved in file: plutarchusvitae.pdf, 
compresslevel 3, objectcompresslevel 1

mkiv lua stats  > loaded patterns: de::3 en::1 la::65, load time: 0.000
mkiv lua stats  > xml load time: 0.648 seconds, 4 files, 4 converted
mkiv lua stats  > lxml preparation time: 0.626 seconds, 233814 nodes, 
578788 lpath calls, 578743 cached calls

mkiv lua stats  > interactive elements: 0 references, 37 destinations
mkiv lua stats  > margin data: 10798 entries, 0 pending
mkiv lua stats  > loaded fonts: 9 files: garamondpremrpro.otf, 
sabonltstd-bold.otf, sabonltstd-italic.otf, sabonltstd-roman.otf, 
kadmosu.otf, oldstandard-bold.otf, oldstandard-italic.otf, 
xitsmath-regular.otf, dejavusansmono.ttf
mkiv lua stats  > font engine: otf 3.113, afm 1.513, tfm 1.000, 17 
instances, 6 shared in backend, 0 common vectors, 6 common hashes, load 
time 0.146 seconds
mkiv 

[NTG-context] TeX capacity exceeded

2021-05-17 Thread Thomas A. Schmitz


Hi all,

I have a rather large (almost 120,000 lines) xml file, processing pulls 
in another large xml file. The project compiles under mkiv; with lmtx, I get


tex error   > tex error on line 8 in file : TeX capacity exceeded, 
sorry [reference count=32767]


 \reallanguagetag

just twenty pages shy of the end of the document.

There is an error log with this content:

return {
 ["errortype"]=3,
 ["filename"]="",
 ["lastcontext"]="\n\n\n \\reallanguagetag \n\n 
\\reallanguagetag #1->\\ifcsname \\??languagelinked #1\n\\endcsname 
\\lastnamedcs \\else #1\\fi \n \\setusedlanguage #1->\\edef 
\\currentusedlanguage {\\reallanguagetag {#1}\n}\\ifempty 
\\currentusedlanguage \\let \\currentusedlanguage \\currentlanguage 
\\always\\let \\usedlanguageparameter \\languageparameter \\orelse \\ifx 
\\currentusedlanguage \\v!global \\let \\currentusedlanguage\n\n 
\\typo_delimited_push ...\\currentdelimitedtext {#1}\\edef 
\\m_delimited_argument {#2}\\ifempty \\m_delimited_argument 
\\typo_delimited_set_language_nop \n\\else 
\\typo_delimited_set_language_yes \\fi \\let 
\\currentparentdelimitedtext \\currentdelimitedtext \\global \\advance 
\\c_typo...\n\n \\delimitedtext [#1]#*[#2]->\\dontleavehmode 
\\typo_delimited_push {#1}{#2}\n\\edef \\p_delimited_method 
{\\delimitedtextparameter \\c!method }\\ifx \\p_delimited_method 
\\v!font \\expandafter \\typo_delimited_fontdriven \\else \\expandafter 
\\typo_delimited_other \\fi \n\n \n 
{\n...\n\n \n",

 ["lastluaerror"]="",
 ["lasttexerror"]="TeX capacity exceeded, sorry [reference count=32767]",
 ["lasttexhelp"]="If you really absolutely need more capacity, you can 
ask a wizard to enlarge me.",

 ["linenumber"]=8,
 ["offset"]=10,
 ["skiplinenumber"]=8,
}

 In mkiv, these are the stats at the end of the run:

mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/mnt/shared/lmtx/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.009 seconds, 1 scans 
with scantime 0.005 seconds, 0 shared scans, 27 found files, scanned 
paths: /home/tas/texmf
mkiv lua stats  > stored bytecode data: 455 modules (0.122 sec), 96 
tables (0.007 sec), 551 chunks (0.130 sec)
mkiv lua stats  > traced context: maxstack: 1422, freed: 2, unreachable: 
1420

mkiv lua stats  > cleaned up reserved nodes: 63 nodes, 9 lists of 442
mkiv lua stats  > node memory usage: 17 attribute, 4 attribute_list, 1 
glue, 51 glue_spec, 3 kern, 2 penalty, 2 temp, 2 user_defined
mkiv lua stats  > node list callback tasks: 8 unique task lists, 9336 
instances (re)created, 177413 calls

mkiv lua stats  > h-node processing time: 4.800 seconds including kernel
mkiv lua stats  > attribute processing time: 0.617 seconds front- and 
backend

mkiv lua stats  > driver time: 0.886 seconds
mkiv lua stats  > used backend: pdf (backend for directly generating pdf 
output)

mkiv lua stats  > jobdata time: 0.161 seconds saving, 0.052 seconds loading
mkiv lua stats  > callbacks: internal: 261417, file: 319, direct: 3, 
late: 31831, function 200128, total: 493698 (464 per page)

mkiv lua stats  > randomizer: resumed with value 0.47143577262518
mkiv lua stats  > positions: 9535 collected, 9535 regular, 0 special
mkiv lua stats  > v-node processing time: 0.401 seconds
mkiv lua stats  > result saved in file: plutarchusvitae.pdf, 
compresslevel 3, objectcompresslevel 1

mkiv lua stats  > loaded patterns: de::3 en::1 la::65, load time: 0.000
mkiv lua stats  > xml load time: 0.648 seconds, 4 files, 4 converted
mkiv lua stats  > lxml preparation time: 0.626 seconds, 233814 nodes, 
578788 lpath calls, 578743 cached calls

mkiv lua stats  > interactive elements: 0 references, 37 destinations
mkiv lua stats  > margin data: 10798 entries, 0 pending
mkiv lua stats  > loaded fonts: 9 files: garamondpremrpro.otf, 
sabonltstd-bold.otf, sabonltstd-italic.otf, sabonltstd-roman.otf, 
kadmosu.otf, oldstandard-bold.otf, oldstandard-italic.otf, 
xitsmath-regular.otf, dejavusansmono.ttf
mkiv lua stats  > font engine: otf 3.113, afm 1.513, tfm 1.000, 17 
instances, 6 shared in backend, 0 common vectors, 6 common hashes, load 
time 0.146 seconds
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree: 
texmf-linux-64
mkiv lua stats  > used engine: luatex version: 1.13, functionality 
level: 7420, banner: this is luatex, version 1.13.0 (tex live 2021)

mkiv lua stats  > used hash slots: 47131 of 65536 + 25
mkiv lua stats  > lua properties: engine: lua 5.3, used memory: 601 MB, 
ctx: 579 MB, max: unknown MB, hash chars: min(64,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 22.310 seconds, 1068 processed pages, 10

Re: [NTG-context] Issue running ConTeXt from TeX Live 2019 on Alpine Linux 3.12

2021-05-01 Thread Nicola
INPUTS = $TEXMFDOTDIR;$SELFAUTOLOC/lib/{$progname,$engine,}/lua//

% Architecture independent executables.
TEXMFSCRIPTS = $TEXMF/scripts/{$progname,$engine,}//

% Other languages.
JAVAINPUTS   = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/java//
PERLINPUTS   = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/perl//
PYTHONINPUTS = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/python//
RUBYINPUTS   = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/ruby//


%% The mktex* scripts rely on KPSE_DOT. Do not set it in the environment.
% KPSE_DOT = .

% This definition isn't used from this .cnf file itself (that would be
% paradoxical), but the compile-time default in paths.h is built from it.
% The SELFAUTO* variables are set automatically from the location of
% argv[0], in kpse_set_program_name.
% 
% This main texmf.cnf file is installed, for a release , in a
% directory such as /usr/local/texlive//texmf-dist/web2c/texmf.cnf.
% Since this file is subject to future updates, the TeX Live installer
% or human administrator may also create a file
% /usr/local/texlive//texmf.cnf; any settings in this latter file
% will take precedence over the distributed one.
% 
% For security reasons, it is best not to include . in this path.
%
% The idea behind this lengthy definition: for each of
% SELFAUTO{LOC,DIR,PARENT}, look in the directory,
% then the subdirectories share/texmf-local, share/texmf-dist, share/texmf,
% then the subdirectories ./texmf-local, texmf-dist, ./texmf.
% At any given installation, most of these directories will not exist,
% but they all turn out to be useful somewhere.
% 
% Special addition -- we want to include one more directory: the
% great-grandparent's texmf-local, because that is how TL is installed
% by default.  That is, given a binary
% /usr/local/texlive//bin/PLATFORM/kpsewhich, it should find
% /usr/local/texlive/texmf-local/web2c/texmf.cnf.  I.e., not under .
% 
% As a result, we cannot use actual brace expansion in the definition,
% since we don't want to scatter ../'s throughout the value.  Hence we
% explicitly list every directory.  Arguably more understandable anyway.
%
TEXMFCNF = {\
$SELFAUTOLOC,\
$SELFAUTOLOC/share/texmf-local/web2c,\
$SELFAUTOLOC/share/texmf-dist/web2c,\
$SELFAUTOLOC/share/texmf/web2c,\
$SELFAUTOLOC/texmf-local/web2c,\
$SELFAUTOLOC/texmf-dist/web2c,\
$SELFAUTOLOC/texmf/web2c,\
\
$SELFAUTODIR,\
$SELFAUTODIR/share/texmf-local/web2c,\
$SELFAUTODIR/share/texmf-dist/web2c,\
$SELFAUTODIR/share/texmf/web2c,\
$SELFAUTODIR/texmf-local/web2c,\
$SELFAUTODIR/texmf-dist/web2c,\
$SELFAUTODIR/texmf/web2c,\
\
$SELFAUTOGRANDPARENT/texmf-local/web2c,\
$SELFAUTOPARENT,\
\
$SELFAUTOPARENT/share/texmf-local/web2c,\
$SELFAUTOPARENT/share/texmf-dist/web2c,\
$SELFAUTOPARENT/share/texmf/web2c,\
$SELFAUTOPARENT/texmf-local/web2c,\
$SELFAUTOPARENT/texmf-dist/web2c,\
$SELFAUTOPARENT/texmf/web2c\
}
%
% For reference, here is the old brace-using definition:
%TEXMFCNF = 
{$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c}

% kpathsea 3.5.3 and later sets these at runtime. To avoid empty
% expansions from binaries linked against an earlier version of the
% library, we set $progname and $engine to something non-empty:
progname = unsetprogname
engine = unsetengine


% 
   Part 2: Options.

% If this option is set to true, `tex a.b' will look first for a.b.tex
% (within each path element), and then for a.b, i.e., we try standard
% extensions first.  If this is false, we first look for a.b and then
% a.b.tex, i.e., we try the name as-is first.
%
% Both names are always tried; the difference is the order in which they
% are tried.  The setting applies to all searches, not just .tex.
%
% This setting only affects names being looked up which *already* have
% an extension.  A name without an extension (e.g., `tex story') will
% always have an extension added first.
%
% The default is true, because we already avoid adding the standard
% extension(s) in the usual cases.  E.g., babel.sty will only look for
% babel.sty, not babel.sty.tex, regardless of this setting.
try_std_extension_first = t

% Enable system commands via \write18{...}.  When enabled fully (set to
% t), obviously insecure.  When enabled partially (set to p), only the
% commands listed in shell_escape_commands are allowed.  Although this
% is not fully secure either, it is much better, and so useful that we
% enable it for everything but bare tex.
shell_escape = p

% No spaces in this command list.
% 
% The programs listed here are as safe as any we know: they either do
% not write any output files, respect openout_any, or have hard-coded
% restrictions similar to or higher than openout_any=p.  They also have
% no features to invoke arbitrary other programs, and no known
% exploitable bugs.  All to the best of our knowledge.  They also have
% practical use for being called from TeX.
% 
shell_escape_commands = \
bibtex,bibtex8,\
extractbb,\
gregorio,\
kpsewhich,\
makeindex,\
repstopdf,\
r

Re: [NTG-context] register for biblical citations

2021-04-16 Thread jbf
Hans, thanks for your ingenious solution but there is still a way to go 
I suspect!


I implemented (copy-paste) precisely the solution offered and I get an 
index but with some strange results ! Notice that in my previous own 
solution (but only as far as 26 books!) I at least got an index in the 
order of the biblical books, but using the luacode you offered, I get a 
seemingly random result (see below).


I extended your example by a few books. so:

\startluacode
sorters.definitions["biblical"] = {
    method  = interfaces.variables.before,
    replacements = {
    { "Gen",  string.char(1) },
    { "Ex",   string.char(2) },
    { "Lev",  string.char(3) },
    { "Deut", string.char(4) },
    { "Lam",  string.char(5) },
    { "Dan",  string.char(6) },
    { "Joel",  string.char(7) },
    { "Ps",  string.char(8) },
    { "Prov",  string.char(9) },
    { "Sir",  string.char(10) },
    { "Mt",  string.char(11) },
    { "Mk",  string.char(12) },

    },
}
\stopluacode

But the result I get (just showing you a dozen or so, and you will see 
that Gen doesn't even turn up in this list ... it does, but much later!):


Mk 2:19-20 with parallels (PES) 146
Mt 3:8-10 (PES) 135
Prov 3:11-12 (PES) 139, 172
Sir 4:17-18 (PES) 139
Mt 5:5 (PES) 146
Mt 5:6 (MAC) 123
Mt 5:16 (MAC) 121
Mt 6:1-6, 16-18 (MAC) 121
Mt 6:1-6, 16-18 (PES) 145
Mt 7:13-14 (PES) 146
Sir 10:9 (PES) 142
Mt 11:12 (PRO) 160
Mt 12:34 (MAC) 124, 137
Mt 12:36 (PES) 134
Mk 12:41-44 (MAC) 122
Sir 17:27 (PES) 142

I have no idea why this is happening. I changed nothing of what you gave 
me and removed anything I had previously. If you need an example of how 
\bibcit is being used in the text, just in case it helps (but I doubt 
it), here is one:


The widow’s mite pleased God because of her good intention, rather than 
the heap of money that the pharisees, urged on by self-love, threw into 
the treasury box (cf.  \bibcit{Mk 12:41-44 (MAC)}Mk 12:41-44).


So, not sure where to go from here. Could I perhaps return to my earlier 
question, which indicated that by using the keyword approach [a] [b] and 
so on, as far as [z] I was at least getting a passable result, but how 
could I continue past [z]? Could I have used [1], [2] etc which would 
allows me to get as far as 66 (if I were to need every biblical book)?


Julian

On 16/4/21 5:24 pm, Hans Hagen wrote:


On 4/15/2021 11:28 AM, jbf wrote:

My simple MWE:

\defineregister[bibcit]
\setupregister[bibcit][%
indicator=no,
before=]

text... \bibcit[a]{Gen 3:6 (MAC) }Gen 3:6

(and so one for each Genesis reference, then moving on to Leviticus 
with [b] etc.)



In other words, I have used the key option [] using the alphabet to 
change the order, with Genesis as [a], Exodus [b], Leviticus [c], and 
so on.


Problem 1: there are 26 letters in the English alphabet. There are 
many more biblical books (OT and NT) than 26, so what do I do when I 
reach z?


Problem 2: the (MAC) would not normally be required in any biblical 
citation, but in my case it is, as well as (PER), (PRO) and several 
other references. In other words, these indicate where, in  a set of 
documents, the particular citations are to be found. But I think they 
may affect the order of citations, so, for example, I get the 
following results for the first four books of the Bible:


Gen 3:6 (MAC)    120
Gen 4:2-8 (MAC) 123
Gen 39:6-20 (MAG)     127
Gen 17:1 (PES)   137
Gen 18:27 (PES) 140
Gen 28:10-12 (PES)    141
Ex 20:12 (MAG)  129
Lev 6:5-6 (PES)   136
Deut 6:5 (PES)    145
Lam 3:27 (MAG)  129

Notice that Gen 39:6-20 is out of order in terms of chapters and 
verses. It should come after Gen 28:10-12 (PES) but I do not know how 
to control that order. It may be that (MAG), which comes after (MAC) 
in alphabetical terms, is controlling the order, rather than chapter 
and verse which I really want to control the order.


I realise this is complicated, but I'm sure ConTeXt is up to it. I've 
got the basics right for getting at least 26 books in some sort of 
order, but after that??

cheat (crossed fingers that you have enough entries) :

\startluacode
sorters.definitions["biblical"] = {
    method  = interfaces.variables.before,
    replacements = {
    { "Gen",  string.char(1) },
    { "Ex",   string.char(2) },
    { "Lev",  string.char(3) },
    { "Deut", string.char(4) },
    { "Lam",  string.char(5) },
    },
}
\stopluacode

\defineregister[bibcit] \setupregister[bibcit][language=biblical,before=]

\starttext

test ... \bibcit{Gen 3:6}
test ... \bibcit{Gen 4:2-8}
test ... \bibcit{Gen 39:6-20}
test ... \bibcit{Gen 17:1}
test ... \bibcit{Gen 18:27}
test ... \bibcit{Gen 28:10-12}
test ... \bibcit{Ex 20:12}
test .

Re: [NTG-context] register for biblical citations

2021-04-16 Thread Hans Hagen

On 4/15/2021 11:28 AM, jbf wrote:

My simple MWE:

\defineregister[bibcit]
\setupregister[bibcit][%
indicator=no,
before=]

text... \bibcit[a]{Gen 3:6 (MAC) }Gen 3:6

(and so one for each Genesis reference, then moving on to Leviticus with 
[b] etc.)



In other words, I have used the key option [] using the alphabet to 
change the order, with Genesis as [a], Exodus [b], Leviticus [c], and so 
on.


Problem 1: there are 26 letters in the English alphabet. There are many 
more biblical books (OT and NT) than 26, so what do I do when I reach z?


Problem 2: the (MAC) would not normally be required in any biblical 
citation, but in my case it is, as well as (PER), (PRO) and several 
other references. In other words, these indicate where, in  a set of 
documents, the particular citations are to be found. But I think they 
may affect the order of citations, so, for example, I get the following 
results for the first four books of the Bible:


Gen 3:6 (MAC)    120
Gen 4:2-8 (MAC) 123
Gen 39:6-20 (MAG)     127
Gen 17:1 (PES)   137
Gen 18:27 (PES) 140
Gen 28:10-12 (PES)    141
Ex 20:12 (MAG)  129
Lev 6:5-6 (PES)   136
Deut 6:5 (PES)    145
Lam 3:27 (MAG)  129

Notice that Gen 39:6-20 is out of order in terms of chapters and verses. 
It should come after Gen 28:10-12 (PES) but I do not know how to control 
that order. It may be that (MAG), which comes after (MAC) in 
alphabetical terms, is controlling the order, rather than chapter and 
verse which I really want to control the order.


I realise this is complicated, but I'm sure ConTeXt is up to it. I've 
got the basics right for getting at least 26 books in some sort of 
order, but after that??

cheat (crossed fingers that you have enough entries) :

\startluacode
sorters.definitions["biblical"] = {
method  = interfaces.variables.before,
replacements = {
{ "Gen",  string.char(1) },
{ "Ex",   string.char(2) },
{ "Lev",  string.char(3) },
{ "Deut", string.char(4) },
{ "Lam",  string.char(5) },
},
}
\stopluacode

\defineregister[bibcit] \setupregister[bibcit][language=biblical,before=]

\starttext

test ... \bibcit{Gen 3:6}
test ... \bibcit{Gen 4:2-8}
test ... \bibcit{Gen 39:6-20}
test ... \bibcit{Gen 17:1}
test ... \bibcit{Gen 18:27}
test ... \bibcit{Gen 28:10-12}
test ... \bibcit{Ex 20:12}
test ... \bibcit{Lev 6:5-6}
test ... \bibcit{Deut 6:5}
test ... \bibcit{Lam 3:27}

\blank[3*big] \placeregister[bibcit]

\stoptext

but is shows that it's not impossible to come up with a solution

-
  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] register for biblical citations

2021-04-15 Thread jbf

My simple MWE:

\defineregister[bibcit]
\setupregister[bibcit][%
indicator=no,
before=]

text... \bibcit[a]{Gen 3:6 (MAC) }Gen 3:6

(and so one for each Genesis reference, then moving on to Leviticus with 
[b] etc.)



In other words, I have used the key option [] using the alphabet to 
change the order, with Genesis as [a], Exodus [b], Leviticus [c], and so on.


Problem 1: there are 26 letters in the English alphabet. There are many 
more biblical books (OT and NT) than 26, so what do I do when I reach z?


Problem 2: the (MAC) would not normally be required in any biblical 
citation, but in my case it is, as well as (PER), (PRO) and several 
other references. In other words, these indicate where, in  a set of 
documents, the particular citations are to be found. But I think they 
may affect the order of citations, so, for example, I get the following 
results for the first four books of the Bible:


Gen 3:6 (MAC)    120
Gen 4:2-8 (MAC) 123
Gen 39:6-20 (MAG)     127
Gen 17:1 (PES)   137
Gen 18:27 (PES) 140
Gen 28:10-12 (PES)    141
Ex 20:12 (MAG)  129
Lev 6:5-6 (PES)   136
Deut 6:5 (PES)    145
Lam 3:27 (MAG)  129

Notice that Gen 39:6-20 is out of order in terms of chapters and verses. 
It should come after Gen 28:10-12 (PES) but I do not know how to control 
that order. It may be that (MAG), which comes after (MAC) in 
alphabetical terms, is controlling the order, rather than chapter and 
verse which I really want to control the order.


I realise this is complicated, but I'm sure ConTeXt is up to it. I've 
got the basics right for getting at least 26 books in some sort of 
order, but after that??


Julian

On 15/4/21 6:08 pm, Hans Hagen wrote:

On 4/14/2021 11:16 PM, jbf wrote:
I am wondering if anyone has had to set up a register (index) for 
biblical citations, where the order is not alphabetical but the order 
of the biblical books themselves, so, for example, citations from 
Genesis (e.g. Gen 1:1; Gen 6:4; Ex 15:2; Deut 12:8 etc. etc). I am 
not at all sure how to achieve this.

best make some MWE and explain what you expect


-
  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] Hyphenation patterns

2021-04-09 Thread Arthur Rosendahl
  Denis’ latest question reminded me of an earlier query he had about
hyphenation, asking why “applicable” and “obligated” were hyphenated by
ConTeXt as ap-plic-a-ble and ob-lig-at-ed, and not ap-pli-ca-ble and
ob-li-ga-te(d) like in Merriam-Webster (the discussion started at
https://mailman.ntg.nl/pipermail/ntg-context/2020/099695.html).

  First of all, I note that while Webster’s dictionary is a useful
guide, and indeed a major reference for any American typographer,
there’s no absolute rule that we have to follow it either.  The break
applic-able, for example, does look acceptable to me; oblig-ated, less
so.

  Taco reminded that when producing a set of hyphenation patterns from a
list of hyphenated words, we’re essentially compressing information, and
that some minor deviations are to be expected.  However, in my
experience, unexpected breakpoints are almost never due to chance, but
to a deliberate decision.

  Then Hraban said that:

On Fri, Oct 09, 2020 at 10:15:17AM +0200, Henning Hraban Ramm wrote:
> Usually Arthur’s (hail the emperor of hyphenation and protector of the 
> patterns) patterns are flawless, so I guess it’s not a bug but an exception 
> of the rules.

  I see that my self-appointed title is catching on, nice :-)
Unfortunately the patterns are just as likely to contain errors as
anything else, and in this particular case we’ll probably never know for
sure, because the original hyphenated word list was never published (all
the word lists from which patterns were produced in the 80s and 90s have
been lost, for all languages).  We’re thus reduced to guessing the
intent of those who compiled the lists.

  We can get hints from looking at the patterns involved in the
debatable breaks.  Hans has a useful script:

$ mtxrun --script patterns --language=us --left=2 --right=2 --hyphenate 
applicable
hyphenator  |
hyphenator  | . a p p l i c a b l e .   . a p p l i c a b l e .  
hyphenator  |4p1p0   0 4 1 0 0 0 0 0 0 0 0  
hyphenator  |  1p2l2 0 4 1 2 2 0 0 0 0 0 0  
hyphenator  |  0p0l0i2c1a0b0 0 4 1 2 2 2 1 0 0 0 0  
hyphenator  |1c0a0   0 4 1 2 2 2 1 0 0 0 0  
hyphenator  |0c0a1b0l0   0 4 1 2 2 2 1 1 0 0 0  
hyphenator  |0b2l2   0 4 1 2 2 2 1 1 2 2 0  
hyphenator  |0b4l0e0.0   0 4 1 2 2 2 1 1 4 2 0  
hyphenator  | .0a4p1p2l2i2c1a1b4l2e0.   . a p-p l i c-a-b l e .  
hyphenator  |
mtx-patterns| us 2 2 : applicable : ap-plic-a-ble

  That tells us that there are seven patterns involved in hyphenating
the word applicable: 4p1, 1p2l2, pli2c1ab, 1ca, ca1bl, b2l2, and b4le.
(the final dot is part of that last pattern).  The pattern responsible
for the break applic-able is pli2c1ab.  If we now refer to the source
repository for hyphenation patterns (since comments are stripped in the
ConTeXt sources): 
https://github.com/hyphenation/tex-hyphen/blob/master/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-en-us.tex
-- we can see line 4508

hyphen.tex patterns end here, and additional patterns begin:

which means that the pattern pli2c1ab, line 4817, is an “additional
pattern”.  The background story is that hyphen.tex, the original
hyphenation pattern file for American English, produced in 1982-1983
from a list of hyphenated words (following mostly Webster’s), was later
augmented with more patterns that were supposed to improve hyphenation
for many words.  The person who added these new patterns apparently had
a list of words hyphenated incorrectly (according to him) by hyphen.tex,
but both that list and the one used to produce hyphen.tex are as
mentioned above now lost, probably forever.

  In any case, the pattern that causes the break applic-able was clearly
added intentionally; and as I said that break seems quite reasonable to
me.  Not so for the one in oblig-ated, so let’s have a look at that:

$ mtxrun --script patterns --language=us --left=2 --right=2 --hyphenate 
obligated
hyphenator  |
hyphenator  | . o b l i g a t e d .   . o b l i g a t e d .  
hyphenator  |  0o0b0l0i2g1 0 0 0 0 2 1 0 0 0 0  
hyphenator  |0b2l2 0 0 2 2 2 1 0 0 0 0  
hyphenator  |  5l0i0g0a0t0e0   0 0 5 2 2 1 0 0 0 0  
hyphenator  |2i0g0 0 0 5 2 2 1 0 0 0 0  
hyphenator  |  1g0a0   0 0 5 2 2 1 0 0 0 0  
hyphenator  |  2t1e0d0 0 0 5 2 2 1 2 1 0 0  
hyphenator  | .0o0b5l2i2g1a2t1e0d0.   . o b-l i g-a t-e d .  
hyphenator  |
mtx-patterns| us 2 2 : obligated : ob-lig-at-ed

  Here we see that the dubious break is caused by the pattern obli2g1,
also an “additional pattern” (line 4783), and here it’s not hard to
gu

Re: [NTG-context] Formulanumbers in margin

2021-03-23 Thread Adam Reviczky
Hi,

So the numbercommand does work after all, I just needed to keep something
in the "formulanumber" part of the textline, otherwise it wouldn't get
drawn.

Not sure how nice this looks, but it does work like this now:

\starttext
\showframe
\setupformulas[numbercommand=\nbsp\inrightmargin]
\startplaceformula \startformula c^2 = a^2 + b^2
\stopformula \stopplaceformula
\stoptext

Adam

On Sun, Mar 21, 2021 at 8:41 PM Adam Reviczky  wrote:

> Thanks Hraban,
>
> That should be fine, I've tried to increase the margins as well, but not
> sure that's the issue as I can perfectly place text with \inmargin
> directly, just not with the numbercommand.
>
> MWE:
>
> \starttext
> \setuplayout[margin=2cm, leftmargin=2cm, rightmargin=2cm]
>
> \showframe
> \showlayout
>
> \setupcaption[figure][location={rightmargin}]
> \startplacefigure[title=Cow] \externalfigure[cow] \stopplacefigure
>
> \define[1]\MyFormulaNumber{\inleftmargin{#1}}
> \setupformula[numbercommand=\MyFormulaNumber]
>
> \inleftmargin{Left Margin Text}
> \inrightmargin{Right Margin Text}
>
> \startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2
> \stopformula \stopplaceformula
> \stoptext
>
> Adam
>
> On Sun, Mar 21, 2021 at 8:31 PM Henning Hraban Ramm 
> wrote:
>
>>
>> > Am 21.03.2021 um 20:56 schrieb Adam Reviczky :
>> >
>> > Thanks Hraban,
>> >
>> > I've tried the numbercommand as well, but that also just makes the
>> formula number disappear, unless I am doing something wrong.
>> >
>> > The framing as per the math manual (manuals/math/math-framing.tex)
>> however does work, so not sure:
>> > \setupformula[numbercommand={\inframed[framecolor=green]}]
>>
>> Are your margins actually non-zero? (\setuplayout)
>> Maybe check with \showlayout
>>
>> 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] Formulanumbers in margin

2021-03-21 Thread Adam Reviczky
Thanks Hraban,

That should be fine, I've tried to increase the margins as well, but not
sure that's the issue as I can perfectly place text with \inmargin
directly, just not with the numbercommand.

MWE:

\starttext
\setuplayout[margin=2cm, leftmargin=2cm, rightmargin=2cm]

\showframe
\showlayout

\setupcaption[figure][location={rightmargin}]
\startplacefigure[title=Cow] \externalfigure[cow] \stopplacefigure

\define[1]\MyFormulaNumber{\inleftmargin{#1}}
\setupformula[numbercommand=\MyFormulaNumber]

\inleftmargin{Left Margin Text}
\inrightmargin{Right Margin Text}

\startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2
\stopformula \stopplaceformula
\stoptext

Adam

On Sun, Mar 21, 2021 at 8:31 PM Henning Hraban Ramm  wrote:

>
> > Am 21.03.2021 um 20:56 schrieb Adam Reviczky :
> >
> > Thanks Hraban,
> >
> > I've tried the numbercommand as well, but that also just makes the
> formula number disappear, unless I am doing something wrong.
> >
> > The framing as per the math manual (manuals/math/math-framing.tex)
> however does work, so not sure:
> > \setupformula[numbercommand={\inframed[framecolor=green]}]
>
> Are your margins actually non-zero? (\setuplayout)
> Maybe check with \showlayout
>
> 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] Formulanumbers in margin

2021-03-21 Thread Adam Reviczky
Hi,

One more question on formulas. How can I get the formula number to be put
into the left/right margin instead of left/right inside the text?

I have tried the following:

\starttext
\showframe
% figure caption into the margin
\setupcaption[figure][location={rightmargin}]
\startplacefigure[title=Cow] \externalfigure[cow] \stopplacefigure

% this makes the formulanumber disappear
% \setupformulas[location={rightmargin}]
\startplaceformula[reference=eq1,location={rightmargin}] \startformula c^2
= a^2 + b^2 \stopformula \stopplaceformula
\stoptext

But the setupformulas will make the number disappear entirely, and the
placeformula location doesn't seem to take the margin option.

Thanks,
Adam
___
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] Formula numbering including all prefix segments

2021-03-21 Thread Adam Reviczky
Hi Hans,

That does it indeed, thank you!

Together with prefixconversion I mainly wanted to use this for formulas in
the appendix with the added prefix.

I'll add it to the wiki, as it is a very helpful information.

Adam

On Sun, Mar 21, 2021 at 12:55 PM Hans Hagen  wrote:

> On 3/20/2021 11:45 PM, Adam Reviczky wrote:
> > Hi,
> >
> > Is there a way to have formula numbers showing all prefix segments?
> > When I use prefixsegments, I get the desired numbering in the placelist
> > but not in the formula number itself.
> >
> > For example:
> > \starttext
> > \setupcaption[figure][way=bytext,prefixsegments=1:*]
> > \setupformulas[way=bytext,prefixsegments=1:*]
> > \startsection[title=Section]
> > \startsubsection[title=SubSection]
> > \startplacefigure[list=cow] \externalfigure[cow] \stopplacefigure
> > \startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2
> > \stopformula \stopplaceformula
> > \stopsubsection
> > \stopsection
> > \placelistoffigures[criterium=all]
> > \placelist[formula][criterium=all]
> > \stoptext
> >
> > The figure has number 1.1.1 and is in the list as 1.1.1, the formula has
> > number 1.1 but is listed as 1.1.1.
> > I would like to have the formula numbered 1.1.1 as well (as referenced
> > in the placelist), so with section and subsection numbering.
> you need to add: prefixset=all (default is limited to 3, see strc-def)
>
> \starttext
>  \setupcounter[formula][way=bytext]
>  \setupcaption[figure][way=bytext,prefixsegments=1:*]
>  \setupformulas[way=bytext,prefixsegments=1:*,prefixset=all]
>
>  \startchapter[title=Chapter]
>  \dorecurse{4}{
>  \startsection[title=Section]
>  \startsubsection[title=SubSection]
>  \startplacefigure[list=cow] \externalfigure[cow]
> \stopplacefigure
>  \startplaceformula[reference=eq1] \startformula c^2
> = a^2 + b^2 \stopformula \stopplaceformula
>  \stopsubsection
>  \startsubsection[title=SubSection]
>  \startplacefigure[list=cow] \externalfigure[cow]
> \stopplacefigure
>  \startplaceformula[reference=eq1] \startformula c^2
> = a^2 + b^2 \stopformula \stopplaceformula
>  \stopsubsection
>  \stopsection
>  }
>  \stopchapter
>
>  \placelistoffigures[criterium=all]
>  \placelist[formula][criterium=all]
> \stoptext
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 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] Formula numbering including all prefix segments

2021-03-21 Thread Hans Hagen

On 3/20/2021 11:45 PM, Adam Reviczky wrote:

Hi,

Is there a way to have formula numbers showing all prefix segments?
When I use prefixsegments, I get the desired numbering in the placelist 
but not in the formula number itself.


For example:
\starttext
\setupcaption[figure][way=bytext,prefixsegments=1:*]
\setupformulas[way=bytext,prefixsegments=1:*]
\startsection[title=Section]
\startsubsection[title=SubSection]
\startplacefigure[list=cow] \externalfigure[cow] \stopplacefigure
\startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2 
\stopformula \stopplaceformula

\stopsubsection
\stopsection
\placelistoffigures[criterium=all]
\placelist[formula][criterium=all]
\stoptext

The figure has number 1.1.1 and is in the list as 1.1.1, the formula has 
number 1.1 but is listed as 1.1.1.
I would like to have the formula numbered 1.1.1 as well (as referenced 
in the placelist), so with section and subsection numbering.

you need to add: prefixset=all (default is limited to 3, see strc-def)

\starttext
\setupcounter[formula][way=bytext]
\setupcaption[figure][way=bytext,prefixsegments=1:*]
\setupformulas[way=bytext,prefixsegments=1:*,prefixset=all]

\startchapter[title=Chapter]
\dorecurse{4}{
\startsection[title=Section]
\startsubsection[title=SubSection]
\startplacefigure[list=cow] \externalfigure[cow] 
\stopplacefigure
\startplaceformula[reference=eq1] \startformula c^2 
= a^2 + b^2 \stopformula \stopplaceformula

\stopsubsection
\startsubsection[title=SubSection]
\startplacefigure[list=cow] \externalfigure[cow] 
\stopplacefigure
\startplaceformula[reference=eq1] \startformula c^2 
= a^2 + b^2 \stopformula \stopplaceformula

\stopsubsection
\stopsection
}
\stopchapter

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

maillist : ntg-context@ntg.nl / 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] Formula numbering including all prefix segments

2021-03-20 Thread Adam Reviczky
Hi,

Is there a way to have formula numbers showing all prefix segments?
When I use prefixsegments, I get the desired numbering in the placelist but
not in the formula number itself.

For example:
\starttext
\setupcaption[figure][way=bytext,prefixsegments=1:*]
\setupformulas[way=bytext,prefixsegments=1:*]
\startsection[title=Section]
\startsubsection[title=SubSection]
\startplacefigure[list=cow] \externalfigure[cow] \stopplacefigure
\startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2
\stopformula \stopplaceformula
\stopsubsection
\stopsection
\placelistoffigures[criterium=all]
\placelist[formula][criterium=all]
\stoptext

The figure has number 1.1.1 and is in the list as 1.1.1, the formula has
number 1.1 but is listed as 1.1.1.
I would like to have the formula numbered 1.1.1 as well (as referenced in
the placelist), so with section and subsection numbering.

Adam
___
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] (no subject)

2021-03-20 Thread Adam Reviczky
Hi,

Is there a way to have formula numbers showing all prefix segments?
When I use prefixsegments, I get the desired numbering in the placelist but
not in the formula number itself.

For example:
\starttext
\setupcaption[figure][way=bytext,prefixsegments=1:*]
\setupformulas[way=bytext,prefixsegments=1:*]
\startsection[title=Section]
\startsubsection[title=SubSection]
\startplacefigure[list=cow] \externalfigure[cow] \stopplacefigure
\startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2
\stopformula \stopplaceformula
\stopsubsection
\stopsection
\placelistoffigures[criterium=all]
\placelist[formula][criterium=all]
\stoptext

The figure has number 1.1.1 and is in the list as 1.1.1, the formula has
number 1.1 but is listed as 1.1.1.
I would like to have the formula numbered 1.1.1 as well (as referenced in
the placelist), so with section and subsection numbering.

Adam
___
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] placenamedformula in placelist (MKII vs MKIV/LMTX)

2021-03-17 Thread Adam Reviczky
Hi,

Or would it be possible to just add a "list=" option to placeformula
similar to placefigure? (although that might conflict with the combination
of "title=")

All I am really after is to label or name numbered formulas in the
placelist.

---
\starttext

% 1   This is a picture of a cow  . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .  1
\startplacefigure[title={My cow},list={This is a picture of a cow}]
\externalfigure[cow] \stopplacefigure

% Mass-energy equivalence . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . 1
\startplaceformula[reference=eq:one,title={Mass-energy equivalence}]
\startformula e=mc^2 \stopformula \stopplaceformula

% 1   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .  1
% list option could give: 1   Mass-energy equivalence . . . . . . . . . . .
. . . . . . . . . . . .  1
\startplaceformula[reference=eq:one,list={Mass-energy equivalence}]
\startformula e=mc^2 \stopformula \stopplaceformula

\placelistoffigures[criterium=all,alternative=c]
\placelist[formula][criterium=all,alternative=c]

\stoptext
--

Adam

On Tue, Mar 16, 2021 at 5:28 AM Adam Reviczky  wrote:

> Hi,
>
> I want to use placenamedformula to list a formula in the placelist with
> both the formula name and the formula number (alongside the pagenumber).
>
> The example in the wiki (https://wiki.contextgarden.net/Math/Display) and
> the test suite (cont-tst/doc/context/tests/mkiv/math/formulas-003.tex)
> shows what I would like to have.
>
> Using MKII I get the desired output (1 formulaname ... and 3b formulaname
> ...) but with MKIV and LMTX I only get the reference from the placeformula
> (as 1 and correctly not listed in the placelist) and none of the
> placenamedformula numbers. The placeformula number is then carried onto the
> second placenamedformula as 1 (resulting in formulaname ... and 1
> formulaname ...).
>
> I have attached the test suite file output with both MKII and MKIV.
>
> Is there a way to get the MKII output with MKIV/LMTX somehow?
>
> Adam
>
___
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] placenamedformula in placelist (MKII vs MKIV/LMTX)

2021-03-15 Thread Adam Reviczky
Hi,

I want to use placenamedformula to list a formula in the placelist with
both the formula name and the formula number (alongside the pagenumber).

The example in the wiki (https://wiki.contextgarden.net/Math/Display) and
the test suite (cont-tst/doc/context/tests/mkiv/math/formulas-003.tex)
shows what I would like to have.

Using MKII I get the desired output (1 formulaname ... and 3b formulaname
...) but with MKIV and LMTX I only get the reference from the placeformula
(as 1 and correctly not listed in the placelist) and none of the
placenamedformula numbers. The placeformula number is then carried onto the
second placenamedformula as 1 (resulting in formulaname ... and 1
formulaname ...).

I have attached the test suite file output with both MKII and MKIV.

Is there a way to get the MKII output with MKIV/LMTX somehow?

Adam


formulas-003-mkii.pdf
Description: Adobe PDF document


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

maillist : ntg-context@ntg.nl / 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] Multiple Layouts

2021-03-13 Thread Jeroen
I have the following document, but I want a different
\setuplayout[backspace] for the titlepage and copyright space. What is
the best way to achieve this?





\setupcolors
  [state=start]

\usecolors
  [xwi]

\usetypescriptfile
  [euler]

\definetypeface
  [mainface][rm][serif][pagella][default]

\definetypeface
  [mainface][tt][mono][dejavu][default]

\definetypeface
  [mainface][mm][math][pagellaovereuler][default]

\setupbodyfont
  [mainface,11.5pt]

\setuppapersize
  [A4,
   portrait]

\setuplayout
  [backspace=19mm,
   width=176mm,
   topspace=7mm,
   header=10mm,
   headerdistance=3mm,
   height=middle,
   footerdistance=5mm,
   footer=9mm,
   bottomspace=11mm]

\setuphead
  [chapter]
  [style={\bfb},
   before={\vskip 0mm},
   after={\vskip-\parskip}]

\setuphead
[section]
[style=bold,
   before={\vskip 6mm},
   after={\vskip 2mm}]

\setuppagenumbering
  [alternative=doublesided]

\setupheadertexts
  []

\setupfooter
  [style=\it]

\setupfootertexts
  [{Footer Title} \hfill \pagenumber]

\definemakeup
  [titlepage]
  [align=left]

\definemakeup
  [copyrightpage]

\setupmakeup
  [copyrightpage]
  [align={right,bottom},
   top=\vfill,
   pagestate=stop,
   style=smallbodyfont]

\definealternativestyle
  [authorstyle]
  [\rm\tfb]
  []

\definealternativestyle
  [titlestyle]
  [{\rm\bfd\color[red]}]
  []

\definealternativestyle
  [subtitlestyle]
  [\rm\tfb]
  []

\definealternativestyle
  [publisherstyle]
  [\rm\bfb]
  []


\starttext

\startmakeup[titlepage]
\authorstyle{The Author}
\blank[13*big]
\titlestyle{Title 1}
\blank[5*small]
\titlestyle{Title 2}
\blank[2*big]
\subtitlestyle{Subtitle}
\blank[47*big]
\publisherstyle{Publisher}
\stopmakeup

\startmakeup[copyrightpage]
Title \crlf
Subtitle
\blank
Geprint in Country. \crlf
Document Reference ABC-ABC-001. \crlf
Eerste draft versie, gepubliceerd op \date. \crlf
Dit document is getypset met \CONTEXT\ LMTX op Microsoft Windows 10.
\blank
\startalignment[flushmiddle]
Copyright \copyright\ 2021, Publisher. Alle rechten voorbehouden. \crlf
Niets uit deze uitgave mag worden verveelvoudigd, opgeslagen in een
geautomatiseerd gegevensbestand en/of openbaar gemaakt in enige vorm of op
enige wijze, hetzij elektronisch, mechanisch, door fotokopieën, opnamen of
op enige andere manier zonder voorafgaande schriftelijk bevestigde
toestemming van Publisher.
\stopalignment
\stopmakeup

\startcolumns[2]

\startchapter[title={Bryson and Tufte}]

\dorecurse{5}{
  \startsection[title={Bryson}] \input{bryson} \stopsection
  \startsection[title={Tufte}] \input{tufte} \stopsection}

\stopchapter

\startchapter[title={Zapf and Ward}]

\dorecurse{5}{
  \startsection[title={Zapf}] \input{zapf} \stopsection
  \startsection[title={Ward}] \input{ward} \stopsection}

\stopchapter

\stopcolumns

\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] (no subject)

2021-03-13 Thread Jeroen
I have the following document, but I want a different
\setuplayout[backspace] for the titlepage and copyright space. What is
the best way to achieve this?





\setupcolors
  [state=start]

\usecolors
  [xwi]

\usetypescriptfile
  [euler]

\definetypeface
  [mainface][rm][serif][pagella][default]

\definetypeface
  [mainface][tt][mono][dejavu][default]

\definetypeface
  [mainface][mm][math][pagellaovereuler][default]

\setupbodyfont
  [mainface,11.5pt]

\setuppapersize
  [A4,
   portrait]

\setuplayout
  [backspace=19mm,
   width=176mm,
   topspace=7mm,
   header=10mm,
   headerdistance=3mm,
   height=middle,
   footerdistance=5mm,
   footer=9mm,
   bottomspace=11mm]

\setuphead
  [chapter]
  [style={\bfb},
   before={\vskip 0mm},
   after={\vskip-\parskip}]

\setuphead
[section]
[style=bold,
   before={\vskip 6mm},
   after={\vskip 2mm}]

\setuppagenumbering
  [alternative=doublesided]

\setupheadertexts
  []

\setupfooter
  [style=\it]

\setupfootertexts
  [{Footer Title} \hfill \pagenumber]

\definemakeup
  [titlepage]
  [align=left]

\definemakeup
  [copyrightpage]

\setupmakeup
  [copyrightpage]
  [align={right,bottom},
   top=\vfill,
   pagestate=stop,
   style=smallbodyfont]

\definealternativestyle
  [authorstyle]
  [\rm\tfb]
  []

\definealternativestyle
  [titlestyle]
  [{\rm\bfd\color[red]}]
  []

\definealternativestyle
  [subtitlestyle]
  [\rm\tfb]
  []

\definealternativestyle
  [publisherstyle]
  [\rm\bfb]
  []


\starttext

\startmakeup[titlepage]
\authorstyle{The Author}
\blank[13*big]
\titlestyle{Title 1}
\blank[5*small]
\titlestyle{Title 2}
\blank[2*big]
\subtitlestyle{Subtitle}
\blank[47*big]
\publisherstyle{Publisher}
\stopmakeup

\startmakeup[copyrightpage]
Title \crlf
Subtitle
\blank
Geprint in Country. \crlf
Document Reference ABC-ABC-001. \crlf
Eerste draft versie, gepubliceerd op \date. \crlf
Dit document is getypset met \CONTEXT\ LMTX op Microsoft Windows 10.
\blank
\startalignment[flushmiddle]
Copyright \copyright\ 2021, Publisher. Alle rechten voorbehouden. \crlf
Niets uit deze uitgave mag worden verveelvoudigd, opgeslagen in een
geautomatiseerd gegevensbestand en/of openbaar gemaakt in enige vorm of op
enige wijze, hetzij elektronisch, mechanisch, door fotokopieën, opnamen of
op enige andere manier zonder voorafgaande schriftelijk bevestigde
toestemming van Publisher.
\stopalignment
\stopmakeup

\startcolumns[2]

\startchapter[title={Bryson and Tufte}]

\dorecurse{5}{
  \startsection[title={Bryson}] \input{bryson} \stopsection
  \startsection[title={Tufte}] \input{tufte} \stopsection}

\stopchapter

\startchapter[title={Zapf and Ward}]

\dorecurse{5}{
  \startsection[title={Zapf}] \input{zapf} \stopsection
  \startsection[title={Ward}] \input{ward} \stopsection}

\stopchapter

\stopcolumns

\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] Write to tuc file

2021-03-07 Thread Pablo Rodriguez
On 3/6/21 2:35 PM, Hans Hagen wrote:
> On 3/6/2021 1:56 PM, Pablo Rodriguez wrote:
>> [...]
>> The select style could generate from start-identifier and
>> stop-identifier, the result "identifier.pdf".
> \startchapter[reference=whatever,title=foo]
> \stopchapter
> \startchapter[reference=moreover,title=oof]
> \stopchapter
>
> and --pages=whatever,moreover will give you the info you need to call
> context --extra=copy or whatever with the right arguments

Hans,

real-world needs may be complex, such as in the following sample:

 \starttext
  \completecontent
  \dorecurse{3}
   {\startpart
\edef\pn{\recurselevel}
\dorecurse{30}
 {\startchapter\markpage[start-\pn.\recurselevel]
  \dorecurse{\randomnumber{0}{30}}
{\input knuth\par}
 \markpage[stop-\pn.\recurselevel]\stopchapter}
\stoppart}
  \stoptext

This generates a document to be split in 90 individual documents. I
cannot even think in specifying them manually.

It would be very useful to have something similar to:

  context --extra=select --selection=pages oeps --once --autopdf

I hope my explanation is clearer now.

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
___


Re: [NTG-context] Write to tuc file

2021-03-06 Thread Hans Hagen

On 3/6/2021 1:56 PM, Pablo Rodriguez wrote:

On 3/5/21 11:13 PM, Hans Hagen wrote:

On 3/5/2021 10:38 PM, denis.ma...@ub.unibe.ch wrote:

Thanks for this as well, Hans. Looks promising.
So, this is to select pages or page-ranges for processing?

assuming that you have either marked pages or proper refs for chapters
you can use the reported values and feed them into whatever

i could add something to the select style but i guess then there is no
uniformity in how users do this


Many thanks for the new stuff, Hans.

This could be an approach:

   \starttext
   \completecontent
   \dorecurse{10}
   {\startchapter\markpage[start-\recurselevel]
  \dorecurse{\randomnumber{0}{1000}}
{\input knuth\par}
\markpage[stop-\recurselevel]\stopchapter}
   \stoptext

"start-" and "stop-" could define page ranges when the same identifier
is used.

The select style could generate from start-identifier and
stop-identifier, the result "identifier.pdf".

\startchapter[reference=whatever,title=foo]
\stopchapter
\startchapter[reference=moreover,title=oof]
\stopchapter

and --pages=whatever,moreover will give you the info you need to call 
context --extra=copy or whatever with the right arguments


-
  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] Write to tuc file

2021-03-05 Thread denis.maier
Thanks for this as well, Hans. Looks promising.
So, this is to select pages or page-ranges for processing?

> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Freitag, 5. März 2021 11:29
> An: Maier, Denis Christian (UB) ; ntg-
> cont...@ntg.nl
> Betreff: Re: AW: [NTG-context] Write to tuc file
> 
> On 2/27/2021 6:28 PM, denis.ma...@ub.unibe.ch wrote:
> > It's a book that will be published in two volumes, continually paginated.
> > In the end I need two pdf files, but I thought it might be easier to treat
> them as one volume and just split the files with some external tool
> afterwards.
> >
> > I could also treat them as two individual books, but then I'd have to get 
> > the
> last page number of volume 1 in volume 2.
> In the early days of context (more than 2 decades ago) we had a printer
> where we could inject from different trays and that is why we have a feature
> in context to mark pages (so that directives for printers could be inserted).
> This feature survived / evolved into marked pages.
> 
> You can do this (oeps.tex):
> 
> \starttext
> 
> \chapter[one]{One}
> 
> \markpage[first]  test \page test \page
> \markpage[second] test \page
> 
> \chapter[two]{Two}
> 
> test \page
> \markpage[fourth] test
> 
> \page
> 
> % \doifelsemarkedpage{second}{YES}{NO}
> % \doifelsemarkedpage{fourth}{YES}{NO}
> 
> % \page
> 
> % \doifelsemarkedpage{second}{YES}{NO}
> % \doifelsemarkedpage{fourth}{YES}{NO}
> 
> \stoptext
> 
> So, I was wondering if we can expose that differently.
> 
>  >context --pages oeps
> mtx-context | page : 0001 first
> mtx-context | page : 0003 second
> mtx-context | page : 0005 fourth
> 
>  >context --pages --page=second oeps
> mtx-context | page : 0003 second
> 
>  >context --pages --page=second,fourth oeps
> mtx-context | page : 0003 second
> mtx-context | page : 0005 fourth
> 
> But, as you're talking chapters, a variants (with less overhead) is:
> 
>  >context --pages --list=one,two oeps
> mtx-context | list : 0001 one
> mtx-context | list : 0004 two
> 
> Which of course assumes that you have a reference for the chapters.
> 
> This --pages feature is in the latest upload.
> 
> 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] tex live code freeze

2021-03-05 Thread Hans Hagen

Hi,

The 2021 texlive code is currently being frozen. This means that Mojca 
will check-in the current context release right before tl gets deep frozen.


The MKII code (mkii and mpii files) hasn't changed so it should still 
work well with pdftex and xetex although I admit that I haven't checked 
to what extend updates to those engines have side effects for context, 
but I assume none. Let me know if there are problems.


The MKIV code (mkiv, mkvi, mpiv, lua files) has changed but not much, 
mostly as a side effect of the code split and move to LMTX where the 
focus is on now. There have been recent changes in the metafun code, but 
new functionality is LMTX only, simply because we use an extended 
library (more features). Of course there have been some bug fixes to 
MKIV and if you think more (bugs) should be fixed let us know.


The yearly texlive release is also the 'official' yearly current release 
but of course after that there will be updates when needed. In these 
updates we don't distinguish between betas and currents: we dropped that 
some time ago because it was only confusing.


Last/this year much of LMTX (mkxl, mpxl, lmt files) already got split 
and I expect that this year all the lua and mp files also will be 
independent so that at some point we have a more or less frozen MKIV 
that uses luatex (which doesn't change fundamentally apart from fixes so 
we don't need to adapt code to it i.e. MKIV should keep working just 
like MKII does with pdftex; updates to for instance fonts and languages 
will be applied).


I get the impression that most users already moved to LMTX which helped 
getting it in the state it is now (thanks for all the testing). Although 
MKII/MKIV serves a reference for functionality, new stuff got and gets 
added to LMTX. I could backport some but it probably makes no sense 
(some is probably easy). There is of course untested code like the 
overload protection mechasnisms but I have that enabled on my machine 
(users can do that too) so I can notice side effects.


The new engine (luametatex) doesn't change much. Recent changes are 
mostly cosmetic and I don't expect many more fundamental additions, but 
who knows ... (not all in there is yet used extensively) and maybe 
context users have interesting demands that trigger extra stuff (read: 
challenges me).


So apart from new trickery at the tex macro end, we also reach a more 
stable state in LMTX. Soon I'll pick up some todo's. Some users want 
parallel stuff (keeps coming up), I also want to see how we can do more 
metafun - let me know what is missing as I'm currently in metafun mode - 
and go over some older lua code that started as experiment but hasn't 
been checked recently. I also want to cleanup the export code a bit but 
it's kind of boring to do and maybe we should ditch some pdf backend 
functionilty that adobe dropped from its viewers. And there are always 
manuals to complete / update ... Anyway, the current LMTX release is 
also a kind of yearly snapshot.


So, if there is some last minute stuff that needs to be done to context 
MKII and MKIV before the tl code freeze, let us know.


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] reference chapters from another doc in this doc's toc

2021-03-05 Thread denis.maier
Hi,
is it possible to include structure elements from other documents in a toc? 
E.g. when your having a multivolume book where each book is an individual book, 
but you want to have a TOC that covers all volumes?
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] Write to tuc file

2021-03-05 Thread Hans Hagen

On 2/27/2021 6:28 PM, denis.ma...@ub.unibe.ch wrote:

It's a book that will be published in two volumes, continually paginated.
In the end I need two pdf files, but I thought it might be easier to treat them 
as one volume and just split the files with some external tool afterwards.

I could also treat them as two individual books, but then I'd have to get the 
last page number of volume 1 in volume 2.
In the early days of context (more than 2 decades ago) we had a printer 
where we could inject from different trays and that is why we have a 
feature in context to mark pages (so that directives for printers could 
be inserted). This feature survived / evolved into marked pages.


You can do this (oeps.tex):

\starttext

\chapter[one]{One}

\markpage[first]  test \page test \page
\markpage[second] test \page

\chapter[two]{Two}

test \page
\markpage[fourth] test

\page

% \doifelsemarkedpage{second}{YES}{NO}
% \doifelsemarkedpage{fourth}{YES}{NO}

% \page

% \doifelsemarkedpage{second}{YES}{NO}
% \doifelsemarkedpage{fourth}{YES}{NO}

\stoptext

So, I was wondering if we can expose that differently.

>context --pages oeps
mtx-context | page : 0001 first
mtx-context | page : 0003 second
mtx-context | page : 0005 fourth

>context --pages --page=second oeps
mtx-context | page : 0003 second

>context --pages --page=second,fourth oeps
mtx-context | page : 0003 second
mtx-context | page : 0005 fourth

But, as you're talking chapters, a variants (with less overhead) is:

>context --pages --list=one,two oeps
mtx-context | list : 0001 one
mtx-context | list : 0004 two

Which of course assumes that you have a reference for the chapters.

This --pages feature is in the latest upload.

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] Fwd: Re: LMTX 2021.03.02 | cross reference to an external file | \pagereference

2021-03-04 Thread Richard Mahoney
Wolfgang [and Hans ],

I'm attaching a minimal(ish) example of a project structure with
a call to \pagereference. One can see from the output of master000.tex
that the cross references to an external file all work, *apart* from
the call to \pagereference. (This is the same issue that I am having
with
my two volume proceedings.)

I'd be grateful for suggestions.


Best, Richard


% testproject.tex -- LMTX 2021.03.02

\startproject testproject

\product testproduct000

\product testproduct001

\stopproject



% master000.tex -- LMTX 2021.03.02

\startproduct testproduct000

\project testproject

\startbodymatter

\component boo.tex

\stopbodymatter

\stopproduct


% master001.tex -- LMTX 2021.03.02

\startproduct testproduct001

\project testproject

\startbodymatter

\component foo.tex

\stopbodymatter

\stopproduct



% boo.tex -- LMTX 2021.03.02

\startcomponent boo

\project testproject

\product testproduct000

\useexternaldocument[m001][master001][Test Product, Vol.~{\sc ii}]

\chapter[oeps]{oeps}

test \from[m001], \in{Ch.~}[m001::one], \at{page}[m001::one] {[}test
page one{]}

test \from[m001], \in{Ch.~}[m001::one], \at{page}[m001::page-
reference] {[}test {\bf pagereference}{]}

test \from[m001], \in{Ch.~}[m001::two], \at{page}[m001::two] {[}test
page two{]}

\stopcomponent




% foo.tex -- LMTX 2021.03.02

\startcomponent foo

\project testproject

\product testproduct001

\chapter[one]{one}

\pagereference[page-reference]foo

\chapter[two]{two}

foo

\stopcomponent







 Forwarded Message 
From: Richard Mahoney 
Reply-To: Richard Mahoney , mailing
list for ConTeXt users 
To: ntg-context@ntg.nl
Subject: Re: [NTG-context] LMTX 2021.03.02 | cross reference to an
external file | \pagereference
Date: Fri, 05 Mar 2021 12:02:54 +1300
Mailer: Evolution 3.36.5 
Organization: Indica et Buddhica
X-Spam-Score: 0.0

Thanks Wolfgang,

Hans kindly sent me a simple minimal. I've adjusted it to include a
call
to \pagereference and it works. I'm currently trying to test my
project
to see why my own calls to \pagereference do not result in any output,
despite the fact that all the calls to the reference ids in chapters
work
as expected. I'm imagining at this point that it has something to do
with
using two master files --one for each volume-- with multiple includes
(\components) for each chapter  -- the \pagereference code appears
in a number of the components.

I'll try to set up a simple example replicating the file structure I'm
using
and then send it through.


Best, Richard



-- 
T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
IM https://t.me/rmahoney  W https://indica-et-buddhica.org/


Indica et Buddhica  Littledene  Bay Road  Oxford  NZ

-Original Message-
From: Wolfgang Schuster 
Reply-To: mailing list for ConTeXt users 
To: mailing list for ConTeXt users 
Subject: Re: [NTG-context] LMTX 2021.03.02 | cross reference to an
external file | \pagereference
Date: Thu, 4 Mar 2021 22:35:46 +0100
Mailer: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
 PostboxApp/7.0.47
X-Spam-Score: 0.0



Richard Mahoney schrieb am 04.03.2021 
um 09:04:

>   
>   Readers,
>   
> 
>   I'm working on a couple of volumes of papers set up and generated
>   separately (though within the same project). Some of the papers 
> in
>   the second volume make cross references to papers in the first.
>   Now this is working well so long as the reference is to the 
> details
>   associated with, say, a chapter, using \about, \in, and \at. Its 
> doesn't
>   seem to work though with \pagereference: no page number appears
>   in the PDF whatsoever. I have  been following the material here:
>   
> 
>   
> https://wiki.contextgarden.net/References#References_to_an_external_file
>   
> 
>   I'm wondering then ... do cross references to an external file 
> work
>   with \pagereference? 
> 
>   


Hi Richard,



I just tested \pagereference in a simple example and had no problem
to 
get

the page numbers from the other document. Without a minimal example

there is no way to tell what's missing in your document.



Wolfgang




__
_If your question is of interest to others as well, please
add an entry to the Wiki!
maillist : ntg-context@ntg.nl / 
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
a

Re: [NTG-context] LMTX 2021.03.02 | cross reference to an external file | \pagereference

2021-03-04 Thread Richard Mahoney
Thanks Wolfgang,

Hans kindly sent me a simple minimal. I've adjusted it to include a
call
to \pagereference and it works. I'm currently trying to test my
project
to see why my own calls to \pagereference do not result in any output,
despite the fact that all the calls to the reference ids in chapters
work
as expected. I'm imagining at this point that it has something to do
with
using two master files --one for each volume-- with multiple includes
(\components) for each chapter  -- the \pagereference code appears
in a number of the components.

I'll try to set up a simple example replicating the file structure I'm
using
and then send it through.


Best, Richard




-Original Message-
From: Wolfgang Schuster 
Reply-To: mailing list for ConTeXt users 
To: mailing list for ConTeXt users 
Subject: Re: [NTG-context] LMTX 2021.03.02 | cross reference to an
external file | \pagereference
Date: Thu, 4 Mar 2021 22:35:46 +0100
Mailer: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
 PostboxApp/7.0.47
X-Spam-Score: 0.0



Richard Mahoney schrieb am 04.03.2021 
um 09:04:

>   
>   Readers,
>   
> 
>   I'm working on a couple of volumes of papers set up and generated
>   separately (though within the same project). Some of the papers 
> in
>   the second volume make cross references to papers in the first.
>   Now this is working well so long as the reference is to the 
> details
>   associated with, say, a chapter, using \about, \in, and \at. Its 
> doesn't
>   seem to work though with \pagereference: no page number appears
>   in the PDF whatsoever. I have  been following the material here:
>   
> 
>   
> https://wiki.contextgarden.net/References#References_to_an_external_file
>   
> 
>   I'm wondering then ... do cross references to an external file 
> work
>   with \pagereference? 
> 
>   


Hi Richard,



I just tested \pagereference in a simple example and had no problem
to 
get

the page numbers from the other document. Without a minimal example

there is no way to tell what's missing in your document.



Wolfgang




__
_If your question is of interest to others as well, please
add an entry to the Wiki!
maillist : ntg-context@ntg.nl / 
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
__
_
-- 
T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
IM https://t.me/rmahoney  W https://indica-et-buddhica.org/


Indica et Buddhica  Littledene  Bay Road  Oxford  NZ
___
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] LMTX 2021.03.02 | cross reference to an external file | \pagereference

2021-03-04 Thread Wolfgang Schuster

Richard Mahoney schrieb am 04.03.2021 um 09:04:

Readers,

I'm working on a couple of volumes of papers set up and generated
separately (though within the same project). Some of the papers in
the second volume make cross references to papers in the first.
Now this is working well so long as the reference is to the details
associated with, say, a chapter, using \about, \in, and \at. Its doesn't
seem to work though with \pagereference: no page number appears
in the PDF whatsoever. I have  been following the material here:

https://wiki.contextgarden.net/References#References_to_an_external_file

I'm wondering then ... do cross references to an external file work
with \pagereference?


Hi Richard,

I just tested \pagereference in a simple example and had no problem to get
the page numbers from the other document. Without a minimal example
there is no way to tell what's missing in your document.

Wolfgang

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

maillist : ntg-context@ntg.nl / 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] LMTX 2021.03.02 | cross reference to an external file | \pagereference

2021-03-04 Thread Richard Mahoney
Readers,

I'm working on a couple of volumes of papers set up and generated
separately (though within the same project). Some of the papers in
the second volume make cross references to papers in the first.
Now this is working well so long as the reference is to the details
associated with, say, a chapter, using \about, \in, and \at. Its
doesn't
seem to work though with \pagereference: no page number appears
in the PDF whatsoever. I have  been following the material here:

https://wiki.contextgarden.net/References#References_to_an_external_file

I'm wondering then ... do cross references to an external file work
with \pagereference? 


Best, Richard




-- 
T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
IM https://t.me/rmahoney  W https://indica-et-buddhica.org/


Indica et Buddhica  Littledene  Bay Road  Oxford  NZ
___
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] Incorrect css reference in exported html file

2021-02-27 Thread Aditya Mahajan
Hi,

This message is prompted by a bug report for t-vim 
(https://github.com/adityam/filter/issues/43), but the issue is more general. 
Whenever, `cssfile` in `\setupexport` points to a file now in $PWD, the 
reference to the file in the exported CSS is incorrect:

Consider the following directory tree:

test.tex
styles/mystyle.css

where test.tex is:

```
\setupbackend[export=yes]
\setupexport[cssfile=styles/mystyle.css]

\starttext
\startparagraph
  This is a test
\stopparagraph
\stoptext
```

and 

styles/mystyle.tex is (the content doesn't matter, listing it for completeness):

```
paragraph,
p,
div.paragraph,
div.p {
  color : red ;
}
```

I am attaching a zip file for convenience. 

When I compile the above file, I get (selective lines from output)

```
backend > export > copying styles/mystyle.css
...
backend > export > adding css reference 'styles/styles/mystyle.css'
```

Indeed, the styles/mystyle.css file is copied to 
`test-export/styles/mystyle.css` but the reference in 
`test-export/test-export-div.html` is:

```

```

Note the repeated styles/styles. 

What is happening is that while copying the file, context is using (in 
back-exp.lua):

local source = addsuffix(cssextra[i],"css")
local target = joinfile(stylepath,basename(source))

while for reference, context is using:

result[#result+1] = replacetemplate(csspreamble, { filename = cssfile })
extras[#extras+1] = replacetemplate(cssheadlink, { filename = cssfile })

Shouldn't the last part be 

  filename=basename(source)

to get the right name? Without that whenever the value of cssfile is a file in 
another directory, the css reference in the exported html file will be 
incorrect.

In case anyone is interested, this manifests in t-vim as follows.
The t-vim module includes a pre-generated css file which provides the color and 
style values for the default color schemes. 

The module provides a macro \vimcssfile, which is the complete path of the file 
(basically the value of  `resolvers.resolve("full:vimtyping-default.css")`).

The intended usage is:

\usemodule[vim]
\setupbackend[export=yes]
\setupexport[cssfile=\vimtypingcssfile]
...


In this case, the css file is correctly copied to the '\jobname-export/styles` 
directory. but the `\jobname-div.html` file contains a unusable reference:

```
...

```

In principle, I can work around this in t-vim but I think that this will impact 
others as well.

Thanks,
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] Warning: "nodes: unable to store reference from lua in tex"

2021-02-26 Thread Hans Hagen

On 2/26/2021 6:58 PM, Wolfgang Schuster wrote:

Hans Hagen schrieb am 26.02.2021 um 18:36:

On 2/26/2021 6:01 PM, Lukas/ConTeXt wrote:

Hello,
after I renewed ConTeXt MkIV, I started to get the following warning:
"
...
luatex warning  > nodes: unable to store reference from lua in tex
...
(repeated more times)
"
This happens when I try to typeset a looo...ong table (by 
\start/\stop-tabulate) over several pages.

It used to work OK with a Ctx version several months (or half year) ago.
Is there a simple way to overtake the problem?
MWE:


\starttext
   \startluacode
 context[[
 \starttabulate[|Tr|]
   \HL
   \NC AABBCC \NC\AR
   \HL[3]
]]

 for i = 1, 4000 do
   context.NC(i)
   context.NC()
   context.AR()
 end

 context[[
   \HL
 \stoptabulate
]]
   \stopluacode
\stoptext


... lmtx ... no problem, doing 4K or 40K or ..



MkIV only, there is no output for \HL with too many lines (and the 
warning is shown).


\starttext

\starttabulate[|l|]
\NC xxx \NC\NR
\HL
\ntimes{\NC yyy \NC\NR}{4000}
\stoptabulate

\stoptext
i removed some older (slower / more demanding) code in mkiv and indeed 
one can now hit a boundary in luatex ... (i wanted to share critical 
code between mkiv and lmtx) .. there are reasons why we go lmtx


btw, one can decide to split up this large table in pieces, after all, 
it is generated so one knows the properties


(Thomas has larger tables and so far he didn't complain for lmtx; the 
lmtx table code is also faster.)


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] Warning: "nodes: unable to store reference from lua in tex"

2021-02-26 Thread Wolfgang Schuster

Hans Hagen schrieb am 26.02.2021 um 18:36:

On 2/26/2021 6:01 PM, Lukas/ConTeXt wrote:

Hello,
after I renewed ConTeXt MkIV, I started to get the following warning:
"
...
luatex warning  > nodes: unable to store reference from lua in tex
...
(repeated more times)
"
This happens when I try to typeset a looo...ong table (by 
\start/\stop-tabulate) over several pages.

It used to work OK with a Ctx version several months (or half year) ago.
Is there a simple way to overtake the problem?
MWE:


\starttext
   \startluacode
 context[[
 \starttabulate[|Tr|]
   \HL
   \NC AABBCC \NC\AR
   \HL[3]
]]

 for i = 1, 4000 do
   context.NC(i)
   context.NC()
   context.AR()
 end

 context[[
   \HL
 \stoptabulate
]]
   \stopluacode
\stoptext


... lmtx ... no problem, doing 4K or 40K or ..



MkIV only, there is no output for \HL with too many lines (and the 
warning is shown).


\starttext

\starttabulate[|l|]
\NC xxx \NC\NR
\HL
\ntimes{\NC yyy \NC\NR}{4000}
\stoptabulate

\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] Warning: "nodes: unable to store reference from lua in tex"

2021-02-26 Thread Hans Hagen

On 2/26/2021 6:01 PM, Lukas/ConTeXt wrote:

Hello,
  
after I renewed ConTeXt MkIV, I started to get the following warning:
  
"

...
luatex warning  > nodes: unable to store reference from lua in tex
...
(repeated more times)
"
  
This happens when I try to typeset a looo...ong table (by \start/\stop-tabulate) over several pages.

It used to work OK with a Ctx version several months (or half year) ago.
Is there a simple way to overtake the problem?
  
MWE:



\starttext
   \startluacode
 context[[
 \starttabulate[|Tr|]
   \HL
   \NC AABBCC \NC\AR
   \HL[3]
]]

 for i = 1, 4000 do
   context.NC(i)
   context.NC()
   context.AR()
 end

 context[[
   \HL
 \stoptabulate
]]
   \stopluacode
\stoptext


... lmtx ... no problem, doing 4K or 40K or ..


-
  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] Warning: "nodes: unable to store reference from lua in tex"

2021-02-26 Thread Lukas/ConTeXt
Hello,

after I renewed ConTeXt MkIV, I started to get the following warning:

"
...
luatex warning  > nodes: unable to store reference from lua in tex
...
(repeated more times)
"

This happens when I try to typeset a looo...ong table (by 
\start/\stop-tabulate) over several pages.
It used to work OK with a Ctx version several months (or half year) ago.
Is there a simple way to overtake the problem?

MWE:


\starttext
  \startluacode
context[[
\starttabulate[|Tr|]
  \HL
  \NC AABBCC \NC\AR
  \HL[3]
]]

for i = 1, 4000 do
  context.NC(i)
  context.NC()
  context.AR()
end

context[[
  \HL
\stoptabulate
]]
  \stopluacode
\stoptext


Best regards,

Lukasopen source > level 1, order 1, name 
'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2021.02.01 13:17 MKIV  fmt: 2021.2.3  int: 
english/english
system  > 
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name 
'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name 
'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'

system  > jobfiles > using path: d:/Lukas/ConTeXt/Styles
system  > files > jobname 't', input 
'D:/Lukas/Jobs/Chrastany-D5.4-RDS/SO_201/t.mkiv', result 't'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name 
'D:/Lukas/Jobs/Chrastany-D5.4-RDS/SO_201/t.mkiv'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
luatex warning  > nodes: unable to store reference from lua in tex
luatex warning  > nodes: unable to store reference from lua in tex
luatex warning  > nodes: unable to store reference from lua in tex
luatex warning  > nodes: unable to store reference from lua in tex
backend > xmp > using file 
'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
pages   > flushing realpage 2, userpage 2, subpage 2
pages   > flushing realpage 3, userpage 3, subpage 3
pages   > flushing realpage 4, userpage 4, subpage 4
pages   > flushing realpage 5, userpage 5, subpage 5
pages   > flushing realpage 6, userpage 6, subpage 6
pages   > flushing realpage 7, userpage 7, subpage 7
pages   > flushing realpage 8, userpage 8, subpage 8
pages   > flushing realpage 9, userpage 9, subpage 9
pages   > flushing realpage 10, userpage 10, subpage 10
pages   > flushing realpage 11, userpage 11, subpage 11
pages   > flushing realpage 12, userpage 12, subpage 12
pages   > flushing realpage 13, userpage 13, subpage 13
pages   > flushing realpage 14, userpage 14, subpage 14
pages   > flushing realpage 15, userpage 15, subpage 15
pages   > flushing realpage 16, userpage 16, subpage 16
pages   > flushing realpage 17, userpage 17, subpage 17
pages   > flushing realpage 18, userpage 18, subpage 18
pages   > flushing realpage 19, userpage 19, subpage 19
pages   > flushing realpage 20, userpage 20, subpage 20
pages   > flushing realpage 21, userpage 21, subpage 21
pages   > flushing realpage 22, userpage 22, subpage 22
pages   > flushing realpage 23, userpage 23, subpage 23
pages   > flushing realpage 24, userpage 24, subpage 24
pages   > flushing realpage 25, userpage 25, subpage 25
pages   > flushing realpage 26, userpage 26, subpage 26
pages   > flushing realpage 27, userpage 27, subpage 27
pages   > flushing realpage 28, userpage 28, subpage 28
pages   > flushing realpage 29, userpage 29, subpage 29
pages   > flushing realpage 30, userpage 30, subpage 30
pages   > flushing realpage 31, userpage 31, subpage 31
pages   > flushing realpage 32, userpage 32, subpage 32
pages   > flushing realpage 33, userpage 33, subpage 33
pages   > flushing realpage 34, userpage 34, subpage 34
pages   > flushing realpage 35, userpage 35, subpage 35
pages   > flushing realpage 36, userpage 36, subpage 36
pages   > flushing realpage 37, userpage 37, subpage 37
pages   > flushing realpage 38, userpage 38, subpage 38
pages   > flushing realpage 39, userpage 39, subpage 39
pages   > flushing realpage 40, userpage 40, subpage 40
pages   > flushing realpage 41, userpage 41, subpage 41
pages   > flushing realp

Re: [NTG-context] Arbitrary equation tags... again

2021-02-23 Thread Jairo A. del Rio
I found a workaround for anyone interested:


\setupinteraction[state=start,focus=standard]

\starttext

\startplaceformula[title=$\alpha$,reference=alpha]

\startformula

1 + 1 = 2

\stopformula

\stopplaceformula

\dorecurse{20}{\samplefile{knuth}}

I'm in \in{$\alpha$}[alpha] %so the reference is now visible

\stoptext

However, one has to manually write a label and a title independently, so
I'm not sure that's a clean solution...

Best regards,

Jairo

El lun, 22 de feb. de 2021 a la(s) 23:28, Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:

> Hi again. The following doesn't work (the tag is missing):
>
> \startTEXpage[offset=2bp]
> \startplaceformula[title=A,reference=alpha]
>  \startformula
>  1 + 1 = 2
>  \stopformula
> \stopplaceformula
> I'm in \in[alpha]
> \stopTEXpage
>
> Jairo
>
> El lun, 22 de feb. de 2021 a la(s) 09:00, Jairo A. del Rio (
> jairoadelr...@gmail.com) escribió:
>
>> Oh, dumb me, sorry for the noise and thank you very much. Not every day
>> is a good one, sorry again.
>>
>> Jairo.
>>
>> El lun, 22 de feb. de 2021 a la(s) 08:51, Hans Hagen (j.ha...@xs4all.nl)
>> escribió:
>>
>>> On 2/22/2021 2:05 PM, Jairo A. del Rio wrote:
>>> > Hi. list.
>>> > Is it possible to assign an arbitrary equation tag in ConTeXt? I've
>>> seen
>>> > solutions here;
>>> >
>>> >
>>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
>>> > <
>>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
>>> >
>>> >
>>> > but none of them works as expected (either the formula counter is
>>> still
>>> > incrementing with arbitrary conversions or cross-references don't
>>> work).
>>>
>>> Define 'expected' ... \eqno is something low level (a primitive) and we
>>> have that nilled at the user level and only use it deep down. It was
>>> never meant as user command.
>>>
>>> > I imagine some things have changed in 2021 and I hope a better
>>> solution
>>> > is feasible nowadays.
>>>
>>> \startTEXpage[offset=2bp]
>>> \startplaceformula[title=A]
>>>  \startformula
>>>  1 + 1 = 2
>>>  \stopformula
>>> \stopplaceformula
>>> \stopTEXpage
>>>
>>> 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] Arbitrary equation tags... again

2021-02-22 Thread Jairo A. del Rio
Hi again. The following doesn't work (the tag is missing):

\startTEXpage[offset=2bp]
\startplaceformula[title=A,reference=alpha]
 \startformula
 1 + 1 = 2
 \stopformula
\stopplaceformula
I'm in \in[alpha]
\stopTEXpage

Jairo

El lun, 22 de feb. de 2021 a la(s) 09:00, Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:

> Oh, dumb me, sorry for the noise and thank you very much. Not every day is
> a good one, sorry again.
>
> Jairo.
>
> El lun, 22 de feb. de 2021 a la(s) 08:51, Hans Hagen (j.ha...@xs4all.nl)
> escribió:
>
>> On 2/22/2021 2:05 PM, Jairo A. del Rio wrote:
>> > Hi. list.
>> > Is it possible to assign an arbitrary equation tag in ConTeXt? I've
>> seen
>> > solutions here;
>> >
>> >
>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
>> > <
>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text
>> >
>> >
>> > but none of them works as expected (either the formula counter is still
>> > incrementing with arbitrary conversions or cross-references don't work).
>>
>> Define 'expected' ... \eqno is something low level (a primitive) and we
>> have that nilled at the user level and only use it deep down. It was
>> never meant as user command.
>>
>> > I imagine some things have changed in 2021 and I hope a better solution
>> > is feasible nowadays.
>>
>> \startTEXpage[offset=2bp]
>> \startplaceformula[title=A]
>>  \startformula
>>  1 + 1 = 2
>>  \stopformula
>> \stopplaceformula
>> \stopTEXpage
>>
>> 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] lmtx error: You can't use 'integer 340' in internal vertical mode

2021-02-20 Thread Hans Hagen

On 2/20/2021 4:42 PM, juh wrote:

Am Fri, Feb 19, 2021 at 01:17:15PM +0100 schrieb Hans Hagen:

On 2/19/2021 11:46 AM, juh wrote:

Am Fri, Feb 19, 2021 at 10:47:36AM +0100 schrieb Hans Hagen:

The question is: what happens in that file with modes?


Nothing too fancy. I attached the files with mode definitions

works here so you need to make a mwe


Maybe it was the option --arrange. When I unset it, lmtx compiles without
problems and the result seems to be ok.

I believe that I needed the options earlier because I position three pages on a 
a4 paper to get
a folded flyer. The option seems to be obsolete now.

hm, but it still makes sense to know if something fails .. keep en eye on it

this integer message just means that some number reference ends up in 
the list while \the or something similar needs to be used; it's normally 
a signal of something wrong in a macro; in luamatatex we use cheap 
integers for modes, think of


  \integerdef\foo123

and then \foo is not supposed to show up on its own (unless you use 
\the\foo and then you see 123) but is to be used in a context where a 
number is expected ... so, it's not something 'dramatic' happening here 
and at least we get some signal


now, when for instance we use a traditional cheap integer, like

  \chardef\foo123

we can use that as a number (\ifnum\foo ...) but when we put that one 
someplacem like


  test \foo test

tex will not complain but just typeset that number. Now, because these 
states normally are 0, 1 or 2, you actually would get a reference to a 
character but these are never in normal fonts so what you get then is 
some 'invisible' glyph node


depending on the place you can get an empty page, an empty line, messed 
up spacing, or just nothing if it in the text stream so if this is some 
old issue you'd see some side effect too (but no error message)


maybe that gives a clue (like a message about a font not having a 
character on the console or in the log)


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] tikzpicture in margin

2021-02-15 Thread Hans Hagen

On 2/14/2021 10:43 PM, Aditya Mahajan wrote:

On Sun, 14 Feb 2021, Jigé wrote:


Hi all.

I'm trying to place a TikZ picture in the margin.
Here is a small example:

\usemodule[tikz]
\setuplayout[backspace=4cm, topspace=2cm, height=middle]
\starttext
\input{lorem}
\margintext{I have discovered a truly
             marvelous proof ...  but
             this margin is too narrow
             to contain it.}
\input{lorem}
\inmargin{\externalfigure[cow] [width=\marginwidth]}
% The above works.
% The following does not:
\input{lorem}
\inmargin{
\starttikzpicture
   \draw[gray] (-2,0) grid (2,2) ;
   \draw plot [domain=-2:2, samples=50, smooth] (\x,{\x * \x});
\stoptikzpicture
}
\stoptext

-> Undefined control sequence


Most likely because the argument of \inmargin is scanned upfront and at that 
time \draw etc are undefined. One option is:

\startbuffer[picture]
\starttikzpicture
...
\stoptikzpicture
\stopbuffer

\inmargin{\getbuffer[picture]}

Another option (but better to do that in tikz module) is:

\let\draw\relax
\let\x\relax

\inmargin{\starttikzpicture ... \stoptikzpicture}


Actually the command \startmarginblock ... \stop... described in the ConText 
reference works with a TikZ picture.


Because the \start ... \stop blocks don't scan the argument.

Here's one for you to ponder:

we have this:

 % \doifelsenothing{#content}\donefalse\donetrue

we could use the slower (maybe even side effects)

 % \doifelsetext{#content}\donetrue\donefalse

but go modern instead:

   \ifparameter#content\donefalse\or\donetrue\else\donefalse\fi

i'll add that last one to lmtx

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] tikzpicture in margin

2021-02-14 Thread Aditya Mahajan
On Sun, 14 Feb 2021, Jigé wrote:

> Hi all.
> 
> I'm trying to place a TikZ picture in the margin.
> Here is a small example:
> 
> \usemodule[tikz]
> \setuplayout[backspace=4cm, topspace=2cm, height=middle]
> \starttext
> \input{lorem}
> \margintext{I have discovered a truly
>             marvelous proof ...  but
>             this margin is too narrow
>             to contain it.}
> \input{lorem}
> \inmargin{\externalfigure[cow] [width=\marginwidth]}
> % The above works.
> % The following does not:
> \input{lorem}
> \inmargin{
> \starttikzpicture
>   \draw[gray] (-2,0) grid (2,2) ;
>   \draw plot [domain=-2:2, samples=50, smooth] (\x,{\x * \x});
> \stoptikzpicture
> }
> \stoptext
> 
> -> Undefined control sequence

Most likely because the argument of \inmargin is scanned upfront and at that 
time \draw etc are undefined. One option is:

\startbuffer[picture]
\starttikzpicture
...
\stoptikzpicture
\stopbuffer

\inmargin{\getbuffer[picture]}

Another option (but better to do that in tikz module) is:

\let\draw\relax
\let\x\relax

\inmargin{\starttikzpicture ... \stoptikzpicture}

> Actually the command \startmarginblock ... \stop... described in the ConText 
> reference works with a TikZ picture. 

Because the \start ... \stop blocks don't scan the argument.

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
___


[NTG-context] tikzpicture in margin

2021-02-14 Thread Jigé
Hi all.

I'm trying to place a TikZ picture in the margin.
Here is a small example:

\usemodule[tikz]
\setuplayout[backspace=4cm, topspace=2cm, height=middle]
\starttext
\input{lorem}
\margintext{I have discovered a truly
            marvelous proof ...  but
            this margin is too narrow
            to contain it.}
\input{lorem}
\inmargin{\externalfigure[cow] [width=\marginwidth]}
% The above works.
% The following does not:
\input{lorem}
\inmargin{
\starttikzpicture
  \draw[gray] (-2,0) grid (2,2) ;
  \draw plot [domain=-2:2, samples=50, smooth] (\x,{\x * \x});
\stoptikzpicture
}
\stoptext

-> Undefined control sequence

I tried using \startfigure, \hbox... no success.

Actually the command \startmarginblock ... \stop... described in the ConText 
reference works with a TikZ picture. But the picture, in the margin, gets near 
the top of the page. I don't understand the meaning of the options (especially 
the difference between `location' and `align'). And is it 
`\setuppagenumbering[alternative=doublesided]'-aware ?
Example:

\usemodule[tikz]
\setuplayout[backspace=4cm, topspace=2cm, height=middle]
\setuppagenumbering[alternative=doublesided]
\starttext
\input{lorem}
\inmargin{\externalfigure[cow] [width=\marginwidth]}
\pagebreak
\input{lorem}
\input{lorem}

\blank
We would like the picture to go the the left of this paragraph.
\setupmarginblocks[location=left,align=inner]
\startmarginblock
\starttikzpicture[scale=0.2]
  \draw[gray] (-2,0) grid (2,2) ;
  \draw plot [domain=-2:2, samples=50, smooth] (\x,{\x * \x});
\stoptikzpicture
\stopmarginblock
\stoptext


Best regards
___
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] Fwd: Re: Hyphenation on digits

2021-01-28 Thread Richard Mahoney
Just to clarify. The new \hyphenateddigits means that witha couple of
tightly packed columns of footnotes it is nowpossible to break a
textual reference such as this acrosstwo lines.
({\it Ṛgveda}~\hyphenateddigits{1.114.10})
This is just great, and I can see it being used reasonablyoften.

Best, Richard



 Forwarded Message From: Richard Mahoney <
rmaho...@indica-et-buddhica.org>Reply-To: Richard Mahoney <
rmaho...@indica-et-buddhica.org>To: mailing list for ConTeXt users <
ntg-context@ntg.nl>Subject: Re: [NTG-context] Hyphenation on
digitsDate: Fri, 29 Jan 2021 04:52:34 +1300Mailer: Cyrus-JMAP/3.5.0-
alpha0-84-gfc141fe8b8-fm-20210125.001-gfc141fe8X-Spam-Score: 0.0
p.MsoNormal,p.MsoNoSpacing{margin:0}Thank you for this Hans, its going
to be very useful for
breaking bibliographic refs including manuscript or
inscription codes in two column mode.

Best, Richard


--
T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
IM https://t.me/rmahoney  W https://indica-et-buddhica.org/


Indica et Buddhica  Littledene  Bay Road  Oxford  NZ


- Original message -
From: Hans Hagen 
To: mailing list for ConTeXt users , "Jairo A. del
Rio" 
Subject: Re: [NTG-context] Hyphenation on digits
Date: Friday, 29 January 2021 03:00

On 1/28/2021 12:50 PM, Jairo A. del Rio wrote:
> Hi, list.
> 
> I want to know if ConTeXt provides an option to automatically 
> hyphenate/break digits as if they were alphabetic characters.
Example, 
> in a narrow page I expect something like that (I've used (-) for an 
> optional hyphen):
> 
> *π = *3.141592653(-)
> 58979323846264(-)
> 33832795028841(-)
> 97169399375105(-)
> ...
> 
> I found myself unable to read a satisfactory solution in the
mailing 
> list archive nor other TeX related resources. Maybe LMTX has some
magic 
> for that?

I'll add support for:

\starttext

\hsize6cm

\pi\ = 
\hyphenateddigits[\unknown]{3.1415926535897932384626433832795028841971
69399375105} 
  \blank
\pi\ = 
\hyphenateddigits{3.14159265358979323846264338327950288419716939937510
5} 
\blank
x $\pi  = 
\hyphenateddigits[\unknown]{3.1415926535897932384626433832795028841971
69399375105}$ 
\blank
x $\pi  = 
\hyphenateddigits{3.14159265358979323846264338327950288419716939937510
5}$ 
  \blank

\stoptext

A quick and dirty hack as we don't need some full blown mechanism for 
such a rare case.

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
__
_



-- 
T +6433121699  M +64210640216  E rmaho...@indica-et-buddhica.org
IM https://t.me/rmahoney  W https://indica-et-buddhica.org/


Indica et Buddhica  Littledene  Bay Road  Oxford  NZ
___
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] possible problem with MPinstance or MPinclusions? works in 20200920 but not in the current 20210124 ...

2021-01-26 Thread Rudd, Kevin
argh. the problem with multiple versions of lmtx

  - running mtxrun --generate then mtxrun --find finds the file
  - running context with the document doesn't find the file and gives the same 
error
. but i haven't changed my environment usepath/usesubpath file

so:

20200920: mtxrun --generate .. mtxrun --find boxrow.mp works; context 
 works w/ or w/o putting the file in .../lmtx/tex/texmf-local/metapost
20210124: mtxrun --generate .. mtxrun --find boxrow.mp works; context 
 doesn't work w/ or w/o putting the file in 
.../lmtx/tex/texmf-local/metapost

 ---K

Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu>

Visiting Research Professor
United States Naval Academy

r...@usna.edu<mailto:r...@usna.edu>


On Jan 26, 2021, at 12:32, Rudd, Kevin 
mailto:ke...@lps.umd.edu>> wrote:

hi, Hans---

putting boxrow.mp in the lmtx tree and running "mtxrun --generate"  worked, so 
it appears that my old path settings in the environment file isn't working any 
more. and i'd rather not mangle the distribution tree as that's 
out-of-sight/out-of-mind and likely to get replaced sometime after i've 
forgotten that i mangled it

  - does that mean that the usepath/usesubpath feature or environment scoping 
is now different?
=> if so, where do i find the new rules/syntax so i can regenerate my path 
code/environment file?
=> is there a hook to generate/append the file paths dynamically using a 
lua script in the top-level setup file (seems easier than the manual csh 
script=>environment file that i'm using now)

  - is it possible to configure lmtx to add my local tree to the search path? i 
seem to recall it was possible when i was fiddling with kpse many many years 
ago.
=> if so, where do i find the info to set that up in my *shrc files?

thanks,
 ---K

Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu>

Visiting Research Professor
United States Naval Academy

r...@usna.edu<mailto:r...@usna.edu>


On Jan 26, 2021, at 12:00, Hans Hagen 
mailto:j.ha...@xs4all.nl>> wrote:

On 1/26/2021 1:19 PM, Rudd, Kevin wrote:
Hi---
I have a number of included figures that work in 20200920 but not in the 
current 20210124 version. There's a project structure that sets everything up 
but after that they are input as a figure:
\startplacefigure[title={NS Hierarchy},
  reference={f:ns-hierarchy}]
\input ns_hierarchy
\stopplacefigure
and generate the error:
metafun > log > error: Not implemented: (unknown numeric)=(string)
metafun > log >
metapost> log >
metapost> log > 
metapost> log >,
metapost> log > <*>  make_BoxRow [ name = "Parent",
metafun > log >
metafun > log > I'm afraid I don't know how to apply that operation to 
that combination of types.
Continue, and I'll return the second argument (see above) as the result of 
theoperation.
metafun > log >
metapost> log > label = "Parent 
Root Namespace", ]; ;
>From triaging, it looks like the "boxrow.mp" file isn't being input by the 
>current version from within the MPinclusions block associated with the 
>MPinstance; the error appears to be spurious as a result of make_BoxRow not 
>being defined and doesn't occur in the old version where the file is input. 
>"boxrow.mp" is not in the same directory as the document but is in the 
>configured through the usepath/usesubpath interface from an environment file.
I can put together and share a runnable MWE set of files if this information is 
not complete enough to identify the problem.
Here is the MWE that I used for the input figure file that demonstrates the 
problem.
\defineMPinstance[ns_hier]
[
format=metafun,
extensions=yes,
initializations=yes,
method=double,
]
\startMPinclusions{ns_hier}
input boxrow
\stopMPinclusions
\startMPdefinitions{ns_hier}
% nothing to see here
\stopMPdefinitions
\startMPcode{ns_hier}
make_BoxRow
[
name   = "Parent",
label  = "Parent Root Namespace",
];
\stopMPcode
What if you put it in your tree? Someplace under

texmf-local/metapost/...

(run mtxrun --generate afterdpimng that)

Hans



-
 

Re: [NTG-context] possible problem with MPinstance or MPinclusions? works in 20200920 but not in the current 20210124 ...

2021-01-26 Thread Rudd, Kevin
hi, Hans---

putting boxrow.mp in the lmtx tree and running "mtxrun --generate"  worked, so 
it appears that my old path settings in the environment file isn't working any 
more. and i'd rather not mangle the distribution tree as that's 
out-of-sight/out-of-mind and likely to get replaced sometime after i've 
forgotten that i mangled it

  - does that mean that the usepath/usesubpath feature or environment scoping 
is now different?
=> if so, where do i find the new rules/syntax so i can regenerate my path 
code/environment file?
=> is there a hook to generate/append the file paths dynamically using a 
lua script in the top-level setup file (seems easier than the manual csh 
script=>environment file that i'm using now)

  - is it possible to configure lmtx to add my local tree to the search path? i 
seem to recall it was possible when i was fiddling with kpse many many years 
ago.
=> if so, where do i find the info to set that up in my *shrc files?

thanks,
 ---K

Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu>

Visiting Research Professor
United States Naval Academy

r...@usna.edu<mailto:r...@usna.edu>


On Jan 26, 2021, at 12:00, Hans Hagen 
mailto:j.ha...@xs4all.nl>> wrote:

On 1/26/2021 1:19 PM, Rudd, Kevin wrote:
Hi---
I have a number of included figures that work in 20200920 but not in the 
current 20210124 version. There's a project structure that sets everything up 
but after that they are input as a figure:
\startplacefigure[title={NS Hierarchy},
  reference={f:ns-hierarchy}]
\input ns_hierarchy
\stopplacefigure
and generate the error:
metafun > log > error: Not implemented: (unknown numeric)=(string)
metafun > log >
metapost> log >
metapost> log > 
metapost> log >,
metapost> log > <*>  make_BoxRow [ name = "Parent",
metafun > log >
metafun > log > I'm afraid I don't know how to apply that operation to 
that combination of types.
Continue, and I'll return the second argument (see above) as the result of 
theoperation.
metafun > log >
metapost> log > label = "Parent 
Root Namespace", ]; ;
>From triaging, it looks like the "boxrow.mp" file isn't being input by the 
>current version from within the MPinclusions block associated with the 
>MPinstance; the error appears to be spurious as a result of make_BoxRow not 
>being defined and doesn't occur in the old version where the file is input. 
>"boxrow.mp" is not in the same directory as the document but is in the 
>configured through the usepath/usesubpath interface from an environment file.
I can put together and share a runnable MWE set of files if this information is 
not complete enough to identify the problem.
Here is the MWE that I used for the input figure file that demonstrates the 
problem.
\defineMPinstance[ns_hier]
[
format=metafun,
extensions=yes,
initializations=yes,
method=double,
]
\startMPinclusions{ns_hier}
input boxrow
\stopMPinclusions
\startMPdefinitions{ns_hier}
% nothing to see here
\stopMPdefinitions
\startMPcode{ns_hier}
make_BoxRow
[
name   = "Parent",
label  = "Parent Root Namespace",
];
\stopMPcode
What if you put it in your tree? Someplace under

texmf-local/metapost/...

(run mtxrun --generate afterdpimng that)

Hans



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

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

maillist : ntg-context@ntg.nl / 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] possible problem with MPinstance or MPinclusions? works in 20200920 but not in the current 20210124 ...

2021-01-26 Thread Hans Hagen

On 1/26/2021 1:19 PM, Rudd, Kevin wrote:

Hi---

I have a number of included figures that work in 20200920 but not in the 
current 20210124 version. There's a project structure that sets 
everything up but after that they are input as a figure:


             \startplacefigure[title={NS Hierarchy},
                               reference={f:ns-hierarchy}]
                 \input ns_hierarchy
             \stopplacefigure

and generate the error:

metafun         > log > error: Not implemented: (unknown numeric)=(string)
metafun         > log >
metapost        > log >
metapost        > log > 
metapost        > log >                    ,
metapost        > log > <*>  make_BoxRow [ name = "Parent",
metafun         > log >
metafun         > log > I'm afraid I don't know how to apply that 
operation to that combination of types.
Continue, and I'll return the second argument (see above) as the result 
of theoperation.

metafun         > log >
metapost        > log >                                     label = 
"Parent Root Namespace", ]; ;


 From triaging, it looks like the "boxrow.mp" file isn't being input by 
the current version from within the MPinclusions block associated with 
the MPinstance; the error appears to be spurious as a result of 
make_BoxRow not being defined and doesn't occur in the old version where 
the file is input. "boxrow.mp" is not in the same directory as the 
document but is in the configured through the usepath/usesubpath 
interface from an environment file.


I can put together and share a runnable MWE set of files if this 
information is not complete enough to identify the problem.


Here is the MWE that I used for the input figure file that demonstrates 
the problem.


\defineMPinstance[ns_hier]
[
     format=metafun,
     extensions=yes,
     initializations=yes,
     method=double,
]

\startMPinclusions{ns_hier}
     input boxrow
\stopMPinclusions

\startMPdefinitions{ns_hier}
     % nothing to see here
\stopMPdefinitions

\startMPcode{ns_hier}

     make_BoxRow
     [
         name           = "Parent",
         label          = "Parent Root Namespace",
     ];

\stopMPcode

What if you put it in your tree? Someplace under

texmf-local/metapost/...

(run mtxrun --generate afterdpimng that)

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] possible problem with MPinstance or MPinclusions? works in 20200920 but not in the current 20210124 ...

2021-01-26 Thread Rudd, Kevin
Hi---

I have a number of included figures that work in 20200920 but not in the 
current 20210124 version. There's a project structure that sets everything up 
but after that they are input as a figure:

\startplacefigure[title={NS Hierarchy},
  reference={f:ns-hierarchy}]
\input ns_hierarchy
\stopplacefigure

and generate the error:

metafun > log > error: Not implemented: (unknown numeric)=(string)
metafun > log >
metapost> log >
metapost> log > 
metapost> log >,
metapost> log > <*>  make_BoxRow [ name = "Parent",
metafun > log >
metafun > log > I'm afraid I don't know how to apply that operation to 
that combination of types.
Continue, and I'll return the second argument (see above) as the result of 
theoperation.
metafun > log >
metapost> log > label = "Parent 
Root Namespace", ]; ;

>From triaging, it looks like the "boxrow.mp" file isn't being input by the 
>current version from within the MPinclusions block associated with the 
>MPinstance; the error appears to be spurious as a result of make_BoxRow not 
>being defined and doesn't occur in the old version where the file is input. 
>"boxrow.mp" is not in the same directory as the document but is in the 
>configured through the usepath/usesubpath interface from an environment file.

I can put together and share a runnable MWE set of files if this information is 
not complete enough to identify the problem.

Here is the MWE that I used for the input figure file that demonstrates the 
problem.

\defineMPinstance[ns_hier]
[
format=metafun,
extensions=yes,
initializations=yes,
method=double,
]

\startMPinclusions{ns_hier}
input boxrow
\stopMPinclusions

\startMPdefinitions{ns_hier}
% nothing to see here
\stopMPdefinitions

\startMPcode{ns_hier}

make_BoxRow
[
name   = "Parent",
label  = "Parent Root Namespace",
];

\stopMPcode

Thanks for any feedback,
 ---K

Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu>

Visiting Research Professor
United States Naval Academy

r...@usna.edu<mailto:r...@usna.edu>


___
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] LMTX isn't typesetting math correctly with Pagella

2021-01-18 Thread Mikael Sundqvist
On Sun, Jan 17, 2021 at 10:00 PM Hans Hagen  wrote:

> On 1/16/2021 12:33 AM, Hans Hagen wrote:
> > On 1/15/2021 1:33 PM, Jack Hill wrote:
> >> Hi,
> >>
> >> I've been having some trouble with ConTeXt not typesetting math
> >> correctly when using the Pagella font (I do not know if the same issue
> >> occurs with other fonts as I haven't tested them).
> >>
> >> If I compile with LMTX, the spacing between letters becomes very small
> >> so that when I type "|f|", for example, the second "|" intersects the
> >> f and looks rather ugly. However, compiling with the --luatex switch
> >> fixes these issues and the math looks nice again.
> >>
> >> Can anybody else replicate this issue, and does anybody know why it is
> >> happening?
> >>
> >> This the code I used to test:
> >>
> >> |\setupbodyfont[pagella] \starttext \startformula |f| = \sqrt{\int_0^1
> >> |f(t)|^2 \text{d}t} \stopformula \stoptext |||
> > I'll check it ... smells like some interference between newer and older
> > corrections (these gyre fonts need some special treatment).
> I uploaded lmtx.
>
> Here is the story about math:
>
> - there is traditional math, the 8 bit fonts (from Don Knuth)
> - and there is opentype math (originating at Microsoft)
>
> the eight bit fonts are all modelled after the cmr fonts so they have
> the same set of parameters, the same assumptions about family 2 and 3,
> use the same width/height/depth trickery
>
> one thing is that they lie about the width: the italic correction is
> subtracted from the width and the engine always adds it when a glyph is
> dealt with but then removes in some cases afterwards
>
> in opentype we also have italic correction but that is applied in
> specific cases; there the shapes have a real width
>
> (there are tricks to make fonts seen as opentype be treated as old
> school which work ok for virtual constructs that only use those 8 bit
> fonts but often fail for gyre fonts)
>
> now, the gust foundation fonts are a mix: they are opentype, have its
> parameters and properties but have the wrong width and assume the italic
> hackery
>
> the microsoft cambria font is the reference for opentype math (and to
> some extend microsoft word also is)
>
> afaik xetex uses the old tex approach also for opentype so that is why
> probably the old width approach works ok there but i never looked into
> it; cambria is an opentype font but probably seldom used so side effects
> will go unnoticed, also, texies often have no problem blaming microsoft,
> even when they got it right; of course we have to admit that 'moving
> forward wrt math fonts' didn't come from our community so we just have
> to follow
>
> now, when we move on (with context + luametatex) to a variants font
> scaling model, i need to adapt the math machinery to deal with that ...
> this can have side effects as you noticed but these will be dealt with
> (or fixed when something is wrong)
>
> in context we have font goodies that can handle this (widths, kerns etc)
> and we do so for at least the 'f' which also has a strange left offset
> ... i now adapted that to also serve the new (compact context font)
> model and also make sure that the smaller sizes for mkiv are handled; we
> can add more in those files, but that's also a (math) user effort
>
> to be decided is of we use the feature setting "mathkerns=yes" (this was
> a directive but i made it just a feature)
>
> Now, ideally:
>
> \enableexperiments[fonts.compact] % for the definitions
>
> should give nearly similar results (but less mem usage, less fonts
> loaded and possibly some performance gain)
>
> I also updated some test features:
>
> \definefontfeature[mathextra][staircase=yes,boundingbox=frame]
>
> as part of the general lmtx upgrading process. Only cambria (and lucida)
> have these staircase kerns and e.g. pagella and friends have a few
> defined in the font goodies but one has to do something liek this:
>
>
>
> \definefontfeature[mathextra][mathkerns=yes,staircase=yes,boundingbox=frame]
>
> more such tracers will be added in due time (and some old ones will go
> away as they lost their purpose).
>
> Hans
>
>
I got curious about those staircase kerns. Is there a simple example that
shows their effect? I greped the source, but did not find anything where I
could see a difference.

/Mikael
___
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] LMTX isn't typesetting math correctly with Pagella

2021-01-17 Thread Hans Hagen

On 1/16/2021 12:33 AM, Hans Hagen wrote:

On 1/15/2021 1:33 PM, Jack Hill wrote:

Hi,

I've been having some trouble with ConTeXt not typesetting math 
correctly when using the Pagella font (I do not know if the same issue 
occurs with other fonts as I haven't tested them).


If I compile with LMTX, the spacing between letters becomes very small 
so that when I type "|f|", for example, the second "|" intersects the 
f and looks rather ugly. However, compiling with the --luatex switch 
fixes these issues and the math looks nice again.


Can anybody else replicate this issue, and does anybody know why it is 
happening?


This the code I used to test:

|\setupbodyfont[pagella] \starttext \startformula |f| = \sqrt{\int_0^1 
|f(t)|^2 \text{d}t} \stopformula \stoptext |||
I'll check it ... smells like some interference between newer and older 
corrections (these gyre fonts need some special treatment).

I uploaded lmtx.

Here is the story about math:

- there is traditional math, the 8 bit fonts (from Don Knuth)
- and there is opentype math (originating at Microsoft)

the eight bit fonts are all modelled after the cmr fonts so they have 
the same set of parameters, the same assumptions about family 2 and 3, 
use the same width/height/depth trickery


one thing is that they lie about the width: the italic correction is 
subtracted from the width and the engine always adds it when a glyph is 
dealt with but then removes in some cases afterwards


in opentype we also have italic correction but that is applied in 
specific cases; there the shapes have a real width


(there are tricks to make fonts seen as opentype be treated as old 
school which work ok for virtual constructs that only use those 8 bit 
fonts but often fail for gyre fonts)


now, the gust foundation fonts are a mix: they are opentype, have its 
parameters and properties but have the wrong width and assume the italic 
hackery


the microsoft cambria font is the reference for opentype math (and to 
some extend microsoft word also is)


afaik xetex uses the old tex approach also for opentype so that is why 
probably the old width approach works ok there but i never looked into 
it; cambria is an opentype font but probably seldom used so side effects 
will go unnoticed, also, texies often have no problem blaming microsoft, 
even when they got it right; of course we have to admit that 'moving 
forward wrt math fonts' didn't come from our community so we just have 
to follow


now, when we move on (with context + luametatex) to a variants font 
scaling model, i need to adapt the math machinery to deal with that ... 
this can have side effects as you noticed but these will be dealt with 
(or fixed when something is wrong)


in context we have font goodies that can handle this (widths, kerns etc) 
and we do so for at least the 'f' which also has a strange left offset 
... i now adapted that to also serve the new (compact context font) 
model and also make sure that the smaller sizes for mkiv are handled; we 
can add more in those files, but that's also a (math) user effort


to be decided is of we use the feature setting "mathkerns=yes" (this was 
a directive but i made it just a feature)


Now, ideally:

   \enableexperiments[fonts.compact] % for the definitions

should give nearly similar results (but less mem usage, less fonts 
loaded and possibly some performance gain)


I also updated some test features:

   \definefontfeature[mathextra][staircase=yes,boundingbox=frame]

as part of the general lmtx upgrading process. Only cambria (and lucida) 
have these staircase kerns and e.g. pagella and friends have a few 
defined in the font goodies but one has to do something liek this:



\definefontfeature[mathextra][mathkerns=yes,staircase=yes,boundingbox=frame]

more such tracers will be added in due time (and some old ones will go 
away as they lost their purpose).


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] expansion of xml userdata

2021-01-17 Thread Wolfgang Schuster

Jano Kula schrieb am 17.01.2021 um 21:22:

Hello to everybody!

\setuphead[section][expansion=yes] expands xml reference to the actual 
content in TUC file:


\xmlatt {xml:name::4}{title} → First section

for titles & bookmarks. The same is not true for userdata (mkiv & mkxl). 
Do you know how to force expansion of userdata?



You can drop "expansion=yes" when you use

\normalexpanded{\startsection[..,..=..,..][..,..=..,..]}

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
___


[NTG-context] expansion of xml userdata

2021-01-17 Thread Jano Kula
Hello to everybody!

\setuphead[section][expansion=yes] expands xml reference to the actual
content in TUC file:

\xmlatt {xml:name::4}{title} → First section

for titles & bookmarks. The same is not true for userdata (mkiv & mkxl). Do
you know how to force expansion of userdata?

MWE attached.

Thank you,
Jano

\startbuffer[doc]



text


text


\stopbuffer

\setuphead[section][expansion=yes]
\setuplist[section][alternative=command,
command=\SectionListCommand]

\define[3]\SectionListCommand{%
   {\bf#1\par
   title: #2\par
   usertitle: \structurelistuservariable{usertitle}}\par
   \blank
   \endgraf}

\startxmlsetups xml:name
\xmlsetsetup{\xmldocument}{document|section}{xml:name:*}
\stopxmlsetups
\xmlregistersetup{xml:name}

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

\startxmlsetups xml:name:section
\startsection[title=\xmlatt{#1}{title}]
 [usertitle=\xmlatt{#1}{title}]
\stopsection
\stopxmlsetups

\starttext
\placelist[section]
\xmlprocessbuffer{xml:name}{doc}{}
\stoptext


xml-one-file-head-toc.tex
Description: Binary data
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 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] RE : Missing kern when using \feature

2021-01-08 Thread Joseph
OK makes sense. I’ll see if I can remove this \feature macro.Yes 2nd case was only for reference for working case.Thanks De : Hans HagenEnvoyé le :vendredi 8 janvier 2021 16:32À : mailing list for ConTeXt users; JosephObjet :Re: [NTG-context] Missing kern when using \feature On 1/8/2021 2:45 PM, Joseph wrote:> Dear list,> > Still spot a minor difference with previous LMTX versions. MWE > reproduces it (in previous beta we had twice as kerning, now it’s no > kerning at all).> > Thanks a lot as usual.> > \definefontfeature[xvicentury][mode=node]> > \definefontfeature[default][default][kern=yes]> > \definefontfamily[mainfont][serif][EBGaramond]> > \setupbodyfont[mainfont, 9pt]> > \showfontkerns> > \starttext> > Chapitre {\feature[-][xvicentury]v}. % no kerning between v and . indeed there should be no kerning because there are two different font setups (lmtx is a bit better in these dynamic features: more strict testing at the cost of a bit more runtimen but optimized so not noticeable) > Chapitre v. i see a kern 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> ___>   --  -   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] LuaTeX and PDF.js

2021-01-08 Thread Vedran Miletić

08. 01. 2021. u 05:41, Aditya Mahajan piše:

On Fri, 8 Jan 2021, Hans Hagen wrote:


On 1/8/2021 12:39 AM, Vedran Miletić wrote:


It's whatever ConTeXt standalone has. I don't have any extra Lua installed:


--credits should mention the lua version


Should I see it on non-HiDPI as well? Because it seems it's there.


depends on what you consider (non) hdpi ... the positioning of glyphs
depends on font scale, rounding of stems and such (hints in fonts but
these get less relevant with high res displays), caching, inter glyph
corrections (that pdftex/luatex/...) put in the text stream to resync
within certain tolerances, etc ... (often a print is a better reference
as displays are seldom 600+ dpi) .. it's also why often expansion looks
bad on screen because even a sub percentage difference can give such
effects


Another way to see it is just zoom in on the PDF. If the artifacts go away on 
zooming in, then they are due to anti-aliasing.

Aditya

Thanks to both of you for the detailed explanations. Printed page shows 
no artifacts and neither does PDF.js when the text is zoomed. So it is 
an issue with anti-aliasing after all.


I'll report it to PDF.js and see what they tell me.

Regards,
Vedran

--
Vedran Miletić
vedran.miletic.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] LuaTeX and PDF.js

2021-01-07 Thread Aditya Mahajan
On Fri, 8 Jan 2021, Hans Hagen wrote:

> On 1/8/2021 12:39 AM, Vedran Miletić wrote:
> 
> > It's whatever ConTeXt standalone has. I don't have any extra Lua installed:
> 
> --credits should mention the lua version
> 
> > Should I see it on non-HiDPI as well? Because it seems it's there.
> 
> depends on what you consider (non) hdpi ... the positioning of glyphs 
> depends on font scale, rounding of stems and such (hints in fonts but 
> these get less relevant with high res displays), caching, inter glyph 
> corrections (that pdftex/luatex/...) put in the text stream to resync 
> within certain tolerances, etc ... (often a print is a better reference 
> as displays are seldom 600+ dpi) .. it's also why often expansion looks 
> bad on screen because even a sub percentage difference can give such 
> effects

Another way to see it is just zoom in on the PDF. If the artifacts go away on 
zooming in, then they are due to anti-aliasing.

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] LuaTeX and PDF.js

2021-01-07 Thread Hans Hagen

On 1/8/2021 12:39 AM, Vedran Miletić wrote:


It's whatever ConTeXt standalone has. I don't have any extra Lua installed:


--credits should mention the lua version


Should I see it on non-HiDPI as well? Because it seems it's there.


depends on what you consider (non) hdpi ... the positioning of glyphs 
depends on font scale, rounding of stems and such (hints in fonts but 
these get less relevant with high res displays), caching, inter glyph 
corrections (that pdftex/luatex/...) put in the text stream to resync 
within certain tolerances, etc ... (often a print is a better reference 
as displays are seldom 600+ dpi) .. it's also why often expansion looks 
bad on screen because even a sub percentage difference can give such 
effects

 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] Display reference number as Roman number

2021-01-06 Thread Rik Kabel

On 11/24/2020 22:09, Rik Kabel wrote:


Hello all,

What I thought should be a simple conversion escapes me.

I have a reference (created originally via a label defined by 
\definelabel) that, when referenced as \in[label] or 
\ref[number][label] displays a number, and that is how I normally use 
it. However, I want to display it in one instance as a Roman numeral. 
\Romannumerals{\in[label]} complains that it is not being fed a number.


How can I display the label number in Roman number format in this one 
instance?


--
Rik

Okay, I have something that works. Perhaps not optimally, but it is 
functional.


   \definelabel[Qa]
   \definecounter[SAVE][numberconversion=R]
   \starttext
   This is labeled.\Qa\par
   This is labeled.\Qa[REF]\par
   \setcounter[SAVE][{\rawcountervalue[Qa]}]
   See \in[REF].\par
   See \ref[number][REF].\par
   See \in[REF].\par
   This is labeled.\Qa\par
   See \convertedcounter[SAVE].\par
   \stoptext

If you can improve it, please do. A solution that lets me use the label 
name (Qa here) and convert the associated number would be nice.


--
Rik

___
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] dutch calendars 3 months

2021-01-05 Thread luigi scarso
On Tue, Jan 5, 2021 at 1:14 PM Taco Hoekwater  wrote:

>
>
> Being Dutch, I never realised there was such a thing as a “Dutch
> calendar”.
>
> These are just calendars? What makes them “Dutch” from an Italian
> viewpoint?
>
> Best wishes,
> Taco
>
>
The  reference site treccani says
https://www.treccani.it/vocabolario/olandese/
 Calendario o., quello formato da 12 o 6 fogli contenenti ciascuno uno o
due mesi con i giorni disposti in colonna, che si appende alla parete.

So, a wall calendar with 12 or 6 sheets, each one within one or two months,
but the canonical form is  with  12 sheets  with the previous month on the
left, the current month at the center and the next month on the right,
each one with the days in a single column.
Of course there are now many variations, but the canonical form is the
better one.
I don't know the origin of the term.
-- 
luigi
___
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] A not so short introduction to ConTeXt Mark IV

2021-01-05 Thread Hans Hagen

On 1/4/2021 5:32 PM, Joaquín Ataz López wrote:



Really? I wouldn't see it this way. I wondered a bit about the
number of primitives shown in the document of Joaquín, but that they
are used certainly doesn't make context like plaintex.


I have calculated the number of primitives from the list made in "TeX 
Reference Manual" by David Bausum (of which there is a web version at 
https://www.tug.org/utilities/plain/cseq.html).


According to that text the number of primitives is exactly 326. In my 
document I rounded it to "approximately 300".
That list is a bit old. In the meantime we got etex extensions, which 
adds a few more, and then pdftex ades some, as well as omega and after 
that of course luatex. In luametatex we dropped some, and added others, 
so there we currently have 770 primitives. The increase of number is 
partly due to the 166 extra math related primitives of which many deal 
with all kind of font related paraneters and inter-blob spacing.


\starttext

\startTEXpage[offset=2mm,width=30cm,align={verytolerant,nothyphenated,flushleft},foregroundstyle=\tttf]
\startluacode
local t = tex.primitives()
table.sort(t)
local n = 0
for i=1,#t do
if string.find(t[i],"^U") then
n =n + 1
end
end
context("%i / %i: % t",#t,n,t)
\stopluacode
\stopTEXpage

\stoptext

if yuou want to know if something is a primitive, say:

\meaningfull\vskip \par
\meaningfull\relax \par
\meaningfull\framed\par

and you get an idea (\meaningfull itself is a primitive, the more 
verbose \meaning, and there's also \meaningless which I let you figure 
out yourself; of course these add two primitives to the repertoire).


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] A not so short introduction to ConTeXt Mark IV

2021-01-04 Thread Joaquín Ataz López



Really? I wouldn't see it this way. I wondered a bit about the
number of primitives shown in the document of Joaquín, but that they
are used certainly doesn't make context like plaintex.


I have calculated the number of primitives from the list made in "TeX 
Reference Manual" by David Bausum (of which there is a web version at 
https://www.tug.org/utilities/plain/cseq.html).


According to that text the number of primitives is exactly 326. In my 
document I rounded it to "approximately 300".



--
Joaquín Ataz López
Derecho Civil
Universidad de Murcia

___
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   3   4   5   6   7   8   9   10   >