Re: [NTG-context] index issues

2020-11-06 Thread Henning Hraban Ramm
> Am 06.11.2020 um 12:22 schrieb Henning Hraban Ramm :
> 
> (2)
> Page/column breaking is odd in that the preferred breaking point seems to be 
> one entry too early, i.e. the last entry of one letter end up in the next 
> column and the previous column is one line too short.
> It doesn’t change with balance=yes/no.

If one of the \index{D...} lines is commented in the following example, the 
last D entry goes into the second column, the columns get balanced, and the 
second line of the last K entry is broken to the next page.
If you uncomment that line, it looks as intended (no balancing, full left 
column).
What’s wrong? Can I influence this e.g. with penalties?

(Screenshots were too big...)

Hraban


\setuppapersize[A6]
\setupbodyfont[16pt]
\setupregister[index][balance=no,indicator=no]
\showframe

\starttext

%\setinjector[index][10][{\column}]
%\showinjector[index] % ERROR!
\index{Danold}
\index{Drum}
%\index{Dapper} % uncomment to test
\index{Kankra}
\index{Kookaburra}

\placeregister[index][criterium=all]
\page

\startregister[index][test]{Knuth}
  \input tufte
  \index{Donald}\index{Drom}\index{Divine}
  \page\index{Dummy}
  \input knuth
  \index{Donald}\index{Dom}\index{Dunno}
  \page
\stopregister[index][test]

\input darwin\index{Darwin}
\page

\dorecurse{5}{
\input knuth
\index{Knuth}\index{Donald}\index{Dixit}
\page\index{Knothing}
}

\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] index issues

2020-11-06 Thread Henning Hraban Ramm


> Am 06.11.2020 um 15:48 schrieb Duncan Hothersall :
> 
> I don't think \showinjector needs an argument. My MWE when I was looking at 
> this has just \showinjector after the register definition but before the 
> \setinjector[...] commands.

Docs say otherwise.
Without argument, I don’t get an error, but also nothing happens.

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

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


Re: [NTG-context] index issues

2020-11-06 Thread Duncan Hothersall
On Fri, 6 Nov 2020 at 14:31, Henning Hraban Ramm  wrote:

>
>
> > Am 06.11.2020 um 12:54 schrieb Duncan Hothersall :
> >
> > Without MWE try \showinjector and \setinjector.
> >
> > I would add to that that when experimenting with \showinjector you need
> to have at least one \setinjector as well otherwise it doesn't show the
> numbers.
> >
>
> It doesn’t work for me:
>
> lua error   > lua error on line 24 in file inhalt/99anhang.tex:
>
> registered function call [421]:
> ...-06/tex/texmf-context/tex/context/base/mkiv/typo-inj.lua:63: attempt to
> index a nil value (field '?')
> stack traceback:
> ...-06/tex/texmf-context/tex/context/base/mkiv/typo-inj.lua:63: in
> function <...-06/tex/texmf-context/tex/context/base/mkiv/typo-inj.lua:57>
> (...tail calls...)
>
> 23 \setinjector[Person][10][{\column}]
> 24 >>  \showinjector[Person]
>
>
> Regardless what I try as parameter of \showinjector (e.g. register, index,
> my own registers, one or a list) and where (in the environment or before
> \placeregister), I always get this error.
>
> Bug?
>
> LMTX version: 2020.09.20 23:02
>
> Hraban
>
>
I don't think \showinjector needs an argument. My MWE when I was looking at
this has just \showinjector after the register definition but before the
\setinjector[...] commands.

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

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

2020-11-06 Thread Henning Hraban Ramm


> Am 06.11.2020 um 12:54 schrieb Duncan Hothersall :
> 
> Without MWE try \showinjector and \setinjector.
> 
> I would add to that that when experimenting with \showinjector you need to 
> have at least one \setinjector as well otherwise it doesn't show the numbers.
> 

It doesn’t work for me:

lua error   > lua error on line 24 in file inhalt/99anhang.tex:

registered function call [421]: 
...-06/tex/texmf-context/tex/context/base/mkiv/typo-inj.lua:63: attempt to 
index a nil value (field '?')
stack traceback:
...-06/tex/texmf-context/tex/context/base/mkiv/typo-inj.lua:63: in 
function <...-06/tex/texmf-context/tex/context/base/mkiv/typo-inj.lua:57>
(...tail calls...)

23 \setinjector[Person][10][{\column}]
24 >>  \showinjector[Person]


