Re: [NTG-context] How to go through a vbox line by line in Lua?

2017-04-26 Thread Hans Hagen

On 4/26/2017 11:10 PM, Henri Menke wrote:


Recently I answered a question on TeX.SX where it was necessary to go
through an already typeset vbox and examine it line by line.  Therefore
I used the macro \eatlines from Viktor Ei­jkhout's "TeX by Topic", here
a version tailored to my needs:

\def\eatlines{%
  \setbox\scratchbox=\lastbox
  \ifvoid\scratchbox\else
\unskip\unpenalty
{\eatlines}%
\setbox\scratchbox=\hbox{\unhbox\scratchbox}%
% Do something with scratchbox, e.g. examine width
  \fi
}

It is then used like

\vbox{ ... some content ... \par\eatlines}

The macro goes through all hboxes (lines) in the vertical list until
there is none left (\ifvoid) and unpacks each hbox into a new one.

I was wondering, can the same thing be done in Lua (with probably less
and more readable code)?


it depends on what you want to do. In any case you neet to be aware of 
possible side effects then.


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] How to go through a vbox line by line in Lua?

2017-04-26 Thread Henri Menke
Dear list,

Recently I answered a question on TeX.SX where it was necessary to go
through an already typeset vbox and examine it line by line.  Therefore
I used the macro \eatlines from Viktor Ei­jkhout's "TeX by Topic", here
a version tailored to my needs:

\def\eatlines{%
  \setbox\scratchbox=\lastbox
  \ifvoid\scratchbox\else
\unskip\unpenalty
{\eatlines}%
\setbox\scratchbox=\hbox{\unhbox\scratchbox}%
% Do something with scratchbox, e.g. examine width
  \fi
}

It is then used like

\vbox{ ... some content ... \par\eatlines}

The macro goes through all hboxes (lines) in the vertical list until
there is none left (\ifvoid) and unpacks each hbox into a new one.

I was wondering, can the same thing be done in Lua (with probably less
and more readable code)?

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 with distinguishable entries -- again

2017-04-26 Thread Rik Kabel

On 2017-04-26 09:18, Florian Grammel wrote:

Back in april 2012 Robert Blackstone asked some questions about indexing
http://www.mail-archive.com/ntg-context@ntg.nl/msg63134.html
i.a.:


For a book in the area of musicology I would like to make one register with
entries of different kinds, distinguishable by their appearance in the
register (or index or whatever).
The index entries will mostly be authors, including composers, musical terms
and musical compositions. The titles of the compositions and the foreign words
are set in italic characters throughout in the text of the book.
What I would like is to be able to distinguish all entries according to whether
they are treated in the text, are shown in a musical example, or are mentioned
only in a foot- or endnote.

In many books page numbers indicating illustrations are set in italics.
Pagenumbers indicating foot- or endnotes often have a suffix "n".


His other question were resolved, but this one remained unanswered, apart from 
that two other users also wanted to do exactly the same thing.

I would like to do something very similar and was wondering: Has this been 
addressed/solved since then?


Perhaps the following can help. It has separate user page numbers for 
the main matter and back matter, with a suffixed ‘n’ for the items 
indexed from backmatter pages, but no suffix on the backmatter page 
numbers. The index entries for figures are rubricated and have a leading 
‘f’.


   \defineprocessor [backpart] [style=slanted,right=n]
   \defineprocessor [Figure] [style=\tf,color=red,left=f]
   \defineconversionset [backpart:pagenumber][][backpart->o]
   \setupuserpagenumber[way=byblock]
   \setuppagenumbering [location=none]
   \setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]
   \setupnote[footnote][location=none]
   \useMPlibrary[dum]
   \starttext
   \startbodymatter
   \startchapter[title=A chapter]
  \index{aaa}This is in the main body.\footnote{\index{bbb}This is
   a footnote.}
   \stopchapter
   \startchapter[title={Another chapter}]
  \index{aaa}This is in the main body.\footnote{\index{bbb}This is
   a footnote.}
  \startplacefigure[location=default,
  title={Body illustration\index[Figure->]{ccc}}]
\externalfigure[dummy][]
  \stopplacefigure
   \stopchapter
   \stopbodymatter
   \page
   \startbackmatter
   \startchapter[title=An appendix]
  This is in the backmatter.\index{aaa}\footnote{\index{bbb}This is
   a footnote.}
  \startplacefigure[location=default,
  title={Appendix illustration\index[Figure->]{ddd}}]
\externalfigure[dummy][]
  \stopplacefigure
   \stopchapter
   \startchapter[title=Notes]
  \placenotes[footnote]
   \stopchapter
   \startchapter[title=Index]
  \placeregister[index]
   \stopchapter
   \stopbackmatter
   \stoptext


--
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] eqalignno failing

2017-04-26 Thread Otared Kavian
Hi Hans,

Since a few weeks (or months?…) ago the use of \eqno and \eqalignno has been 
changed in mkiv. 
It is better to use the construction such as:

\placeformula
\startformula
\startalign
\NC H(I,J) \NC = H(I) + H(J|I) \NR[eq:equivoc]
\NC W(I,J) \NC = H(J) - H(J|I) \NR[eq:wedinfo]
\stopalign
\stopformula

Best regards: OK
 

