[NTG-context] Re: utiliydata

2024-04-25 Thread Hans Hagen

On 4/25/2024 9:25 AM, Thomas A. Schmitz wrote:




Nope, very sorry, can’t figure it out… I see job.register, I see I can access 
structures.refrences.collected, but what about the next level

utilitydata.structures.references.collected={
[""]={
  [“REF"]={

What does the empty key do? And how do I retrieve the value of

REF.references.realpage?

Thomas


Sigh, as always: just when I had hit “send,” I figured it out:

structures.references.collected[""][REF].references.realpage

But I’m not sure if there is an easier/better way. And I still would like to 
know what the empty string as key does.
it's the prefix (namespace) which here is empty (easier to use "" as key 
than have some exception)


Hans



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

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

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


[NTG-context] Re: utiliydata

2024-04-25 Thread Thomas A. Schmitz

> 
> Nope, very sorry, can’t figure it out… I see job.register, I see I can access 
> structures.refrences.collected, but what about the next level
> 
> utilitydata.structures.references.collected={
> [""]={
>  [“REF"]={
> 
> What does the empty key do? And how do I retrieve the value of
> 
> REF.references.realpage?
> 
> Thomas

Sigh, as always: just when I had hit “send,” I figured it out:

structures.references.collected[""][REF].references.realpage

But I’m not sure if there is an easier/better way. And I still would like to 
know what the empty string as key does.

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

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


[NTG-context] Re: utiliydata

2024-04-25 Thread Thomas A. Schmitz

> On 24. Apr 2024, at 17:59, Hans Hagen  wrote:
> 
> grep for "job." (i bet you can figure it out and compensate the embaressment 
> that way)
> 
> Hans

Nope, very sorry, can’t figure it out… I see job.register, I see I can access 
structures.refrences.collected, but what about the next level

utilitydata.structures.references.collected={
 [""]={
  [“REF"]={

What does the empty key do? And how do I retrieve the value of

REF.references.realpage?

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

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


[NTG-context] Re: How to track down source of [entry not flushed] displaying in indexes?

2024-03-13 Thread Joel via ntg-context
 After many hours of trial-and-error, I was able to recreate the problem in a 
minimum working example:
file main.tex only contains:

\starttext

    \index{birds}
    \index{insects}
    
    \input secondary
    
    \placeindex
    
\stoptext
file secondary.tex only contains:


   \index{turtles}

For reasons I can't understand, the index produces the same [entry not flushed] 
error. It seems here happening when contents are input.
My code is so simple, I can't understand what I've typed wrong.

--Joel


On Wednesday, March 13, 2024 at 12:51:56 PM MDT, Joel via ntg-context 
 wrote:  
 
  Okay, I maybe made some progress. I traced the code back and back through the 
various documents and found I have some items inside:

\startnointerference\startnointerference
My intent is to have items that are "there" but invisible to viewers, taking up 
no space on screen, but treated as being present, so the index will still point 
to that particular page.
This solution seems to be what's causing the [entry not flushed] error in the 
index.
Is there another solution instead of startnointerferencethat will hide text or 
any content but still allow page references to link to that blank spot?

--Joel

On Wednesday, March 13, 2024 at 07:53:21 AM MDT, Joel via ntg-context 
 wrote:  
 
 I have some custom registers that I use to index some information. When 
compiled, it just prints [entry not flushed] instead of printing some of the 
page numbers.
I have tens of thousands of lines of code, so have no idea how to break the 
problem down to a minimal example. What does [entry not flushed] mean? What 
kind of feature in my document do I need to search for that might explain why 
this is appearing?

Here is the minimal code used in my index, as you see it isn't showing the 
error, so something else in the document is causing it:

 \setvalue{W3}{this is text for W3}


\defineregister[learnedshort][compress=yes]
\setupregister[learnedshort][style=sansbold, textstyle=slanted, n=3, 
pagenumber=yes, indicator=no]
%
\defineregister[learnedlong][compress=yes]
\setupregister[learnedlong][style=sansbold, textstyle=slanted, n=2, 
pagenumber=yes, indicator=no]
%
\define[1]\learnedis{%
    \txt{} \getvalue{#1}
    \learnedshort{#1}
    \learnedlong{#1}
}
\define[1]\learned{%
    \textreference[textref#1]{\expanded{\currentstructuretitle}}
    \reference[ref#1]{}%
%
    \learnedshort{#1}
    \learnedlong{\getvalue{#1}}
}

\starttext

\learned{W3}

    \startchapter[title=Standards]
  \placeregister[learnedlong]
    \stopchapter
\stoptext


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

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

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

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


[NTG-context] Re: How to track down source of [entry not flushed] displaying in indexes?

2024-03-13 Thread Joel via ntg-context
 Okay, I maybe made some progress. I traced the code back and back through the 
various documents and found I have some items inside:

\startnointerference\startnointerference
My intent is to have items that are "there" but invisible to viewers, taking up 
no space on screen, but treated as being present, so the index will still point 
to that particular page.
This solution seems to be what's causing the [entry not flushed] error in the 
index.
Is there another solution instead of startnointerferencethat will hide text or 
any content but still allow page references to link to that blank spot?

--Joel

On Wednesday, March 13, 2024 at 07:53:21 AM MDT, Joel via ntg-context 
 wrote:  
 
 I have some custom registers that I use to index some information. When 
compiled, it just prints [entry not flushed] instead of printing some of the 
page numbers.
I have tens of thousands of lines of code, so have no idea how to break the 
problem down to a minimal example. What does [entry not flushed] mean? What 
kind of feature in my document do I need to search for that might explain why 
this is appearing?

Here is the minimal code used in my index, as you see it isn't showing the 
error, so something else in the document is causing it:

 \setvalue{W3}{this is text for W3}


\defineregister[learnedshort][compress=yes]
\setupregister[learnedshort][style=sansbold, textstyle=slanted, n=3, 
pagenumber=yes, indicator=no]
%
\defineregister[learnedlong][compress=yes]
\setupregister[learnedlong][style=sansbold, textstyle=slanted, n=2, 
pagenumber=yes, indicator=no]
%
\define[1]\learnedis{%
    \txt{} \getvalue{#1}
    \learnedshort{#1}
    \learnedlong{#1}
}
\define[1]\learned{%
    \textreference[textref#1]{\expanded{\currentstructuretitle}}
    \reference[ref#1]{}%
%
    \learnedshort{#1}
    \learnedlong{\getvalue{#1}}
}

\starttext

\learned{W3}

    \startchapter[title=Standards]
  \placeregister[learnedlong]
    \stopchapter
\stoptext


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

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

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


[NTG-context] How to track down source of [entry not flushed] displaying in indexes?

2024-03-13 Thread Joel via ntg-context
I have some custom registers that I use to index some information. When 
compiled, it just prints [entry not flushed] instead of printing some of the 
page numbers.
I have tens of thousands of lines of code, so have no idea how to break the 
problem down to a minimal example. What does [entry not flushed] mean? What 
kind of feature in my document do I need to search for that might explain why 
this is appearing?

Here is the minimal code used in my index, as you see it isn't showing the 
error, so something else in the document is causing it:

 \setvalue{W3}{this is text for W3}


\defineregister[learnedshort][compress=yes]
\setupregister[learnedshort][style=sansbold, textstyle=slanted, n=3, 
pagenumber=yes, indicator=no]
%
\defineregister[learnedlong][compress=yes]
\setupregister[learnedlong][style=sansbold, textstyle=slanted, n=2, 
pagenumber=yes, indicator=no]
%
\define[1]\learnedis{%
    \txt{} \getvalue{#1}
    \learnedshort{#1}
    \learnedlong{#1}
}
\define[1]\learned{%
    \textreference[textref#1]{\expanded{\currentstructuretitle}}
    \reference[ref#1]{}%
%
    \learnedshort{#1}
    \learnedlong{\getvalue{#1}}
}

\starttext

\learned{W3}

    \startchapter[title=Standards]
  \placeregister[learnedlong]
    \stopchapter
\stoptext


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

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


[NTG-context] Re: Framed Text with Chapter Numbers as Counter

2023-09-17 Thread Wolfgang Schuster

Jeroen schrieb am 16.09.2023 um 22:28:
This MWE has a framed text for some verbatim text (code) with as title 
ref. a counter 1, 2, etc.. Is there a way to change this frame text 
title as following with the chapter number and a sequential number and 
the title.


Code Fragment 1.1 (The First Title)
Code Fragment 1.2 (The Second Title)
Code Fragment 2.1 (The Third Title)

MWE:

[...]

\defineenumeration
   [Counter]
   [title=yes,
    alternative=empty,
    before=\startCountFramedText,
    after=\stopCountFramedText]


\defineenumeration
  [Counter]
  [  title=yes,
   alternative=empty,
  text=Code Fragment,
   way=bychapter,
prefix=yes,
before=\startCountFramedText,
 after=\stopCountFramedText]

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

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

[NTG-context] Re: Framed Text with Chapter Numbers as Counter

2023-09-17 Thread Jeroen
That works fine except that the following line does only issue the
sequential number and not the chapter number.

Refer to \in{code fragment}[tit1] bla

MWE:

\startuseMPgraphic{CountFrame}
  picture p; numeric w, h, o;
  p := textext.rt("\wrappedcurrentconstruction");
  w := OverlayWidth;
  h := OverlayHeight;
  o := BodyFontSize;
  p := p shifted (2o,h-ypart center p);
  draw p;
  path b;
  b := boundingbox p enlarged (o/10);
  path a;
  a := (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner b,h);
  drawoptions (withpen pencircle scaled 1pt withcolor black);
  draw a;
  draw b;
  setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay
  [CountFrame]
  [\useMPgraphic{CountFrame}]

\defineframedtext
  [CountFramedText]
  [frame=off,
   background=CountFrame,
   offset=\bodyfontsize,
   width=\textwidth,
%  style={\switchtobodyfont[11pt,tt]}]
   bodyfont=11pt,
   style={\tt}]

\defineenumeration
  [Code]
  [title=yes,
   alternative=empty,
   before=\startCountFramedText,
   after=\stopCountFramedText,
   left={\somenamedheadnumber{chapter}{current}.}]

\starttext

\startchapter
  [title=first]

\startCode
  [title={The First Title},
   reference={tit1}]
   Some verbatim text
\stopCode

\startCode
  [title={The Second Title},
   reference={tit2}]
   Some verbatim text
\stopCode

Refer to \in{code fragment}[tit1] bla

\stopchapter

\startchapter
  [title=second]

\startCode
  [title={The Third Title},
   reference={tit3}]
   Some verbatim text
\stopCode

\stopchapter

\stoptext

Op zo 17 sep 2023 om 17:31 schreef Bruce Horrocks :

>
>
> > On 16 Sep 2023, at 21:28, Jeroen  wrote:
> >
> > This MWE has a framed text for some verbatim text (code) with as title
> ref. a counter 1, 2, etc.. Is there a way to change this frame text title
> as following with the chapter number and a sequential number and the title.
>
> Amemd the \defineenumeration as follows:
>
> \defineenumeration
>   [Counter]
>   [title=yes,
>alternative=empty,
>before=\startCountFramedText,
>after=\stopCountFramedText,
>left={\somenamedheadnumber{chapter}{current}:}]
>
> —
> Bruce Horrocks
> Hampshire, UK
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

[NTG-context] Re: Framed Text with Chapter Numbers as Counter

2023-09-17 Thread Bruce Horrocks


> On 16 Sep 2023, at 21:28, Jeroen  wrote:
> 
> This MWE has a framed text for some verbatim text (code) with as title ref. a 
> counter 1, 2, etc.. Is there a way to change this frame text title as 
> following with the chapter number and a sequential number and the title.

Amemd the \defineenumeration as follows:

\defineenumeration
  [Counter]
  [title=yes,
   alternative=empty,
   before=\startCountFramedText,
   after=\stopCountFramedText,
   left={\somenamedheadnumber{chapter}{current}:}]

—
Bruce Horrocks
Hampshire, UK

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

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

[NTG-context] Framed Text with Chapter Numbers as Counter

2023-09-16 Thread Jeroen
This MWE has a framed text for some verbatim text (code) with as title ref.
a counter 1, 2, etc.. Is there a way to change this frame text title as
following with the chapter number and a sequential number and the title.

Code Fragment 1.1 (The First Title)
Code Fragment 1.2 (The Second Title)
Code Fragment 2.1 (The Third Title)

MWE:

\startuseMPgraphic{CountFrame}
  picture p; numeric w, h, o;
  p := textext.rt("\wrappedcurrentconstruction");
  w := OverlayWidth; h := OverlayHeight; o := BodyFontSize;
p := p shifted (2o,h-ypart center p);
draw p;
path b;
b := boundingbox p enlarged (o/10);
drawoptions (withpen pencircle scaled 1pt withcolor black);
draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner b,h);
draw b;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay
  [CountFrame]
  [\useMPgraphic{CountFrame}]

\defineframedtext
  [CountFramedText]
  [frame=off,
   background=CountFrame,
   offset=\bodyfontsize,
   width=\textwidth,
%   style={\switchtobodyfont[11pt,tt]}]
   bodyfont=11pt,
   style={\tt},
   ]

\def\FrameTitle#1%
  {\setMPtext{CountFrame}
  {\hbox spread 1em{\hss\strut#1\hss}}}\setMPtext{CountFrame}
  {}

\defineenumeration
  [Counter]
  [title=yes,
   alternative=empty,
   before=\startCountFramedText,
   after=\stopCountFramedText]

\starttext

\startchapter
  [title=first]

\startCounter
  [title={The First Title},
   reference={tit1}]
   Some verbatim text
\stopCounter

\startCounter
  [title={The Second Title},
   reference={tit2}]
   Some verbatim text
\stopCounter

Refer to \in{code fragment}[tit1] bla

\stopchapter

\startchapter
  [title=second]

\startCounter
  [title={The Third Title},
   reference={tit3}]
   Some verbatim text
\stopCounter

\stopchapter

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

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

[NTG-context] Enable interaction on custom apa cite variant

2023-08-19 Thread Jethro Djan
Hi,

I would like a variant of cite per the APA specification that removes the
bracket when quoted in mathematical definitions, theorems, etc. I could of
course do it manually for reach using right= and left= but I didn't want to
do it every time. I have come up with this MWE:

\startbuffer[ref]
@book{burago2022course,
  title={A course in metric geometry},
  author={Burago, Dmitri and Burago, Yuri and Ivanov, Sergei},
  volume={33},
  year={2022},
  publisher={American Mathematical Society}
}
\stopbuffer

\setupinteraction[state=start, color=blue]
\setupcolors[state=start]

\usebtxdataset[ref.buffer]

\usebtxdefinitions[apa]
\definebtx
[apa:cite:theorem]
[apa:cite]
\startsetups btx:apa:cite:theorem
\btxflushauthorname{author}
\btxcomma
\btxflush{year}
\fastsetup{btx:cite:righttext}
\stopsetups

\setupenumeration[
  before={\blank[medium]},
  after={\blank[medium]},
  alternative=serried,
  right=,
  headcommand=\groupedcommand{}{.},
  distance=0.5em,
  width=fit,
  headstyle=bold,
  titlestyle=bold,
  way=bytext,
  conversion=numbers,
  prefix=chapter,
  list=all,
  title=yes,
  indentnext=no,
]

\defineenumeration[definition][
  text=Defintion,
  style=normal,
  number=no,
]

\starttext

\startdefinition{\cite[righttext={{ p.\nbsp 1}},
alternative=theorem][burago2022course]}

This is something

\stopdefinition

\startsubject[title={References}]
\placelistofpublications
\startsubject

\stoptext

The problem with this is that the citation is not interactive like it would
be if I used apa:cite:authoryear and just removed the parentheses in the
options. How do I get it to highlight blue and be interactive like the
default behaviour when you turn on interaction? Also this is probably
overkill so if there is a better way to achieve this...

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

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

[NTG-context] Re: Link from a PDF to a reference of an embedded PDF

2023-07-24 Thread Aditya Mahajan
On Mon, 24 Jul 2023, Gerion Entrup wrote:

> Hi Pablo,
> 
> > not sure I’m getting your point right.
> 
> Thank you for the detailed answer.
> But I fear, I have not expressed myself precise enough.
> The solution that you described does not directly fit to my setting.
> I'll try to rephrase. Maybe it gets more clear then. I think, named
> destinations could be a important part in the solution.
> 
> I'm do not know the structure of PDFs exactly, therefore some of my
> terms might be wrong. I'll name the two things from now on the following
> way:
> - a destination: This is a defined position within a PDF document; so
>   some position that a PDF viewer is able to jump to. In ConTeXt, you
>   can set such a position most of the time with the "reference" keyword.
>   In LaTeX, you use \label.
> - a reference: This is a link that you can click on and cause the
>   PDF viewer to jump/scroll to the linked destination. In ConTeXt, you
>   can use \in to create a reference. In LaTeX, you use \ref.
> 
> The situation is that I have a PDF-document (inner.pdf) that defines
> several destinations and I want to embed that document with
> \externalfigure into another PDF-document (outer.pdf). My question is:
> Is it possible to create references within the source code of outer.pdf
> that correctly set a link to a destination that is defined in inner.pdf?
> Asked in another way: Is is possible that \externalfigure can extract
> the (maybe named) destinations of inner.pdf and translate them in such a
> way, that I can use \in within the outer document to link to them.

According to https://wiki.contextgarden.net/Command/setupexternalfigure

\externalfigure[][interaction=reference]

should keep all the references (you can also try interaction=all). Not sure how 
the references get mapped internally, so that they may be linked. 

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

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

[NTG-context] Re: Link from a PDF to a reference of an embedded PDF

2023-07-24 Thread Gerion Entrup
Hi Pablo,

> not sure I’m getting your point right.

Thank you for the detailed answer.
But I fear, I have not expressed myself precise enough.
The solution that you described does not directly fit to my setting.
I'll try to rephrase. Maybe it gets more clear then. I think, named
destinations could be a important part in the solution.

I'm do not know the structure of PDFs exactly, therefore some of my
terms might be wrong. I'll name the two things from now on the following
way:
- a destination: This is a defined position within a PDF document; so
  some position that a PDF viewer is able to jump to. In ConTeXt, you
  can set such a position most of the time with the "reference" keyword.
  In LaTeX, you use \label.
- a reference: This is a link that you can click on and cause the
  PDF viewer to jump/scroll to the linked destination. In ConTeXt, you
  can use \in to create a reference. In LaTeX, you use \ref.

The situation is that I have a PDF-document (inner.pdf) that defines
several destinations and I want to embed that document with
\externalfigure into another PDF-document (outer.pdf). My question is:
Is it possible to create references within the source code of outer.pdf
that correctly set a link to a destination that is defined in inner.pdf?
Asked in another way: Is is possible that \externalfigure can extract
the (maybe named) destinations of inner.pdf and translate them in such a
way, that I can use \in within the outer document to link to them.


Gerion


signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] hyperlinks not working with current latest

2023-05-28 Thread Hans Hagen via ntg-context

On 5/28/2023 8:57 PM, Pablo Rodriguez via ntg-context wrote:

Dear list,

in the following sample, hyperlinks for footnotest don’t work with
current latest (2023.05.28 18:57) with current LMTX (20230528):

   \setupinteraction
 [state=start,
  focus=standard]
   \starttext
   \completecontent
   \dorecurse{5}
 {a\footnote{}}
   \stoptext

LuaTeX generates fine hyperlinks for footnotes.

My guess is that the issue is in the LuaMetaTeX binary.

Could anyone confirm this issue?
i'll check it but (maybe side effect of some ref things Alan and I are 
working on). The engine has nothing to do with it as it doesn't play a 
role in these matters.


Hans

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

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

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


[NTG-context] Trial to use LibreOffice Calc (+ python) to build ConTeXt customized environnements files

2023-04-10 Thread Garulfo via ntg-context

Hi all,

I started an attempt to help producing customized environnements files 
with LibreOffice Calc and macro with python, to see if and how it can 
helps newcomers (after viewing video about batch commander from Ricardo 
Lafuente and Kaveh Bazargan).


It is very early stage (and very quick and dirty), but any feedback is 
welcome.


=

Currently working:

- one sheet to setup colors  ==> env_A05_color.tex
  - after clicking on button Go!, colors are actually shown
deduced from hsv parameter

- one sheet to setup sectionning ==> env_B14_section.tex
  - Options are categorized
- 01-Style
- 02-Numbering
- 03-Position (not yet clear)
- 04-Insert
- 05-Reference
- 06-commands

- one sheet to setup layout  ==> env_A01_layout.tex

- one sheet to setup font==> env_A04_fonts.tex
  - thanks to mtxrun --script font it provides
- the list of available font families
  - after 1st clic on fonts button
- the list of available font names
  - after selecting families and 2nd clic on fonts button
  - it can help to produce simple typescripts in 1min

=
Package can be found at 
https://wiki.contextgarden.net/images/7/73/SetupContext_with_libreoffice_v00.04.zip


4 files

1/ SetupContext_with_libreoffice.py ---
Python file that should be put in
- gnu+linux : ~/.config/libreoffice/4/user/Scripts/python
- win : C:\Users\x\AppData\Roaming\OpenOffice\4\user\Scripts\python
- mac : /Applications//LibreOffice\ 
Vanilla.app/Contents/Resources/Scripts/python/


def Initialization(): should be adapted for
 ContextPath = "path to …/tex/texmf-linux-64/bin/"

2/ readme.tex 
Basic document with content and ref to global environnement file

3/ env_00.tex 
environnement file that refers to other specific environnement files
which are produced by the macro

4/ gui_v04.ods 
LibreOffice Calc as interface for user

=
examples of output env files are attached.




\setuplayout
  [
   backspace=37mm,
   width=136mm,
   topspace=12mm,
   height=273mm,
   margindistance=5mm,
   leftmargin=20mm,
   rightmargin=20mm,
   edgedistance=2mm,
   leftedge=5mm,
   rightedge=5mm,
   headerdistance=5mm,
   header=10mm,
   footerdistance=5mm,
   footer=10mm,
   topdistance=2mm,
   top=5mm,
   bottomdistance=2mm,
   bottom=5mm,
   grid=no,
  ]





\setuppapersize[A4]



\starttypescript [serif] [myfont]
\setups[font:fallback:serif]
  \definefontsynonym [Serif] [name:palatinoltstdlight]   [features=default]
  \definefontsynonym [SerifItalic]   [name:palatinoltstdlightitalic] [features=default]
  \definefontsynonym [SerifBold] [name:palatinoltstdmedium]  [features=default]
  \definefontsynonym [SerifBoldItalic]   [name:palatinoltstdmediumitalic][features=default]
\stoptypescript

\starttypescript [sans] [myfont]
\setups[font:fallback:sans]
  \definefontsynonym [Sans] [name:ibmplexsans]  [features=default]
  \definefontsynonym [SansItalic]   [name:ibmplexsansitalic][features=default]
  \definefontsynonym [SansBold] [name:ibmplexsansbold]  [features=default]
  \definefontsynonym [SansBoldItalic]   [name:ibmplexsansbolditalic][features=default]
\stoptypescript

\starttypescript [mono] [myfont]
\setups[font:fallback:mono]
  \definefontsynonym [Mono] [name:sourcecodeprolight]   [features=default]
  \definefontsynonym [MonoItalic]   [name:sourcecodeprolightit] [features=default]
  \definefontsynonym [MonoBold] [name:sourcecodeprobold][features=default]
  \definefontsynonym [MonoBoldItalic]   [name:sourcecodeproblackit] [features=default]
\stoptypescript

\starttypescript [math] [myfont]
\setups[font:fallback:math]
  \definefontsynonym [Math] [name:lmroman10regular] [features=default]
  \definefontsynonym [MathItalic]   [name:lmroman10italic]  [features=default]
  \definefontsynonym [MathBold] [name:lmroman10bold][features=default]
  \definefontsynonym [MathBoldItalic]   [name:lmroman10bolditalic]  [features=default]
\stoptypescript

\starttypescript [handwriting] [myfont]
\setups[font:fallback:handwriting]
  \definefontsynonym [Handwriting] [name:snellroundhandltstdscr]  

[NTG-context] [m-database] How to properly add module arguments?

2023-02-25 Thread Paul Mazaitis via ntg-context
Dear list,

## The Incredibly Short Version

I am trying to extend m-database, and I want to add a flag to control behavior. 
I can get it to work, but I am having trouble understanding how to do it 
properly.

## The Short Version

I have a project where I wish to incorporate many CSV files as Natural Tables.

I want to keep the headers in the CSV files so they're useful in other contexts.

The `m-database` module doesn't have a feature to suppress the header row, from 
what I can see.

(I know `handlecsv` can do this, but I'm having troubles with that; if the 
`m-database` line of inquiry doesn't work out, I'll go back it, but I figure 
I'll focus on this solution for now.)

Looking at the module sources, I can implement the functionality I need in the 
Lua part of the module, but:

I seem to only be able to bodge in additional arguments for the commands in the 
module.

On first try, I got the error: `tex error   > tex error on line 30 in file 
/Users/pmazaitis/Opt/context/tex/texmf-context/tex/context/modules/mkiv/m-databaseplus.mkiv:
 ! Undefined control sequence`

And then: `The control sequence at the end of the top line of your error 
message was never
\def'ed.`

Looking at the docs points me to a solution using  `\def`, but it's not clear 
to me how that's working in the case of the database module (the database 
module seems to be initializing these values someplace else?).

If I \def the settings variable in m-database.mkiv,  I can get it to work, but 
I don't think that's the correct way to go about this.

Question: how do I properly define new module arguments for the database module?

## The Long Version, With MWE

### Files Associated With the MWE

Apologies for all of the file inclusions, but I want to be complete.


Here's the .csv file I'm using for the MWE:

--- begin database-mwe.csv ---

Ref. No.,Part No.,Description,Remarks
,RD14C82E000J,Carbon 000흮 ±5% 1/4W,

---  end database-mwe.csv  ---

Some notes on database-mwe.csv:

I'd like to keep the header row in place to make this file useful for other 
tools.

These are lists of electronic parts, so I'd like to include uppercase omega, 
lower case mu, and percent sign characters in the CSV file.


Here's the .tex file I'm using for the MWE:

--- begin database-mwe.tex ---

\usemodule[database]

\setupdatabase[quotechar={"},separator={,}]

\defineseparatedlist
  [PartsTable]
  [separator=comma,left=\bTD,right=\eTD,first=\bTR,last=\eTR,before={
\bTABLE[split=repeat,option=stretch]
  \bTABLEhead
  \bTR
    \bTH Ref. No. \eTH \bTH Part No. \eTH \bTH Description \eTH \bTH Remarks 
\eTH
  \eTR
  \eTABLEhead
  \bTABLEbody
   },
   after={
  \eTABLEbody
  \eTABLE
   }]

\starttext

test

\startasciimode
\processdatabasefile[PartsTable][parts_list-test.csv]
\stopasciimode

\stoptext

---  end database-mwe.tex  ---

Some notes on database-mwe.tex:

This actually works pretty well with the distributed m-database module!

Some of these lists are quite long, so I want to use a TABLEhead to replicate 
the headings at the top of a new page. I don't think there's a way to automate 
this with `m-database`, so I'm okay with hard-coding the headers. This does 
mean I get a double header row at the top of the table. I want to suppress the 
header row; I'd like to implement this behavior in the module behind a switch.

(I'm using the `asciimode` environment to dodge problems with unescaped `%` 
characters and Greek letters. I tried adding the startasciimode/stopasciimode 
commands to various keys in the \defineseparatedlist command, but I didn't get 
anywhere with it - I got errors. A problem for another time...)

I think I've got a good handle on how to do this in Lua, but I'm struggling 
with what to add to the switch appropriately.

In attempting to add a switch, I tried the following.

Based off of https://wiki.contextgarden.net/Modules#Modules_writing_guidelines,
I added a stanza to the appropriate interface file:

--- begin stanza added to i-database.xml ---






---  end stanza added to i-database.xml  ---

I modeled that after the stanza for the argument `strip`. I think that's the 
only thing I need to do in the interface file.

Changing the i-database.xml file does not break the build.

However, as soon as I add the skipheader argument to the m-database.mkiv file:

--- begin definition in m-database.mkiv ---

\setupdatabase
  [\c!separator={,},
   \c!quotechar=,
   \c!commentchar=,
   \c!strip=\v!no,
   \c!skipheader=\v!no, % <- Added, following the pattern with strip
   \c!before=,
   \c!after=,
   \c!first=,
   \c!last=,
   \c!left=,
   \c!right=]

---  end definition in m-database.mkiv  ---


...the build fails (with the error from the Short Version section).

If I then add the following \def to m-database.mkiv before the \setupdatabase 
command:

\def\c!skipheader {skipheader}

...the build succeeds! I can now pass that settings value to m-database.l

Re: [NTG-context] Wrong prefix in cross references to formulas in external document

2023-01-31 Thread Yaroslav Beltukov via ntg-context
Dear Hans,

Thank you for the nice and straightforward solution. I have tested it
locally and it works. I hope it will be in the next release (should I do
anything?).

By the way, I have a couple of other small issues. I will describe them in
detail in other threads of this mailing list if it is the right place to do
so.

Best regards,
Yaroslav


пн, 30 янв. 2023 г. в 12:52, Hans Hagen via ntg-context :

> On 1/29/2023 5:03 PM, Yaroslav Beltukov via ntg-context wrote:
> > Dear Hans and all contributors,
> >
> > I really appreciate ConTeXt for the right way to obtain high quality
> > documents. I'm a theoretical physicist and I'm going to write a book. I
> > think ConTeXt is the right choice to work with a number of formulas,
> > figures and cross-references. The visual quality of formulas is better
> > than in regular LaTeX. The new feature with formula autosplitting looks
> > also very promising. For me it is important to obtain the high quality
> > without a lot of manual tweaks of each formula for each given document
> > format and figure placement.
> >
> > However, I have found a problem with references if I compile one
> > component only. The references to formulas in other components have
> > wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the right
> > formula references are very important.
> >
> > I started looking into this issue. The references to other components
> > are taken from the whole product as from an external document. It turned
> > out that this is a general problem with references with prefixes to
> > external documents. The prefix is stored in a tuc file as a reference to
> > a section as a sequential number of the header in the document. As a
> > result, the prefix from the external document is calculated using the
> > structure of the current document.
> >
> > Here is the MWE, which consists of two files:
> > foo.tex:
> >
> > \defineenumeration[remark][prefix=yes, prefixsegments=chapter:section]
> >
> > \starttext
> >
> > Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4]
> >
> > Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4]
> >
> > Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4]
> >
> > Remarks: \in[remark1], \in[remark2]
> >
> > \startbodymatter
> >
> > \chapter[chap1]{Chapter}
> > \placeformula[eq1]\startformula x = y\stopformula
> > \chapter[chap2]{Chapter}
> > \section[sec1]{Section}
> > \section[sec2]{Section}
> > \placeformula[eq1]\startformula x = y\stopformula
> > \placeformula[eq2]\startformula x = y\stopformula
> >
> > \stopbodymatter
> >
> > \startappendices
> >
> > \chapter[chap3]{Chapter}
> > \section[sec3]{Section}
> > \placeformula[eq3]\startformula x = y\stopformula
> > \section[sec4]{Section}
> > \startremark[remark1]\stopremark
> > \placeformula[eq4]\startformula x = y\stopformula
> > \startremark[remark2]\stopremark
> > \chapter[chap4]{Chapter}
> >
> > \stopappendices
> >
> > \stoptext
> >
> >
> > bar.tex:
> >
> > \starttext
> >
> > Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4]
> >
> > Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec4]
> >
> > Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3],
> \in[foo::chap4]
> >
> > Remarks: \in[foo::remark1], \in[foo::remark2]
> >
> > % any chapters and sections here
> >
> > \stoptext
> >
> > It is expected to have the same first page on these documents:
> >
> > Equations: 1.1, 2.2, A.1, A.2
> > Sections: 2.1, 2.2, A.1, A.2
> > Chapters: 1, 2, A, B
> > Remarks: A.2.1, A.2.2
> >
> > However, the bar.tex produces wrong prefixes to formulas and remarks.
> > The output depends on the document structure of bar.tex, not foo.tex.
> >
> > I started looking into the source code. Thanks to lua, it is not a big
> > deal to track the problem. The prefixdata is complemented by the
> > sectiondata after the loading the tuc file. So, the question is: is it
> > possible to store the full prefixdata with all necessary prefix numbers
> > in the tuc file? Here is my proposal to change the source code:
> >
> > --- strc-lst-old.lmt2023-01-29 11:30:15.610309948 +0300
> > +++ strc-lst.lmt2023-01-29 12:10:08.864228923 +0300
> > @@ -266,6 +266,16 @@
> >   if r and not r.section then
> >   r.section = structures.sections.currentid()
> >   end
> > +-- store sectiondata in prefixdata (necessary for extern

Re: [NTG-context] Wrong prefix in cross references to formulas in external document

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

On 1/29/2023 5:03 PM, Yaroslav Beltukov via ntg-context wrote:

Dear Hans and all contributors,

I really appreciate ConTeXt for the right way to obtain high quality 
documents. I'm a theoretical physicist and I'm going to write a book. I 
think ConTeXt is the right choice to work with a number of formulas, 
figures and cross-references. The visual quality of formulas is better 
than in regular LaTeX. The new feature with formula autosplitting looks 
also very promising. For me it is important to obtain the high quality 
without a lot of manual tweaks of each formula for each given document 
format and figure placement.


However, I have found a problem with references if I compile one 
component only. The references to formulas in other components have 
wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the right 
formula references are very important.


I started looking into this issue. The references to other components 
are taken from the whole product as from an external document. It turned 
out that this is a general problem with references with prefixes to 
external documents. The prefix is stored in a tuc file as a reference to 
a section as a sequential number of the header in the document. As a 
result, the prefix from the external document is calculated using the 
structure of the current document.


Here is the MWE, which consists of two files:
foo.tex:

\defineenumeration[remark][prefix=yes, prefixsegments=chapter:section]

\starttext

Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4]

Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4]

Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4]

Remarks: \in[remark1], \in[remark2]

\startbodymatter

\chapter[chap1]{Chapter}
\placeformula[eq1]\startformula x = y\stopformula
\chapter[chap2]{Chapter}
\section[sec1]{Section}
\section[sec2]{Section}
\placeformula[eq1]\startformula x = y\stopformula
\placeformula[eq2]\startformula x = y\stopformula

\stopbodymatter

\startappendices

\chapter[chap3]{Chapter}
\section[sec3]{Section}
\placeformula[eq3]\startformula x = y\stopformula
\section[sec4]{Section}
\startremark[remark1]\stopremark
\placeformula[eq4]\startformula x = y\stopformula
\startremark[remark2]\stopremark
\chapter[chap4]{Chapter}

\stopappendices

\stoptext


bar.tex:

\starttext

Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4]

Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec4]

Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], \in[foo::chap4]

Remarks: \in[foo::remark1], \in[foo::remark2]

% any chapters and sections here

\stoptext

It is expected to have the same first page on these documents:

Equations: 1.1, 2.2, A.1, A.2
Sections: 2.1, 2.2, A.1, A.2
Chapters: 1, 2, A, B
Remarks: A.2.1, A.2.2

However, the bar.tex produces wrong prefixes to formulas and remarks. 
The output depends on the document structure of bar.tex, not foo.tex.


I started looking into the source code. Thanks to lua, it is not a big 
deal to track the problem. The prefixdata is complemented by the 
sectiondata after the loading the tuc file. So, the question is: is it 
possible to store the full prefixdata with all necessary prefix numbers 
in the tuc file? Here is my proposal to change the source code:


--- strc-lst-old.lmt    2023-01-29 11:30:15.610309948 +0300
+++ strc-lst.lmt        2023-01-29 12:10:08.864228923 +0300
@@ -266,6 +266,16 @@
      if r and not r.section then
          r.section = structures.sections.currentid()
      end
+    -- store sectiondata in prefixdata (necessary for external files)
+    if t.prefixdata and r.section then
+        local sectiondata = structures.sections.collected[r.section]
+        if sectiondata then
+            for k, v in next, sectiondata do
+                t.prefixdata[k] = v
+            end
+        end
+    end
+    --
      local b = r and t.block
      if r and not b then
          local s = r.section

--- strc-ref-old.lmt    2023-01-29 11:30:15.823643904 +0300
+++ strc-ref.lmt        2023-01-29 12:07:45.697109862 +0300
@@ -2318,7 +2318,17 @@
      if data then
          numberdata = lists.reordered(data) -- data.numberdata
          if numberdata then
-            helpers.prefix(data,prefixspec)
+            -- helpers.prefix(data,prefixspec)
+            -- use the actual numbers from prefixdata
+            local prefixdata = data.prefixdata
+            if prefixdata then
+                -- adapted from helpers.prefix (not sure)
+                if (prefixspec and prefixspec == no) or 
prefixdata.prefix == no then

+                    prefixdata = false
+                end
+                sections.typesetnumber(prefixdata,"prefix", prefixspec 
or false, prefixdata)

+            end
+            --
 
  sections.typesetnumber(numberdata,"number",numberspec,numberdata)

          else
              local useddata = data.useddata

After this small change, all the references are correct. How

Re: [NTG-context] Wrong prefix in cross references to formulas in external document

2023-01-29 Thread Alan Braslau via ntg-context
I, too, am struggling with external (and internal) references.
I have created (and sent to Hans) a MWE that seems to identify two bugs:

1) External references: in a single product, some of these work, and
*some* do not render the numbers (using \in{} [ref], for example). They
are, however, identified as known or "verified".

2) Internal references: all render but *some* get "missing link target"
errors (in the PDF viewer).

I have not been able to get anywhere with the (lua) code, myself.

Alan




On Sun, 29 Jan 2023 19:03:32 +0300
Yaroslav Beltukov via ntg-context  wrote:

> Dear Hans and all contributors,
> 
> I really appreciate ConTeXt for the right way to obtain high quality
> documents. I'm a theoretical physicist and I'm going to write a book.
> I think ConTeXt is the right choice to work with a number of formulas,
> figures and cross-references. The visual quality of formulas is
> better than in regular LaTeX. The new feature with formula
> autosplitting looks also very promising. For me it is important to
> obtain the high quality without a lot of manual tweaks of each
> formula for each given document format and figure placement.
> 
> However, I have found a problem with references if I compile one
> component only. The references to formulas in other components have
> wrong prefixes, e.g. (2.1) instead of (3.1). Needless to say, the
> right formula references are very important.
> 
> I started looking into this issue. The references to other components
> are taken from the whole product as from an external document. It
> turned out that this is a general problem with references with
> prefixes to external documents. The prefix is stored in a tuc file as
> a reference to a section as a sequential number of the header in the
> document. As a result, the prefix from the external document is
> calculated using the structure of the current document.
> 
> Here is the MWE, which consists of two files:
> foo.tex:
> 
> \defineenumeration[remark][prefix=yes, prefixsegments=chapter:section]
> 
> \starttext
> 
> Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4]
> 
> Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4]
> 
> Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4]
> 
> Remarks: \in[remark1], \in[remark2]
> 
> \startbodymatter
> 
> \chapter[chap1]{Chapter}
> \placeformula[eq1]\startformula x = y\stopformula
> \chapter[chap2]{Chapter}
> \section[sec1]{Section}
> \section[sec2]{Section}
> \placeformula[eq1]\startformula x = y\stopformula
> \placeformula[eq2]\startformula x = y\stopformula
> 
> \stopbodymatter
> 
> \startappendices
> 
> \chapter[chap3]{Chapter}
> \section[sec3]{Section}
> \placeformula[eq3]\startformula x = y\stopformula
> \section[sec4]{Section}
> \startremark[remark1]\stopremark
> \placeformula[eq4]\startformula x = y\stopformula
> \startremark[remark2]\stopremark
> \chapter[chap4]{Chapter}
> 
> \stopappendices
> 
> \stoptext
> 
> 
> bar.tex:
> 
> \starttext
> 
> Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4]
> 
> Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3],
> \in[foo::sec4]
> 
> Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3],
> \in[foo::chap4]
> 
> Remarks: \in[foo::remark1], \in[foo::remark2]
> 
> % any chapters and sections here
> 
> \stoptext
> 
> It is expected to have the same first page on these documents:
> 
> Equations: 1.1, 2.2, A.1, A.2
> Sections: 2.1, 2.2, A.1, A.2
> Chapters: 1, 2, A, B
> Remarks: A.2.1, A.2.2
> 
> However, the bar.tex produces wrong prefixes to formulas and remarks.
> The output depends on the document structure of bar.tex, not foo.tex.
> 
> I started looking into the source code. Thanks to lua, it is not a
> big deal to track the problem. The prefixdata is complemented by the
> sectiondata after the loading the tuc file. So, the question is: is
> it possible to store the full prefixdata with all necessary prefix
> numbers in the tuc file? Here is my proposal to change the source
> code:
> 
> --- strc-lst-old.lmt2023-01-29 11:30:15.610309948 +0300
> +++ strc-lst.lmt2023-01-29 12:10:08.864228923 +0300
> @@ -266,6 +266,16 @@
>  if r and not r.section then
>  r.section = structures.sections.currentid()
>  end
> +-- store sectiondata in prefixdata (necessary for external files)
> +if t.prefixdata and r.section then
> +local sectiondata = structures.sections.collected[r.section]
> +if sectiondata then
> +for k, v in next, sectiondata do
> +t.prefixdata[k] = v
> +end
> +end
> +end
> +--
>  local b = r and t

[NTG-context] Wrong prefix in cross references to formulas in external document

2023-01-29 Thread Yaroslav Beltukov via ntg-context
Dear Hans and all contributors,

I really appreciate ConTeXt for the right way to obtain high quality
documents. I'm a theoretical physicist and I'm going to write a book. I
think ConTeXt is the right choice to work with a number of formulas,
figures and cross-references. The visual quality of formulas is better than
in regular LaTeX. The new feature with formula autosplitting looks also
very promising. For me it is important to obtain the high quality without a
lot of manual tweaks of each formula for each given document format and
figure placement.

However, I have found a problem with references if I compile one component
only. The references to formulas in other components have wrong prefixes,
e.g. (2.1) instead of (3.1). Needless to say, the right formula references
are very important.

I started looking into this issue. The references to other components are
taken from the whole product as from an external document. It turned out
that this is a general problem with references with prefixes to external
documents. The prefix is stored in a tuc file as a reference to a section
as a sequential number of the header in the document. As a result, the
prefix from the external document is calculated using the structure of the
current document.

Here is the MWE, which consists of two files:
foo.tex:

\defineenumeration[remark][prefix=yes, prefixsegments=chapter:section]

\starttext

Equations: \in[eq1], \in[eq2], \in[eq3], \in[eq4]

Sections: \in[sec1], \in[sec2], \in[sec3], \in[sec4]

Chapters: \in[chap1], \in[chap2], \in[chap3], \in[chap4]

Remarks: \in[remark1], \in[remark2]

\startbodymatter

\chapter[chap1]{Chapter}
\placeformula[eq1]\startformula x = y\stopformula
\chapter[chap2]{Chapter}
\section[sec1]{Section}
\section[sec2]{Section}
\placeformula[eq1]\startformula x = y\stopformula
\placeformula[eq2]\startformula x = y\stopformula

\stopbodymatter

\startappendices

\chapter[chap3]{Chapter}
\section[sec3]{Section}
\placeformula[eq3]\startformula x = y\stopformula
\section[sec4]{Section}
\startremark[remark1]\stopremark
\placeformula[eq4]\startformula x = y\stopformula
\startremark[remark2]\stopremark
\chapter[chap4]{Chapter}

\stopappendices

\stoptext


bar.tex:

\starttext

Equations: \in[foo::eq1], \in[foo::eq2], \in[foo::eq3], \in[foo::eq4]

Sections: \in[foo::sec1], \in[foo::sec2], \in[foo::sec3], \in[foo::sec4]

Chapters: \in[foo::chap1], \in[foo::chap2], \in[foo::chap3], \in[foo::chap4]

Remarks: \in[foo::remark1], \in[foo::remark2]

% any chapters and sections here

\stoptext

It is expected to have the same first page on these documents:

Equations: 1.1, 2.2, A.1, A.2
Sections: 2.1, 2.2, A.1, A.2
Chapters: 1, 2, A, B
Remarks: A.2.1, A.2.2

However, the bar.tex produces wrong prefixes to formulas and remarks. The
output depends on the document structure of bar.tex, not foo.tex.

I started looking into the source code. Thanks to lua, it is not a big deal
to track the problem. The prefixdata is complemented by the sectiondata
after the loading the tuc file. So, the question is: is it possible to
store the full prefixdata with all necessary prefix numbers in the tuc
file? Here is my proposal to change the source code:

--- strc-lst-old.lmt2023-01-29 11:30:15.610309948 +0300
+++ strc-lst.lmt2023-01-29 12:10:08.864228923 +0300
@@ -266,6 +266,16 @@
 if r and not r.section then
 r.section = structures.sections.currentid()
 end
+-- store sectiondata in prefixdata (necessary for external files)
+if t.prefixdata and r.section then
+local sectiondata = structures.sections.collected[r.section]
+if sectiondata then
+for k, v in next, sectiondata do
+t.prefixdata[k] = v
+end
+end
+end
+--
 local b = r and t.block
 if r and not b then
 local s = r.section

--- strc-ref-old.lmt2023-01-29 11:30:15.823643904 +0300
+++ strc-ref.lmt2023-01-29 12:07:45.697109862 +0300
@@ -2318,7 +2318,17 @@
 if data then
 numberdata = lists.reordered(data) -- data.numberdata
 if numberdata then
-helpers.prefix(data,prefixspec)
+-- helpers.prefix(data,prefixspec)
+-- use the actual numbers from prefixdata
+local prefixdata = data.prefixdata
+if prefixdata then
+-- adapted from helpers.prefix (not sure)
+if (prefixspec and prefixspec == no) or prefixdata.prefix
== no then
+prefixdata = false
+end
+sections.typesetnumber(prefixdata,"prefix", prefixspec or
false, prefixdata)
+end
+--

 sections.typesetnumber(numberdata,"number",numberspec,numberdata)
 else
 local useddata = data.useddata

After this small change, all the references are correct. However, I'm quite
new to ConTeXt, so maybe here are some caveats. It would be great to fix
the references to formulas, especially

Re: [NTG-context] question about multimedia renderings

2023-01-16 Thread Pablo Rodriguez via ntg-context
On 1/16/23 02:42, Michal Vlasák via ntg-context wrote:
> [...] 
> I would think that something like the attached could work. But in some
> cases it fails on the TeX side with something I am not sure about. I
> probably overlooked something. Anyways the idea is to just use the
> Start/StopRendering actions with the correct label.

Hi Michal,

many thanks for your reply.

Your code fixes the "auto" option. At least with the following sample:

  \setupinteraction[state=start]
  \unexpanded\def\IncludeVideo[#1]
   {\definerenderingwindow[#1]
  [width=\textwidth, height=\textwidth,
  framecolor=red]
\userendering[#1][video/mp4][#1]
  [embed=yes, auto]
\placerenderingwindow[#1][#1]}
  \starttext
  \null\page
  \startTEXpage[offset=1em, pagestate=start]
\IncludeVideo[video-1.mp4]
  \stopTEXpage
  \null\page
  \startTEXpage[offset=1em, pagestate=start]
\IncludeVideo[video-2.mp4]
  \stopTEXpage
  \null\page
  \stoptext

I attach a diff and complete file with the the fix from today and the
addition of controls, volume, repeat and opacity you sent me some days
ago (already sent in
https://mailman.ntg.nl/pipermail/dev-context/2022/003957.html).

Just in case Hans may review your code and merge into ConTeXt.

Many thanks for your help,

Pablo--- /home/ousia/Desktop/lpdf-wid.lmt
+++ /home/ousia/mkxl/lpdf-wid.lmt
@@ -64,6 +64,10 @@
 local v_compress   = variables.compress
 local v_list   = variables.list
 local v_title  = variables.title
+local v_controls   = variables.controls
+local v_volume = variables.volume
+local v_repeat = variables["repeat"]
+local v_opacity= variables.opacity
 
 local lpdf = lpdf
 
@@ -615,7 +619,7 @@
 -- sound is different, no window (or zero) so we need to collect them and
 -- force them if not set
 
-local ms, mu, mf = { }, { }, { }
+local mu, mf = { }, { }, { }
 
 local function delayed(label)
 local reserved = mu[label]
@@ -623,7 +627,7 @@
 reserved = pdfreserveobject()
 mu[label] = reserved
 end
-return pdfreference(reserved)
+return reserved
 end
 
 local function checkedreference(ref)
@@ -639,16 +643,16 @@
 local openpage  = specification.openpage
 local closepage = specification.closepage
 local option= settings_to_hash(specification.option)
-if option[v_auto] then
-if not openpage or openpage == "" then
-openpage = variables.StartCurrentRendering
-end
-if not closepage or closepage == "" then
-closepage = variables.StopCurrentRendering
-end
-end
 openpage  = checkedreference(openpage)
 closepage = checkedreference(closepage)
+if option[v_auto] then
+if not openpage then
+openpage = executers.startrendering(label)
+end
+if not closepage then
+closepage = executers.stoprendering(label)
+end
+end
 if openpage or closepage then
 actions = pdfdictionary {
 PO = openpage,
@@ -656,13 +660,8 @@
 }
 end
 local page = tonumber(specification.page) or texgetcount("realpageno") -- todo
-local r = mu[label] or pdfreserveobject() -- reserve, child refers to parent
-local a = pdfdictionary {
-S  = pdfconstant("Rendition"),
-R  = mf[label],
-OP = 0,
-AN = pdfreference(r),
-}
+local r = delayed(label) -- reserve, child refers to parent
+local a = executers.startrendering(label)
 local bs, bc = pdfborder()
 local d = pdfdictionary {
 Subtype = pdfconstant("Screen"),
@@ -676,7 +675,6 @@
 local width = specification.width or 0
 local height = specification.height or 0
 context(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
-return pdfreference(r)
 end
 
 -- some dictionaries can have a MH (must honor) or BE (best effort) capsule
@@ -713,7 +711,7 @@
  --  B = start,
  -- }
  -- }
-local parameters = pdfdictionary {
+local permissions = pdfdictionary {
 Type = pdfconstant("MediaPermissions"),
 TF   = pdfstring("TEMPALWAYS"), -- TEMPNEVER TEMPEXTRACT TEMPACCESS TEMPALWAYS / needed for acrobat/wmp
 }
@@ -733,6 +731,20 @@
 forcereference = option[v_list] ~= v_no,
 }
 end
+local media_play_params = pdfdictionary {
+Type = pdfconstant("MediaPlayParams"),
+BE   = pdfdictionary {
+C  = option[v_controls] and option[v_controls] ~= v_no or false,
+V  = tonumber(option[v_volume]) or 100,
+RC = tonumber(option[v_repeat]) or 1,
+},
+  

Re: [NTG-context] question about multimedia renderings

2023-01-15 Thread Michal Vlasák via ntg-context
uot;Note"),
-- TextNote = pdfconstant("Text Note"),
-- UpArrow  = pdfconstant("Up Arrow"),
-- UpLeftArrow  = pdfconstant("Up-Left Arrow"),
-- }

local attachment_symbols = {
Graph = pdfconstant("Graph"),
Paperclip = pdfconstant("Paperclip"),
Pushpin   = pdfconstant("PushPin"),
}

attachment_symbols.PushPin = attachment_symbols.Pushpin
attachment_symbols.Default = attachment_symbols.Pushpin

function lpdf.attachmentsymbols()
return sortedkeys(comment_symbols)
end

local comment_symbols = {
Comment  = pdfconstant("Comment"),
Help = pdfconstant("Help"),
Insert   = pdfconstant("Insert"),
Key  = pdfconstant("Key"),
Newparagraph = pdfconstant("NewParagraph"),
Note = pdfconstant("Note"),
Paragraph= pdfconstant("Paragraph"),
}

comment_symbols.NewParagraph = Newparagraph
comment_symbols.Default  = Note

function lpdf.commentsymbols()
return sortedkeys(comment_symbols)
end

local function analyzesymbol(symbol,collection)
if not symbol or symbol == "" then
return collection and collection.Default, nil
elseif collection and collection[symbol] then
return collection[symbol], nil
else
local setn, setr, setd
local set = settings_to_array(symbol)
if #set == 1 then
setn, setr, setd = set[1], set[1], set[1]
elseif #set == 2 then
setn, setr, setd = set[1], set[1], set[2]
else
setn, setr, setd = set[1], set[2], set[3]
end
local appearance = pdfdictionary {
N = setn and registeredsymbol(setn),
R = setr and registeredsymbol(setr),
D = setd and registeredsymbol(setd),
}
local appearanceref = pdfshareobjectreference(appearance)
return nil, appearanceref
end
end

local function analyzenormalsymbol(symbol)
local appearance = pdfdictionary {
N = registeredsymbol(symbol),
}
local appearanceref = pdfshareobjectreference(appearance)
return appearanceref
end

codeinjections.analyzesymbol   = analyzesymbol
codeinjections.analyzenormalsymbol = analyzenormalsymbol

local function analyzelayer(layer)
-- todo:  (specification.layer ~= "" and pdfreference(specification.layer)) 
or nil, -- todo: ref to layer
end

local function analyzecolor(colorvalue,colormodel)
local cvalue = colorvalue and tonumber(colorvalue)
local cmodel = colormodel and tonumber(colormodel) or 3
return cvalue and pdfarray { pdfcolorvalues(cmodel,cvalue) } or nil
end

local function analyzetransparency(transparencyvalue)
local tvalue = transparencyvalue and tonumber(transparencyvalue)
return tvalue and pdftransparencyvalue(tvalue) or nil
end

-- Attachments

local nofattachments= 0
local attachments   = { }
local filestreams   = { }
local referenced= { }
local ignorereferenced  = true -- fuzzy pdf spec .. twice in attachment list, 
can become an option
local tobesavedobjrefs  = utilities.storage.allocate()
local collectedobjrefs  = utilities.storage.allocate()
local permitted = true
local enabled   = true

function codeinjections.setattachmentsupport(option)
if option == false then
permitted = false
enabled   = false
end
end

local fileobjreferences = {
collected = collectedobjrefs,
tobesaved = tobesavedobjrefs,
}

job.fileobjreferences = fileobjreferences

local function initializer()
collectedobjrefs = job.fileobjreferences.collected or { }
tobesavedobjrefs = job.fileobjreferences.tobesaved or { }
end

job.register('job.fileobjreferences.collected', tobesavedobjrefs, initializer)

local function flushembeddedfiles()
if enabled and next(filestreams) then
local e = pdfarray()
local f = pdfarray()
for tag, reference in sortedhash(filestreams) do
if not reference then
report_attachment("unreferenced file, tag %a",tag)
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
else
-- messy spec ... when annot not in named else twice in menu 
list acrobat
f[#f+1] = reference
end
end
if #e > 0 then

lpdf.addtonames("EmbeddedFiles",pdfreference(pdfflushobject(pdfdictionary{ 
Names = e })))
end
if #f > 0 then -- PDF/A-2|3: all associated files must have a 
relationship to the PDF document (global or part)
lpdf.addtocatalog("AF", pdfreference(pdfflushobject(f))) -- global 
(

[NTG-context] Achieving different \cite styles

2022-12-08 Thread Jethro Djan via ntg-context
Hello everyone

I am interested in being able to cite in different ways. By analogy, I
refer to the \texcite{}, \parencite{} and other options available with
biblatex in LaTeX. How do I achieve something like \textcite{} in ConTeXt?
Here is my MWE:

\startbuffer[ref]

@Article{wn:2017,
  author  = {Who, Nobody and What, Everyone},
  journal = {Good Journal},
  title   = {The Art of Being},
  year= {2017},
}

\stopbuffer

\definebtxdataset[ref]
\usebtxdataset[ref][ref.buffer]
\setupbtx[
  dataset=ref,
]
\definebtxrendering
  [ref]
  [apa]
  [
  dataset=ref,
  ]
\usebtxdefinitions[apa]

\starttext

In \cite[wn:2017], they illustrated that it is impossible to not be them.
\cite[wn:2017] said it was worth the discovery.

\startsection[title={References}, number=no, incrementnumber=no]
\placelistofpublications[ref][method=dataset]
\stopsection

\stoptext

The first sentence is okay. In the second, I would like the parenthesis
around the citation to come off because of the way I am citing it.

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

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


Re: [NTG-context] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2022-12-06 Thread Hans Hagen via ntg-context

On 12/6/2022 10:04 PM, Rik Kabel via ntg-context wrote:


On 2022-12-06 15:32, Hans Hagen via ntg-context wrote:

On 12/6/2022 9:06 PM, Rik Kabel via ntg-context wrote:

\definelabel[X][text=]
\startTEXpage[offset=1cm]
   \X\X[a]\X[b]\X\par
   \convertnumber{R}{\ref[number][a]}
   \convertnumber{G}{\ref[number][b]}
\stopTEXpage


maybe like this:

\definelabel[X][text=]

\startTEXpage[offset=1cm]
  (\X)
  (\X[a])
  (\X[b])
  (\X)
  \par
  \doifelsereferencefound {a}
    {\convertnumber{number}{\currentreferencenumber}}
    {}
  \par
  \doifelsereferencefound {a}
    {\convertnumber{R}{\currentreferencenumber}}
    {}
  \par
  \doifelsereferencefound {b}
    {\convertnumber{G}{\currentreferencenumber}}
    {}
\stopTEXpage

-
  Hans Hagen | PRAGMA ADE


Perfect! Thank you.

It looks like \currentreference number is initially empty, and when 
\doifelsereferencefound succeeds it is set to that value, and remains 
set to that value until another \doifelsereferencefound is encountered. 
If \doifelsereferencefound fails, \currentreference is again empty. Is 
that correct?

yes, btw, there are some more \currentreference* available

Hans

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

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

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


Re: [NTG-context] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2022-12-06 Thread Rik Kabel via ntg-context


On 2022-12-06 15:32, Hans Hagen via ntg-context wrote:

On 12/6/2022 9:06 PM, Rik Kabel via ntg-context wrote:

\definelabel[X][text=]
\startTEXpage[offset=1cm]
   \X\X[a]\X[b]\X\par
   \convertnumber{R}{\ref[number][a]}
   \convertnumber{G}{\ref[number][b]}
\stopTEXpage


maybe like this:

\definelabel[X][text=]

\startTEXpage[offset=1cm]
  (\X)
  (\X[a])
  (\X[b])
  (\X)
  \par
  \doifelsereferencefound {a}
    {\convertnumber{number}{\currentreferencenumber}}
    {}
  \par
  \doifelsereferencefound {a}
    {\convertnumber{R}{\currentreferencenumber}}
    {}
  \par
  \doifelsereferencefound {b}
    {\convertnumber{G}{\currentreferencenumber}}
    {}
\stopTEXpage

-
  Hans Hagen | PRAGMA ADE


Perfect! Thank you.

It looks like \currentreference number is initially empty, and when 
\doifelsereferencefound succeeds it is set to that value, and remains 
set to that value until another \doifelsereferencefound is encountered. 
If \doifelsereferencefound fails, \currentreference is again empty. Is 
that correct?


--
Rik

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

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


Re: [NTG-context] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2022-12-06 Thread Hans Hagen via ntg-context

On 12/6/2022 9:06 PM, Rik Kabel via ntg-context wrote:

\definelabel[X][text=]
\startTEXpage[offset=1cm]
   \X\X[a]\X[b]\X\par
   \convertnumber{R}{\ref[number][a]}
   \convertnumber{G}{\ref[number][b]}
\stopTEXpage


maybe like this:

\definelabel[X][text=]

\startTEXpage[offset=1cm]
  (\X)
  (\X[a])
  (\X[b])
  (\X)
  \par
  \doifelsereferencefound {a}
{\convertnumber{number}{\currentreferencenumber}}
{}
  \par
  \doifelsereferencefound {a}
{\convertnumber{R}{\currentreferencenumber}}
{}
  \par
  \doifelsereferencefound {b}
{\convertnumber{G}{\currentreferencenumber}}
{}
\stopTEXpage

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

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

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


Re: [NTG-context] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2022-12-06 Thread Rik Kabel via ntg-context


On 2022-01-19 12:39, Rik Kabel via ntg-context wrote:


This is still a problem with the current standalone.

\definelabel[X][text=]
\startTEXpage[offset=1cm]
  \X\X[a]\X[b]\X\par
  \convertnumber{R}{\ref[number][a]}
  \convertnumber{G}{\ref[number][b]}
\stopTEXpage

%% The above example fails to compile when there is no tuc file,
%%    complaining of a missing number in line 4. When lines 4
%%    and 5 are removed and the file is compiled, producing
%%    a .tuc file, and then they are restored, the example
%%    compiles without error. The effect of having or not having
%%    an associated .tuc file does seem a bit odd.

Surely there is a way to get the number from a label reference that 
can then be converted to a numeral of choice.


--
Rik



(A year later) Is there still no way to do this without resorting to the 
.tuc-file gimmick?


The need is to take a label reference number and display it under a 
different numberconversion regime.


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

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


Re: [NTG-context] Command for specifying et al limit

2022-09-27 Thread jethro Reuel via ntg-context
Dear Alan, 

Thanks again for all your help.

Deleting the definebtxrendering[ref] part makes my citations disappear. I get 
something like:

 says in their paper…

Also, the setupbtx[apa:list]… doesn’t solve my etallimit problem.

Could you test my code and tweak it for me? Can’t find examples of what I want 
to achieve in the mailing list archives although it seems it should be fairly 
straightforward. I want something like:

Bronstein et al. says in their paper…

I found the etaldisplay affects the display of the references and I don’t want 
that. 

Jethro 

> On 27 Sep 2022, at 04:13, Alan Braslau via ntg-context  
> wrote:
> 
> On Mon, 26 Sep 2022 21:40:14 -0600
> Alan Braslau via ntg-context  wrote:
> 
>>> On Sat, 24 Sep 2022 18:57:25 +
>>> Jethro Djan via ntg-context  wrote:
>>> 
>>> \setupbtx[
>>>  dataset=ref,
>>>  etaldisplay = 1,
>>>  etallimit = 1,
>>> ]
>> 
>> Remove extra spaces.
> 
> Sorry,
> 
> Try
> 
> \setupbtx
>  [apa:list]
>  [etaldisplay=1,
>   etallimit=1]
> 
> and drop the 
> 
> \definebtxrendering
>  [ref]
> 
> 
> I have not tested your example, but the bibliography subsystem creates
> many inherited namespaces, so changing parameters in a general
> namespace after inheritance has occurred (in the definitions) has no
> effect.
> 
> Of course, the etaldisplay and etallimits are set to the APA standard
> in the APA definitions.
> 
> Alan
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Command for specifying et al limit

2022-09-26 Thread Alan Braslau via ntg-context
On Mon, 26 Sep 2022 21:40:14 -0600
Alan Braslau via ntg-context  wrote:

> On Sat, 24 Sep 2022 18:57:25 +
> Jethro Djan via ntg-context  wrote:
> 
> > \setupbtx[
> >   dataset=ref,
> >   etaldisplay = 1,
> >   etallimit = 1,
> > ]
> 
> Remove extra spaces.

Sorry,

Try

\setupbtx
  [apa:list]
  [etaldisplay=1,
   etallimit=1]

and drop the 

\definebtxrendering
  [ref]


I have not tested your example, but the bibliography subsystem creates
many inherited namespaces, so changing parameters in a general
namespace after inheritance has occurred (in the definitions) has no
effect.

Of course, the etaldisplay and etallimits are set to the APA standard
in the APA definitions.

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

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


Re: [NTG-context] Command for specifying et al limit

2022-09-26 Thread Alan Braslau via ntg-context
On Sat, 24 Sep 2022 18:57:25 +
Jethro Djan via ntg-context  wrote:

> \setupbtx[
>   dataset=ref,
>   etaldisplay = 1,
>   etallimit = 1,
> ]

Remove extra spaces.

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

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


[NTG-context] Command for specifying et al limit

2022-09-24 Thread Jethro Djan via ntg-context
Dear list,

I am trying to specify that 'et al’ should be appended after the first author 
if paper has multiple authors. It seems from the mkiv-publications.pdf manual 
that it should work like this but it doesn’t. Here is my MWE:

\startbuffer[ref]

@Article{bb:2017,
  author  = {Bronstein, Michael M. and Bruna, Joan and Cohen, Taco and 
Veličković, Petar},
  journal = {arXiv preprint arXiv:2104.13478},
  title   = {Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and 
Gauges},
  year= {2021},
}

\stopbuffer

\definebtxdataset[ref]
\setupbtx[dataset=ref]
\definebtxrendering
[ref]
[apa]
[
dataset=ref,
]
\usebtxdefinitions[apa]
\usebtxdataset[ref][ref.buffer]
\setupbtx[
  dataset=ref,
  etaldisplay = 1,
  etallimit = 1,
]

\starttext

\cite[author][bb:2017] says in their paper \cite[bb:2017] 

\startsection[title={References}, number=no, incrementnumber=no]
\placelistofpublications[ref][method=dataset]
\stopsection

\stoptext

Thanks in advance.

Jethro



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

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


Re: [NTG-context] "pragma-ade.com" is now a domain parking page

2022-07-01 Thread Taco Hoekwater via ntg-context
Well, 

Hans had been complaining about networksolutions not allowing him to move the 
domain away from them, so I guess this was to be expected.

Best wishes,
Taco

> On 1 Jul 2022, at 08:01, Max Chernoff via ntg-context  
> wrote:
> 
> When I go to:
> 
>https://www.pragma-ade.com/
> 
> I get a page that says:
> 
>pragma-ade.com expired on 06/28/2016 and is pending renewal or deletion.
> 
> followed by some advertisements. Both a link archiver
> 
>https://archive.today/jUOox
> 
> and an SSL/TLS certificate checker
> 
>https://www.ssllabs.com/ssltest/analyze.html?d=www.pragma-ade.com
> 
> show the same results, so I'm pretty sure that this isn't just an issue
> with my connection.
> 
> Both "https://www.pragma-ade.nl/; and "https://www.pragma-pod.nl/; still
> work as expected.
> 
> Here's the output of a few debugging commands:
> 
>$ whois pragma-ade.com
>   Domain Name: PRAGMA-ADE.COM
>   Registry Domain ID: 30119007_DOMAIN_COM-VRSN
>   Registrar WHOIS Server: whois.networksolutions.com
>   Registrar URL: http://networksolutions.com
>   Updated Date: 2022-06-30T10:41:12Z
>   Creation Date: 2000-06-28T10:41:39Z
>   Registry Expiry Date: 2023-06-28T10:41:39Z
>   Registrar: Network Solutions, LLC
>   Registrar IANA ID: 2
>   Registrar Abuse Contact Email: ab...@web.com
>   Registrar Abuse Contact Phone: +1.8003337680
>   Domain Status: clientTransferProhibited 
> https://icann.org/epp#clientTransferProhibited
>   Name Server: NS1.PENDINGRENEWALDELETION.COM
>   Name Server: NS2.PENDINGRENEWALDELETION.COM
>   DNSSEC: unsigned
>   URL of the ICANN Whois Inaccuracy Complaint Form: 
> https://www.icann.org/wicf/
>>>> Last update of whois database: 2022-07-01T05:34:25Z <<<
> 
> 
>$ dig www.pragma-ade.com @1.1.1.1
>; <<>> DiG 9.16.1-Ubuntu <<>> www.pragma-ade.com @1.1.1.1
>;; global options: +cmd
>;; Got answer:
>;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33675
>;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
> 
>;; OPT PSEUDOSECTION:
>; EDNS: version: 0, flags:; udp: 1232
>;; QUESTION SECTION:
>;www.pragma-ade.com.IN  A
> 
>;; ANSWER SECTION:
>www.pragma-ade.com. 7200IN  A   208.91.197.132
> 
>;; Query time: 90 msec
>;; SERVER: 1.1.1.1#53(1.1.1.1)
>;; WHEN: Thu Jun 30 23:34:00 MDT 2022
>;; MSG SIZE  rcvd: 63
> 
> 
>$ whois 208.91.197.132
>NetRange:   208.91.196.0 - 208.91.197.255
>CIDR:   208.91.196.0/23
>NetName:CONFLUENCE-NETWORK-INC
>NetHandle:  NET-208-91-196-0-1
>Parent: NET208 (NET-208-0-0-0-0)
>NetType:Direct Allocation
>OriginAS:   AS40034
>Organization:   Confluence Networks Inc (CN)
>RegDate:2011-04-15
>Updated:2015-11-23
>Ref:https://rdap.arin.net/registry/ip/208.91.196.0
> 
>OrgName:Confluence Networks Inc
>OrgId:  CN
>Address:3rd Floor, J & C Building, P.O. Box 362
>City:   Road Town
>StateProv:  Tortola
>PostalCode: VG1110
>Country:VG
>RegDate:2011-04-07
>Updated:2017-03-29
>Ref:https://rdap.arin.net/registry/entity/CN
> 
> 
>$ whois pragma-ade.nl
>Domain name: pragma-ade.nl
>Status:  active
> 
>Reseller:
>   Soverin BV
>   Vijzelstraat 68
>   1017HL Amsterdam
>   Netherlands
> 
>Registrar:
>   Metaregistrar B.V.
>   Zuidelijk Halfrond 1
>   2801DD Gouda
>   Netherlands
> 
>Abuse Contact:
>   +31.858885692
>   ab...@metaregistrar.com
> 
>Creation Date: 1999-02-10
> 
>Updated Date: 2021-11-23
> 
>DNSSEC:  yes
> 
>Domain nameservers:
>   ns0.soverin.net
>   ns1.soverin.net
>   ns2.soverin.net
>   ns3.soverin.net
> 
>Record maintained by: NL Domain Registry
>$ dig www.pragma-ade.nl @1.1.1.1
>; <<>> DiG 9.16.1-Ubuntu <<>> www.pragma-ade.nl @1.1.1.1
>;; global options: +cmd
>;; Got answer:
>;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7089
>;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
> 
>;; OPT PSEUDOSECTION:
>; EDNS: version: 0, flags:; udp: 1232
>;; QUESTION SECTION:
>;www.pragma-ade.nl. IN  A
> 
>;; ANSWER SECTION:
>   

[NTG-context] "pragma-ade.com" is now a domain parking page

2022-07-01 Thread Max Chernoff via ntg-context

When I go to:

https://www.pragma-ade.com/

I get a page that says:

pragma-ade.com expired on 06/28/2016 and is pending renewal or deletion.

followed by some advertisements. Both a link archiver

https://archive.today/jUOox

and an SSL/TLS certificate checker

https://www.ssllabs.com/ssltest/analyze.html?d=www.pragma-ade.com

show the same results, so I'm pretty sure that this isn't just an issue
with my connection.

Both "https://www.pragma-ade.nl/; and "https://www.pragma-pod.nl/; still
work as expected.

Here's the output of a few debugging commands:

$ whois pragma-ade.com
   Domain Name: PRAGMA-ADE.COM
   Registry Domain ID: 30119007_DOMAIN_COM-VRSN
   Registrar WHOIS Server: whois.networksolutions.com
   Registrar URL: http://networksolutions.com
   Updated Date: 2022-06-30T10:41:12Z
   Creation Date: 2000-06-28T10:41:39Z
   Registry Expiry Date: 2023-06-28T10:41:39Z
   Registrar: Network Solutions, LLC
   Registrar IANA ID: 2
   Registrar Abuse Contact Email: ab...@web.com
   Registrar Abuse Contact Phone: +1.8003337680
   Domain Status: clientTransferProhibited 
https://icann.org/epp#clientTransferProhibited
   Name Server: NS1.PENDINGRENEWALDELETION.COM
   Name Server: NS2.PENDINGRENEWALDELETION.COM
   DNSSEC: unsigned
   URL of the ICANN Whois Inaccuracy Complaint Form: 
https://www.icann.org/wicf/
>>> Last update of whois database: 2022-07-01T05:34:25Z <<<


$ dig www.pragma-ade.com @1.1.1.1
; <<>> DiG 9.16.1-Ubuntu <<>> www.pragma-ade.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33675
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.pragma-ade.com.IN  A

;; ANSWER SECTION:
www.pragma-ade.com. 7200IN  A   208.91.197.132

;; Query time: 90 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Thu Jun 30 23:34:00 MDT 2022
;; MSG SIZE  rcvd: 63


$ whois 208.91.197.132
NetRange:   208.91.196.0 - 208.91.197.255
CIDR:   208.91.196.0/23
NetName:CONFLUENCE-NETWORK-INC
NetHandle:  NET-208-91-196-0-1
Parent: NET208 (NET-208-0-0-0-0)
NetType:Direct Allocation
OriginAS:   AS40034
Organization:   Confluence Networks Inc (CN)
    RegDate:2011-04-15
Updated:2015-11-23
Ref:https://rdap.arin.net/registry/ip/208.91.196.0

OrgName:Confluence Networks Inc
OrgId:  CN
Address:3rd Floor, J & C Building, P.O. Box 362
City:   Road Town
StateProv:  Tortola
PostalCode: VG1110
Country:VG
    RegDate:2011-04-07
Updated:2017-03-29
Ref:https://rdap.arin.net/registry/entity/CN


$ whois pragma-ade.nl
Domain name: pragma-ade.nl
Status:  active

Reseller:
   Soverin BV
   Vijzelstraat 68
   1017HL Amsterdam
   Netherlands

Registrar:
   Metaregistrar B.V.
   Zuidelijk Halfrond 1
   2801DD Gouda
   Netherlands

Abuse Contact:
   +31.858885692
   ab...@metaregistrar.com

Creation Date: 1999-02-10

Updated Date: 2021-11-23

DNSSEC:  yes

Domain nameservers:
   ns0.soverin.net
   ns1.soverin.net
   ns2.soverin.net
   ns3.soverin.net

Record maintained by: NL Domain Registry


$ dig www.pragma-ade.nl @1.1.1.1

; <<>> DiG 9.16.1-Ubuntu <<>> www.pragma-ade.nl @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7089
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.pragma-ade.nl. IN  A

;; ANSWER SECTION:
www.pragma-ade.nl.  300 IN  A   213.125.29.165

;; Query time: 730 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Thu Jun 30 23:55:28 MDT 2022
;; MSG SIZE  rcvd: 62


$ whois 213.125.29.165
inetnum:213.125.29.160 - 213.125.29.167
netname:PRAGMA
descr:  Pragma
descr:  Hasselt
descr:  This space is statically assigned.
country:NL
admin-c:HH6275-RIPE
tech-c: ZBTB1-RIPE
status: ASSIGNED PA
mnt-by: ZIGGO-AUTOREG1
created:2015-11-18T13:16:01Z
last-modified:  2015-11-18T13:16:01Z
source: RIPE

role:   VODAFONEZIGGO IP AUTHORITY
address:Kabelweg 51
address:1014BA Amsterdam
address:The Netherlands
phone:  +31

Re: [NTG-context] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2022-01-19 Thread Rik Kabel via ntg-context

This is still a problem with the current standalone.

   \definelabel[X][text=]
   \startTEXpage[offset=1cm]
  \X\X[a]\X[b]\X\par
  \convertnumber{R}{\ref[number][a]}
  \convertnumber{G}{\ref[number][b]}
   \stopTEXpage

   %% The above example fails to compile when there is no tuc file,
   %%    complaining of a missing number in line 4. When lines 4
   %%    and 5 are removed and the file is compiled, producing
   %%    a .tuc file, and then they are restored, the example
   %%    compiles without error. The effect of having or not having
   %%    an associated .tuc file does seem a bit odd.

Surely there is a way to get the number from a label reference that can 
then be converted to a numeral of choice.


--
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] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2021-10-28 Thread Rik Kabel via ntg-context


On 10/28/2021 02:56, Hans Hagen wrote:

On 10/28/2021 4:58 AM, Rik Kabel via ntg-context wrote:
Following up on my own note, I see that this fails under LMTX if 
compiled in a clean directory, but succeeds if first compiled with 
the troublesome line removed, and then, restoring the line, compiled 
a second time. It also works by placing a .tuc file from an older 
version of the document into the directory before compiling. Very 
strange indeed. The expected output, from one of those successful 
compilations:


So. I am clearly doing something wrong, but sometimes LMTX is letting 
me get away with it.


--
Rik

On 10/27/2021 21:47, Rik Kabel via ntg-context wrote:


Hello list,

The following fails with ConTeXt  ver: 2021.10.24 21:45 MKIV but 
works with the companion LMTX. The error message is:tex error   
> tex error on line 6 in file G:/TestConTeXt/convert.tex: ! 
Incompatible glue units , pointing to the second \convertnumber line.


\definelabel[XX]%[text=,before=,after=,alternative=inright]
    \startTEXpage[offset=2em]
     abc\XX[xx]\par
     \ref[number][xx] ·
     \convertnumber{r}{1} ·
     \convertnumber{R}{\ref[number][xx]}
    \stopTEXpage

In this case I am trying to display with roman numerals the number 
generated in the label created through \definelabel.


Suggestions welcomed.

the conmversion is (partly) done in lua so at some point the

  \ref[number][xx]

gets scanned which is more robust in lmtx than in mkiv

normally one does the conversion differently:

\definelabel[XX][numberconversion=R]
\definelabel[YY][XX][numberconversion=A]

\startTEXpage[offset=2em]
    1: \XX[xx]\par 2: \YY[xx]
\stopTEXpage

Hans



(Resending because attachment was too large.)

That generates a new labeled item albeit with a roman numeral label. I 
am trying to get the value of a previously generated numeric label 
converted roman numerals. So, consider that I have a numeric label 
identifying a paragraph of text. I want to reference that label in 
another place but need to do it in Latin.


I want to convert the original label number to a roman numeral for use 
in that one place, not generate a new label displayed as a roman 
numeral. So,


   \definelabel[XX][text=¶]
   \define\Naa{\ref[number][aa]}
   \define[1]\Nnn{\ref[number][#1]}
   \define\Raa{\convertnumber{R}{\ref[number][aa]}}
   \define[1]\Rnn{\convertnumber{R}{\ref[number][#1]}}
   \startTEXpage[offset=2em]
    Paragraph\XX[aa]\par
    Paragraph\XX[bb]\par
    Paragraph\XX[cc]\par
    1: \Naa\par
    2: \Nnn{bb}\par
   % these fail without an existing tuc file:
    I: {\la Vide paragraphum \Raa.}\par
    II: {\la Vide paragraphum \Rnn{bb}.}
   \stopTEXpage

should produce:

   Paragraph *¶ 1
   *Paragraph *¶ 2*
   Paragraph *¶ 3*
   1: 1
   2: 2
   I: Vide paragraphum I.
   II: Vide paragraphum II.

but this fails without an existing good tuc file. If I comment out the 
two latin lines, compile (to failure), and then uncomment the lines and 
try again, it compiles without error. Does this mean that 
\ref[number][label] does not really return a number as \convertnumber 
expects?


This is the case with today's upload as well (ConTeXt  ver: 2021.10.28 
10:19 LMTX).


--
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] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2021-10-28 Thread Hans Hagen via ntg-context

On 10/28/2021 4:58 AM, Rik Kabel via ntg-context wrote:
Following up on my own note, I see that this fails under LMTX if 
compiled in a clean directory, but succeeds if first compiled with the 
troublesome line removed, and then, restoring the line, compiled a 
second time. It also works by placing a .tuc file from an older version 
of the document into the directory before compiling. Very strange 
indeed. The expected output, from one of those successful compilations:


So. I am clearly doing something wrong, but sometimes LMTX is letting me 
get away with it.


--
Rik

On 10/27/2021 21:47, Rik Kabel via ntg-context wrote:


Hello list,

The following fails with ConTeXt  ver: 2021.10.24 21:45 MKIV but works 
with the companion LMTX. The error message is:tex error   > tex 
error on line 6 in file G:/TestConTeXt/convert.tex: ! Incompatible 
glue units , pointing to the second \convertnumber line.


\definelabel[XX]%[text=,before=,after=,alternative=inright]
\startTEXpage[offset=2em]
 abc\XX[xx]\par
     \ref[number][xx] ·
 \convertnumber{r}{1} ·
 \convertnumber{R}{\ref[number][xx]}
\stopTEXpage

In this case I am trying to display with roman numerals the number 
generated in the label created through \definelabel.


Suggestions welcomed.

the conmversion is (partly) done in lua so at some point the

  \ref[number][xx]

gets scanned which is more robust in lmtx than in mkiv

normally one does the conversion differently:

\definelabel[XX][numberconversion=R]
\definelabel[YY][XX][numberconversion=A]

\startTEXpage[offset=2em]
1: \XX[xx]\par 2: \YY[xx]
\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] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2021-10-27 Thread Rik Kabel via ntg-context
Following up on my own note, I see that this fails under LMTX if 
compiled in a clean directory, but succeeds if first compiled with the 
troublesome line removed, and then, restoring the line, compiled a 
second time. It also works by placing a .tuc file from an older version 
of the document into the directory before compiling. Very strange 
indeed. The expected output, from one of those successful compilations:


So. I am clearly doing something wrong, but sometimes LMTX is letting me 
get away with it.


--
Rik

On 10/27/2021 21:47, Rik Kabel via ntg-context wrote:


Hello list,

The following fails with ConTeXt  ver: 2021.10.24 21:45 MKIV but works 
with the companion LMTX. The error message is:tex error   > tex 
error on line 6 in file G:/TestConTeXt/convert.tex: ! Incompatible 
glue units , pointing to the second \convertnumber line.


\definelabel[XX]%[text=,before=,after=,alternative=inright]
\startTEXpage[offset=2em]
 abc\XX[xx]\par
     \ref[number][xx] ·
 \convertnumber{r}{1} ·
 \convertnumber{R}{\ref[number][xx]}
\stopTEXpage

In this case I am trying to display with roman numerals the number 
generated in the label created through \definelabel.


Suggestions welcomed.

--
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
__
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] Convertnumber with \ref[number] fails in MkIV, works in LMTX

2021-10-27 Thread Rik Kabel via ntg-context

Hello list,

The following fails with ConTeXt  ver: 2021.10.24 21:45 MKIV but works 
with the companion LMTX. The error message is:tex error   > tex 
error on line 6 in file G:/TestConTeXt/convert.tex: ! Incompatible glue 
units , pointing to the second \convertnumber line.


   \definelabel[XX]%[text=,before=,after=,alternative=inright]
   \startTEXpage[offset=2em]
 abc\XX[xx]\par
     \ref[number][xx] ·
 \convertnumber{r}{1} ·
 \convertnumber{R}{\ref[number][xx]}
   \stopTEXpage

In this case I am trying to display with roman numerals the number 
generated in the label created through \definelabel.


Suggestions welcomed.

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


[NTG-context] Rotating pages

2021-08-07 Thread Jeroen via ntg-context
For the following document, the last 3 pages are landscape, but I would
like to have the pdf-ed rotated so they are in the pdf document portrait,
ie rotated 90 degree to the left but leave the page as how they are now. Is
there an easy way to achieve this?





\startbuffer[apx]

\setuppapersize[
  A4,landscape]

\setuppagenumbering[
  location={footer,center}]

\setbreakpoints[compound]

\starttext

\startsection[title={MyTitle},ref={apx}]

  \dorecurse{10}{\input zapf\par}

\stopsection

\stoptext

\stopbuffer

  \savebuffer[list=apx, file=apx.tex]

  \starttext
  \startbodymatter
  \dorecurse{10}{\input zapf\par}
  \typesetfile[\jobname-apx.tex][--purgeall][object=no, width=0pt]
  \stopbodymatter
  \startappendices
  \getfiguredimensions[\jobname-apx.pdf]
  \dorecurse{\noffigurepages}
  {\startTEXpage
\externalfigure[\jobname-apx.pdf][page=\recurselevel]
   \stopTEXpage}
  \stopappendices
  \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] Code document and simpleslides and create in one go the document with simpleslides added

2021-08-06 Thread Jeroen via ntg-context
>
>
> One final question on this one. As per latest comments this works great,
> but is there a way so the presentation pages in the appendix are made-up
> landscape as they are now, but are rotated 90 degrees so they are created
> in the pdf document as the first two pages.




\startbuffer[slides]
\setuptolerance[
  horizontal,
  tolerant,
  stretch]

\setuppapersize[
  A4,landscape]

\setuplayout[
  width=middle,
  backspace=35mm,
  cutspace=35mm,
  height=middle,
  topspace=5mm,
  bottomspace=20mm]

\setuppagenumbering[
  location={footer,center}]

\setuphead
  [section]
  [page={yes}]

\usetypescript[pagella]
\setupbodyfont[pagella,18pt]
\setupbodyfontenvironment[
  28pt][  % For body
  d=36pt, % For title
  a=12pt, % For author & date
  ]
\setuptype[style=medium]
\setuptyping[typing][bodyfont=16pt]

\setupwhitespace[medium]

\setbreakpoints[compound]

\setuphead[chapter][style=\bfd]
\setuphead[section][style=\bfc]
\setuphead[subsection][style=\bfb]
\setuphead[subsubsection][style=\bf]

\setupitemize[autointro] % prevent orphan list intro
\setupitemize[indentnext=no]

\starttext

\startsection[title={MySlideTitle},ref={myref1}]

Body text

\startitemize
\item Item 1
\item Item 2
\stopitemize

\stopsection

\startsection[title={MySlideTitle},ref={myref2}]

Body text

\startitemize
\item Item 1
\item Item 2
\stopitemize

\stopsection

\stoptext\starttext
text

\stoptext
\stopbuffer

  \savebuffer[list=slides, file=slides.tex]

  \starttext
  \startbodymatter
  \dorecurse{10}{\input zapf\par}
  \typesetfile[\jobname-slides.tex][--purgeall][object=no, width=0pt]
  \stopbodymatter
  \startappendices
  \getfiguredimensions[\jobname-slides.pdf]
  \dorecurse{\noffigurepages}
  {\startTEXpage
\externalfigure[\jobname-slides.pdf][page=\recurselevel]
   \stopTEXpage}
  \stopappendices
  \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] Code document and simpleslides and create in one go the document with simpleslides added

2021-07-31 Thread Jeroen via ntg-context
I worked around it, instead of simpleslides just use larger fonts to with
regular pages

\startbuffer[slides]
\setuptolerance[
  horizontal,
  tolerant,
  stretch]

\setuppapersize[
  A4,landscape]

\setuplayout[
  width=middle,
  backspace=35mm,
  cutspace=35mm,
  height=middle,
  topspace=5mm,
  bottomspace=20mm]

\setuppagenumbering[
  location={footer,center}]

\setuphead
  [section]
  [page={yes}]

\usetypescript[pagella]
\setupbodyfont[pagella,18pt]
\setupbodyfontenvironment[
  28pt][  % For body
  d=36pt, % For title
  a=12pt, % For author & date
  ]
\setuptype[style=medium]
\setuptyping[typing][bodyfont=16pt]

\setupwhitespace[medium]

\setbreakpoints[compound]

\setuphead[chapter][style=\bfd]
\setuphead[section][style=\bfc]
\setuphead[subsection][style=\bfb]
\setuphead[subsubsection][style=\bf]

\setupitemize[autointro] % prevent orphan list intro
\setupitemize[indentnext=no]

\starttext

\startsection[title={MySlideTitle},ref={myref1}]

Body text

\startitemize
\item Item 1
\item Item 2
\stopitemize

\stopsection

\startsection[title={MySlideTitle},ref={myref2}]

Body text

\stopsection

\stoptext\starttext
text

\stoptext
\stopbuffer

  \savebuffer[list=slides, file=\jobname_slides.tex, prefix=no]

  \starttext
  \startbodymatter
  \dorecurse{25}{\input zapf\par}
  \typesetfile[\jobname_slides.tex][--purgeall][object=no, width=0pt]
  \stopbodymatter
  \startappendices
  \getfiguredimensions[\jobname_slides.pdf]
  \dorecurse{\noffigurepages}
  {\startTEXpage
\externalfigure[\jobname_slides.pdf][page=\recurselevel]
   \stopTEXpage}
  \stopappendices
  \stoptext

Op za 31 jul. 2021 om 16:22 schreef Thomas A. Schmitz via ntg-context <
ntg-context@ntg.nl>:

>
> On 7/31/21 4:06 PM, Pablo Rodriguez via ntg-context wrote:
> > BTW, I cannot get simpleslides working with LMTX.
>
>
> I had to make some slight adjustments but have been to lazy to upload a
> new and improved version. One reason being that I can't remember my
> username and password for the modules section of the garden... I'll have
> to ask Taco to reset it for me.
>
> Thomas
>
> ___
> 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] 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.

By the way, Pablo, your issue
https://www.mail-archive.com/ntg-context@ntg.nl/msg88204.html was also
solved in the last upload. Unfortunately it will probably not help you,
because Acrobat no longer supports this.

\useexternalsoundtrack
  [myaudio][audio.mp3]

\checksoundtrack{myaudio}

\goto{PLAY SOUND}[StartSound{myaudio}]


But, you can use renderings instead:

\useexternalrendering[myaudiorendering]
  [audio/mp3][audio.mp3][embed=yes]

\definerenderingwindow[audiowindow]
  [width=0sp, height=0sp]

\definelayer[resources]
\setupbackgrounds[page][background=resources]
\setlayer[resources]{\placerenderingwindow[audiowindow][myaudiorendering]}

\goto{PLAY SOUND}[StartRendering{myaudiorendering}]


This is basically the example from "/back-swf.mkiv". Works in Acrobat.
And one can use either of the three possible file methods (embedded,
external, URL), not just external files. The layer is so that the empty
frame doesn't interfere with normal page content. No frame is drawn when
both dimensions are 0, not sure if that is a behaviour one can take as
granted. But currenntly the dimensions can't be zero.

Hans, I would omit the check for 0 dimensions of rendering window (as
already noted in the source, it is useful for sound). See patch below.

Michal Vlasák

--- a/tex/context/base/mkxl/lpdf-wid.lmt
+++ b/tex/context/base/mkxl/lpdf-wid.lmt
@@ -655,9 +655,6 @@ local function insertrenderingwindow(specification)
 }
 local width = specification.width or 0
 local height = specification.height or 0
-if height == 0 or width == 0 then
--- todo: sound needs no window
-end
 context(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
 return pdfreference(r)
 end
___
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] working on page refs with MP

2021-03-19 Thread Werner Hennrich

yes I had realized this already but I still don't know how to get those
page numbers down into MP - they keep being strings with macro code instead

is there a way the I can get \setupMPvariables[hdrPgs] in
\setupheadertexts[\setups{page:header}]
to be fully evaluated and stored as the page number in the MPvariables
first= and next= ??

   \startsetups page:header
    \setupMPvariables[hdrPgs]
        [curr=\pagenumber,
        first={\ref[page][\headerfirst]},
        next={\ref[page][\headernext]}]

    I've tried \expanded and \numeric without success

or alternatively in MP how would I call TeX (from MP) with a string like
"\ref[page][a]" and have the page number stored in a numeric var?

Thanks in advance,
Werner


Am 18.03.21 um 19:55 schrieb Hans Hagen:

On 3/18/2021 6:14 PM, Werner Hennrich wrote:


metafun > log >
metafun > log > error: Improper subscript has been replaced
by zero
metapost    > log > <*> ... numeric numFirst; numFirst := \ref
[page]

watch closely to the previous log line ... you're missing quotes so mp
sees \ref [page] and as it ignores a \ it sees ref[page] which unless
you defined 'ref' and 'page' triggers an error

-
  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] working on page refs with MP

2021-03-18 Thread Hans Hagen

On 3/18/2021 6:14 PM, Werner Hennrich wrote:


metafun > log >
metafun > log > error: Improper subscript has been replaced by zero
metapost    > log > <*> ... numeric numFirst; numFirst := \ref [page]
watch closely to the previous log line ... you're missing quotes so mp 
sees \ref [page] and as it ignores a \ it sees ref[page] which unless 
you defined 'ref' and 'page' triggers an error


-
  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] working on page refs with MP

2021-03-18 Thread Werner Hennrich

Hello everyone,

I'm having page references and want to calc / draw 'Page x of y' for
some subsections in MP.
How can I pass 'em down so I end up with numbers to do calculations with?

   \setuplayout[header=15mm]
   \def\myHeader[#1]#2{
   \ignorespaces
   \getdummyparameters[ref=,next=,#1]
   \pagebreak[yes]
   \pagereference[\dummyparameter{ref}]
   \doassign[header][first=\dummyparameter{ref}]
   \doassign[header][next=\dummyparameter{next}]
   {\tfc\bf{#2}}\par
   \vskip3mm
   }
   \def\fillWithText[#1]{
   \dorecurse{#1}{
   \input tufte
   \input knuth
   }
   }
   \setupheadertexts[\setups{page:header}]%
   \startsetups page:header
   \setupMPvariables[hdrPgs]
   [curr=\pagenumber,
   first={\ref[page][\headerfirst]},
   next={\ref[page][\headernext]}]
   \framed[
   frame=off,
   background={hdrPgs}
   ]{}% all to be done in MP
   \stopsetups
   \defineoverlay[hdrPgs][\useMPgraphic{hdrPgs}]
   \startuseMPgraphic{hdrPgs}
   StartPage; % calc and draw 'Page x of y'
   numeric numCurr; numCurr := \MPvar{curr};
   string strFirst; strFirst := "\MPvar{first}";
   string strNext; strNext := "\MPvar{next}";
   message("===");
   message("MP_hdrPageNrs: curr="& tostring numCurr & ", sFirst="&
   strFirst & ", sNext="& strNext);
   % fails:
   numeric numFirst; numFirst := \MPvar{first};
   StopPage;
   \stopuseMPgraphic
   \starttext
   \myHeader[ref=a,next=b]{  AaAaAaAa}
   \fillWithText[10]
   \myHeader[ref=b,next=c]{  BbBbBbBbBb}
   \fillWithText[3]
   \myHeader[ref=c,next=d]{ c CcCcCcCc}
   \fillWithText[8]
   \myHeader[ref=c,next=last]{ d DdDdDdDdDd}
   \fillWithText[8]
   \pagebreak[yes]
   \pagereference[last]
   This is the last page, goodby
   \stoptext

metapost    > message : MP_hdrPageNrs: curr=1, sFirst=\ref
[page][a], sNext=\ref [page][b]
metafun > log >
metafun > log > error: Improper subscript has been replaced by zero
metapost    > log > <*> ... numeric numFirst; numFirst := \ref [page]
metafun > log >
metafun > log > A bracketed subscript must have a known numeric
value;

So MP gets the macro and tries array access... I tried \expanded,
\numeric, and resolving the page numbers via \ref[page][id] at the
various code levels - unsuccessfully so far - and out of wit now.

TIA, Werner


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


[NTG-context] Display reference number as Roman number

2020-11-24 Thread Rik Kabel

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

___
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

2020-10-09 Thread Denis Maier

Am 09.10.2020 um 14:48 schrieb Hans Hagen:

On 10/9/2020 9:01 AM, Denis Maier wrote:

[...]
I see. I've noticed lang-us.lua has a list of exceptions in it:
  ["exceptions"]={
   ["characters"]="abcdefghijlmnoprstuyz",
   ["data"]="as-so-ciate as-so-ciates dec-li-na-tion oblig-a-tory 
phil-an-thropic present presents project projects reci-procity 
re-cog-ni-zance ref-or-ma-tion ret-ri-bu-tion ta-ble",

   ["length"]=168,
   ["n"]=14,
  },

Would it be possible to add more exceptions to that list as they come 
up? Or is that inappropriate?

you can add your own runtime in a style:

\hyphenation {fo-ob-ar} \hsize 1mm foobar


Sure. I use \startexceptions[en] for that. I just thought everyone might 
benefit...


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

2020-10-09 Thread Hans Hagen

On 10/9/2020 9:01 AM, Denis Maier wrote:

Am 09.10.2020 um 08:57 schrieb Taco Hoekwater:



On 9 Oct 2020, at 08:52, Denis Maier  wrote:

Am 08.10.2020 um 19:05 schrieb Henning Hraban Ramm:

\starttext

{EN: \en\hyphenatedcoloredword{applicable}}

{DE: \de\hyphenatedcoloredword{applicable}}

\stoptext

Wow, that's super helpful. The English pattern seems to be 
"ap-plic-a-ble"

According to Meriam-Webster it should just be "ap·​pli·​ca·​ble".

{EN: \en\hyphenatedcoloredword{obligate}} gives me "ob-lig-ate"
According to Meriam-Webster it should be "ob·​li·​gate".

I've had a look at the files mentioned by Tomáš, but as these are not 
just wordlists I can not really tell what is happening.


So, is that a bug?
Not really. hyphenation patterns are a bit like applying JPEG 
compression to
a dictionary. It makes the data size smaller by recognising patterns 
while

ignoring outliers.

Occasional errors are to be expected, which is why \hyphenation exists.



I see. I've noticed lang-us.lua has a list of exceptions in it:
  ["exceptions"]={
   ["characters"]="abcdefghijlmnoprstuyz",
   ["data"]="as-so-ciate as-so-ciates dec-li-na-tion oblig-a-tory 
phil-an-thropic present presents project projects reci-procity 
re-cog-ni-zance ref-or-ma-tion ret-ri-bu-tion ta-ble",

   ["length"]=168,
   ["n"]=14,
  },

Would it be possible to add more exceptions to that list as they come 
up? Or is that inappropriate?

you can add your own runtime in a style:

\hyphenation {fo-ob-ar} \hsize 1mm foobar

-
  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

2020-10-09 Thread Denis Maier

Am 09.10.2020 um 08:57 schrieb Taco Hoekwater:



On 9 Oct 2020, at 08:52, Denis Maier  wrote:

Am 08.10.2020 um 19:05 schrieb Henning Hraban Ramm:

\starttext

{EN: \en\hyphenatedcoloredword{applicable}}

{DE: \de\hyphenatedcoloredword{applicable}}

\stoptext


Wow, that's super helpful. The English pattern seems to be "ap-plic-a-ble"
According to Meriam-Webster it should just be "ap·​pli·​ca·​ble".

{EN: \en\hyphenatedcoloredword{obligate}} gives me "ob-lig-ate"
According to Meriam-Webster it should be "ob·​li·​gate".

I've had a look at the files mentioned by Tomáš, but as these are not just 
wordlists I can not really tell what is happening.

So, is that a bug?

Not really. hyphenation patterns are a bit like applying JPEG compression to
a dictionary. It makes the data size smaller by recognising patterns while
ignoring outliers.

Occasional errors are to be expected, which is why \hyphenation exists.



I see. I've noticed lang-us.lua has a list of exceptions in it:
 ["exceptions"]={
  ["characters"]="abcdefghijlmnoprstuyz",
  ["data"]="as-so-ciate as-so-ciates dec-li-na-tion oblig-a-tory 
phil-an-thropic present presents project projects reci-procity 
re-cog-ni-zance ref-or-ma-tion ret-ri-bu-tion ta-ble",

  ["length"]=168,
  ["n"]=14,
 },

Would it be possible to add more exceptions to that list as they come 
up? Or is that inappropriate?


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

2020-10-05 Thread Aditya Mahajan
On Mon, 5 Oct 2020, Hans Hagen wrote:

> On 10/5/2020 2:47 AM, Aditya Mahajan wrote:
> > > John MacFarlane, the developper of Pandoc, has released a new Citeproc
> > > that generates citations and bibliographies using CSL style files (CSL=
> > > citation style language). While it is written in Haskell and while it's
> > > primarily intended for use with Pandoc, it can also be used in other
> > > contexts. Provided with a JSON encoded list of references via stdin, it
> > > can produce formatted output.
> > 
> > The man page of the new citeproc executable, for those who are interested:
> > 
> > https://github.com/jgm/citeproc/blob/master/man/citeproc.1.md
> > 
> > > I know that ConTeXt has its own infrastructure to format bibliographies
> > > and citations, but, given the enormous amount of available styles in
> > > CSL, I nevertheless think that this could be a worthwile addition. What
> > > would be necessary to make such a toll usable with ConTeXt? How
> > > complicated would that be?
> > 
> > In principle, this should be trivial. Define a new command, say
> > \citeproc[ref], which saves the values of `ref` to a lua table, and at the
> > end of the run, write that lua table to an aux .json file, call citeproc and
> > store output to a new file, and on the second run read from that file. This
> > is essentially how the old bibtex used to work.
> > 
> > Note that this scheme has a few drawbacks: First, it needs to call an
> > external executable, which can be slower than directly reading the bib file
> > via lua. Second, it creates a bunch of extra auxiliary files, which is
> > always annoying. But I do agree that it will provide us with the ability to
> > use the large number CSL styles.
> > 
> > Of course, a better option will be write a CSL processor in Lua, but that is
> > a lot of tedious (but relatively simple) task. I wonder if there is already
> > a CSL processor written in Lua.
> the bib module can read lua files (or whatever)
> 
> i have no clue what csl is but I assume it's just some key / value thing as
> the bib module itself should to the logic

It is similar to a bst file and specifies how the bibliography should be 
formatted. The specification is written as an XML file, for example, this is 
the specification for APA style:

https://www.zotero.org/styles/apa-5th-edition

The detailed schema is here:

https://github.com/citation-style-language/schema/tree/v1.0.1

There are a large number of such specifications available. For example: 

  https://www.zotero.org/styles

So, the user can easily search for a style that matches his/her needs and 
simply use it. The task of finding a reference from a reference database is 
left to a CSL processor and there a few of them available:

https://citationstyles.org/developers/

In principle, it should be relatively straight forward (but tedious) to write a 
processor in Lua. But I am not volunteering for that :-)


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

2020-10-05 Thread Hans Hagen

On 10/5/2020 2:47 AM, Aditya Mahajan wrote:

John MacFarlane, the developper of Pandoc, has released a new Citeproc
that generates citations and bibliographies using CSL style files (CSL=
citation style language). While it is written in Haskell and while it's
primarily intended for use with Pandoc, it can also be used in other
contexts. Provided with a JSON encoded list of references via stdin, it
can produce formatted output.


The man page of the new citeproc executable, for those who are interested:

https://github.com/jgm/citeproc/blob/master/man/citeproc.1.md


I know that ConTeXt has its own infrastructure to format bibliographies
and citations, but, given the enormous amount of available styles in
CSL, I nevertheless think that this could be a worthwile addition. What
would be necessary to make such a toll usable with ConTeXt? How
complicated would that be?


In principle, this should be trivial. Define a new command, say \citeproc[ref], 
which saves the values of `ref` to a lua table, and at the end of the run, 
write that lua table to an aux .json file, call citeproc and store output to a 
new file, and on the second run read from that file. This is essentially how 
the old bibtex used to work.

Note that this scheme has a few drawbacks: First, it needs to call an external 
executable, which can be slower than directly reading the bib file via lua. 
Second, it creates a bunch of extra auxiliary files, which is always annoying. 
But I do agree that it will provide us with the ability to use the large number 
CSL styles.

Of course, a better option will be write a CSL processor in Lua, but that is a 
lot of tedious (but relatively simple) task. I wonder if there is already a CSL 
processor written in Lua.

the bib module can read lua files (or whatever)

i have no clue what csl is but I assume it's just some key / value thing 
as the bib module itself should to the logic


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

2020-10-04 Thread Aditya Mahajan
> John MacFarlane, the developper of Pandoc, has released a new Citeproc 
> that generates citations and bibliographies using CSL style files (CSL= 
> citation style language). While it is written in Haskell and while it's 
> primarily intended for use with Pandoc, it can also be used in other 
> contexts. Provided with a JSON encoded list of references via stdin, it 
> can produce formatted output.

The man page of the new citeproc executable, for those who are interested:

https://github.com/jgm/citeproc/blob/master/man/citeproc.1.md

> I know that ConTeXt has its own infrastructure to format bibliographies 
> and citations, but, given the enormous amount of available styles in 
> CSL, I nevertheless think that this could be a worthwile addition. What 
> would be necessary to make such a toll usable with ConTeXt? How 
> complicated would that be?

In principle, this should be trivial. Define a new command, say \citeproc[ref], 
which saves the values of `ref` to a lua table, and at the end of the run, 
write that lua table to an aux .json file, call citeproc and store output to a 
new file, and on the second run read from that file. This is essentially how 
the old bibtex used to work.

Note that this scheme has a few drawbacks: First, it needs to call an external 
executable, which can be slower than directly reading the bib file via lua. 
Second, it creates a bunch of extra auxiliary files, which is always annoying. 
But I do agree that it will provide us with the ability to use the large number 
CSL styles.

Of course, a better option will be write a CSL processor in Lua, but that is a 
lot of tedious (but relatively simple) task. I wonder if there is already a CSL 
processor written in Lua.

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

2020-10-02 Thread Henri Menke
On 01/10/20, 20:55, Susanne G. Loeber wrote:
> Dear Reader,
> 
> I have a colored section, text in another color and a TikZ picture with a
> differently colored node, following each other. However, either the node
> gets the wrong color or the following paragraph, see example below.
> 
> Is there something wrong with the section settings? How do I get all the
> colors right without using a paragraph in between?

From experience, this usually works:

\prependvalue{starttikzpicture}{\dontleavehmode\forcecolorhack}

Cheers, Henri

> 
> \setuphead[chapter]
> 
> [
> 
> style={\tfd},
> 
> color={A2plus},
> 
> ]
> 
> \setuphead[section]
> 
> [
> 
> style={\tfc},
> 
> color={A3plus},
> 
> ]
> 
> 
> \definecolor[A1plus][h=5CAF00]
> 
> \definecolor[A2plus][h=B6437E]
> 
> \definecolor[A3plus][h=606ABD]
> 
> \definecolor[A4plus][h=FFC700]
> 
> \definecolor[A5plus][h=D0202B]
> 
> \definecolor[A6plus][h=EF8600]
> 
> \definecolor[A7plus][h=0082AA]
> 
> 
> \setupcolors[textcolor=A1plus]
> 
> 
> \usemodule[tikz]
> 
> 
> 
> \starttext
> 
> 
> \startchapter[title={Colour test}, ref=colourtest]
> 
> 
> \startsection[title={Section}]
> 
> \starttikzpicture
> 
> \draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text should be
> orange};
> 
> \stoptikzpicture
> 
> 
> \par This a paragraph which gets the colour of the section for no reason.
> 
> 
> \stopsection
> 
> 
> \stopchapter
> 
> 
> \startchapter[title={Colour test 2}, ref=colourtest]
> 
> 
> \startsection[title={Another section }]
> 
> 
> \par This a paragraph in the appropriate text color (green).
> 
> 
> 
> \starttikzpicture
> 
> \draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text is orange};
> 
> \stoptikzpicture
> 
> 
> \stopsection
> 
> 
> \stopchapter
> 
> \stoptext

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

2020-10-01 Thread Susanne G. Loeber
Dear Reader,

I have a colored section, text in another color and a TikZ picture with a
differently colored node, following each other. However, either the node
gets the wrong color or the following paragraph, see example below.

Is there something wrong with the section settings? How do I get all the
colors right without using a paragraph in between?

\setuphead[chapter]

[

style={\tfd},

color={A2plus},

]

\setuphead[section]

[

style={\tfc},

color={A3plus},

]


\definecolor[A1plus][h=5CAF00]

\definecolor[A2plus][h=B6437E]

\definecolor[A3plus][h=606ABD]

\definecolor[A4plus][h=FFC700]

\definecolor[A5plus][h=D0202B]

\definecolor[A6plus][h=EF8600]

\definecolor[A7plus][h=0082AA]


\setupcolors[textcolor=A1plus]


\usemodule[tikz]



\starttext


\startchapter[title={Colour test}, ref=colourtest]


\startsection[title={Section}]

\starttikzpicture

\draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text should be
orange};

\stoptikzpicture


\par This a paragraph which gets the colour of the section for no reason.


\stopsection


\stopchapter


\startchapter[title={Colour test 2}, ref=colourtest]


\startsection[title={Another section }]


\par This a paragraph in the appropriate text color (green).



\starttikzpicture

\draw[text=A6plus] (0,0) rectangle (2,1) node[right] {node text is orange};

\stoptikzpicture


\stopsection


\stopchapter

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

maillist : ntg-context@ntg.nl / 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] Using variables and macros for styling of section title and line in table of contents

2020-07-22 Thread James Withers
Thanks so much for such a quick reply Wolfgang

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, 22 Jul 2020 at 20:38, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> James Withers schrieb am 22.07.2020 um 21:20:
> > Dear list
> >
> > I have a document with section headings which include a title, date and
> > reference spread over two lines with different font style and
> > justification, plus a slightly different text for the table of contents.
> >
> > So that I can alter the styling of the section headings without having
> > to recode each \startsection command, I have used variables and a macro
> > command for the style.
> >
> > This works for section 'title' and 'marking', but not for the 'list'
> > attribute.
>
> The title argument works only because it is placed in the text but it
> won't work when you try to show the argument in the ToC like the list
> argument.
>
> > The minimal working example below shows what I'm trying to do.
> >
> > Best wishes and many thanks in advance.
> >
> > James
> >
> >
> \define\mytitle{\getvariable{myvar}{title}\crlf{\tfx\getvariable{myvar}{date}\hfill\getvariable{myvar}{ref}}}
> > \define\mylist{\getvariable{myvar}{list}---{\bf
> \getvariable{myvar}{date}}}
>
> In this case you have to use \defineexpandable to create your commands
> and enable expansion for sections.
>
> \defineexpandable\mytitle{...}
> \defineexpandable\mylist {...}
>
> \setuphead[section][expansion=yes]
>
> 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] Using variables and macros for styling of section title and line in table of contents

2020-07-22 Thread Wolfgang Schuster

James Withers schrieb am 22.07.2020 um 21:20:

Dear list

I have a document with section headings which include a title, date and 
reference spread over two lines with different font style and 
justification, plus a slightly different text for the table of contents.


So that I can alter the styling of the section headings without having 
to recode each \startsection command, I have used variables and a macro 
command for the style.


This works for section 'title' and 'marking', but not for the 'list' 
attribute.


The title argument works only because it is placed in the text but it 
won't work when you try to show the argument in the ToC like the list 
argument.



The minimal working example below shows what I'm trying to do.

Best wishes and many thanks in advance.

James

\define\mytitle{\getvariable{myvar}{title}\crlf{\tfx\getvariable{myvar}{date}\hfill\getvariable{myvar}{ref}}}
\define\mylist{\getvariable{myvar}{list}---{\bf \getvariable{myvar}{date}}}


In this case you have to use \defineexpandable to create your commands 
and enable expansion for sections.


\defineexpandable\mytitle{...}
\defineexpandable\mylist {...}

\setuphead[section][expansion=yes]

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] Using variables and macros for styling of section title and line in table of contents

2020-07-22 Thread James Withers
Dear list


I have a document with section headings which include a title, date and
reference spread over two lines with different font style and
justification, plus a slightly different text for the table of contents.


So that I can alter the styling of the section headings without having to
recode each \startsection command, I have used variables and a macro
command for the style.


This works for section 'title' and 'marking', but not for the 'list'
attribute.


The minimal working example below shows what I'm trying to do.


Best wishes and many thanks in advance.


James



\define\mytitle{\getvariable{myvar}{title}\crlf{\tfx\getvariable{myvar}{date}\hfill\getvariable{myvar}{ref}}}
\define\mylist{\getvariable{myvar}{list}---{\bf \getvariable{myvar}{date}}}

\starttext

\completecontent

\setvariables[myvar][
title={What I would like},
date={2020},
ref={Reference No 1},
list={Variation on title},
]

\startsection[title=\mytitle,list={Variation on title---{\bf 2020}}]

Contents line to look like this:

\mylist

\stopsection


\setvariables[myvar][
title={What I get},
date={2021},
ref={Reference No 2},
list={Something for the contents},
]

\startsection[title=\mytitle,list=\mylist]

Contents line to look like this:

\mylist

\stopsection
\stoptext

<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
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] Setup left, right, between entries in custom cite of multiple references

2020-06-06 Thread Mike O'Connor
I'm trying to customise \cite and unable to get inbetween= to appear between 
entries in a multi-ref citation.

My own customisations via a copy of publ-imp-apa.mkvi and .lua have this 
problem, so in case it was due to my customisation I went back to solid ground 
— the Chemistry example, pp. 70-74 in the Publications manual 
(http://pragma-ade.nl/general/manuals/mkiv-publications.pdf).

The cite examples on p.74 work as shown, but when I add each of the following:

\cite [name][108-95-2,566-33-5]\par
\cite [formula][108-95-2,566-33-5]\par
\cite [chemical][108-95-2,566-33-5]\par
\cite [molarvolume][108-95-2,566-33-5,24599-57-3]\par

I simply get the citation details, no separator between, and no left or right.

Either of the following works for left= and right=. However inbetween= does not 
activate, and similarly for separator:2, separator:3, separator:4.

\definebtx [chemistry:cite:formula]
[left={\color[blue]{(}}, % the colour to differentiate from \setupbtx below
 right={\color[red]{)}},
 inbetween={\btxcomma\btxspace},  % no effect
]

\setupbtx [chemistry:cite:formula]
[left={(},
 right={)},
 inbetween={\btxcomma\btxspace},
]

Grateful for any guidance as to how I can remedy this issue.

Regards, and thanks,

Mike



testChem-btx.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
___


Re: [NTG-context] \placetable[location=split] reference ??

2020-05-07 Thread Benjamin Buchmuller
Okay, I found the solution myself: Need to specify \startxtable[split=repeat] 
or else. 

It’s actually a bit surprising that the value of the “outer” enivornment 
(placetable) depends on the settings in the inner one (xtable). I speculate 
this might be because the order of the tables might be different as soon as 
xtable tries to place them …

Cheers

\startplacetable[reference=tab1,title={A table},location=split]
\startxtable[split=repeat]
\startxrow
\startxcell hi \stopxcell
\stopxrow
\stopxtable
\stopplacetable


> On 22 Apr 2020, at 21:10, Benjamin Buchmuller  
> wrote:
> 
> Hi,
> 
> I would like to reference a table of the following structure. 
> 
> \starttext
> 
> \startplacetable[reference=tab1,title={A table},location=split]
> \startxtable
> \startxrow
> \startxcell hi \stopxcell
> \stopxrow
> \stopxtable
> \stopplacetable
> 
> In Table \in[tab1]
> 
> \stoptext
> 
> 
> It has [location=split], which I need this because xtable doesn’t like to be 
> placed without a split; and apparently neither does it accept the 
> \placetable[ref]{...} syntax. However, the reference is now no longer 
> detected.
> 
> I can see that the split table’s caption is about to become "Table 1.a.", 
> "Table 1.b" etc. and I appreciate that this is potentially a quite complex 
> mechanism anyways, but if there was any chance to  get a reference as “Table 
> 1”, I would be helped a lot.
> 
> On similar lines, is there a way to have “Table 1 (continued).” in the 
> caption?
> 
> Cheers
> 
> 
> 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
___


[NTG-context] \placetable[location=split] reference ??

2020-04-22 Thread Benjamin Buchmuller
Hi,

I would like to reference a table of the following structure. 

\starttext

\startplacetable[reference=tab1,title={A table},location=split]
\startxtable
\startxrow
\startxcell hi \stopxcell
\stopxrow
\stopxtable
\stopplacetable

In Table \in[tab1]

\stoptext


It has [location=split], which I need this because xtable doesn’t like to be 
placed without a split; and apparently neither does it accept the 
\placetable[ref]{...} syntax. However, the reference is now no longer detected.

I can see that the split table’s caption is about to become "Table 1.a.", 
"Table 1.b" etc. and I appreciate that this is potentially a quite complex 
mechanism anyways, but if there was any chance to  get a reference as “Table 
1”, I would be helped a lot.

On similar lines, is there a way to have “Table 1 (continued).” in the caption?

Cheers


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] Referencing formulas doesn't work?

2020-02-09 Thread Exp
Please allow me to ask in this thread something slightly off-topic:
why doesn't ConTeXt give a compilation error or alike when
encountering such kind of mistakes? Is it technically difficult, or
is it conventional for *TeX processors to be over tolerant?

On Sun, Feb 9, 2020 at 11:05 PM Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> On Mon, 10 Feb 2020 05:58:50 +0800
> Jon Wong  wrote:
>
> > MWE:
> >
> > \starttext
> >
> > The famous result (and again) is given by
> > \placeformula[formulalabel]
> > \startformula
> > c^2 = a^2 + b^2.
> > \stopformula
> > And now we can refer to formula \ref[][formulalabel].
> >
> > \stoptext
> >
> > There is a blank where the formula label should be at “now we can refer
> to formula ---“.
>
> Use \ref[number][formulalabel] or \in[formulalabel].
>
> Wolfgang
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Referencing formulas doesn't work?

2020-02-09 Thread Wolfgang Schuster
On Mon, 10 Feb 2020 05:58:50 +0800
Jon Wong  wrote:

> MWE:
> 
> \starttext
> 
> The famous result (and again) is given by
> \placeformula[formulalabel]
> \startformula
> c^2 = a^2 + b^2.
> \stopformula
> And now we can refer to formula \ref[][formulalabel].
> 
> \stoptext
> 
> There is a blank where the formula label should be at “now we can refer to 
> formula ---“.

Use \ref[number][formulalabel] or \in[formulalabel].

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] Referencing formulas doesn't work?

2020-02-09 Thread Jon Wong
MWE:

\starttext

The famous result (and again) is given by
\placeformula[formulalabel]
\startformula
c^2 = a^2 + b^2.
\stopformula
And now we can refer to formula \ref[][formulalabel].

\stoptext

There is a blank where the formula label should be at “now we can refer to 
formula ---“.

Regards
Jon
___
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] Cross references to column numbers

2019-11-15 Thread Taco Hoekwater
Hi,

> On 15 Nov 2019, at 15:44, Oliver von Criegern 
>  wrote:
> 
> Could someone please take a look at this?

Well, I can tell you what is wrong …

The definition of \referencecolumnnumber is like this:

\def\referencecolumnnumber
  {\numexpr \dimexpr \clf_referenceposx -\cutspace \relax /
\dimexpr \makeupwidth /\nofcolumns \relax 
   +\plusone \relax }

But that outer \numexpr rounds instead of truncates. so anything that
is past halfway of the column is rounded too far up. This fixes it
(but not very elegantly)

\unprotect
\def\referencecolumnnumber
  {\numexpr \dimexpr \clf_referenceposx -\cutspace - \makeupwidth 
/(2*\nofcolumns) \relax /
\dimexpr \makeupwidth /\nofcolumns \relax 
   +\plusone \relax }
\protect
 

Best wishes,
Taco

> 
> Am 12.11.19 um 13:02 schrieb Oliver von Criegern:
>> Am 10.09.19 um 13:16 schrieb Hans Hagen:
>>> On 9/9/2019 10:05 PM, Henri Menke wrote:
>>>> Bump
>>>> 
>>>> On 9/3/19 4:46 AM, Oliver von Criegern wrote:
>>>>> Dear list members,
>>>>> 
>>>>> is there any way to get a cross reference to a column in a two column 
>>>>> layout?
>>> 
>>> yes and no:
>>> 
>>> no : there is not something buil tin
>>> yes: one can write some hack in a few lines
>>> 
>>> but instead of posting such a hack (which then will a live of its own) i'll 
>>> add a feature:
>>> 
>>> \pagereference[column:#1]
>>> 
>>> \doifelsereferencefound{column:#1}{\number\referencecolumnnumber}{}
>>> 
>>> in the next beta,
>>> 
>>> Hans
>> 
>> Thanks for implementing this, but I am afraid it does not work properly, at 
>> least not if there are several targets following one after another.
>> 
>> Consider this example:
>> 
>> 
>> \setupcolumns[
>> n=2,
>> ]
>> \setuplinenumbering[
>> step=5,
>>     method=page,
>> ]
>> 
>> \def\Lab#1{%
>> \pagereference[#1]%
>> \pagereference[column:#1]%
>> \someline[#1]%
>> }
>> 
>> \def\Ref#1{
>> page \at[#1],
>> column \doifelsereferencefound{column:#1}{\number\referencecolumnnumber}{},
>> line \inlinerange[#1].
>> }
>> 
>> \starttext
>> \startcolumns
>> \startlinenumbering
>> 
>> REFERENCES:\par
>> A: \Ref{A}\par
>> B: \Ref{B}\par
>> C: \Ref{C}\par
>> D: \Ref{D}\par
>> E: \Ref{E}\par
>> F: \Ref{F}\par
>> \input lorem
>> TARGETS:
>> \Lab{A} A,
>> \Lab{B} B,
>> \Lab{C} C.
>> \input lorem
>> TARGETS:
>> \Lab{D} D,
>> \Lab{E} E,
>> \Lab{F} F.
>> \input lorem
>> 
>> \stoplinenumbering
>> \stopcolumns
>> \stoptext
>> 
>> As you will see, targets A, B and C are all in the first column, and targets 
>> D, E and F are all in the second column. But the references read as follows:
>> 
>> A: page 1, column 1, line 29.
>> B: page 1, column 1, line 29.
>> C: page 1, column 2, line 29.
>> D: page 1, column 2, line 14.
>> E: page 1, column 3, line 14.
>> F: page 1, column 3, line 14.
>> 
>> 
>> Best regards,
>> Oliver
>> 
>> 
>>> 
>>>>> At least, I would need to get some value that tells me whether the target 
>>>>> is in the left or in the right column. How to achieve this?
>>>>> 
>>>>> This is the more simplified version of the my previous question cited 
>>>>> below.
>>>>> 
>>>>> Best regards,
>>>>> Oliver.
>>>>> 
>>>>> 
>>>>> Am 12.08.19 um 15:26 schrieb Oliver von Criegern:
>>>>>> Dear list members,
>>>>>> 
>>>>>> how can I create cross references to column numbers?
>>>>>> 
>>>>>> I have a two column layout with column numbers in the header instead of 
>>>>>> page numbers (actually, these column numbers are calculated from the 
>>>>>> page numbers). Now I want to create a cross reference that returns the 
>>>>>> column number of the target. How can I achieve this?
>>>>>> 
>>>>>> Of course, I can get the page number with \pagereference (for the 
>>>>>> target) and \at (for the reference), but for calculating the column 
>>>>>> number (according to what I did in the header), I would also need to 
>>>>>> know whether the target is in the left or in the right column, and I 
>>

Re: [NTG-context] Cross references to column numbers

2019-11-15 Thread Oliver von Criegern

Could someone please take a look at this?

Am 12.11.19 um 13:02 schrieb Oliver von Criegern:

Am 10.09.19 um 13:16 schrieb Hans Hagen:

On 9/9/2019 10:05 PM, Henri Menke wrote:

Bump

On 9/3/19 4:46 AM, Oliver von Criegern wrote:

Dear list members,

is there any way to get a cross reference to a column in a two 
column layout?


yes and no:

no : there is not something buil tin
yes: one can write some hack in a few lines

but instead of posting such a hack (which then will a live of its 
own) i'll add a feature:


\pagereference[column:#1]

\doifelsereferencefound{column:#1}{\number\referencecolumnnumber}{}

in the next beta,

Hans


Thanks for implementing this, but I am afraid it does not work 
properly, at least not if there are several targets following one 
after another.


Consider this example:


\setupcolumns[
    n=2,
]
\setuplinenumbering[
    step=5,
    method=page,
]

\def\Lab#1{%
\pagereference[#1]%
\pagereference[column:#1]%
\someline[#1]%
}

\def\Ref#1{
page \at[#1],
column 
\doifelsereferencefound{column:#1}{\number\referencecolumnnumber}{},

line \inlinerange[#1].
}

\starttext
\startcolumns
\startlinenumbering

REFERENCES:\par
A: \Ref{A}\par
B: \Ref{B}\par
C: \Ref{C}\par
D: \Ref{D}\par
E: \Ref{E}\par
F: \Ref{F}\par
\input lorem
TARGETS:
\Lab{A} A,
\Lab{B} B,
\Lab{C} C.
\input lorem
TARGETS:
\Lab{D} D,
\Lab{E} E,
\Lab{F} F.
\input lorem

\stoplinenumbering
\stopcolumns
\stoptext

As you will see, targets A, B and C are all in the first column, and 
targets D, E and F are all in the second column. But the references 
read as follows:


A: page 1, column 1, line 29.
B: page 1, column 1, line 29.
C: page 1, column 2, line 29.
D: page 1, column 2, line 14.
E: page 1, column 3, line 14.
F: page 1, column 3, line 14.


Best regards,
Oliver




At least, I would need to get some value that tells me whether the 
target is in the left or in the right column. How to achieve this?


This is the more simplified version of the my previous question 
cited below.


Best regards,
Oliver.


Am 12.08.19 um 15:26 schrieb Oliver von Criegern:

Dear list members,

how can I create cross references to column numbers?

I have a two column layout with column numbers in the header 
instead of page numbers (actually, these column numbers are 
calculated from the page numbers). Now I want to create a cross 
reference that returns the column number of the target. How can I 
achieve this?


Of course, I can get the page number with \pagereference (for the 
target) and \at (for the reference), but for calculating the 
column number (according to what I did in the header), I would 
also need to know whether the target is in the left or in the 
right column, and I can't see how I can get this information.


For an example, see the question posted by me at stackexchange:
https://tex.stackexchange.com/questions/502944/context-cross-references-to-column-numbers 



Besides, I am wondering, regarding the generally very regular and 
consistent naming of commands in ConTeXt, why this is not so in 
the case of references. For example, to refer to a page, I need 
\pagereference (for the target) and \at (for the reference); to 
refer to a line, I need \someline (for the target) and \inline 
(for the reference), but only if I want it to automatically add 
the word "line" or something else before the number, otherwise I 
have to use \inlinerange. It took me some time to find that out. 
Wouldn't it be easier to have just one command for the target and 
another one for the reference, and everything else, as counters 
and headers to be returned, text to be added etc. to be configured 
by options?
Because all these \in \at \about ... give back different things (a 
title, a number, a range, a ...) and packaging all that in one macro 
doens't make it cleaner so soon users will then wrap complex calls in 
a macro of their own (which then can clash with some existing name).


Also, the ref mechanism evolved over decades and we're not going to 
drop compatibility.


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
___ 




--
Dr. Oliver von Criegern
Referat für IT und Digital Humanities
Bayerische Akademie der Wissenschaften
Alfons-Goppel-Str. 11
80539 München

Re: [NTG-context] Cross references to column numbers

2019-11-12 Thread Oliver von Criegern

Am 10.09.19 um 13:16 schrieb Hans Hagen:

On 9/9/2019 10:05 PM, Henri Menke wrote:

Bump

On 9/3/19 4:46 AM, Oliver von Criegern wrote:

Dear list members,

is there any way to get a cross reference to a column in a two 
column layout?


yes and no:

no : there is not something buil tin
yes: one can write some hack in a few lines

but instead of posting such a hack (which then will a live of its own) 
i'll add a feature:


\pagereference[column:#1]

\doifelsereferencefound{column:#1}{\number\referencecolumnnumber}{}

in the next beta,

Hans


Thanks for implementing this, but I am afraid it does not work properly, 
at least not if there are several targets following one after another.


Consider this example:


\setupcolumns[
    n=2,
]
\setuplinenumbering[
    step=5,
    method=page,
]

\def\Lab#1{%
\pagereference[#1]%
\pagereference[column:#1]%
\someline[#1]%
}

\def\Ref#1{
page \at[#1],
column \doifelsereferencefound{column:#1}{\number\referencecolumnnumber}{},
line \inlinerange[#1].
}

\starttext
\startcolumns
\startlinenumbering

REFERENCES:\par
A: \Ref{A}\par
B: \Ref{B}\par
C: \Ref{C}\par
D: \Ref{D}\par
E: \Ref{E}\par
F: \Ref{F}\par
\input lorem
TARGETS:
\Lab{A} A,
\Lab{B} B,
\Lab{C} C.
\input lorem
TARGETS:
\Lab{D} D,
\Lab{E} E,
\Lab{F} F.
\input lorem

\stoplinenumbering
\stopcolumns
\stoptext

As you will see, targets A, B and C are all in the first column, and 
targets D, E and F are all in the second column. But the references read 
as follows:


A: page 1, column 1, line 29.
B: page 1, column 1, line 29.
C: page 1, column 2, line 29.
D: page 1, column 2, line 14.
E: page 1, column 3, line 14.
F: page 1, column 3, line 14.


Best regards,
Oliver




At least, I would need to get some value that tells me whether the 
target is in the left or in the right column. How to achieve this?


This is the more simplified version of the my previous question 
cited below.


Best regards,
Oliver.


Am 12.08.19 um 15:26 schrieb Oliver von Criegern:

Dear list members,

how can I create cross references to column numbers?

I have a two column layout with column numbers in the header 
instead of page numbers (actually, these column numbers are 
calculated from the page numbers). Now I want to create a cross 
reference that returns the column number of the target. How can I 
achieve this?


Of course, I can get the page number with \pagereference (for the 
target) and \at (for the reference), but for calculating the column 
number (according to what I did in the header), I would also need 
to know whether the target is in the left or in the right column, 
and I can't see how I can get this information.


For an example, see the question posted by me at stackexchange:
https://tex.stackexchange.com/questions/502944/context-cross-references-to-column-numbers 



Besides, I am wondering, regarding the generally very regular and 
consistent naming of commands in ConTeXt, why this is not so in the 
case of references. For example, to refer to a page, I need 
\pagereference (for the target) and \at (for the reference); to 
refer to a line, I need \someline (for the target) and \inline (for 
the reference), but only if I want it to automatically add the word 
"line" or something else before the number, otherwise I have to use 
\inlinerange. It took me some time to find that out. Wouldn't it be 
easier to have just one command for the target and another one for 
the reference, and everything else, as counters and headers to be 
returned, text to be added etc. to be configured by options?
Because all these \in \at \about ... give back different things (a 
title, a number, a range, a ...) and packaging all that in one macro 
doens't make it cleaner so soon users will then wrap complex calls in 
a macro of their own (which then can clash with some existing name).


Also, the ref mechanism evolved over decades and we're not going to 
drop compatibility.


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
___ 



--
Dr. Oliver von Criegern
Referat für IT und Digital Humanities
Bayerische Akademie der Wissenschaften
Alfons-Goppel-Str. 11
80539 München
Tel.: 089-

Re: [NTG-context] Cross references to column numbers

2019-09-10 Thread Oliver von Criegern


Am 10.09.19 um 13:16 schrieb Hans Hagen:

On 9/9/2019 10:05 PM, Henri Menke wrote:

Bump

On 9/3/19 4:46 AM, Oliver von Criegern wrote:

Dear list members,

is there any way to get a cross reference to a column in a two 
column layout?


yes and no:

no : there is not something buil tin
yes: one can write some hack in a few lines

but instead of posting such a hack (which then will a live of its own) 
i'll add a feature:


\pagereference[column:#1]

\doifelsereferencefound{column:#1}{\number\referencecolumnnumber}{}

in the next beta,

Hans



This would be great, thanks!

Best regards,
Oliver




At least, I would need to get some value that tells me whether the 
target is in the left or in the right column. How to achieve this?


This is the more simplified version of the my previous question 
cited below.


Best regards,
Oliver.


Am 12.08.19 um 15:26 schrieb Oliver von Criegern:

Dear list members,

how can I create cross references to column numbers?

I have a two column layout with column numbers in the header 
instead of page numbers (actually, these column numbers are 
calculated from the page numbers). Now I want to create a cross 
reference that returns the column number of the target. How can I 
achieve this?


Of course, I can get the page number with \pagereference (for the 
target) and \at (for the reference), but for calculating the column 
number (according to what I did in the header), I would also need 
to know whether the target is in the left or in the right column, 
and I can't see how I can get this information.


For an example, see the question posted by me at stackexchange:
https://tex.stackexchange.com/questions/502944/context-cross-references-to-column-numbers 



Besides, I am wondering, regarding the generally very regular and 
consistent naming of commands in ConTeXt, why this is not so in the 
case of references. For example, to refer to a page, I need 
\pagereference (for the target) and \at (for the reference); to 
refer to a line, I need \someline (for the target) and \inline (for 
the reference), but only if I want it to automatically add the word 
"line" or something else before the number, otherwise I have to use 
\inlinerange. It took me some time to find that out. Wouldn't it be 
easier to have just one command for the target and another one for 
the reference, and everything else, as counters and headers to be 
returned, text to be added etc. to be configured by options?
Because all these \in \at \about ... give back different things (a 
title, a number, a range, a ...) and packaging all that in one macro 
doens't make it cleaner so soon users will then wrap complex calls in 
a macro of their own (which then can clash with some existing name).


Also, the ref mechanism evolved over decades and we're not going to 
drop compatibility.


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
___ 



--
Dr. Oliver von Criegern
Referat für IT und Digital Humanities
Bayerische Akademie der Wissenschaften
Alfons-Goppel-Str. 11
80539 München
Tel.: 089-23031-1310

___
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] Cross references to column numbers

2019-09-10 Thread Hans Hagen

On 9/9/2019 10:05 PM, Henri Menke wrote:

Bump

On 9/3/19 4:46 AM, Oliver von Criegern wrote:

Dear list members,

is there any way to get a cross reference to a column in a two column layout?


yes and no:

no : there is not something buil tin
yes: one can write some hack in a few lines

but instead of posting such a hack (which then will a live of its own) 
i'll add a feature:


\pagereference[column:#1]

\doifelsereferencefound{column:#1}{\number\referencecolumnnumber}{}

in the next beta,

Hans


At least, I would need to get some value that tells me whether the target is in 
the left or in the right column. How to achieve this?

This is the more simplified version of the my previous question cited below.

Best regards,
Oliver.


Am 12.08.19 um 15:26 schrieb Oliver von Criegern:

Dear list members,

how can I create cross references to column numbers?

I have a two column layout with column numbers in the header instead of page 
numbers (actually, these column numbers are calculated from the page numbers). 
Now I want to create a cross reference that returns the column number of the 
target. How can I achieve this?

Of course, I can get the page number with \pagereference (for the target) and 
\at (for the reference), but for calculating the column number (according to 
what I did in the header), I would also need to know whether the target is in 
the left or in the right column, and I can't see how I can get this information.

For an example, see the question posted by me at stackexchange:
https://tex.stackexchange.com/questions/502944/context-cross-references-to-column-numbers

Besides, I am wondering, regarding the generally very regular and consistent naming of 
commands in ConTeXt, why this is not so in the case of references. For example, to refer 
to a page, I need \pagereference (for the target) and \at (for the reference); to refer 
to a line, I need \someline (for the target) and \inline (for the reference), but only if 
I want it to automatically add the word "line" or something else before the 
number, otherwise I have to use \inlinerange. It took me some time to find that out. 
Wouldn't it be easier to have just one command for the target and another one for the 
reference, and everything else, as counters and headers to be returned, text to be added 
etc. to be configured by options?
Because all these \in \at \about ... give back different things (a 
title, a number, a range, a ...) and packaging all that in one macro 
doens't make it cleaner so soon users will then wrap complex calls in a 
macro of their own (which then can clash with some existing name).


Also, the ref mechanism evolved over decades and we're not going to drop 
compatibility.


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] hypertarget and hyperlink in ConTeXt?

2019-08-31 Thread Jon Wong
Hi all,

I’m having trouble getting \textreference to show up.

MWE:

\starttext

\textreference[bleh]{\bf Ref One}.

\page

\textreference[blah]{\bf Ref Two}.

\at[bleh].

\at[blah].

\stoptext


Regards
Jon


> On Aug 28, 2019, at 7:40 PM, Jon Wong  wrote:
> 
> Hi all,
> 
> Any way to do hypertarget and hyperlink in ConTeXt?
> 
> From https://www.contextgarden.net/Command/textreference: 
> <https://www.contextgarden.net/Command/textreference:> I see that the name of 
> the anchor is also the displayed text (“houses”).
> 
> Regards
> Jon
> 

___
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] index page ranges where start page == end page

2019-07-09 Thread Sanjoy Mahajan
The following probably well known minimal example

  \starttext
  \startregister[index][key1]{an entry}\input knuth\stopregister[index][key1]

  \placeindex

  \stoptext

produces the index entry "an entry 1--1", where the page range should be
just a single page.

A question (and then two workarounds): Could ConTeXt automatically
change such page ranges to the single page ("an entry 1")?

Meanwhile, a couple of workarounds:

In the MkII (pre-lua) days, I wrote a shell/sed/awk/perl script that
converted the .pdf file to text, grepped for (strings that are likely to
be) page ranges, and spat out lines where the page range should be a
page.  (Those days were so long ago that I've forgotten the script's
language.)  Then I would manually find and change the corresponding
\startregister[index] in the source to a plain \index (and delete the
corresponding \stopregister).

In these MkIV days, with the index data in a lua table, I've been
playing with the following python2 script that parse the .tuc file to
spit out the same information slightly more reliably.  In the next
step, coming soon, the script will check that each \seeindex entry
points to an actual entry and also that each \seeindex{also ...} entry
originates from an actual entry (otherwise it shouldn't be "also").

The script requires the slpp package;

  pip install git+https://github.com/SirAnthony/slpp

The parser in the script has a bug in that it doesn't handle minus signs
in the lua table, maybe everywhere or maybe only some of them, so the
script replaces them with "_" before sending the data to the parser (a
terrible hack).

To run the script:

  python check-index.py < file.tuc

Here is check-index.py:

# parse lua-format index-entry table extracted from book.tuc to check
# that each xref points to an actual entry, and that, further, "see
# also" src entries have at least one page ref (perhaps in subtree)

# due to bug in slpp parser: replace "-" (minus signs) in data with "_"

from slpp import slpp as lua
from sys import stdin,stderr
import re

def tuclist2entry(l):
return '+'.join(l)

data = []
intro_re = r'utilitydata.structures.registers.collected\s*='
in_register_data = False
for l in stdin:
if re.match(intro_re, l):
in_register_data = True
data.append(re.sub(intro_re,'',l))
elif in_register_data:
data.append(l)
if re.match(r'}$', l):
in_register_data = False
data = re.sub("-", "_", ''.join(data))
dict = lua.decode(data)
index = dict['index']

entries = []
xrefs   = []
for entry in index['entries']:
src = [x[0] for x in entry['list']]
refs = entry['references']
if 'seeword' in entry:
dest = entry['seeword']['text']
xrefs.append((src,dest))
else:
page = refs['realpage']
if refs.get('lastrealpage',None) == page:
print "silly range:", tuclist2entry(src)
entries.append(src)

for xref in  xrefs:
print tuclist2entry(xref[0]),'->', xref[1]
___
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 get reference label from stacked itemize

2019-04-06 Thread Henning Hraban Ramm
Am 2019-04-06 um 16:51 schrieb Floris van Manen :

> Could someone point me to the docs where to find the proper way to
> make a reference to some stacked itemize context?
> 
> 
> \startitemize[n]
> \item One
> \item Two
> \startitemize[a]
> \item A
> \item B Test
> \stopitemize
> \stopitemize
> 
> how to label / ref the generated label for item 2.b ?
> 
> see (2.b) Test

Did you try \item[myref] and \in[myref]?


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] how to get reference label from stacked itemize

2019-04-06 Thread Floris van Manen
Could someone point me to the docs where to find the proper way to
make a reference to some stacked itemize context?


\startitemize[n]
\item One
\item Two
\startitemize[a]
\item A
\item B Test
\stopitemize
\stopitemize

how to label / ref the generated label for item 2.b ?

see (2.b) Test



Thanks!
.Floris van Manen




signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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] Space between initials in bibliography

2019-03-02 Thread Mikael P. Sundqvist
Hi,

By default there seem to be no space between initials in bibliography
(which I guess there should be?). I can get a space by adding
\setupbtx[
stopper:initials={.\btxspace},
]
but I don't think that this is how the stopper is meant to be used. Do
I miss some other key that I can use to get space inbetween initials?
Minimal example below, and I attach the result without the setting
above (no space V.I. Arnol'd) and with the setting above (space V. I.
Arnol'd).

/Mikael

%Example
\startbuffer[ref]
@book {arnold,
AUTHOR = {Arnold, Vladimir I.},
 TITLE = {Ordinary differential equations},
SERIES = {Universitext},
  NOTE = {Translated from the Russian by Roger Cooke,
  Second printing of the 1992 edition},
 PUBLISHER = {Springer-Verlag, Berlin},
  YEAR = {2006},
 PAGES = {ii+334},
  ISBN = {978-3-540-34563-3; 3-540-34563-9},
   MRCLASS = {34-01 (34Cxx 37-01 37C10)},
  MRNUMBER = {2242407},
}
\stopbuffer

\usebtxdataset[ref][ref.buffer]
\setupbtx[dataset=ref]
\definebtxrendering[ref][dataset=ref]
\setupbtx[
stopper:initials={.\btxspace},%comment to show version without space
]
\starttext
\startTEXpage[offset=3bp]
We study \cite[arnold].
\placelistofpublications[ref][method=dataset]
\stopTEXpage
\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] TeX Live 2019: attempt to call a nil value (upvalue 'isfile')

2019-03-01 Thread Hans Hagen

On 3/1/2019 12:01 PM, Mojca Miklavec wrote:

On Fri, 1 Mar 2019 at 08:50, luigi scarso wrote:


$> context luatex
  mkiv lua stats  > used platform: linux-64, type: unix, binary subtree: 
texmf-linux-64
mkiv lua stats  > used engine: luatex version 1.1 with functionality level 
7088, banner: this is luatex, version 1.10.0 (tex live 2019)
mkiv lua stats  > control sequences: 53180 of 65536 + 10
mkiv lua stats  > lua properties: engine: lua 5.3, used memory: 441 MB (ctx: 
437 MB), hash chars: min(64,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 21.608 seconds, 294 processed pages, 294 shipped 
pages, 13.606 pages/second
system  | total runtime: 47.547 seconds


OK, strange. It works for me in TeX Live as well after I installed the
missing dejavu fonts. I didn't imagine that it would break with such a
strange error when a font is missing though.


( forget the time, it's a zero-optimized binary (fast to compile))


It takes even longer for me with the binary from the distribution.

On the mac, is that one run?

With luatex 1.10 (mingw 64 version), when i delete the tuc file so with 
multiple runs to get the cross ref and lists right, I get:


mkiv lua stats  > runtime: 13.676 seconds, 294 processed pages, 294 
shipped pages, 21.498 pages/second

system  | total runtime: 67.472 seconds

After that, single runs take around 13 seconds:

mkiv lua stats  > runtime: 13.227 seconds, 294 processed pages, 294 
shipped pages, 22.227 pages/second


so, so, on my laptop (which for sure is slower than yours) a 21 pps rate 
is normal


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] State of the reference manual contextref.pdf

2019-02-10 Thread Hans Hagen

On 2/10/2019 8:13 PM, Marco Patzer wrote:

On Sun, 10 Feb 2019 17:43:09 +0100
Hans Hagen  wrote:


that effort was changed in cooking up smaller independent manuals ...


Which I personally like. It provides more in depth knowledge.


that ref manual still applies to much (encodings and fonts have
changed of course)


I know about the state of the manual. The question is, if it's
frozen and abandoned and the source repo closed down or if it has
moved elsewhere. But as it seems it's no longer updated.


indeed, so just forget about it


The wiki should reflect that, at least the old repo information
(foundry.supelec.fr) should go. The manual can stay. But before
removing the info on the wiki someone needs to confirm there's no
repo any longer.
Sure, so best coordinate this with taco who is cleaning up / upgrading 
the wiki andhas a shadow to play with running. Actually some more input 
on / help with that is welcome.


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] State of the reference manual contextref.pdf

2019-02-10 Thread Marco Patzer
On Sun, 10 Feb 2019 17:43:09 +0100
Hans Hagen  wrote:

> that effort was changed in cooking up smaller independent manuals ...

Which I personally like. It provides more in depth knowledge.

> that ref manual still applies to much (encodings and fonts have
> changed of course)

I know about the state of the manual. The question is, if it's
frozen and abandoned and the source repo closed down or if it has
moved elsewhere. But as it seems it's no longer updated.

The wiki should reflect that, at least the old repo information
(foundry.supelec.fr) should go. The manual can stay. But before
removing the info on the wiki someone needs to confirm there's no
repo any longer.

Marco
___
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] State of the reference manual contextref.pdf

2019-02-10 Thread Hans Hagen

On 2/10/2019 2:00 PM, Marco Patzer wrote:

Hi!

I'm wondering about the state of the reference manual
contextref.pdf. The wiki states

   “ConTeXt reference manual. This is the most comprehensive and
up-to-date general manual[…]” Date: September 27, 2013

There used to be SVN access on
foundry.supelec.fr/projects/contextman, but apparently it's
permanently down. Where is the manual hosted at the moment? The wiki
still points to foundry.supelec.fr:

   https://wiki.contextgarden.net/Improving_the_manuals

Some years ago there was a discussion about moving it to github. But
I doubt that has ever taken place.
that effort was changed in cooking up smaller independent manuals ... 
that ref manual still applies to much (encodings and fonts have changed 
of course)


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] linking to an external PDF file

2018-10-08 Thread Pablo Rodriguez
On 10/8/18 10:09 AM, Hans van der Meer wrote:
> I am embedding links to an URL in my documents. Although it is used in
> XML-documents, you might be able to use the gist of this code that
> generates a clickable link. Perhaps you find it useful. 

Many thanks for your reply, dr. Hans van der Meer.

Sorry, but I’m afraid I don’t see the way of generating an URL to a
non-external document in your code.

After all, the document is embedded in the PDF document itself.

Pablo

> % Return the code when clicking the link.
> \def\URIReturnCode#1{\ctxlua{tex.print(hvdm.urireturncode("#1"))}}
> 
> — Some Lua code needed:
> -- Check URI
> 
> socket.http.TIMEOUT = 5-- set URI timeout in seconds
> hvdm.urireturncode = function (theuri)
> -- Differentiate between file and http protocols.
> local first,last = string.find(theuri, "file://")
> if first == nil then
> -- We have http to search for.
> local content, status, authinfo = socket.http.request{
> method = "HEAD",
> url = theuri,
> }
> return type(status) == "number" and status or "failure"
> else
> -- We must ascertain the existence of the file.
> local thefile = io.open(string.sub(theuri, last+1, -1), "r")
> if thefile then
> io.close(thefile)
> return "200"
> else
> return "404"
> end
> end
> end
> 
> % . Place an url link
> .
> 
> % BEWARE: spaces in file names must be %20 in the link !!!
> 
> % This global definition of the URLbase cannot be missed.
> \def\THEURLBASE{http://}
> 
> % Signal the occurence of timeout on URI search.
> \newif\ifURItimeout
> 
> \startxmlsetups xmlcommon:urlbase
> \edef\THEURLBASE{\xmlstrippednolines{#1}{.}}
> 
> % Reset the URI timeout for new URLbase.
> \global\URItimeoutfalse
> \stopxmlsetups
> 
> \startxmlsetups xmlcommon:url
> 
> % Define the full uri.
> \edef\theurl{\THEURLBASE\xmlatt{#1}{link}}
> 
> % File suffix should be one of the list.
> \doifelse{\FileSuffixList{\xmlatt{#1}{link}}
> {pdf,jpg,jpeg,html,png,tif,tiff}}{\empty}
> {\def\suffix{.impossible}}% no suffix from the list here
> {\def\suffix{\empty}}% one of the list is present
> 
> % First try link as given, beware of unreachable site.
> \ifURItimeout
> % For previously timeout on this site.
> \else
> \edef\returncode{\URIReturnCode{\theurl}}
> \doif{\returncode}{failure}
> {
> \global\URItimeouttrue
> \errorcall{#1}{url access fails for \THEURLBASE\xmlatt{#1}{link}}
> }
> \fi
> 
> % On URI timeout there is no hope to find the file.
> \ifURItimeout
> \else
> % When there is no suffix from the list, try several.
> \doifnot{\suffix}{\empty}
> {
> \scratchcounter=200\relax
> \ifnum\returncode=\scratchcounter\else
> \def\suffix{.pdf}
> \edef\returncode{\URIReturnCode{\theurl\suffix}}
> \fi
> \ifnum\returncode=\scratchcounter\else
> \def\suffix{.jpg}
> \edef\returncode{\URIReturnCode{\theurl\suffix}}
> \fi
> \ifnum\returncode=\scratchcounter\else
> \def\suffix{.jpeg}
> \edef\returncode{\URIReturnCode{\theurl\suffix}}
> \fi
> \ifnum\returncode=\scratchcounter\else
> \def\suffix{.html}
> \edef\returncode{\URIReturnCode{\theurl\suffix}}
> \fi
> \ifnum\returncode=\scratchcounter\else
> \def\suffix{.png}
> \edef\returncode{\URIReturnCode{\theurl\suffix}}
> \fi
> \ifnum\returncode=\scratchcounter\else
> \def\suffix{.tiff}
> \edef\returncode{\URIReturnCode{\theurl\suffix}}
> \fi
> \ifnum\returncode=\scratchcounter\else
> \def\suffix{.tif}
> \edef\returncode{\URIReturnCode{\theurl\suffix}}
> \fi
> }
> 
> % Give up if returncode other then 200.
> \ifnum\returncode=200\relax
> % Page number might be added.
> \doifelse{\xmlatt{#1}{page}}{\empty}
> {\let\thep\empty}
> {\edef\thep{\letterhash page=\xmlatt{#1}{page}}}
> 
> % Place the link, ref-attribute prevales in the presentation.
> \doifelse{\xmlatt{#1}{ref}}{\empty}
> {\edef\temp{\xmlatt{#1}{link}}}
> {\edef\temp{\xmlatt{#1}{ref}}}
> \goto
> {\FirstLastCharacters{\temp}{\xmlatt{#1}{maxsize}}}
> [url(\theurl\suffix\thep)]
> \else
> \errorcall{#1}
> {\THEURLBASE\xmlatt{#1}{link} not found (\returncode)}
> \fi
> 
> \fi% end of URItimeout
> \stopxmlsetups
> 
> 
>> On 8 Oct 2018, at 00:39, Hans Hagen > <mailto:j.ha...@xs4all.nl>> wrote:
>>
>> On 10/7/2018 8:41 PM, Pablo Rodriguez wrote:
>>> On 10/7/18 8:33 PM, Hans Hagen wrote:
>>>> On 10/7/2018 8:19 PM, Pablo Rodriguez wrote:
>>>>> [...]
>>>>> Is there a way to hyperlink to an attached document? I mean, no matter
>>>>> whether it has been generated by C

Re: [NTG-context] linking to an external PDF file

2018-10-08 Thread Hans van der Meer
  {\let\thep\empty}
{\edef\thep{\letterhash page=\xmlatt{#1}{page}}}

% Place the link, ref-attribute prevales in the 
presentation.
\doifelse{\xmlatt{#1}{ref}}{\empty}
{\edef\temp{\xmlatt{#1}{link}}}
{\edef\temp{\xmlatt{#1}{ref}}}
\goto

{\FirstLastCharacters{\temp}{\xmlatt{#1}{maxsize}}}
[url(\theurl\suffix\thep)]
\else
\errorcall{#1}
{\THEURLBASE\xmlatt{#1}{link} not found 
(\returncode)}
\fi

\fi % end of URItimeout
\stopxmlsetups


> On 8 Oct 2018, at 00:39, Hans Hagen  wrote:
> 
> On 10/7/2018 8:41 PM, Pablo Rodriguez wrote:
>> On 10/7/18 8:33 PM, Hans Hagen wrote:
>>> On 10/7/2018 8:19 PM, Pablo Rodriguez wrote:
>>>> [...]
>>>> Is there a way to hyperlink to an attached document? I mean, no matter
>>>> whether it has been generated by ConTeXt or not.
>>>> i have no clue what you mean
>> Is there a way to link to a page or a destination (such as in
>> https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#page=500
>> or
>> https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#nameddest=G12.2456615)
>> to a document that is attached (using \attachment) in ConTeXt?
>> I hope it is clear now,
> it points to the media mess .. which relates to either or not obsolete stuff 
> (flash related)
> 
> anyway, i don't know as i never embed pdf docs and if i would i'd have no 
> reason to refer to them (it probably depends on a viewer extracting the 
> attachment, caching it and then providing access: it makes no sense to waste 
> time on features that are not supported or maybe only by acrobat unless it's 
> a well paid projects in which case throw away code is a bit less waste of 
> time because it brings foon on the table)
> 
> 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
> ___

___
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] linking to an external PDF file

2018-10-07 Thread Hans Hagen

On 10/7/2018 6:26 PM, Alan Bowen wrote:

A how-to question that has come up:

Is there a way to establish to hyperlink to a specific page or footnote 
in an external PDF document?

-- first.tex --

\setupinteraction[state=start]

\starttext

whatever \footnote[whatever:1]{whatever 1}

\goto{note 3}[second::whatever:3]
\goto{note 4}[second::whatever:4]

\in{note (1)}[whatever:1]
\in{note (2)}[whatever:2]
\in{note (3)}[second::whatever:3]
\in{note (4)}[second::whatever:4]

\page

whatever \footnote[whatever:2]{whatever 2}

\goto{note 3}[second::whatever:3]
\goto{note 4}[second::whatever:4]

\in{note (1)}[whatever:1]
\in{note (2)}[whatever:2]
\in{note (3)}[second::whatever:3]
\in{note (4)}[second::whatever:4]

\stoptext

-- second.tex --


\setupinteraction[state=start]

\starttext

whatever \footnote[whatever:3]{whatever 3}

\goto{note 1}[first::whatever:1]
\goto{note 2}[first::whatever:2]

\in{note (1)}[first::whatever:1]
\in{note (2)}[first::whatever:2]
\in{note (3)}[whatever:3]
\in{note (4)}[whatever:4]

\page

whatever \footnote[whatever:4]{whatever 4}

\goto{note 1}[first::whatever:1]
\goto{note 2}[first::whatever:2]

\in{note (1)}[first::whatever:1]
\in{note (2)}[first::whatever:2]
\in{note (3)}[whatever:3]
\in{note (4)}[whatever:4]

\stoptext

--

the \in ref to the other doc will work ok in a next beta (normally one 
will use a proper project / component structure for such cases)


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] Modifying bibliography entries using lua

2018-07-24 Thread Stanislav Sokolenko

That's perfect, thank you!

On 2018-07-23 06:32 PM, Hans Hagen wrote:

\startsetups btx:list:author:normalshort
    \fastsetup{btx:list:author:concat}
    \begingroup

\ctxluacode{document.CheckMeB("\currentbtxdataset","\currentbtxtag",\number\currentbtxauthorindex)} 


    \ifx\currentbtxinitials\empty \else
    \currentbtxinitials
    \btxparameter{separator:initials}
    \fi
    \ifx\currentbtxvons\empty \else
    \currentbtxvons
    \ifx\currentbtxsurnames\empty \else
    \btxparameter{separator:vons}
    \fi
    \fi
    \ifx\currentbtxsurnames\empty \else
    \currentbtxsurnames
    \ifx\currentbtxjuniors\empty \else
    \btxparameter{separator:juniors}
    \currentbtxjuniors
    \fi
    \fi
    \endgroup
    \fastsetup{btx:list:author:others}
\stopsetups 


I went with the following little extension to match and make bold 
multiple names:


|\startbuffer[ref]@article{solo, author ={MyLast, MyFirst}, title ={Solo 
work}, journal ={Journal}, year ={2000}, month ={1}, volume 
={1}}@article{co, author ={OtherLast, OtherFirst and MyLast, MyFirst and 
CoLast, CoFirst}, title ={Joint work}, journal ={Journal}, month ={1}, 
year ={2000}, volume 
={1}}\stopbuffer\usebtxdataset[ref][ref.buffer]\setupbtx[dataset=ref]\definebtxrendering[ref][dataset=ref]\setupbtx[default:cite][alternative=authoryear, 
etallimit=1, authorconversion=normalshort]\startluacodeBoldNames 
={{firstnames ="MyFirst", surnames ="MyLast"}, {initials ="C", surnames 
="CoLast"}, }function document.CompareNames(reference, targets)-- Loop 
over targets for _, target in pairs(targets)do -- Loop over fields for 
key, value in pairs(target)do if reference[key]==nil then break end 
full_entry ='' for _, part in ipairs(reference[key])do full_entry 
=full_entry .. ' ' .. part end full_entry =string.sub(full_entry, 2)if 
full_entry ==value then return(true)end end end return(false)end 
function document.BoldNames(set, tag, aut)local c 
=publications.getcasted(set, tag, "author")if 
document.CompareNames(c[aut], BoldNames)then context("\\bf")end end 
\stopluacode\startsetupsbtx:list:author:normalshort 
\fastsetup{btx:list:author:concat}\begingroup\ctxluacode{document.BoldNames("\currentbtxdataset","\currentbtxtag",\number\currentbtxauthorindex)}\ifx\currentbtxinitials\empty\else\currentbtxinitials\btxparameter{separator:initials}\fi\ifx\currentbtxvons\empty\else\currentbtxvons\ifx\currentbtxsurnames\empty\else\btxparameter{separator:vons}\fi\fi\ifx\currentbtxsurnames\empty\else\currentbtxsurnames\ifx\currentbtxjuniors\empty\else\btxparameter{separator:juniors}\currentbtxjuniors\fi\fi\endgroup\fastsetup{btx:list:author:others}\stopsetups\starttextCitations: 
\cite[solo]\cite[co]\startsubject[title=Bibliography]\placelistofpublications[ref][method=dataset]\stopsection\stoptext|



Cheers,

Stan

___
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] Modifying bibliography entries using lua

2018-07-23 Thread Hans Hagen

On 7/23/2018 6:42 PM, Stanislav Sokolenko wrote:

Dear list,

I'm struggling to output bibliography entries into lua for string 
modification (like making a particular author name bold). In effect, I 
just need something like the following:


\starttexdefinition btx:customauthor
     \startluacode
     local text = context.btxflush('author')
     -- tex.sprint(text) -- fails because text remains nil
     \stopluacode
\stoptexdefinition

It's clear that btxflux is the wrong function for this as it writes the 
contents to file rather than returning a variable in lua... Is there a 
way to directly access what btxflush is writing through the publications 
table or other means? I've gone over the source code but I can't 
decipher what btxflush is actually doing.


This is not for the fainthearted so here we go

\startluacode
function document.MyBoldPub(set,tag)
 -- local a = publications.getfield(set,tag,"author")
 -- inspect(a)
 -- local c = publications.getcasted(set,tag,"author")
 -- inspect(c)
if c[1].surnames[1] == "Myname" then
context.bold(function()
context.btxflush('author')
end )
else
context.btxflush('author')
end
end
\stopluacode

\starttexdefinition btx:customauthor
\ctxluacode{document.MyBoldPub("\currentbtxdataset","\currentbtxtag")}
\stoptexdefinition

try to avoid tex.print cum suis, use the proper context.* interface instead



Thanks,

Stan

Longer MNWE:

\stopluacode

\startbuffer[ref]
@article{solo,
   author = {Lastname, Firstname},
   title = {Solo work},
   journal = {Journal},
   year = {2000},
   month = {1},
   volume = {1}
}
\stopbuffer

\usebtxdataset[ref][ref.buffer]
\setupbtx[dataset=ref]

\definebtxrendering[ref][dataset=ref]
\setupbtx[default:cite]
   [alternative=authoryear,
    etallimit=1]


\starttexdefinition btx:customauthor
     \startluacode
     local text = context.btxflush('author')
     -- tex.sprint(text) -- text remains nill
     \stopluacode
\stoptexdefinition

\startsetups btx:default:list:article
     \texdefinition{btx:customauthor}
     \texdefinition{btx:default:title}
     \texdefinition{btx:default:journal}
     \texdefinition{btx:default:year}
     \removeunwantedspaces
     \removepunctuation
     \btxperiod
\stopsetups

\starttext

Citations: \cite[solo]

\startsubject[title=Bibliography]
\placelistofpublications[ref][method=dataset]
\stopsection

\stoptext


___ 

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


maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context

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



--

-
  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] Modifying bibliography entries using lua

2018-07-23 Thread Stanislav Sokolenko

Dear list,

I'm struggling to output bibliography entries into lua for string 
modification (like making a particular author name bold). In effect, I 
just need something like the following:


\starttexdefinition btx:customauthor
    \startluacode
    local text = context.btxflush('author')
    -- tex.sprint(text) -- fails because text remains nil
    \stopluacode
\stoptexdefinition

It's clear that btxflux is the wrong function for this as it writes the 
contents to file rather than returning a variable in lua... Is there a 
way to directly access what btxflush is writing through the publications 
table or other means? I've gone over the source code but I can't 
decipher what btxflush is actually doing.


Thanks,

Stan

Longer MNWE:

\stopluacode

\startbuffer[ref]
@article{solo,
  author = {Lastname, Firstname},
  title = {Solo work},
  journal = {Journal},
  year = {2000},
  month = {1},
  volume = {1}
}
\stopbuffer

\usebtxdataset[ref][ref.buffer]
\setupbtx[dataset=ref]

\definebtxrendering[ref][dataset=ref]
\setupbtx[default:cite]
  [alternative=authoryear,
   etallimit=1]


\starttexdefinition btx:customauthor
    \startluacode
    local text = context.btxflush('author')
    -- tex.sprint(text) -- text remains nill
    \stopluacode
\stoptexdefinition

\startsetups btx:default:list:article
    \texdefinition{btx:customauthor}
    \texdefinition{btx:default:title}
    \texdefinition{btx:default:journal}
    \texdefinition{btx:default:year}
    \removeunwantedspaces
    \removepunctuation
    \btxperiod
\stopsetups

\starttext

Citations: \cite[solo]

\startsubject[title=Bibliography]
\placelistofpublications[ref][method=dataset]
\stopsection

\stoptext


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

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

Re: [NTG-context] latest beta and \seeindex

2018-06-25 Thread Alan Braslau
"Mathematics is the art of giving the same name to different things. It
is enough that these things, though differing in matter, should be
similar in form, to permit their being, so to speak, cast in the same
mold. When the language has been carefully chosen, one is surprised to
discover that all proofs developed for a given object, can be
immediately applied to many new objects; there is nothing to be
changed, not even the words, since all the names have become the same."

(my translation)

;-)


On Mon, 25 Jun 2018 07:21:43 -0400
Alan Bowen  wrote:

> I should add too that in this particular volume our contributors
> sometimes mention different terms for the same thing as in “This is
> called p or q”. Indexing both terms (p and q) separately and the
> adding  x-ref is one way to go but indexing the more commonly used
> term and adding a mere x-ref for the other is more efficient.
> 
> Alan
> 
> On Sun, Jun 24, 2018 at 4:08 PM Henning Hraban Ramm 
> wrote:
> 
> > Am 2018-06-24 um 21:57 schrieb Hans Hagen :
> >  
> > > On 6/23/2018 5:10 PM, Alan Bowen wrote:  
> > >> The latest beta (ConTeXtver: 2018.06.23 12:12 MKIV betafmt:
> > >> 2018.6.23)  
> > processes without a hitch but \seeindex is still not working as
> > expected.  
> > >> In
> > >> \starttext
> > >> \index{sample}
> > >> \index{fun+games}\index{fun+stuff}
> > >> %\index{fun}
> > >> \seeindex{fun}{sample}% now with heading (as it should be)
> > >> \seeindex{fun}{blah}% not shown
> > >> \seeindex{fun}{humbug}% not shown
> > >> \seeindex{fun}{bug}% not shown
> > >> \seeindex{fun+games}{entertainment}% not shown
> > >> \placeindex[n=1]
> > >> \stoptext
> > >> When I generate the indices for my book, \seeindex{A}{B} works
> > >> only if  
> > it is a unique x-ref and A is a heading. Multiple x-refs to the same
> > heading fail as do x-refs to subheadings.  
> > > sure,
> > >
> > > \seeindex{fun}{blah}% not shown
> > > \seeindex{fun}{humbug}  % not shown
> > > \seeindex{fun}{bug} % not shown
> > >
> > > as there is no index entry blah, humbug or bug ... so you would
> > > be  
> > fooling your reader
> >
> > I understand the rationale, and it could be a nice feature, but we
> > need to refer to entries in a different register, e.g. from an
> > index of topics to an index of persons, e.g.
> > \seeindex{Pragma}{Hagen, Hans} or to subentries like
> > \seeindex{fun+games}{bah+humbug}. Since the latter doesn’t work (or
> > does it now?), we use \seeindex{fun+games}{bah/humbug}.
> >
> >
> > Greetlings, Hraban
> > ---
> > https://www.fiee.net
> > http://wiki.contextgarden.net
> > https://www.dreiviertelhaus.de
> > GPG Key ID 1C9B22FD
> >
> >
> > ___
> > 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] latest beta and \seeindex

2018-06-25 Thread Hans Hagen

On 6/24/2018 10:07 PM, Henning Hraban Ramm wrote:

Am 2018-06-24 um 21:57 schrieb Hans Hagen :


On 6/23/2018 5:10 PM, Alan Bowen wrote:

The latest beta (ConTeXtver: 2018.06.23 12:12 MKIV betafmt: 2018.6.23) 
processes without a hitch but \seeindex is still not working as expected.
In
\starttext
\index{sample}
\index{fun+games}\index{fun+stuff}
%\index{fun}
\seeindex{fun}{sample}% now with heading (as it should be)
\seeindex{fun}{blah}% not shown
\seeindex{fun}{humbug}% not shown
\seeindex{fun}{bug}% not shown
\seeindex{fun+games}{entertainment}% not shown
\placeindex[n=1]
\stoptext
When I generate the indices for my book, \seeindex{A}{B} works only if it is a 
unique x-ref and A is a heading. Multiple x-refs to the same heading fail as do 
x-refs to subheadings.

sure,

\seeindex{fun}{blah}% not shown
\seeindex{fun}{humbug}  % not shown
\seeindex{fun}{bug} % not shown

as there is no index entry blah, humbug or bug ... so you would be fooling your 
reader


I understand the rationale, and it could be a nice feature, but we need to 
refer to entries in a different register, e.g. from an index of topics to an 
index of persons, e.g. \seeindex{Pragma}{Hagen, Hans} or to subentries like 
\seeindex{fun+games}{bah+humbug}. Since the latter doesn’t work (or does it 
now?), we use \seeindex{fun+games}{bah/humbug}.
hm, sounds like a crappy index to mee (i actually hate these indexes 
that force you to 'see' somplace else .. extra lookup)


anyway, i'll add check=no to placeregister so that one can bypass the 
check (but i cannot foresee side effects like missing references in 
interactiev documents so these have to be taken for granted)


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] latest beta and \seeindex

2018-06-25 Thread Alan Bowen
I should add too that in this particular volume our contributors sometimes
mention different terms for the same thing as in “This is called p or q”.
Indexing both terms (p and q) separately and the adding  x-ref is one way
to go but indexing the more commonly used term and adding a mere x-ref for
the other is more efficient.

Alan

On Sun, Jun 24, 2018 at 4:08 PM Henning Hraban Ramm  wrote:

> Am 2018-06-24 um 21:57 schrieb Hans Hagen :
>
> > On 6/23/2018 5:10 PM, Alan Bowen wrote:
> >> The latest beta (ConTeXtver: 2018.06.23 12:12 MKIV betafmt: 2018.6.23)
> processes without a hitch but \seeindex is still not working as expected.
> >> In
> >> \starttext
> >> \index{sample}
> >> \index{fun+games}\index{fun+stuff}
> >> %\index{fun}
> >> \seeindex{fun}{sample}% now with heading (as it should be)
> >> \seeindex{fun}{blah}% not shown
> >> \seeindex{fun}{humbug}% not shown
> >> \seeindex{fun}{bug}% not shown
> >> \seeindex{fun+games}{entertainment}% not shown
> >> \placeindex[n=1]
> >> \stoptext
> >> When I generate the indices for my book, \seeindex{A}{B} works only if
> it is a unique x-ref and A is a heading. Multiple x-refs to the same
> heading fail as do x-refs to subheadings.
> > sure,
> >
> > \seeindex{fun}{blah}% not shown
> > \seeindex{fun}{humbug}  % not shown
> > \seeindex{fun}{bug} % not shown
> >
> > as there is no index entry blah, humbug or bug ... so you would be
> fooling your reader
>
> I understand the rationale, and it could be a nice feature, but we need to
> refer to entries in a different register, e.g. from an index of topics to
> an index of persons, e.g. \seeindex{Pragma}{Hagen, Hans} or to subentries
> like \seeindex{fun+games}{bah+humbug}. Since the latter doesn’t work (or
> does it now?), we use \seeindex{fun+games}{bah/humbug}.
>
>
> Greetlings, Hraban
> ---
> https://www.fiee.net
> http://wiki.contextgarden.net
> https://www.dreiviertelhaus.de
> GPG Key ID 1C9B22FD
>
>
> ___
> 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] latest beta and \seeindex

2018-06-24 Thread Henning Hraban Ramm
Am 2018-06-24 um 21:57 schrieb Hans Hagen :

> On 6/23/2018 5:10 PM, Alan Bowen wrote:
>> The latest beta (ConTeXtver: 2018.06.23 12:12 MKIV betafmt: 2018.6.23) 
>> processes without a hitch but \seeindex is still not working as expected.
>> In
>> \starttext
>> \index{sample}
>> \index{fun+games}\index{fun+stuff}
>> %\index{fun}
>> \seeindex{fun}{sample}% now with heading (as it should be)
>> \seeindex{fun}{blah}% not shown
>> \seeindex{fun}{humbug}% not shown
>> \seeindex{fun}{bug}% not shown
>> \seeindex{fun+games}{entertainment}% not shown
>> \placeindex[n=1]
>> \stoptext
>> When I generate the indices for my book, \seeindex{A}{B} works only if it is 
>> a unique x-ref and A is a heading. Multiple x-refs to the same heading fail 
>> as do x-refs to subheadings.
> sure,
> 
> \seeindex{fun}{blah}% not shown
> \seeindex{fun}{humbug}  % not shown
> \seeindex{fun}{bug} % not shown
> 
> as there is no index entry blah, humbug or bug ... so you would be fooling 
> your reader

I understand the rationale, and it could be a nice feature, but we need to 
refer to entries in a different register, e.g. from an index of topics to an 
index of persons, e.g. \seeindex{Pragma}{Hagen, Hans} or to subentries like 
\seeindex{fun+games}{bah+humbug}. Since the latter doesn’t work (or does it 
now?), we use \seeindex{fun+games}{bah/humbug}.


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] latest beta and \seeindex

2018-06-24 Thread Hans Hagen

On 6/23/2018 5:10 PM, Alan Bowen wrote:
The latest beta (ConTeXtver: 2018.06.23 12:12 MKIV betafmt: 2018.6.23) 
processes without a hitch but \seeindex is still not working as expected.


In

\starttext
\index{sample}
\index{fun+games}\index{fun+stuff}
%\index{fun}

\seeindex{fun}{sample}% now with heading (as it should be)
\seeindex{fun}{blah}% not shown
\seeindex{fun}{humbug}% not shown
\seeindex{fun}{bug}% not shown

\seeindex{fun+games}{entertainment}% not shown

\placeindex[n=1]
\stoptext

When I generate the indices for my book, \seeindex{A}{B} works only if 
it is a unique x-ref and A is a heading. Multiple x-refs to the same 
heading fail as do x-refs to subheadings.

sure,

\seeindex{fun}{blah}% not shown
\seeindex{fun}{humbug}  % not shown
\seeindex{fun}{bug} % not shown

as there is no index entry blah, humbug or bug ... so you would be 
fooling your reader


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] latest beta and \seeindex

2018-06-23 Thread Alan Bowen
The latest beta (ConTeXt  ver: 2018.06.23 12:12 MKIV beta  fmt: 2018.6.23)
processes without a hitch but \seeindex is still not working as expected.

In

\starttext
\index{sample}
\index{fun+games}\index{fun+stuff}
%\index{fun}

\seeindex{fun}{sample} % now with heading (as it should be)
\seeindex{fun}{blah} % not shown
\seeindex{fun}{humbug} % not shown
\seeindex{fun}{bug} % not shown

\seeindex{fun+games}{entertainment} % not shown

\placeindex[n=1]
\stoptext

When I generate the indices for my book, \seeindex{A}{B} works only if it
is a unique x-ref and A is a heading. Multiple x-refs to the same heading
fail as do x-refs to subheadings.

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] index x-ref problem

2018-05-25 Thread Alan Bowen
This is fixed in the latest beta. Thanks, Hans!

Alan

On Sat, May 19, 2018 at 8:05 AM Alan Bowen  wrote:

> IF I am doing this correctly, then, there seems to be problems in the
> current standalone​ when there are two x-refs to a single heading. The
> space after “and” is missing and should the order of the refs not be
> alphabetical?
>
> MWE
>
> \starttext
> \seeindex{animal}{cat}
> \seeindex{animal}{quadruped}
>
> %\seeindex{animal}{whiskers}
>
> The \index{cat}cat has \index{whiskers} whiskers.
> \blank[3*big]
> \placeindex
> \stoptext
>
> Uncomment the \seeindex{animal}{whiskers} and it gets even messier.
>
> 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] Defining command with optional and mandatory arguments

2018-05-24 Thread Alan Braslau
On Thu, 24 May 2018 11:24:34 +0200
Christoph Reller <christoph.rel...@gmail.com> wrote:

> Thank you Hraban for pointing me to the wiki. I was aware of this page
> but it contains only the case of mandatory arguments in curly braces
> {} not in brackets [].

One must *not* confuse with the LaTeX convention where "mandatory"
arguments are contained in curly braces and brackets indicate
"optional" arguments.

As Taco states below, curly braces not only give grouping but generally
are used for objects to be typeset, as for \in{Figure}{a} [fig:ref].

For new users, it is worth repeating here that arguments within braces
can be either a comma-separated list of words OR a comma-separated
list of keyword=value pairs, BUT NOT A MIXTURE OF BOTH. Generally, a
keyword=value exists for all words, for example \cite[authoryear][ref]
and \cite[alternative=authoryear,reference=ref]

values can be grouped using curly braces, as in
\cite[alternative=authoryear,lefttext={{see },}][ref1,ref2] where the
lefttext is associated with the first cite reference (and none with the
second). This can be tricky but is in fact rather straight-forward.

Alan

P.S. The wiki is only as good as users make it; some pages have not
been changed since mkii...


On Thu, 24 May 2018 15:43:27 +0200
Taco Hoekwater <t...@elvenkind.com> wrote:

> The original intent was for user-level commands to have square
> brackets for arguments setting things up, and curly braces for
> arguments that are actually typeset. That is where commands like \in
> come from, where the braced part is optional and the bracketed part
> required.

___
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] index x-ref problem

2018-05-19 Thread Alan Bowen
IF I am doing this correctly, then, there seems to be problems in the
current standalone​ when there are two x-refs to a single heading. The
space after “and” is missing and should the order of the refs not be
alphabetical?

MWE

\starttext
\seeindex{animal}{cat}
\seeindex{animal}{quadruped}

%\seeindex{animal}{whiskers}

The \index{cat}cat has \index{whiskers} whiskers.
\blank[3*big]
\placeindex
\stoptext

Uncomment the \seeindex{animal}{whiskers} and it gets even messier.

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] Passing two arguments from Lua to Context

2018-02-13 Thread Hans Hagen

On 2/13/2018 10:16 PM, Otared Kavian wrote:

On 13 Feb 2018, at 17:38, Hans Hagen <pra...@wxs.nl> wrote:


[…]


context.goto( "Index", { "ref:index" })

\def\foo#1#2{}

context.foo("a","b")

\def\foo[#1][#2]{}

context.foo( { "a" }, { "b" } )

etc


Hi Hans,

Thanks for your attention, your quick response and the hints, especially 
regarding the definition of a command with brackets.

Indeed, as you may see with the following modified example,
context.goto("Index",{"ref:index"})
generates an error, maybe because of a delimiter issue with the definition of 
\goto.
However, after defining a \MyGoTo command with delimiters being explicitely 
brackets, then
context.MyGoTo({"Index"},{"ref:index"})
works fine, as well as
local s,t = "Index","ref:index"
context.MyGoTo({s},{t})
so that my problem is solved…

Best regards: OK
%% begin test-lua-reference.tex
\setupinteraction[state=start]
\def\MyGoTo[#1][#2]{\goto{#1}[#2]}
\starttext

\startchapter[title={Ward},reference={ch:ward}]

\startluacode
context.index("Knuth")
context.index("Ward")
context("Read Knuth and see also the ")
local s,t = "Index","ref:index"
context.MyGoTo({s},{t})
--  context.goto("Index",{"ref:index"}) -- this does not work
\stopluacode


you need to use

context["goto"]("Index",{"ref:index"}) -- this does not work

because "goto" is a reserved lua word

you can't say foo.if or foo.end either


\input ward.tex

\stopchapter

\starttitle[title={Index}]
\startluacode
local s,t = "ref:","index"
context.pagereference({"ref:index"})
\stopluacode
\placeindex
\stoptitle

\stoptext
%% end test-lua-reference.tex
___
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] Passing two arguments from Lua to Context

2018-02-13 Thread Otared Kavian
> On 13 Feb 2018, at 17:38, Hans Hagen <pra...@wxs.nl> wrote:
> 
>> […]
> 
> context.goto( "Index", { "ref:index" })
> 
> \def\foo#1#2{}
> 
> context.foo("a","b")
> 
> \def\foo[#1][#2]{}
> 
> context.foo( { "a" }, { "b" } )
> 
> etc

Hi Hans,

Thanks for your attention, your quick response and the hints, especially 
regarding the definition of a command with brackets.

Indeed, as you may see with the following modified example,
context.goto("Index",{"ref:index"})
generates an error, maybe because of a delimiter issue with the definition of 
\goto.
However, after defining a \MyGoTo command with delimiters being explicitely 
brackets, then
context.MyGoTo({"Index"},{"ref:index"})
works fine, as well as
local s,t = "Index","ref:index"
context.MyGoTo({s},{t})
so that my problem is solved…

Best regards: OK
%% begin test-lua-reference.tex
\setupinteraction[state=start]
\def\MyGoTo[#1][#2]{\goto{#1}[#2]}
\starttext

\startchapter[title={Ward},reference={ch:ward}]

\startluacode
context.index("Knuth")
context.index("Ward")
context("Read Knuth and see also the ")
local s,t = "Index","ref:index"
context.MyGoTo({s},{t})
--  context.goto("Index",{"ref:index"}) -- this does not work
\stopluacode

\input ward.tex

\stopchapter

\starttitle[title={Index}]
\startluacode
local s,t = "ref:","index"
context.pagereference({"ref:index"})
\stopluacode
\placeindex
\stoptitle

\stoptext
%% end test-lua-reference.tex
___
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] Paasing two arguments from Lua to Context

2018-02-13 Thread Otared Kavian
Hi all,

After Hans showed me an example of using Lua code in ConTeXt, I am learning 
this stuff in the manual cld-mkiv.pdf, which is in 
[ConTeXt-StandAlone]/tex/texmf-context/doc/context/documents/general/manuals/cld-mkiv.pdf
 

From that manual I understand that if a macro command \mycommand is defined so 
that it takes one argument, such as in
\mycommand{Myargument}
then in a Lua code one may use it as in
context.mycommand({"Myargument"})

However, if \mycommand takes two arguments (or more), it is not clear to me how 
these arguments can be passed from Lua to Context. 
Indeed there is always the possibility to say (for a macro taking two arguments)

context("\\mycommand{FirstArgument}{SecondArgument}")

as in the example below with \goto. But I don’t know how to use context.goto…
The reason for which I need such a construction is that I want to add some 
links and buttons in my document which point to locations which are determined 
inside the Lua code.

Does any one have an idea to do this?
Thanks in advance and best regards: OK

%% begin test-lua-reference.tex
\setupinteraction[state=start]

\starttext

\startchapter[title={Knuth},reference={ch:knuth}]

% a simple way of adding a link to some part of the document...
Read the following and also what \goto{Ward says}[ch:ward].\index{Ward}
See also the \goto{Index}[ref:index].

\input knuth.tex

\stopchapter

\startchapter[title={Ward},reference={ch:ward}]

% a complicated way of doing the same as above...
\startluacode
context("Read the following and also what ") 
context("\\goto{Knuth says}[ch:knuth]") context.index("Knuth")
context(". See also the ")
local s,t = "Index","ref:index"
--  context("\\goto{s}[t]") -- this does not work
--  context.goto({"Index"},{"ref:index"}) -- this does not work
context("\\goto{Index}[ref:index]")
\stopluacode

\input ward.tex

\stopchapter

\starttitle[title={Index}]

% one could say \pagereference[ref:index], but I need a construction such as 
this:
\startluacode
local s,t = "ref:","index"
context.pagereference({s..t})
\stopluacode
\placeindex
\stoptitle

\stoptext
%% end test-lua-reference.tex
___
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] Latest beta: reference to items broken in mkiv

2018-02-09 Thread r . ermers
Hi all,

I kindly ask for your attention for this problem again. I would like subitems 
to appear differently in the reference than they are in the listing:

1. item 1

a. subitem a, reference a

b. item b
c. Item c, reference c

2. Item 2, reference 2 See Item b, 2, 1 above. 


See Item b, 2, 1 above. 

--

Desired result:

See item 1b., 2 1 above.

This is possible in mkii, but not in mkiv it seems. Does anyone know how to 
achieve this?

Robert


A minimal example to play with:

%\setupitemgroup[itemize][1][n,repeat][width=1em]
%\setupitemgroup[itemize][2][a,repeat][width=2em]
%\setupitemgroup[itemize][3][r][width=3em]

\starttext 

\startitemize[n]
\item [ref:1] item 1
\startitemize[a]
\startitem[ref:a]
subitem a, reference a
\stopitem
\item [ref:b] item b
\startitem[ref:c]
Item c, reference c
\stopitem
\stopitemize
\item[ref:2]
Item 2, reference 2
\stopitem
\stopitemize

See \in{Item}[ref:b], \in[ref:2], \in[ref:1] above.




> Op 7 feb. 2018, om 14:53 heeft Otared Kavian <ota...@gmail.com 
> <mailto:ota...@gmail.com>> het volgende geschreven:
> 
> Hi Robert,
> 
> Again I answered too quickly… excuse-me!
> If you want to have the subitems appear without the prefix, but references to 
> them contain the number of the item where they appear, I don’t know how to do 
> it.
> My previous message addresses only the separators between the numbers of the 
> items and subitems.
> Sorry… but my belief is that in ConTeXt everything is possible, even if I 
> don’t know how to do it :-)
> 
> Best regards: OK
> 
>> On 7 Feb 2018, at 12:56, r.erm...@hccnet.nl <mailto:r.erm...@hccnet.nl> 
>> wrote:
>> 
>> Hi Otared,
>> 
>> Thanks, the solution works to some extend. It yields the following output.
>> 
>> 1. item 1
>> 
>> 1.a.  subitem a, reference a
>> 
>> 1.b.  item b
>> 
>>  1.b.i. A sub-sub item
>> 
>>  1.b.ii. Another sub-sub item, B 1.c. Item c, reference c
>> 
>> 2. Item 2, reference 2
>> 
>> See Item 1.b, see also items 2 and 1 above, as well as the sub-sub item 
>> 1.b.ii. 
>> 
>> 
>> Yet the output I am looking for, and which I had in mkii, is:
>> 1. item 1
>> 
>> a.  subitem a, reference a
>> 
>> b.  item b
>> 
>>  i. A sub-sub item
>> 
>>  ii. Another sub-sub item, B 1.c. Item c, reference c
>> 
>> 2. Item 2, reference 2
>> 
>> 
>> See Item 1.b / 1b, see also items 2 and 1 above, as well as the sub-sub item 
>> 1.b.ii / 1bii. 
>> 
>> 
>> Is this possible?
>> 
>> Regards,
>> 
>> Robert
>> 
>> 
>> 
>> 
>>> Op 7 feb. 2018, om 12:37 heeft Otared Kavian <ota...@gmail.com 
>>> <mailto:ota...@gmail.com>> het volgende geschreven:
>>> 
>>> Hi Robert,
>>> 
>>> I think the issue does not come from the version of Context you are using 
>>> but rather from a lack of formatting your itemgroups with the keyword « 
>>> repeat ».
>>> 
>>> I guess what you want to obtain can be achieved with the following example 
>>> below. At least here with either versions of Context I have the output is 
>>> as expected.
>>> 
>>> Best regards: OK
>>> 
>>> %% begin repeat-subitem.tex
>>> \setupitemgroup[itemize][1][n,repeat][width=1em]
>>> \setupitemgroup[itemize][2][a,repeat][width=2em]
>>> \setupitemgroup[itemize][3][r][width=3em]
>>> 
>>> \starttext 
>>> 
>>> \startitemize[n]
>>> \item[ref:1] item 1
>>> \startitemize  
>>> \startitem[ref:a]
>>> subitem a, reference a
>>> \stopitem
>>> \item [ref:b] item b
>>> \startitemize
>>> \item A sub-sub item
>>> \item[ref:subsub-B] Another sub-sub item, B
>>> \stopitemize
>>> \startitem[ref:c]
>>> Item c, reference c
>>> \stopitem
>>> \stopitemize
>>> \startitem[ref:2]
>>> Item 2, reference 2
>>> \stopitem
>>> 
>>> \stopitemize
>>> \blank[big]
>>> 
>>> See \in{Item}[ref:b], see also items \in[ref:2] and \in[ref:1] above, as 
>>> well as the \in{sub-sub item}[ref:subsub-B].
>>> 
>>> \stoptext
>>> %% end repeat-subitem.tex
>>> 
>>> 
>>> 
>>>> On 7 Feb 2018, at 

Re: [NTG-context] Latest beta: reference to items broken in mkiv

2018-02-07 Thread r . ermers
Hi Otared,

Thanks for your time and trouble!.

I had found  \defineseparatorset[none][][]

with the same result: it oppresses the dots.


Yes, I want subitems to appear differently in the reference than they are in 
the listing:

1. item 1
a subitem 
b subitem
2. item 2
a subitem
b subitem

Desired result:

See item 1b and 2a.

Does anyone else know how to achieve this?

Robert



> Op 7 feb. 2018, om 14:53 heeft Otared Kavian <ota...@gmail.com> het volgende 
> geschreven:
> 
> Hi Robert,
> 
> Again I answered too quickly… excuse-me!
> If you want to have the subitems appear without the prefix, but references to 
> them contain the number of the item where they appear, I don’t know how to do 
> it.
> My previous message addresses only the separators between the numbers of the 
> items and subitems.
> Sorry… but my belief is that in ConTeXt everything is possible, even if I 
> don’t know how to do it :-)
> 
> Best regards: OK
> 
>> On 7 Feb 2018, at 12:56, r.erm...@hccnet.nl <mailto:r.erm...@hccnet.nl> 
>> wrote:
>> 
>> Hi Otared,
>> 
>> Thanks, the solution works to some extend. It yields the following output.
>> 
>> 1. item 1
>> 
>> 1.a.  subitem a, reference a
>> 
>> 1.b.  item b
>> 
>>  1.b.i. A sub-sub item
>> 
>>  1.b.ii. Another sub-sub item, B 1.c. Item c, reference c
>> 
>> 2. Item 2, reference 2
>> 
>> See Item 1.b, see also items 2 and 1 above, as well as the sub-sub item 
>> 1.b.ii. 
>> 
>> 
>> Yet the output I am looking for, and which I had in mkii, is:
>> 1. item 1
>> 
>> a.  subitem a, reference a
>> 
>> b.  item b
>> 
>>  i. A sub-sub item
>> 
>>  ii. Another sub-sub item, B 1.c. Item c, reference c
>> 
>> 2. Item 2, reference 2
>> 
>> 
>> See Item 1.b / 1b, see also items 2 and 1 above, as well as the sub-sub item 
>> 1.b.ii / 1bii. 
>> 
>> 
>> Is this possible?
>> 
>> Regards,
>> 
>> Robert
>> 
>> 
>> 
>> 
>>> Op 7 feb. 2018, om 12:37 heeft Otared Kavian <ota...@gmail.com 
>>> <mailto:ota...@gmail.com>> het volgende geschreven:
>>> 
>>> Hi Robert,
>>> 
>>> I think the issue does not come from the version of Context you are using 
>>> but rather from a lack of formatting your itemgroups with the keyword « 
>>> repeat ».
>>> 
>>> I guess what you want to obtain can be achieved with the following example 
>>> below. At least here with either versions of Context I have the output is 
>>> as expected.
>>> 
>>> Best regards: OK
>>> 
>>> %% begin repeat-subitem.tex
>>> \setupitemgroup[itemize][1][n,repeat][width=1em]
>>> \setupitemgroup[itemize][2][a,repeat][width=2em]
>>> \setupitemgroup[itemize][3][r][width=3em]
>>> 
>>> \starttext 
>>> 
>>> \startitemize[n]
>>> \item[ref:1] item 1
>>> \startitemize  
>>> \startitem[ref:a]
>>>     subitem a, reference a
>>> \stopitem
>>> \item [ref:b] item b
>>> \startitemize
>>> \item A sub-sub item
>>> \item[ref:subsub-B] Another sub-sub item, B
>>> \stopitemize
>>> \startitem[ref:c]
>>> Item c, reference c
>>> \stopitem
>>> \stopitemize
>>> \startitem[ref:2]
>>> Item 2, reference 2
>>> \stopitem
>>> 
>>> \stopitemize
>>> \blank[big]
>>> 
>>> See \in{Item}[ref:b], see also items \in[ref:2] and \in[ref:1] above, as 
>>> well as the \in{sub-sub item}[ref:subsub-B].
>>> 
>>> \stoptext
>>> %% end repeat-subitem.tex
>>> 
>>> 
>>> 
>>>> On 7 Feb 2018, at 11:46, r.erm...@hccnet.nl <mailto:r.erm...@hccnet.nl> 
>>>> wrote:
>>>> 
>>>> Hi Wolfgang, Otared and others,
>>>> 
>>>> I installed a new standalone:
>>>> 
>>>> mtx-context | main context file: 
>>>> /Applications/ContextStandalone/tex/texmf-context/tex/context/base/mkiv/context.mkiv
>>>> mtx-context | current version: 2018.02.06 18:11
>>>> 
>>>> However, I do not manage to get it going. The minimal example u

Re: [NTG-context] Latest beta: reference to items broken in mkiv

2018-02-07 Thread Otared Kavian
Hi Robert,

Again I answered too quickly… excuse-me!
If you want to have the subitems appear without the prefix, but references to 
them contain the number of the item where they appear, I don’t know how to do 
it.
My previous message addresses only the separators between the numbers of the 
items and subitems.
Sorry… but my belief is that in ConTeXt everything is possible, even if I don’t 
know how to do it :-)

Best regards: OK

> On 7 Feb 2018, at 12:56, r.erm...@hccnet.nl wrote:
> 
> Hi Otared,
> 
> Thanks, the solution works to some extend. It yields the following output.
> 
> 1. item 1
> 
> 1.a.  subitem a, reference a
> 
> 1.b.  item b
> 
>   1.b.i. A sub-sub item
> 
>   1.b.ii. Another sub-sub item, B 1.c. Item c, reference c
> 
> 2. Item 2, reference 2
> 
> See Item 1.b, see also items 2 and 1 above, as well as the sub-sub item 
> 1.b.ii. 
> 
> 
> Yet the output I am looking for, and which I had in mkii, is:
> 1. item 1
> 
> a.  subitem a, reference a
> 
> b.  item b
> 
>   i. A sub-sub item
> 
>   ii. Another sub-sub item, B 1.c. Item c, reference c
> 
> 2. Item 2, reference 2
> 
> 
> See Item 1.b / 1b, see also items 2 and 1 above, as well as the sub-sub item 
> 1.b.ii / 1bii. 
> 
> 
> Is this possible?
> 
> Regards,
> 
> Robert
> 
> 
> 
> 
>> Op 7 feb. 2018, om 12:37 heeft Otared Kavian <ota...@gmail.com 
>> <mailto:ota...@gmail.com>> het volgende geschreven:
>> 
>> Hi Robert,
>> 
>> I think the issue does not come from the version of Context you are using 
>> but rather from a lack of formatting your itemgroups with the keyword « 
>> repeat ».
>> 
>> I guess what you want to obtain can be achieved with the following example 
>> below. At least here with either versions of Context I have the output is as 
>> expected.
>> 
>> Best regards: OK
>> 
>> %% begin repeat-subitem.tex
>> \setupitemgroup[itemize][1][n,repeat][width=1em]
>> \setupitemgroup[itemize][2][a,repeat][width=2em]
>> \setupitemgroup[itemize][3][r][width=3em]
>> 
>> \starttext 
>> 
>> \startitemize[n]
>> \item[ref:1] item 1
>>  \startitemize  
>>  \startitem[ref:a]
>>  subitem a, reference a
>>  \stopitem
>>  \item [ref:b] item b
>>      \startitemize
>>  \item A sub-sub item
>>  \item[ref:subsub-B] Another sub-sub item, B
>>  \stopitemize
>>  \startitem[ref:c]
>>  Item c, reference c
>>  \stopitem
>>  \stopitemize
>>  \startitem[ref:2]
>>  Item 2, reference 2
>>  \stopitem
>> 
>> \stopitemize
>> \blank[big]
>> 
>> See \in{Item}[ref:b], see also items \in[ref:2] and \in[ref:1] above, as 
>> well as the \in{sub-sub item}[ref:subsub-B].
>> 
>> \stoptext
>> %% end repeat-subitem.tex
>> 
>> 
>> 
>>> On 7 Feb 2018, at 11:46, r.erm...@hccnet.nl <mailto:r.erm...@hccnet.nl> 
>>> wrote:
>>> 
>>> Hi Wolfgang, Otared and others,
>>> 
>>> I installed a new standalone:
>>> 
>>> mtx-context | main context file: 
>>> /Applications/ContextStandalone/tex/texmf-context/tex/context/base/mkiv/context.mkiv
>>> mtx-context | current version: 2018.02.06 18:11
>>> 
>>> However, I do not manage to get it going. The minimal example underneath 
>>> gives the following result:
>>> 1. item 1
>>> a. subitem a, reference a 
>>> 
>>> b. item b
>>> 
>>> c. Item c, reference c
>>> 
>>> 2. Item 2, reference 2 
>>> 
>>> 
>>> See Item b, 2, 1 above. 
>>> 
>>> This should be: 
>>> 
>>> See Item 1b, 2, 1 above.
>>> 
>>> Regards,
>>> 
>>> Robert
>>> 
>>> 
>>> 
>>> \starttext 
>>> 
>>> \startitemize[n]\starttext 
>>> 
>>> \startitemize[n]
>>> \item [ref:1] item 1
>>> \startitemize[a]
>>> \startitem[ref:a]
>>> subitem a, reference a
>>> \stopitem
>>> \item [ref:b] item b
>>> \startitem[ref:c]
>>> Item c, reference c
>>> \stopitem
>>> \stopitemize
>>> \startitem[ref:2]
>>> Item 2, reference 2
>>> \stopitem
>>> \stopitemize
>>> 
>>> 

Re: [NTG-context] Latest beta: reference to items broken in mkiv

2018-02-07 Thread Otared Kavian
Hi Robert,

Sorry I didn’t pay attention to the way you wanted the formatting of sub-items.
If you want to remove the separator between numbers, then you may add the 
following two line after the setups of your itemgroups:

\defineseparatorset[nothing][][]
\setupcounter[itemgroup:itemize][numberseparatorset=nothing]

This removes all the dots between the item sympbols or numbers.

Best regards: OK


> On 7 Feb 2018, at 12:56, r.erm...@hccnet.nl wrote:
> 
> Hi Otared,
> 
> Thanks, the solution works to some extend. It yields the following output.
> 
> 1. item 1
> 
> 1.a.  subitem a, reference a
> 
> 1.b.  item b
> 
>   1.b.i. A sub-sub item
> 
>   1.b.ii. Another sub-sub item, B 1.c. Item c, reference c
> 
> 2. Item 2, reference 2
> 
> See Item 1.b, see also items 2 and 1 above, as well as the sub-sub item 
> 1.b.ii. 
> 
> 
> Yet the output I am looking for, and which I had in mkii, is:
> 1. item 1
> 
> a.  subitem a, reference a
> 
> b.  item b
> 
>   i. A sub-sub item
> 
>   ii. Another sub-sub item, B 1.c. Item c, reference c
> 
> 2. Item 2, reference 2
> 
> 
> See Item 1.b / 1b, see also items 2 and 1 above, as well as the sub-sub item 
> 1.b.ii / 1bii. 
> 
> 
> Is this possible?
> 
> Regards,
> 
> Robert
> 
> 
> 
> 
>> Op 7 feb. 2018, om 12:37 heeft Otared Kavian <ota...@gmail.com 
>> <mailto:ota...@gmail.com>> het volgende geschreven:
>> 
>> Hi Robert,
>> 
>> I think the issue does not come from the version of Context you are using 
>> but rather from a lack of formatting your itemgroups with the keyword « 
>> repeat ».
>> 
>> I guess what you want to obtain can be achieved with the following example 
>> below. At least here with either versions of Context I have the output is as 
>> expected.
>> 
>> Best regards: OK
>> 
>> %% begin repeat-subitem.tex
>> \setupitemgroup[itemize][1][n,repeat][width=1em]
>> \setupitemgroup[itemize][2][a,repeat][width=2em]
>> \setupitemgroup[itemize][3][r][width=3em]
>> 
>> \starttext 
>> 
>> \startitemize[n]
>> \item[ref:1] item 1
>>  \startitemize  
>>  \startitem[ref:a]
>>  subitem a, reference a
>>  \stopitem
>>  \item [ref:b] item b
>>      \startitemize
>>  \item A sub-sub item
>>  \item[ref:subsub-B] Another sub-sub item, B
>>  \stopitemize
>>  \startitem[ref:c]
>>  Item c, reference c
>>  \stopitem
>>  \stopitemize
>>  \startitem[ref:2]
>>  Item 2, reference 2
>>  \stopitem
>> 
>> \stopitemize
>> \blank[big]
>> 
>> See \in{Item}[ref:b], see also items \in[ref:2] and \in[ref:1] above, as 
>> well as the \in{sub-sub item}[ref:subsub-B].
>> 
>> \stoptext
>> %% end repeat-subitem.tex
>> 
>> 
>> 
>>> On 7 Feb 2018, at 11:46, r.erm...@hccnet.nl <mailto:r.erm...@hccnet.nl> 
>>> wrote:
>>> 
>>> Hi Wolfgang, Otared and others,
>>> 
>>> I installed a new standalone:
>>> 
>>> mtx-context | main context file: 
>>> /Applications/ContextStandalone/tex/texmf-context/tex/context/base/mkiv/context.mkiv
>>> mtx-context | current version: 2018.02.06 18:11
>>> 
>>> However, I do not manage to get it going. The minimal example underneath 
>>> gives the following result:
>>> 1. item 1
>>> a. subitem a, reference a 
>>> 
>>> b. item b
>>> 
>>> c. Item c, reference c
>>> 
>>> 2. Item 2, reference 2 
>>> 
>>> 
>>> See Item b, 2, 1 above. 
>>> 
>>> This should be: 
>>> 
>>> See Item 1b, 2, 1 above.
>>> 
>>> Regards,
>>> 
>>> Robert
>>> 
>>> 
>>> 
>>> \starttext 
>>> 
>>> \startitemize[n]\starttext 
>>> 
>>> \startitemize[n]
>>> \item [ref:1] item 1
>>> \startitemize[a]
>>> \startitem[ref:a]
>>> subitem a, reference a
>>> \stopitem
>>> \item [ref:b] item b
>>> \startitem[ref:c]
>>> Item c, reference c
>>> \stopitem
>>> \stopitemize
>>> \startitem[ref:2]
>>> Item 2, reference 2
>>> \stopitem
>>> \stopitemize
>>> 
>>> See \in{Item}[ref:b], \in[ref:2], \

  1   2   3   4   5   6   >