Regardless what I try as parameter of \showinjector (e.g. register, index, my 
own registers, one or a list) and where (in the environment or before 
\placeregister), I always get this error.

Bug?

LMTX version: 2020.09.20 23:02

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

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


Re: [NTG-context] index issues

2020-11-06 Thread Henning Hraban Ramm


> Am 06.11.2020 um 12:54 schrieb Duncan Hothersall :
> 
> 
> 
> On Fri, 6 Nov 2020 at 11:52, Jano Kula  wrote:
> 
> On Fri, 6 Nov 2020 at 12:24, Henning Hraban Ramm  wrote:
> Hello again,
> 
> still struggling with indexes.
> 
> I’ll prepare MWEs, but maybe you can answer some of these without?
> 
> Hello Hraban!
> 
> Without MWE try \showinjector and \setinjector.
> 
> Jano
> 
> I would add to that that when experimenting with \showinjector you need to 
> have at least one \setinjector as well otherwise it doesn't show the numbers.
> 
> Duncan 


Jano, Duncan, thank you!

Injectors were mentioned recently, of course I forgout about them... Will try.

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

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


Re: [NTG-context] index issues

2020-11-06 Thread Duncan Hothersall
On Fri, 6 Nov 2020 at 11:52, Jano Kula  wrote:

>
> On Fri, 6 Nov 2020 at 12:24, Henning Hraban Ramm  wrote:
>
>> Hello again,
>>
>> still struggling with indexes.
>>
>> I’ll prepare MWEs, but maybe you can answer some of these without?
>>
>
> Hello Hraban!
>
> Without MWE try \showinjector
>  and \setinjector
> .
>
> Jano
>
> I would add to that that when experimenting with \showinjector you need to
have at least one \setinjector as well otherwise it doesn't show the
numbers.

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

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

2020-11-06 Thread Jano Kula
On Fri, 6 Nov 2020 at 12:24, Henning Hraban Ramm  wrote:

> Hello again,
>
> still struggling with indexes.
>
> I’ll prepare MWEs, but maybe you can answer some of these without?
>

Hello Hraban!

Without MWE try \showinjector
 and \setinjector
.

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

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


[NTG-context] index issues

2020-11-06 Thread Henning Hraban Ramm
Hello again,

still struggling with indexes.

(1)
\setupregister’s before and after go around the indicator.
e.g. \setupregister[][indicator=no,after={XX}]
never shows that XX, since after is only used after the indicator, while before 
also works without.

I was hoping for a hook at the end of a section (to add \testcolumn, \blank 
etc. to work around no.2). Is there any?


(2)
Page/column breaking is odd in that the preferred breaking point seems to be 
one entry too early, i.e. the last entry of one letter end up in the next 
column and the previous column is one line too short.
It doesn’t change with balance=yes/no.

E.g.

p.1
A   A
A   A
A
A   B
A   B
A   B
A   !?

p.2
B   C
B   C
B   C
C
C   
C   D
C   D


(3)
(How) can I otherwise influence page/column breaking? E.g.
- always keep multi line entries together
- break before or after some entry


(4)
Is it possible to combine entries from \index and \startregister[index]?

If I use \start/stopregister and have the same index entry within the range or 
on the same page, I get duplicate pages or page ranges, like 10-12 from 
\startregister and additionally 11, 12-13 from \index entries, makes at the 
moment 10-12, 11, 12-13 instead of just 10-13.



I’ll prepare MWEs, but maybe you can answer some of these without?

Thank you in advance,

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

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


[NTG-context] index issues

2020-10-14 Thread Henning Hraban Ramm
(1)
If I get the same index entry two or more times on a page, sometimes with 
processor formatting, sometimes not, how can I control which version takes 
precedence?

Actual use case: index entries from footnotes should be italics, while those 
from the main text stay upright.
Now, if there is an entry from the main text, the entry from the footnote 
doesn’t matter. Is it possible to control that?
I wouldn’t like to sort out the cases manually and remove the entries from the 
footnotes – there are 981 footnotes in this book, and there are 15 pages of 
index entries.

I’m using a macro (I suppose you’ll remember; I left out the Lua table lookup 
for unified entries):

\defineprocessor[kursiv][style=italicface]

\define[1]\nIndex{\doifmodeelse{*footnote}{%
  \expanded{\index[kursiv->]{#1}}}%
}{%
  \expanded{\index{#1}}}%
}}


(2)
Can I avoid linebreaking of page ranges in \placeindex?

E.g. in

Knuth, Don   23, 35-
  37, 40

I’d like to keep 35–37 together (break before 35).


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

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