> On 26 Apr 2017, at 15:39, Meer, Hans van der  wrote:
> 
> This code now fails where before contextbeta had no problems:
> 
> tex error   > tex error on line 101 in file Info/waarneming.tex: ! 
> Misplaced alignment tab character &
> 
>  &
>  
> l.101 H(I,J) &
>  = H(I) + H(J|I)\qquad&\hbox{\ineq[eq:equivoc]}\cr
> 
>   99 \placeformula\startformula
> 100 \eqalignno{
> 101 >>  H(I,J) &= H(I) + H(J|I)\qquad&\hbox{\ineq[eq:equivoc]}\cr
> 102 W(I,J) &= H(J) - H(J|I)\qquad&\hbox{\ineq[eq:wedinfo]}\cr
> 103 }
> 104 \stopformula
>  
> This happens in ConTeXt  ver: 2017.04.16 12:32 MKIV beta  fmt: 2017.4.16  
> int: english/english
> I am not sure when this started to happen, but for sure after 2016-02-12.
> 
> Here is a minimal example to run:
> 
> \starttext
> \placeformula\startformula
> \eqalignno{
> 3x - 4y &= 5   \cr
> x  +  7 &= -2y \cr
> z &= 2
> }
> \stopformula
> \stoptext
> 
> Hans van der Meer
> 
> 
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] eqalignno failing

2017-04-26 Thread Meer, Hans van der
This code now fails where before contextbeta had no problems:

tex error   > tex error on line 101 in file Info/waarneming.tex: ! 
Misplaced alignment tab character &

 &



l.101 H(I,J) &
 = H(I) + H(J|I)\qquad&\hbox{\ineq[eq:equivoc]}\cr

  99 \placeformula\startformula
100 \eqalignno{
101 >>  H(I,J) &= H(I) + H(J|I)\qquad&\hbox{\ineq[eq:equivoc]}\cr
102 W(I,J) &= H(J) - H(J|I)\qquad&\hbox{\ineq[eq:wedinfo]}\cr
103 }
104 \stopformula

This happens in ConTeXt  ver: 2017.04.16 12:32 MKIV beta  fmt: 2017.4.16  int: 
english/english
I am not sure when this started to happen, but for sure after 2016-02-12.

Here is a minimal example to run:

\starttext
\placeformula\startformula
\eqalignno{
3x - 4y &= 5   \cr
x  +  7 &= -2y \cr
z &= 2
}
\stopformula
\stoptext

Hans van der Meer




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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 with distinguishable entries -- again

2017-04-26 Thread Florian Grammel
Back in april 2012 Robert Blackstone asked some questions about indexing
http://www.mail-archive.com/ntg-context@ntg.nl/msg63134.html
i.a.:

> For a book in the area of musicology I would like to make one register with 
> entries of different kinds, distinguishable by their appearance in the  
> register (or index or whatever).
> The index entries will mostly be authors, including composers, musical terms 
> and musical compositions. The titles of the compositions and the foreign 
> words 
> are set in italic characters throughout in the text of the book.
> What I would like is to be able to distinguish all entries according to 
> whether 
> they are treated in the text, are shown in a musical example, or are 
> mentioned 
> only in a foot- or endnote.
> 
> In many books page numbers indicating illustrations are set in italics. 
> Pagenumbers indicating foot- or endnotes often have a suffix "n".
> 

His other question were resolved, but this one remained unanswered, apart from 
that two other users also wanted to do exactly the same thing.

I would like to do something very similar and was wondering: Has this been 
addressed/solved since then?


Thanks in advance!
Best,
Florian.




Florian Grammel

Copenhagen, Denmark

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Context Journal Articles

2017-04-26 Thread kaddour kardio
good news! Thank you so much Taco

On Wed, Apr 26, 2017 at 11:56 AM, Taco Hoekwater  wrote:

>
> > On 26 Apr 2017, at 10:33, Taco Hoekwater  wrote:
> >
> >
> >> On 26 Apr 2017, at 01:50, Mohammad Hossein Bateni 
> wrote:
> >>
> >> Hi,
> >>
> >> According to the following website, "Proceedings 9° ConTeXt meeting,
> Nasbinals, France, 2015 (PDFs will become available in March 2017)."
> >> http://articles.contextgarden.net/journal/
> >>
> >> It's not April :)  Is anyone planning to upload the PDFs?
> >
> > Of course I will (I forgot). Probably later today.
>
> Done now.
>
> Best wishes,
> Taco
>
> 
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/
> listinfo/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 YAHYAOUI Mohamed Kaddour, cardiologue.Clinique EL ABRAR.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Context Journal Articles

2017-04-26 Thread Taco Hoekwater

> On 26 Apr 2017, at 10:33, Taco Hoekwater  wrote:
> 
> 
>> On 26 Apr 2017, at 01:50, Mohammad Hossein Bateni  wrote:
>> 
>> Hi,
>> 
>> According to the following website, "Proceedings 9° ConTeXt meeting, 
>> Nasbinals, France, 2015 (PDFs will become available in March 2017)."
>> http://articles.contextgarden.net/journal/
>> 
>> It's not April :)  Is anyone planning to upload the PDFs?
> 
> Of course I will (I forgot). Probably later today.

Done now.

Best wishes,
Taco

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Context Journal Articles

2017-04-26 Thread Taco Hoekwater

> On 26 Apr 2017, at 01:50, Mohammad Hossein Bateni  wrote:
> 
> Hi,
> 
> According to the following website, "Proceedings 9° ConTeXt meeting, 
> Nasbinals, France, 2015 (PDFs will become available in March 2017)."
> http://articles.contextgarden.net/journal/
> 
> It's not April :)  Is anyone planning to upload the PDFs?

Of course I will (I forgot). Probably later today.

Best wishes,
Taco




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

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