[NTG-context] Wiki - question about Command/ pages which start with a space character

2024-04-14 Thread garulfo
Hi all,

Is it on purpose that 128 pages "https://wiki.contextgarden.net/Command/ 
" start with a space character ?
I didn't find an explanation in https://wiki.contextgarden.net/Command

For example, these two pages exist :
- https://wiki.contextgarden.net/Command/startbuffer
- https://wiki.contextgarden.net/Command/_startbuffer

If it is on purpose: 
- What is the purpose, and which page should contain which documentation?

If it is not: 
- Is there a way to automatically merge the content of the couple of pages, and 
to remove the "wrong" pages, or should it be done manually ?

Thanks for your help.

List :
Command/ attachment
Command/ background
Command/ bar
Command/ beginblock
Command/ button
Command/ characterkerning
Command/ comment
Command/ completecombinedlist
Command/ completelistoffloats
Command/ completelistofsorts
Command/ completelistofsynonyms
Command/ completeregister
Command/ copylabeltext
Command/ ctxfunction
Command/ ctxfunctiondefinition
Command/ currentlabel
Command/ delimitedtext
Command/ description
Command/ enumeration
Command/ fence
Command/ fraction
Command/ framed
Command/ framedtext
Command/ getbuffer
Command/ hbox
Command/ help
Command/ high
Command/ highlight
Command/ label
Command/ labellanguage
Command/ labeltext
Command/ labeltexts
Command/ language
Command/ leftlabeltext
Command/ linenote
Command/ low
Command/ lowhigh
Command/ lowmidhigh
Command/ margindata
Command/ mathcommand
Command/ mathdoubleextensible
Command/ mathextensible
Command/ mathframed
Command/ mathmatrix
Command/ mathornament
Command/ mathoverextensible
Command/ mathovertextextensible
Command/ mathradical
Command/ mathtriplet
Command/ mathunderextensible
Command/ mathundertextextensible
Command/ mathunstacked
Command/ nextparagraphs
Command/ note
Command/ ornament
Command/ paragraphs
Command/ placecombinedlist
Command/ placefloat
Command/ placelistoffloats
Command/ placelistofsorts
Command/ placelistofsynonyms
Command/ placement
Command/ placepairedbox
Command/ placeregister
Command/ presetlabeltext
Command/ referenceformat
Command/ register
Command/ rightlabeltext
Command/ script
Command/ section
Command/ seeregister
Command/ setupcombinedlist
Command/ setupitemgroup
Command/ setuplabeltext
Command/ setuppairedbox
Command/ setupregister
Command/ shift
Command/ sorting
Command/ startattachment
Command/ startbackground
Command/ startbuffer
Command/ startcolumnset
Command/ startcomment
Command/ startdelimitedtext
Command/ startdescription
Command/ starteffect
Command/ startenumeration
Command/ startfittingpage
Command/ startfloattext
Command/ startformula
Command/ startframedtext
Command/ starthelp
Command/ startindentedtext
Command/ startitemgroup
Command/ startlabeltext
Command/ startlinenote
Command/ startlines
Command/ startmakeup
Command/ startmathalignment
Command/ startmathcases
Command/ startmathmatrix
Command/ startmixedcolumns
Command/ startnarrower
Command/ startnote
Command/ startpagecolumns
Command/ startparagraphs
Command/ startparallel
Command/ startplacefloat
Command/ startplacepairedbox
Command/ startsection
Command/ startsectionblock
Command/ startstartstop
Command/ startstop
Command/ startstyle
Command/ starttabulate
Command/ starttextbackground
Command/ starttyping
Command/ startviewerlayer
Command/ startxtable
Command/ stoplinenote
Command/ style
Command/ synonym
Command/ textbackground
Command/ textnote
Command/ tooltip
Command/ type
Command/ typebuffer
Command/ unit
___
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
___


Re: [NTG-context] How to add data from another PDF in index?

2023-02-26 Thread Joel via ntg-context
 Fantastic! Exactly what I needed. My publisher was gong to ask for the 
information of this index soon, so its great that already works!
--Joel

On Sunday, February 26, 2023 at 11:45:48 AM MST, Alan Braslau 
 wrote:  
 
 Hans needs to confirm, "In the next update..."

Test files (MWEs):

% index-1.tex

\setupinteraction[state=start]

\starttext
    test \index{entry    WB.1} \page empty \page
    test \index{another  WB.1} \page empty \page
    test \index{onemore  WB.1} \page empty \page
    test \index{whatever WB.1} \page empty \page
    test \index{common}        \page empty \page
    \placeregister[index]
\stoptext


% index-2.tex

\setupinteraction[state=start]

\defineregister[xedni]

\useregister[workbook][index-1][index][WB ]

\starttext
    test \index{onemore TB.1} \page
    test \index{another TB.1} \page
    test \index{entry  TB.1} \page
    test \index{common}      \page
    test \xedni{onemore TB.2} \page
    test \xedni{another TB.2} \page
    test \xedni{entry  TB.2} \page
    test \xedni{common}      \page
    \placeregister[index,xedni,workbook]
\stoptext



This seems to work well - I have applied it to a long and complicated
multi-volume book project to great success!

We need to thank Hans for the quick implementation.

Alan



On Fri, 24 Feb 2023 05:43:01 + (UTC)
Joel via ntg-context  wrote:

> I am making a textbook and workbook set.
> I have this custom index using this code, in both the textbook and
> workbook: %
> \defineregister[learnedshort][compress=yes]
> \setupregister[learnedshort][style=sansbold, textstyle=slanted, n=2,
> 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{%
>     \learnedshort{#1}
>     \learnedlong{\getvalue{#1}}
> }
> 
> \starttext
> 
> \learnedis{blah blah}
> 
> \input knuth
> 
> \learnedis{some more}
> 
> 
>     \startchapter[title=Standards]
>         \placelearnedshort
>     \stopchapter
>     
> \stoptext
> 
> 
> My question is, can I have references to the Workbook page numbers in
> the textbook? And visa-versa?
> 
> For instance, the Textbook index currently looks like this:
> -
> Standards
> blah blah 1
> some more 2
> --
> With the data in the Workbook it might look like this:
>  Standards
> blah blah 1, WB: 1, 3-8
> 
> some more 2, WB: 8-9
> yet more WB: 10, 12
> 
> --
> Is this possible to merge index information like this?
> --Joel



-- 
Alan Braslau
816 West Mountain Avenue
Fort Collins, CO 80521 USA
mobile: (970) 237-0957

Conserve energy! ;-)
  ___
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] How to add data from another PDF in index?

2023-02-26 Thread Alan Braslau via ntg-context
Hans needs to confirm, "In the next update..."

Test files (MWEs):

% index-1.tex

\setupinteraction[state=start]

\starttext
test \index{entryWB.1} \page empty \page
test \index{another  WB.1} \page empty \page
test \index{onemore  WB.1} \page empty \page
test \index{whatever WB.1} \page empty \page
test \index{common}\page empty \page
\placeregister[index]
\stoptext


% index-2.tex

\setupinteraction[state=start]

\defineregister[xedni]

\useregister[workbook][index-1][index][WB ]

\starttext
test \index{onemore TB.1} \page
test \index{another TB.1} \page
test \index{entry   TB.1} \page
test \index{common}   \page
test \xedni{onemore TB.2} \page
test \xedni{another TB.2} \page
test \xedni{entry   TB.2} \page
test \xedni{common}   \page
\placeregister[index,xedni,workbook]
\stoptext



This seems to work well - I have applied it to a long and complicated
multi-volume book project to great success!

We need to thank Hans for the quick implementation.

Alan



On Fri, 24 Feb 2023 05:43:01 + (UTC)
Joel via ntg-context  wrote:

> I am making a textbook and workbook set.
> I have this custom index using this code, in both the textbook and
> workbook: %
> \defineregister[learnedshort][compress=yes]
> \setupregister[learnedshort][style=sansbold, textstyle=slanted, n=2,
> 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{%
>     \learnedshort{#1}
>     \learnedlong{\getvalue{#1}}
> }
> 
> \starttext
> 
> \learnedis{blah blah}
> 
> \input knuth
> 
> \learnedis{some more}
> 
> 
>     \startchapter[title=Standards]
>         \placelearnedshort
>     \stopchapter
>     
> \stoptext
> 
> 
> My question is, can I have references to the Workbook page numbers in
> the textbook? And visa-versa?
> 
> For instance, the Textbook index currently looks like this:
> -
> Standards
> blah blah 1
> some more 2
> --
> With the data in the Workbook it might look like this:
>  Standards
> blah blah 1, WB: 1, 3-8
> 
> some more 2, WB: 8-9
> yet more WB: 10, 12
> 
> --
> Is this possible to merge index information like this?
> --Joel



-- 
Alan Braslau
816 West Mountain Avenue
Fort Collins, CO 80521 USA
mobile: (970) 237-0957

Conserve energy! ;-)
___
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] How to add data from another PDF in index?

2023-02-24 Thread Alan Braslau via ntg-context
We are currently working on fixing cross-references as well as shared
register information between products in a ConTeXt project structure.
Much is possible, but not all is fully worked out.

My current use is a multi-volume book, sharing Tables of Contents
between the two volumes. As a teaser,

\placelist [part,chapter,section,subsection]
   [criterium=product,reference=VolumeII]

will include the TOC of VolumeII in product VolumeI.

Once we have this figured-out, I will have to create a wiki page.

Alan


On Fri, 24 Feb 2023 05:43:01 + (UTC)
Joel via ntg-context  wrote:

> I am making a textbook and workbook set.
> I have this custom index using this code, in both the textbook and
> workbook: %
> \defineregister[learnedshort][compress=yes]
> \setupregister[learnedshort][style=sansbold, textstyle=slanted, n=2,
> 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{%
>     \learnedshort{#1}
>     \learnedlong{\getvalue{#1}}
> }
> 
> \starttext
> 
> \learnedis{blah blah}
> 
> \input knuth
> 
> \learnedis{some more}
> 
> 
>     \startchapter[title=Standards]
>         \placelearnedshort
>     \stopchapter
>     
> \stoptext
> 
> 
> My question is, can I have references to the Workbook page numbers in
> the textbook? And visa-versa?
> 
> For instance, the Textbook index currently looks like this:
> -
> Standards
> blah blah 1
> some more 2
> --
> With the data in the Workbook it might look like this:
>  Standards
> blah blah 1, WB: 1, 3-8
> 
> some more 2, WB: 8-9
> yet more WB: 10, 12
> 
> --
> Is this possible to merge index information like this?
> --Joel



-- 
Alan Braslau
816 West Mountain Avenue
Fort Collins, CO 80521 USA
mobile: (970) 237-0957

Conserve energy! ;-)
___
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] How to add data from another PDF in index?

2023-02-23 Thread Joel via ntg-context
I am making a textbook and workbook set.
I have this custom index using this code, in both the textbook and workbook:
%
\defineregister[learnedshort][compress=yes]
\setupregister[learnedshort][style=sansbold, textstyle=slanted, n=2, 
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{%
    \learnedshort{#1}
    \learnedlong{\getvalue{#1}}
}

\starttext

\learnedis{blah blah}

\input knuth

\learnedis{some more}


    \startchapter[title=Standards]
        \placelearnedshort
    \stopchapter
    
\stoptext


My question is, can I have references to the Workbook page numbers in the 
textbook? And visa-versa?

For instance, the Textbook index currently looks like this:
-
Standards
blah blah 1
some more 2
--
With the data in the Workbook it might look like this:
 Standards
blah blah 1, WB: 1, 3-8

some more 2, WB: 8-9
yet more WB: 10, 12

--
Is this possible to merge index information like this?
--Joel
___
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] setupregister/placeregister

2023-02-10 Thread Alan Braslau via ntg-context
Hello,

The criterium key in setupregister (so placeregister, placeindex, ...)
takes the following values:
criterium   local text current previous all section

all: places all entries of the document
section: (part, chapter, section, ...) places entries associated with
that structure element.

Can someone explain local, text, current, previous
for their scope and perhaps subtle differences are not entirely obvious
to me.

Thank you

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] Why won't custom indexes work when the value comes from \getvalue?

2023-01-21 Thread Joel via ntg-context
I setup a custom index like this (see minimum example code below):
The problem is, when I try to create an index entry, using \setcoreidea, but 
place \getvalue inside, it won't render, ex.: \setcoreidea{\getvalue{secret1}}
As you can see in this sample code, \setcoreidea will work fine, but when 
\getvalue{} is placed inside, it can't find the value.

Any suggestions?
--Joel


\defineregister[coreidea][compress=yes]\setupregister[coreidea][style=sansbold, 
textstyle=slanted, n=2, pagenumber=yes, indicator=no]

\define[1]\setcoreidea{%
    \coreidea{#1}%
}

\setvalue{secret1}{this won't work}

\starttext

%

\setcoreidea{this works}

\input knuth
\input knuth
\input knuth
\input knuth


\setcoreidea{\getvalue{secret1}}

        \startchapter[title=Core Ideas]
            \placecoreidea
        \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
___


Re: [NTG-context] setupregister with realpage?

2022-09-24 Thread Hans Hagen via ntg-context

On 9/24/2022 3:30 AM, Benjamin Buchmuller wrote:

Thank you, Hans! This works, I get all the correct page references!

I didn't know about cont-new.mkxl to temporarily store "hacks". I assume the file is 
updated with each release? Is there a way to store local hacks, e.g., in texmf-local? I could not 
find "cont-loc" (maybe it's not a file).


Just use that file, as it will be updated. Local copies can only 
interfere later on (unless you check them each update).


You can have an cont-loc.mkxl file in you local tree for various 
personal preferences and hacks.


For dev there is also cont-exp.mkxl but that's not supposed to be known; 
it's what we use for experimental things that i test for a while.


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] setupregister with realpage?

2022-09-23 Thread Benjamin Buchmuller via ntg-context
Thank you, Hans! This works, I get all the correct page references!

I didn't know about cont-new.mkxl to temporarily store "hacks". I assume the 
file is updated with each release? Is there a way to store local hacks, e.g., 
in texmf-local? I could not find "cont-loc" (maybe it's not a file).

For future reference, this is how I am using the hack:

\def\MyRegisterPageCommand#1{\currentregisterrealpage}

\setupregister[MyRegisterA][pagecommand=\MyRegisterPageCommand]
\setupregister[MyRegisterB][pagecommand=\MyRegisterPageCommand]

> On Sep 23, 2022, at 17:47, Hans Hagen  wrote:
> 
> On 9/23/2022 11:08 PM, Benjamin Buchmuller via ntg-context wrote:
>> Dear list,
>> \setuplist has the convenient option [pagenumber=realpage]
>> \setupregister has not (yet).
>> How can I get the realpagenumber instead of the userpagenumber for the 
>> register indices?
>> I tried
>> \def\MyPageCommand#1{\realpagenumber}
>> \setupregister[MyIndex][pagecommand=\MyPageCommand]
>> but this prints only the current (although real) page number.
> you can try with this in cont-new.mkxl
> 
> \pushoverloadmode \unprotect
> 
> \let\currentregisterrealpage\!!zerocount % todo: more general accessor
> 
> \permanent\protected\def\withregisterpagecommand#1#2#3#4%
>  {\ifcase#3\relax
> {\tt [entry\space not\space flushed]}%
>   \else
> \def\currentregisterpageindex{#2}%
> \def\currentregisterrealpage{#3}%
> \iflocation
> \strc_references_goto_internal{\applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}}[internal(#2)]%
> \else
>   \applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}%
> \fi
>   \fi}
> 
> \protect \popoverloadmode
> 
> which sets \currentregisterrealpage
> 
> -
>  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] setupregister with realpage?

2022-09-23 Thread Hans Hagen via ntg-context

On 9/23/2022 11:08 PM, Benjamin Buchmuller via ntg-context wrote:

Dear list,

\setuplist has the convenient option [pagenumber=realpage]

\setupregister has not (yet).

How can I get the realpagenumber instead of the userpagenumber for the register 
indices?

I tried

\def\MyPageCommand#1{\realpagenumber}

\setupregister[MyIndex][pagecommand=\MyPageCommand]

but this prints only the current (although real) page number.

you can try with this in cont-new.mkxl

\pushoverloadmode \unprotect

\let\currentregisterrealpage\!!zerocount % todo: more general accessor

\permanent\protected\def\withregisterpagecommand#1#2#3#4%
  {\ifcase#3\relax
 {\tt [entry\space not\space flushed]}%
   \else
 \def\currentregisterpageindex{#2}%
 \def\currentregisterrealpage{#3}%
 \iflocation

\strc_references_goto_internal{\applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}}[internal(#2)]%
 \else
   \applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}%
 \fi
   \fi}

\protect \popoverloadmode

which sets \currentregisterrealpage

-
  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] setupregister with realpage?

2022-09-23 Thread Benjamin Buchmuller via ntg-context
Dear list,

\setuplist has the convenient option [pagenumber=realpage]

\setupregister has not (yet).

How can I get the realpagenumber instead of the userpagenumber for the register 
indices?

I tried

\def\MyPageCommand#1{\realpagenumber}

\setupregister[MyIndex][pagecommand=\MyPageCommand]

but this prints only the current (although real) page number.

Thank you!


Benjamin
___
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] sorting for particular sub entries to register

2022-02-01 Thread jbf via ntg-context

Thanks Robert,

Initially I thought it would probably be Lua which could come up with a 
simple solution, though Hans had made it clear that 'messing with' the 
key was the way to go, and, as always, he was proven correct. I simply 
had to find out the best way to do the messing! But when time allows I 
will take a closer look at the Lua possibilities.


Julian

On 1/2/22 18:49, Robert via ntg-context wrote:

Hi Julian,

Another solution could be to use Lua.

I have a multilingual document in which some elements to be printed 
bold (Language 1), and collected in an index (trk) arranged according 
their (verbal) stems. Elements from Language 2 are to be printed in 
italics in the text and collected in a separate index.


In the present example the morphemes from Language 2 are separated by 
::, the verbal stem ends in -.


In \\textbf the input is reproduced as is. Then interesting things 
happen in the index (trk).


The first element (until the first ::) is taken as an main entry in 
the index (hence !). Then the complete input is retained as the 
secondary entry. Note that in the index - separates the morphemes.


I use LuaLatex, but I am quite sure this is also possible in Context.

It is quite complex, but it works.

Robert


\newcommand{\TWI}[1]{\directlua{twi_help(\luastring{#1})}}

\begin{luacode}
function twi_help ( s )
   s = unicode.utf8.gsub (s, 
'^([^:]+)::([^:]+)::([^:]+)::([^:]+)::([^:]+)$' , 
'\\textbf{%1::%2::%3%::%4::%5}\\sindex%[trk%]{%#%1!%1%-%2%-%3%-%4-%5}’ )


  s = unicode.utf8.gsub … other action

\end{luacode}

\begin{document}

text text text text \TWI{dī-::dū::kin::dah} text text text text text

\end{document}



Op 1 feb. 2022, om 01:41 heeft jbf via ntg-context 
 het volgende geschreven:


Yes, Adam, that works. Though it can be a laborious solution, since 
it means creating keys for everything in a sub entry list (and I have 
many instances, 40 or more in some cases). However, I did not ask for 
a 'simple' solution, just a solution! Thank you.


Julian

On 1/2/22 11:09, Adam Reviczky wrote:

Hi Julian,

How about using the keys in every instance?

\setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]
\defineprocessor[special][style=italic]

\starttext
P\index[Plenary+periti]{Plenary Council+{\it periti} (experts)}
B\index[Plenary+beriti]{Plenary Council+{\it beriti} (experts)}
A\index[Plenary+aeriti]{Plenary Council+aeriti (experts)}

S\index[animals+special]{animals+‘special kinds’}
B\index[animals+bpecial]{animals+bpecial}
A\index[animals+apecial]{animals+‘apecial’}
U\index[animals+upecial]{animals+‘upecial’}
T\index[animals+tpecial]{animals+tpecial}

\placeindex
\stoptext

See result in: 
https://live.contextgarden.net/cgi-bin/result.cgi?id=j46XhZ


Adam

On Mon, Jan 31, 2022 at 10:38 PM jbf via ntg-context 
 wrote:


Let me come back to the unresolved (for me) question of two
situations in sub entries to a book index (register). Sub
entries that have formatting or sub entries that are surrounded
by quote marks (straight or curly, it makes no difference) do
not appear in the correct alphabetical order.

Two attempts on my part:

text before \index[Plenary+periti]{Plenary Council+{\it periti}
(experts)} text after.

text before \index{animals+‘special kinds’} text after. Or
alternatively, \index[animals+special]{animals+‘special kinds’}

The setup for my register is a pretty standard one. The
processor is not for the 'periti' case above but I use it for
book titles.

\setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]

\defineprocessor[special][style=italic]

In the periti case it is the \it command that clearly interferes
with correct alphabetic positioning in the sub entry list.
Placing +periti in the key does not overcome that problem.

In the ‘special kinds’ case it is the initial single quote mark
(‘) that causes the problem. The item comes last in the sub
entry list. And if i include a key [special], then it comes
first in the sub entry list. Either way, it is out of the
desired sorting order.

I believe I have followed the helpful suggestions of various
ones, but it is always possible that I have not fully understood
those suggestions. The reality is that at the moment the issue
remains unresolved for me. Any further wisdom out there to offer me?

Julian


___
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] sorting for particular sub entries to register

2022-01-31 Thread Robert via ntg-context
Hi Julian,

Another solution could be to use Lua.

I have a multilingual document in which some elements to be printed bold 
(Language 1), and collected in an index (trk) arranged according their (verbal) 
stems. Elements from Language 2 are to be printed in italics in the text and 
collected in a separate index.

In the present example the morphemes from Language 2 are separated by ::, the 
verbal stem ends in -.

In \\textbf the input is reproduced as is. Then interesting things happen in 
the index (trk).

The first element (until the first ::) is taken as an main entry in the index 
(hence !). Then the complete input is retained as the secondary entry. Note 
that in the index - separates the morphemes.

I use LuaLatex, but I am quite sure this is also possible in Context.

It is quite complex, but it works.

Robert


\newcommand{\TWI}[1]{\directlua{twi_help(\luastring{#1})}}

\begin{luacode}
function twi_help ( s )
   s = unicode.utf8.gsub (s, '^([^:]+)::([^:]+)::([^:]+)::([^:]+)::([^:]+)$' , 
'\\textbf{%1::%2::%3%::%4::%5}\\sindex%[trk%]{%#%1!%1%-%2%-%3%-%4-%5}’ )

  s = unicode.utf8.gsub … other action

\end{luacode}

\begin{document}

text text text text \TWI{dī-::dū::kin::dah} text text text text text 

\end{document}



> Op 1 feb. 2022, om 01:41 heeft jbf via ntg-context  het 
> volgende geschreven:
> 
> Yes, Adam, that works. Though it can be a laborious solution, since it means 
> creating keys for everything in a sub entry list (and I have many instances, 
> 40 or more in some cases). However, I did not ask for a 'simple' solution, 
> just a solution! Thank you.
> 
> Julian
> 
> On 1/2/22 11:09, Adam Reviczky wrote:
>> Hi Julian,
>> 
>> How about using the keys in every instance?
>> 
>> \setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]
>> \defineprocessor[special][style=italic]
>> 
>> \starttext
>> P\index[Plenary+periti]{Plenary Council+{\it periti} (experts)}
>> B\index[Plenary+beriti]{Plenary Council+{\it beriti} (experts)}
>> A\index[Plenary+aeriti]{Plenary Council+aeriti (experts)}
>> 
>> S\index[animals+special]{animals+‘special kinds’}
>> B\index[animals+bpecial]{animals+bpecial}
>> A\index[animals+apecial]{animals+‘apecial’}
>> U\index[animals+upecial]{animals+‘upecial’}
>> T\index[animals+tpecial]{animals+tpecial}
>> 
>> \placeindex
>> \stoptext
>> 
>> See result in: https://live.contextgarden.net/cgi-bin/result.cgi?id=j46XhZ 
>> <https://live.contextgarden.net/cgi-bin/result.cgi?id=j46XhZ>
>> 
>> Adam
>> 
>> On Mon, Jan 31, 2022 at 10:38 PM jbf via ntg-context > <mailto:ntg-context@ntg.nl>> wrote:
>> Let me come back to the unresolved (for me) question of two situations in 
>> sub entries to a book index (register). Sub entries that have formatting or 
>> sub entries that are surrounded by quote marks (straight or curly, it makes 
>> no difference) do not appear in the correct alphabetical order.
>> 
>> Two attempts on my part:
>> 
>> text before \index[Plenary+periti]{Plenary Council+{\it periti} (experts)} 
>> text after.
>> 
>> text before \index{animals+‘special kinds’} text after. Or alternatively, 
>> \index[animals+special]{animals+‘special kinds’}
>> 
>> The setup for my register is a pretty standard one. The processor is not for 
>> the 'periti' case above but I use it for book titles.
>> 
>> \setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]
>> \defineprocessor[special][style=italic]
>> In the periti case it is the \it command that clearly interferes with 
>> correct alphabetic positioning in the sub entry list. Placing +periti in the 
>> key does not overcome that problem.
>> 
>> In the ‘special kinds’ case it is the initial single quote mark (‘) that 
>> causes the problem. The item comes last in the sub entry list. And if i 
>> include a key [special], then it comes first in the sub entry list. Either 
>> way, it is out of the desired sorting order.
>> 
>> I believe I have followed the helpful suggestions of various ones, but it is 
>> always possible that I have not fully understood those suggestions. The 
>> reality is that at the moment the issue remains unresolved for me. Any 
>> further wisdom out there to offer me?
>> 
>> Julian
>> 
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl

Re: [NTG-context] sorting for particular sub entries to register

2022-01-31 Thread jbf via ntg-context
Yes, Adam, that works. Though it can be a laborious solution, since it 
means creating keys for everything in a sub entry list (and I have many 
instances, 40 or more in some cases). However, I did not ask for a 
'simple' solution, just a solution! Thank you.


Julian

On 1/2/22 11:09, Adam Reviczky wrote:

Hi Julian,

How about using the keys in every instance?

\setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]
\defineprocessor[special][style=italic]

\starttext
P\index[Plenary+periti]{Plenary Council+{\it periti} (experts)}
B\index[Plenary+beriti]{Plenary Council+{\it beriti} (experts)}
A\index[Plenary+aeriti]{Plenary Council+aeriti (experts)}

S\index[animals+special]{animals+‘special kinds’}
B\index[animals+bpecial]{animals+bpecial}
A\index[animals+apecial]{animals+‘apecial’}
U\index[animals+upecial]{animals+‘upecial’}
T\index[animals+tpecial]{animals+tpecial}

\placeindex
\stoptext

See result in: https://live.contextgarden.net/cgi-bin/result.cgi?id=j46XhZ

Adam

On Mon, Jan 31, 2022 at 10:38 PM jbf via ntg-context 
 wrote:


Let me come back to the unresolved (for me) question of two
situations in sub entries to a book index (register). Sub entries
that have formatting or sub entries that are surrounded by quote
marks (straight or curly, it makes no difference) do not appear in
the correct alphabetical order.

Two attempts on my part:

text before \index[Plenary+periti]{Plenary Council+{\it periti}
(experts)} text after.

text before \index{animals+‘special kinds’} text after. Or
alternatively, \index[animals+special]{animals+‘special kinds’}

The setup for my register is a pretty standard one. The processor
is not for the 'periti' case above but I use it for book titles.

\setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]

\defineprocessor[special][style=italic]

In the periti case it is the \it command that clearly interferes
with correct alphabetic positioning in the sub entry list. Placing
+periti in the key does not overcome that problem.

In the ‘special kinds’ case it is the initial single quote mark
(‘) that causes the problem. The item comes last in the sub entry
list. And if i include a key [special], then it comes first in the
sub entry list. Either way, it is out of the desired sorting order.

I believe I have followed the helpful suggestions of various ones,
but it is always possible that I have not fully understood those
suggestions. The reality is that at the moment the issue remains
unresolved for me. Any further wisdom out there to offer me?

Julian


___
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] sorting for particular sub entries to register

2022-01-31 Thread Adam Reviczky via ntg-context
Hi Julian,

How about using the keys in every instance?

\setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]
\defineprocessor[special][style=italic]

\starttext
P\index[Plenary+periti]{Plenary Council+{\it periti} (experts)}
B\index[Plenary+beriti]{Plenary Council+{\it beriti} (experts)}
A\index[Plenary+aeriti]{Plenary Council+aeriti (experts)}

S\index[animals+special]{animals+‘special kinds’}
B\index[animals+bpecial]{animals+bpecial}
A\index[animals+apecial]{animals+‘apecial’}
U\index[animals+upecial]{animals+‘upecial’}
T\index[animals+tpecial]{animals+tpecial}

\placeindex
\stoptext

See result in: https://live.contextgarden.net/cgi-bin/result.cgi?id=j46XhZ

Adam

On Mon, Jan 31, 2022 at 10:38 PM jbf via ntg-context 
wrote:

> Let me come back to the unresolved (for me) question of two situations in
> sub entries to a book index (register). Sub entries that have formatting or
> sub entries that are surrounded by quote marks (straight or curly, it makes
> no difference) do not appear in the correct alphabetical order.
>
> Two attempts on my part:
>
> text before \index[Plenary+periti]{Plenary Council+{\it periti} (experts)}
> text after.
>
> text before \index{animals+‘special kinds’} text after. Or alternatively,
> \index[animals+special]{animals+‘special kinds’}
>
> The setup for my register is a pretty standard one. The processor is not
> for the 'periti' case above but I use it for book titles.
>
> \setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]
>
> \defineprocessor[special][style=italic]
>
> In the periti case it is the \it command that clearly interferes with
> correct alphabetic positioning in the sub entry list. Placing +periti in
> the key does not overcome that problem.
>
> In the ‘special kinds’ case it is the initial single quote mark (‘) that
> causes the problem. The item comes last in the sub entry list. And if i
> include a key [special], then it comes first in the sub entry list. Either
> way, it is out of the desired sorting order.
>
> I believe I have followed the helpful suggestions of various ones, but it
> is always possible that I have not fully understood those suggestions. The
> reality is that at the moment the issue remains unresolved for me. Any
> further wisdom out there to offer me?
>
> Julian
>
>
> ___
> 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] sorting for particular sub entries to register

2022-01-31 Thread jbf via ntg-context
Let me come back to the unresolved (for me) question of two situations 
in sub entries to a book index (register). Sub entries that have 
formatting or sub entries that are surrounded by quote marks (straight 
or curly, it makes no difference) do not appear in the correct 
alphabetical order.


Two attempts on my part:

text before \index[Plenary+periti]{Plenary Council+{\it periti} 
(experts)} text after.


text before \index{animals+‘special kinds’} text after. Or 
alternatively, \index[animals+special]{animals+‘special kinds’}


The setup for my register is a pretty standard one. The processor is not 
for the 'periti' case above but I use it for book titles.


\setupregister[index][n=1,method={zc,pc,zm,pm,uc},style=WORD]

\defineprocessor[special][style=italic]

In the periti case it is the \it command that clearly interferes with 
correct alphabetic positioning in the sub entry list. Placing +periti in 
the key does not overcome that problem.


In the ‘special kinds’ case it is the initial single quote mark (‘) that 
causes the problem. The item comes last in the sub entry list. And if i 
include a key [special], then it comes first in the sub entry list. 
Either way, it is out of the desired sorting order.


I believe I have followed the helpful suggestions of various ones, but 
it is always possible that I have not fully understood those 
suggestions. The reality is that at the moment the issue remains 
unresolved for me. Any further wisdom out there to offer me?


Julian
___
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] registers, how to ignore quote marks

2022-01-28 Thread Adam Reviczky via ntg-context
Hi Julian,

Have you tried \index[Innovative]{‘Innovative’}?

See wiki entry: https://wiki.contextgarden.net/Registers
- To sort a word (such as "ConTeXt" under "C"), use: \index
<https://wiki.contextgarden.net/Command/index>[CONTEXT]{\ConTeXt}

You would have to change each index call though.

Adam

On Sat, Jan 29, 2022 at 2:42 AM jbf via ntg-context 
wrote:

> I have an issue that has been raised at least twice in this list but as
> far as I can see it has not received an answer. Perhaps someone can help
> with the following?
>
> I have an index entry that has unicode quote marks either side:
> ‘Innovative Beings’.  I need to retain those quote marks. If I put
> \index{‘Innovative’} then ‘Innovative’ is sorted under ‘ instead of under
> the letter I. How do I get my indexing to ignore the quote marks, at the
> very least the initial one?
>
> My index setup at the moment is as follows:
>
> \defineregister[index][compress=yes]
>
> \setupregister[index][n=1]
>
> \defineprocessor[special][style=italic]
>
> The only hint I could gain from the wiki was that it might depend on using
> a method key in \setupregister, but I could not see which to use. Tried a
> few and got weird results.
>
> Julian
>
>
> ___
> 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] registers, how to ignore quote marks

2022-01-28 Thread jbf via ntg-context
I have an issue that has been raised at least twice in this list but as 
far as I can see it has not received an answer. Perhaps someone can help 
with the following?


I have an index entry that has unicode quote marks either side: 
‘Innovative Beings’.  I need to retain those quote marks. If I put 
\index{‘Innovative’} then ‘Innovative’ is sorted under ‘ instead of 
under the letter I. How do I get my indexing to ignore the quote marks, 
at the very least the initial one?


My index setup at the moment is as follows:

\defineregister[index][compress=yes]

\setupregister[index][n=1]

\defineprocessor[special][style=italic]

The only hint I could gain from the wiki was that it might depend on 
using a method key in \setupregister, but I could not see which to use. 
Tried a few and got weird results.


Julian
___
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 create an index that refers to multiple other books?

2022-01-18 Thread Joel via ntg-context
 I tried adding 'pageprefixsegments' to setupregister, but cannot find any 
value that adds anything, ex. pageprefixsegments={WB1}
pageprefixsegments=part:number

How does it work? I'd be fine if the index listed pages like "WB1 3" meaning 
"Workbook 1, page 3", it isn't ideal but is better than not having the index 
showing anything.

--Joel


On Tuesday, January 18, 2022, 07:41:15 AM MST, Henning Hraban Ramm via 
ntg-context  wrote:  
 
 Am 18.01.22 um 14:27 schrieb Joel via ntg-context:
> One possible solution I see, since the textbooks and workbooks share the 
> same macros, formatting, fonts, etc. is to just render them as a single 
> file, resetting the page number at the start of each new book, then 
> later use pdfjam to split the files, but I'm not sure how the index 
> could tell readers which of the five "page 5's" (for example) the index 
> is referring to. --Joel

In this case, you could use \part per workbook and use 
pageprefixsegments in \setupregister to add the part number in front of 
the page number.

Otherwise, I guess it would be possible to read the .tuc files of the 
other products to create index entries. (Some Lua programming; shouldn’t 
bee too hard, but still way over my head.)

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki    : http://contextgarden.net
___
  ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] How to create an index that refers to multiple other books?

2022-01-18 Thread Hans Hagen via ntg-context

On 1/18/2022 2:16 PM, Joel via ntg-context wrote:
I am writing a secondary textbook to be used in public schools. In my 
state, the textbooks must adhere to standards, such as the Common Core 
State Standards (CCSS). It is typical for a textbook to contain an index 
for teachers to check where in the textbook which standards are used. 
I've used the following code to create such an index, if I simply place 
`\learned{}` somewhere containing the standard's ID, it creates a custom 
index entry, and `\placelearned` displays that index.


\defineregister[learned][compress=yes]
\setupregister[learned][style=sansbold, textstyle=slanted, n=1, 
pagenumber=yes]

\starttext
         \learned{CCSS+W.7.3}
     \input knuth
         \learned{CCSS+W.7.3}
     \input knuth
         \learned{CCSS+W.7.1}
     \startchapter[title=Standards]
         \placelearned
     \stopchapter
\stoptext

This prints an index like this:

Standards
c
CSS
     W.7.1    1
     W.7.3    1

My problem is my textbook also includes four separate workbooks. I need 
the index to show my publisher that I've covered all 300+ standards, so 
I need the index at the back of the textbook to also contain details of 
which pages in each workbook the standards are found. How can I combine 
the index so it refers to all books? Something like this:


Standards

c
CSS
     W.7.1    T 1, Wk.1 3-8, 12, Wk.2 8-9, 60-61
     W.7.3    T 1, Wk.1 3-8, 12, Wk.2 8-9, 60-61, Wk.3 1-2, 54, 70, 90, 
Wk.4 99, 102, 104


...or possibly like this...

Standards
c
CSS
     W.7.1
     Textbook: 1
     Workbook 1: 3-8, 12
     Workbook 2: 8-9, 60-61
     W.7.3
     Textbook: 1
     Workbook 1: 3-8, 12
     Workbook 2: 8-9, 60-61
     Workbook 3: 1-2, 54, 70, 90
     Workbook 4: 99, 102, 104

Is there any way to print an index that covers pages across multiple books?
in principle one can load an index but you want some prefixing ... i 
suppose that we can make some more native feature (some weekend 
challenge i guess)


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] How to create an index that refers to multiple other books?

2022-01-18 Thread Henning Hraban Ramm via ntg-context

Am 18.01.22 um 14:27 schrieb Joel via ntg-context:
One possible solution I see, since the textbooks and workbooks share the 
same macros, formatting, fonts, etc. is to just render them as a single 
file, resetting the page number at the start of each new book, then 
later use pdfjam to split the files, but I'm not sure how the index 
could tell readers which of the five "page 5's" (for example) the index 
is referring to. --Joel


In this case, you could use \part per workbook and use 
pageprefixsegments in \setupregister to add the part number in front of 
the page number.


Otherwise, I guess it would be possible to read the .tuc files of the 
other products to create index entries. (Some Lua programming; shouldn’t 
bee too hard, but still way over my head.)


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] How to create an index that refers to multiple other books?

2022-01-18 Thread Joel via ntg-context
 One possible solution I see, since the textbooks and workbooks share the same 
macros, formatting, fonts, etc. is to just render them as a single file, 
resetting the page number at the start of each new book, then later use pdfjam 
to split the files, but I'm not sure how the index could tell readers which of 
the five "page 5's" (for example) the index is referring to. --Joel

On Tuesday, January 18, 2022, 06:19:01 AM MST, Joel via ntg-context 
 wrote:  
 
 I am writing a secondary textbook to be used in public schools. In my state, 
the textbooks must adhere to standards, such as the Common Core State Standards 
(CCSS). It is typical for a textbook to contain an index for teachers to check 
where in the textbook which standards are used. I've used the following code to 
create such an index, if I simply place `\learned{}` somewhere containing the 
standard's ID, it creates a custom index entry, and `\placelearned` displays 
that index.
\defineregister[learned][compress=yes]
\setupregister[learned][style=sansbold, textstyle=slanted, n=1, pagenumber=yes]
\starttext
        \learned{CCSS+W.7.3}
    \input knuth
        \learned{CCSS+W.7.3}
    \input knuth
        \learned{CCSS+W.7.1}
    \startchapter[title=Standards]
        \placelearned
    \stopchapter
\stoptext

This prints an index like this:

Standards
c
CSS
    W.7.1    1
    W.7.3    1

My problem is my textbook also includes four separate workbooks. I need the 
index to show my publisher that I've covered all 300+ standards, so I need the 
index at the back of the textbook to also contain details of which pages in 
each workbook the standards are found. How can I combine the index so it refers 
to all books? Something like this:

Standards

c
CSS
    W.7.1    T 1, Wk.1 3-8, 12, Wk.2 8-9, 60-61 
    W.7.3    T 1, Wk.1 3-8, 12, Wk.2 8-9, 60-61, Wk.3 1-2, 54, 70, 90, Wk.4 99, 
102, 104

...or possibly like this...

Standards
c
CSS
    W.7.1
    Textbook: 1
    Workbook 1: 3-8, 12
    Workbook 2: 8-9, 60-61 
    W.7.3
    Textbook: 1
    Workbook 1: 3-8, 12
    Workbook 2: 8-9, 60-61
    Workbook 3: 1-2, 54, 70, 90
    Workbook 4: 99, 102, 104

Is there any way to print an index that covers pages across multiple books?

--Joel
___
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] How to create an index that refers to multiple other books?

2022-01-18 Thread Joel via ntg-context
I am writing a secondary textbook to be used in public schools. In my state, 
the textbooks must adhere to standards, such as the Common Core State Standards 
(CCSS). It is typical for a textbook to contain an index for teachers to check 
where in the textbook which standards are used. I've used the following code to 
create such an index, if I simply place `\learned{}` somewhere containing the 
standard's ID, it creates a custom index entry, and `\placelearned` displays 
that index.
\defineregister[learned][compress=yes]
\setupregister[learned][style=sansbold, textstyle=slanted, n=1, pagenumber=yes]
\starttext
        \learned{CCSS+W.7.3}
    \input knuth
        \learned{CCSS+W.7.3}
    \input knuth
        \learned{CCSS+W.7.1}
    \startchapter[title=Standards]
        \placelearned
    \stopchapter
\stoptext

This prints an index like this:

Standards
c
CSS
    W.7.1    1
    W.7.3    1

My problem is my textbook also includes four separate workbooks. I need the 
index to show my publisher that I've covered all 300+ standards, so I need the 
index at the back of the textbook to also contain details of which pages in 
each workbook the standards are found. How can I combine the index so it refers 
to all books? Something like this:

Standards

c
CSS
    W.7.1    T 1, Wk.1 3-8, 12, Wk.2 8-9, 60-61 
    W.7.3    T 1, Wk.1 3-8, 12, Wk.2 8-9, 60-61, Wk.3 1-2, 54, 70, 90, Wk.4 99, 
102, 104

...or possibly like this...

Standards
c
CSS
    W.7.1
    Textbook: 1
    Workbook 1: 3-8, 12
    Workbook 2: 8-9, 60-61 
    W.7.3
    Textbook: 1
    Workbook 1: 3-8, 12
    Workbook 2: 8-9, 60-61
    Workbook 3: 1-2, 54, 70, 90
    Workbook 4: 99, 102, 104

Is there any way to print an index that covers pages across multiple books?

--Joel
___
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 manually adjust the sort order of items appearing in a custom index?

2022-01-17 Thread Henning Hraban Ramm via ntg-context

Am 17.01.22 um 16:53 schrieb Joel via ntg-context:
I created a custom index that displays a list of "Important Dates" 
appearing in my book. It lists the year, a short description of what 
happened, and should show the page number.


I'm running into two errors though:

First, if the date is the same year, it is sorting alphabetically, 
example


\dateis{1900s+1912}{Yet another event happened}
\dateis{1900s+1912}{Another event happened}

...will print the wrong one first in the index..

1912 - Another even happened
1912 - Yet another event happened.

Is there a way to manually tell it to display one first? I don't want to 
add visible month and day details, that would be even more confusing to 
the index as I have to print it in American order.


Second, when it compiles it is not printing the page number, instead 
prints "[Entry not flushed]".


-- Joel

Here is my minimum working example:


\defineregister[listdates][compress=yes]
\setupregister[listdates][style=sansbold, textstyle=slanted, n=1, 
pagenumber=yes]


\define[2]\dateis{%
     \listdates{#1~\emdash ~#2}%
}%

\starttext

\dateis{1900s+1911}{Some event happened}
\dateis{1900s+1912}{Yet another event happened}
\dateis{1900s+1912}{Another event happened}

\startchapter[title=Important Dates]
     \placelistdates
\stopchapter

\stoptext


Change your definition of \dateis (or use an additional macro) to use 
the sort key of \index:


\index[1900s+191201]{January}
\index[1900s+191202]{February}

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] How to manually adjust the sort order of items appearing in a custom index?

2022-01-17 Thread Joel via ntg-context
I created a custom index that displays a list of "Important Dates" appearing in 
my book. It lists the year, a short description of what happened, and should 
show the page number.

I'm running into two errors though:

First, if the date is the same year, it is sorting alphabetically, example

\dateis{1900s+1912}{Yet another event happened}
\dateis{1900s+1912}{Another event happened}

...will print the wrong one first in the index..

1912 - Another even happened
1912 - Yet another event happened.

Is there a way to manually tell it to display one first? I don't want to add 
visible month and day details, that would be even more confusing to the index 
as I have to print it in American order.

Second, when it compiles it is not printing the page number, instead prints 
"[Entry not flushed]".

-- Joel

Here is my minimum working example:


\defineregister[listdates][compress=yes]
\setupregister[listdates][style=sansbold, textstyle=slanted, n=1, 
pagenumber=yes]

\define[2]\dateis{%
    \listdates{#1~\emdash ~#2}%
}%

\starttext

\dateis{1900s+1911}{Some event happened}
\dateis{1900s+1912}{Yet another event happened}
\dateis{1900s+1912}{Another event happened}

\startchapter[title=Important Dates]
    \placelistdates
\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] new upload

2021-12-01 Thread Hans Hagen via ntg-context

On 12/1/2021 9:49 AM, denis.ma...@unibe.ch wrote:

Thank you, Hans!

I don't understand 2, 3, and 4, but I can wikify 1. Just two question: What 
exactly are the limitations? And what is meant by horizontal registers?


% this is a variant of an example on the mailing list

\mainlanguage[es]

\setupbodyfont[dejavu]

\defineregister
  [Russian]
  [n=1,
   command=\Words,
   pagenumber=no,
   language=ru,
   textalternative=horizontal,
   distance=0pt]

\setupregister [Russian] [2] [textstyle=bold,left={, }]
\setupregister [Russian] [3] [textstyle=italic,left={, }]

% word category meaning

\setregisterentry [Russian] [entries:1={исчисление},  entries:2={n. 
neutr.},  entries:3={cálculo}]
\setregisterentry [Russian] [entries:1={исчисление},  entries:2={n. 
neutr.},  entries:3={cálculo}]
\setregisterentry [Russian] [entries:1={вероятность}, entries:2={n. 
fem.},entries:3={probabilidad}]
\setregisterentry [Russian] [entries:1={обозначать},  entries:2={v.}, 
  entries:3={denotar}]
\setregisterentry [Russian] [entries:1={область}, entries:2={n. 
fem}, entries:3={región, área}]
\setregisterentry [Russian] [entries:1={событие}, entries:2={n. 
neutr.},  entries:3={evento}]
\setregisterentry [Russian] [entries:1={определение}, entries:2={n. 
neutr.},  entries:3={definición}]
\setregisterentry [Russian] [entries:1={знание},  entries:2={n. 
neutr,},  entries:3={conocimiento}]
\setregisterentry [Russian] [entries:1={бесконечно},  entries:2={adv.}, 
  entries:3={infinitamente}]
\setregisterentry [Russian] [entries:1={сборник}, entries:2={n. 
masc.},   entries:3={colección, compilación, compendio}]
\setregisterentry [Russian] [entries:1={неравенство}, entries:2={n. 
neutr.},  entries:3={desigualdad}]


\starttext

\starttitle[title=Ruso-español]
\placeRussian
\stoptitle

\stoptext



Regarding the implementation: I've just tried it, and I wondered whether the 
stacking of bars should not happen the other way round. As in
\underbar{\underdot{asdf}}
I would have expected the bar to be below the dot. But maybe that's wrong 
expectations...
that would become rather messy and hard to analyze (this is already a 
runtime consuming feature) and never be consistent, think of


\underbar{%
\underdot{}
x
\underdot{}%
}



-
  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] Concerning dictionaries. glossaries and related in ConTeXt

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

Hi,

kind of like this but maybe we need to go setups as we do with lists and 
sections adn such


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
-\pushoverloadmode \unprotect

\newconditional\c_strc_registers_traditional 
\settrue\c_strc_registers_traditional

\permanent\protected\def\startregisterentry#1% todo: level
  {\typo_injectors_check_register
   \begingroup
   \dostarttagged\t!registerentry\empty
   \global\setconstant\c_strc_registers_page_state\zerocount
   \ifconditional\c_strc_registers_traditional
 \hangindent\d_strc_registers_hangindent
 \hangafter \c_strc_registers_hangafter
   \else
 \namedregisterparameter\currentnestedregister\c!left\relax
   \fi
   \typo_injectors_mark_register}

\permanent\protected\def\stopregisterentry
  {\ifconditional\c_strc_registers_traditional
 \endgraf
   \else
 \namedregisterparameter\currentnestedregister\c!right\relax
   \fi
   \global\setconstant\c_strc_registers_page_state\zerocount
   \dostoptagged
   \endgroup}


\permanent\protected\def\usenestedregisterstyleandcolor#1#2% will change
  {\useregisterstyleandcolor#1#2%
   % how about style
   \ifconditional\c_strc_registers_text_interaction
 \ifempty\currentcolorparameter \else
   \resetinteractionparameter\c!color
   \resetinteractionparameter\c!contrastcolor
 \fi
   \fi}

\permanent\protected\def\startregisterentries#1% depth
  {\ifconditional\c_strc_registers_traditional
 \endgraf
   \fi
   \begingroup
   
\c_strc_register_level\ifnum#1>\c_strc_registers_maxlevel\c_strc_registers_maxlevel\else#1\fi\relax
   \dostarttagged\t!registerentries\empty
   \pushmacro\currentregister % bah
   \edef\currentregister{\currentregister:\number\c_strc_register_level}%
   \let\currentnestedregister\currentregister
   \usenestedregisterstyleandcolor\c!textstyle\c!textcolor
   \ifnum\c_strc_register_level>\plusone
 \advance\leftskip\d_strc_registers_distance\relax
   \fi
   \d_strc_registers_hangindent\registerparameter\c!distance\relax
   \c_strc_registers_hangafter \plusone
   \ifconditional\c_strc_registers_traditional
 \blank[\v!samepage]%
   \fi
   \popmacro\currentregister}

\def\c!textalternative{textalternative}

\appendtoks
\doifelse{\registerparameter\c!textalternative}\v!horizontal
  \setfalse\settrue\c_strc_registers_traditional
\to \everysetupregister

\protect \popoverloadmode

\starttext

\mainlanguage[es]
\enableexperiments[fonts.compact]
\setupbodyfont[dejavu] % computer-modern-unicode]
\setuphead[chapter]
  [alternative=middle]
\defineregister[Russian]
\setupregister[Russian]
  [expansion=yes,
   balance=no,
   n=2,
   command=\Words,
   pagenumber=no,
   language=ru]

\def\Ruso[#1]%
  {\begingroup
   \getdummyparameters
 [word=,
  category=,
  meaning=,
  #1]%
   \setregisterentry
 [Russian]
 [keys={\dummyparameter{word}},
  entries:1={\dummyparameter{word}},
  entries:2={\dummyparameter{category}},
  entries:3={\dummyparameter{meaning}}]%
   \endgroup}

\setupregister
  [Russian]
  [textalternative=horizontal,
   distance=0pt]

\setupregister
  [Russian][2]
  [distance=0pt,
   textstyle=bold,
   left={, }]

\setupregister
  [Russian][3]
  [distance=0pt,
   textstyle=italic,
   left={, }]


\starttext

\Ruso
[word=исчисление,
 category=n. neutr.,
 meaning=cálculo]
\Ruso
[word=вероятность,
 category=n. fem.,
 meaning=probabilidad]
\Ruso
[word=обозначать,
 category=v.,
 meaning=denotar]
\Ruso
[word=область,
 category=n. fem,
 meaning={región, área}]
\Ruso
[word=событие,
 category=n. neutr.,
 meaning=evento]
\Ruso
[word=определение,
 category=n. neutr.,
 meaning=definición]
\Ruso
[word=знание,
 category=n. neutr,,
 meaning=conocimiento]
\Ruso
[word=бесконечно,
 category=adv.,
 meaning=infinitamente]
\Ruso
[word=сборник,
 category=n. masc.,
 meaning={colección, compilación, compendio}]
\Ruso
[word=неравенство,
 category=n. neutr.,
 meaning=desigualdad]

\starttitle[title=Ruso-español]
\placeRussian
\stoptitle

\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] Concerning dictionaries. glossaries and related in ConTeXt

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

On 11/26/2021 12:22 PM, Jairo A. del Rio via ntg-context wrote:
Hi, list. I want to know how I should handle alphabetically sorted data 
in ConTeXt. So far, I'm abusing registers in order to get simple 
glossaries, but I prefer to manage data with tools such as JabRef rather 
than manually typing entries inside a document. I attach an example of 
what I achieved:


\unprotect
\mainlanguage[\s!es]
\enableexperiments[fonts.compact]
\setupbodyfont[computer-modern-unicode]
\setuphead[chapter]
   [\c!alternative=\v!middle]
\defineregister[Russian]
\setupregister[Russian]
   [\c!expansion=\v!yes,
    \c!balance=\v!no,
    \c!n=2,
    \c!command=\Words,
    \c!pagenumber=\v!no,
    \c!language=\s!ru]
\def\Ruso[#1]%
   {\begingroup
    \getdummyparameters[word=,category=,meaning=,#1]%
    \Russian[\dummyparameter{word}]%
    {\bold{\dummyparameter{word}}
    \italic{\dummyparameter{category}}
    \dummyparameter{meaning}}%
    \endgroup}
\protect
\Ruso
     [word=исчисление,
      category=n. neutr.,
      meaning=cálculo]
\Ruso
     [word=вероятность,
      category=n. fem.,
      meaning=probabilidad]
\Ruso
     [word=обозначать,
      category=v.,
      meaning=denotar]
\Ruso
     [word=область,
      category=n. fem,
      meaning={región, área}]
\Ruso
     [word=событие,
      category=n. neutr.,
      meaning=evento]
\Ruso
     [word=определение,
      category=n. neutr.,
      meaning=definición]
\Ruso
     [word=знание,
      category=n. neutr,,
      meaning=conocimiento]
\Ruso
     [word=бесконечно,
      category=adv.,
      meaning=infinitamente]
\Ruso
     [word=сборник,
      category=n. masc.,
      meaning={colección, compilación, compendio}]
\Ruso
     [word=неравенство,
      category=n. neutr.,
      meaning=desigualdad]
\starttext
\starttitle[title=Ruso-español]
\placeRussian
\stoptitle
\stoptitle
\stoptext

Reading the manuals, I find that the publication mechanism for 
bibliography kinda fits my needs (using ConTeXt to sort and type data 
generated via external software) but, unlike registers, it doesn't seem 
to include options for alphabetical headers. Is it fine to keep using 
registers in this case? Is there a better mechanism for this task in 
ConTeXt? Thank you in advance.

you can also use:

\setregisterentry
  [Russian]
  [keys={\dummyparameter{word}},
   entries={\bold{\dummyparameter{word}}
\italic{\dummyparameter{category}}
\dummyparameter{meaning}}]%

no need for c! v! s! unless you make a multi-userinterface style

anyway, makes me wonder if we should have a horizontal register variant

\setupregister
  [Russian][2]
  [textstyle=bold]

\setupregister
  [Russian][3]
  [textstyle=italic]

so that we keep stuff on one line

-
  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] Concerning dictionaries. glossaries and related in ConTeXt

2021-11-26 Thread Jairo A. del Rio via ntg-context
Hi, list. I want to know how I should handle alphabetically sorted data in
ConTeXt. So far, I'm abusing registers in order to get simple glossaries,
but I prefer to manage data with tools such as JabRef rather than manually
typing entries inside a document. I attach an example of what I achieved:

\unprotect
\mainlanguage[\s!es]
\enableexperiments[fonts.compact]
\setupbodyfont[computer-modern-unicode]
\setuphead[chapter]
  [\c!alternative=\v!middle]
\defineregister[Russian]
\setupregister[Russian]
  [\c!expansion=\v!yes,
   \c!balance=\v!no,
   \c!n=2,
   \c!command=\Words,
   \c!pagenumber=\v!no,
   \c!language=\s!ru]
\def\Ruso[#1]%
  {\begingroup
   \getdummyparameters[word=,category=,meaning=,#1]%
   \Russian[\dummyparameter{word}]%
   {\bold{\dummyparameter{word}}
   \italic{\dummyparameter{category}}
   \dummyparameter{meaning}}%
   \endgroup}
\protect
\Ruso
[word=исчисление,
 category=n. neutr.,
 meaning=cálculo]
\Ruso
[word=вероятность,
 category=n. fem.,
 meaning=probabilidad]
\Ruso
[word=обозначать,
 category=v.,
 meaning=denotar]
\Ruso
[word=область,
 category=n. fem,
 meaning={región, área}]
\Ruso
[word=событие,
 category=n. neutr.,
 meaning=evento]
\Ruso
[word=определение,
 category=n. neutr.,
 meaning=definición]
\Ruso
[word=знание,
 category=n. neutr,,
 meaning=conocimiento]
\Ruso
[word=бесконечно,
 category=adv.,
 meaning=infinitamente]
\Ruso
[word=сборник,
 category=n. masc.,
 meaning={colección, compilación, compendio}]
\Ruso
[word=неравенство,
 category=n. neutr.,
 meaning=desigualdad]
\starttext
\starttitle[title=Ruso-español]
\placeRussian
\stoptitle
\stoptitle
\stoptext

Reading the manuals, I find that the publication mechanism for bibliography
kinda fits my needs (using ConTeXt to sort and type data generated via
external software) but, unlike registers, it doesn't seem to include
options for alphabetical headers. Is it fine to keep using registers in
this case? Is there a better mechanism for this task in ConTeXt? Thank you
in advance.

Best regards,

Jairo
___
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] Generating HTML

2021-10-11 Thread Hans Åberg via ntg-context
I would want to generate HTML, but in the example below, "html-test.tex", the 
index does not show in the file "html-test-export/html-test-div.html", and the 
source file \index{…}, gets in the HTML a black triangle. The index and links 
work fine in "html-test.pdf", though.


— html-test.tex —
\definefontfamily [mainface][math][stix]
\setupbodyfont[mainface,10pt]

\setupinteraction[state=start, click=yes, focus=standard, color=darkblue]

\setupbackend[export=yes] % Exporting HTML/XML


\defineregister [index]
\setupregister  [index] [indicator=no]

\startchapter[title={Introduction}]

Foobar\index{foobar} out of working order.

\startbodymatter

Foo\index{foo} or bar\index{bar}.

\startbackmatter

\completeindex

\stopbackmatter

\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] Indexing redux

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


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

Hi Rik,


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

List,

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

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


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

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


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



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

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

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

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

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

Re: [NTG-context] register for biblical citations

2021-04-16 Thread jbf
You are correct on both counts; it is not quite random (just not what I 
was looking for ) and yes, the abbreviated book title needs to be in 
the mix as well, just in case it also ends up throwing things out. But, 
as you can see subsequently, each contribution is making things clearer 
(for me, not so accustomed to working with Lua code) and I have every 
confidence we will work this one out. For almost anyone using ConTeXt 
for preparing a book that includes such an index, and I believe it is 
normal for biblical citations to be listed according to biblical book 
order, at least, this is the author's request in my case, the ultimate 
solution will benefit such people in the future.


Julian

On 16/4/21 8:57 pm, r.erm...@hccnet.nl wrote:

It seems that the items are actually not randomly listed.

It appears to me that the list is sorted on the chapter number, and then the 
verse number. The abbreviated book title is not involved in this sorting order, 
which it should be.

Robert



Op 16 apr. 2021, om 12:22 heeft jbf  het volgende 
geschreven:

There was no mention of the indicator anywhere in what I copied from your 
example. I did try indicator=no just now in case it should be made explicit:

(\setupregister[bibcit][language=biblical,before=,indicator=no]

but that makes no difference either. Same result. Seemingly random index.

Julian

On 16/4/21 8:06 pm, Hans Hagen wrote:

On 4/16/2021 11:47 AM, jbf wrote:

Hans, thanks for your ingenious solution but there is still a way to go I 
suspect!

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

I extended your example by a few books. so:

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

  },
}
\stopluacode

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

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

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

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

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

don't set the indicator


-
   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

Re: [NTG-context] register for biblical citations

2021-04-16 Thread r . ermers
It seems that the items are actually not randomly listed. 

It appears to me that the list is sorted on the chapter number, and then the 
verse number. The abbreviated book title is not involved in this sorting order, 
which it should be.

Robert


> Op 16 apr. 2021, om 12:22 heeft jbf  het volgende 
> geschreven:
> 
> There was no mention of the indicator anywhere in what I copied from your 
> example. I did try indicator=no just now in case it should be made explicit:
> 
> (\setupregister[bibcit][language=biblical,before=,indicator=no]
> 
> but that makes no difference either. Same result. Seemingly random index.
> 
> Julian
> 
> On 16/4/21 8:06 pm, Hans Hagen wrote:
>> On 4/16/2021 11:47 AM, jbf wrote:
>>> Hans, thanks for your ingenious solution but there is still a way to go I 
>>> suspect!
>>> 
>>> I implemented (copy-paste) precisely the solution offered and I get an 
>>> index but with some strange results ! Notice that in my previous own 
>>> solution (but only as far as 26 books!) I at least got an index in the 
>>> order of the biblical books, but using the luacode you offered, I get a 
>>> seemingly random result (see below).
>>> 
>>> I extended your example by a few books. so:
>>> 
>>> \startluacode
>>> sorters.definitions["biblical"] = {
>>>  method  = interfaces.variables.before,
>>>  replacements = {
>>>  { "Gen",  string.char(1) },
>>>  { "Ex",   string.char(2) },
>>>  { "Lev",  string.char(3) },
>>>  { "Deut", string.char(4) },
>>>  { "Lam",  string.char(5) },
>>>  { "Dan",  string.char(6) },
>>>  { "Joel",  string.char(7) },
>>>  { "Ps",  string.char(8) },
>>>  { "Prov",  string.char(9) },
>>>  { "Sir",  string.char(10) },
>>>  { "Mt",  string.char(11) },
>>>  { "Mk",  string.char(12) },
>>> 
>>>  },
>>> }
>>> \stopluacode
>>> 
>>> But the result I get (just showing you a dozen or so, and you will see that 
>>> Gen doesn't even turn up in this list ... it does, but much later!):
>>> 
>>> Mk 2:19-20 with parallels (PES) 146
>>> Mt 3:8-10 (PES) 135
>>> Prov 3:11-12 (PES) 139, 172
>>> Sir 4:17-18 (PES) 139
>>> Mt 5:5 (PES) 146
>>> Mt 5:6 (MAC) 123
>>> Mt 5:16 (MAC) 121
>>> Mt 6:1-6, 16-18 (MAC) 121
>>> Mt 6:1-6, 16-18 (PES) 145
>>> Mt 7:13-14 (PES) 146
>>> Sir 10:9 (PES) 142
>>> Mt 11:12 (PRO) 160
>>> Mt 12:34 (MAC) 124, 137
>>> Mt 12:36 (PES) 134
>>> Mk 12:41-44 (MAC) 122
>>> Sir 17:27 (PES) 142
>>> 
>>> I have no idea why this is happening. I changed nothing of what you gave me 
>>> and removed anything I had previously. If you need an example of how 
>>> \bibcit is being used in the text, just in case it helps (but I doubt it), 
>>> here is one:
>>> 
>>> The widow’s mite pleased God because of her good intention, rather than the 
>>> heap of money that the pharisees, urged on by self-love, threw into the 
>>> treasury box (cf.  \bibcit{Mk 12:41-44 (MAC)}Mk 12:41-44).
>>> 
>>> So, not sure where to go from here. Could I perhaps return to my earlier 
>>> question, which indicated that by using the keyword approach [a] [b] and so 
>>> on, as far as [z] I was at least getting a passable result, but how could I 
>>> continue past [z]? Could I have used [1], [2] etc which would allows me to 
>>> get as far as 66 (if I were to need every biblical book)?
>> don't set the indicator
>> 
>> 
>> -
>>   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] register for biblical citations

2021-04-16 Thread jbf
There was no mention of the indicator anywhere in what I copied from 
your example. I did try indicator=no just now in case it should be made 
explicit:


(\setupregister[bibcit][language=biblical,before=,indicator=no]

but that makes no difference either. Same result. Seemingly random index.

Julian

On 16/4/21 8:06 pm, Hans Hagen wrote:

On 4/16/2021 11:47 AM, jbf wrote:
Hans, thanks for your ingenious solution but there is still a way to 
go I suspect!


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


I extended your example by a few books. so:

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

 },
}
\stopluacode

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


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

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


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


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

don't set the indicator


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

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

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


Re: [NTG-context] register for biblical citations

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


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


I extended your example by a few books. so:

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

    },
}
\stopluacode

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


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

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


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


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


Julian

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


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

My simple MWE:

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

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

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



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


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


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


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

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


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

cheat (crossed fingers that you have enough entries) :

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

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

\starttext

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

Re: [NTG-context] register for biblical citations

2021-04-16 Thread Hans Hagen

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

My simple MWE:

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

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

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



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


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


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


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

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


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

cheat (crossed fingers that you have enough entries) :

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

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

\starttext

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

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

\stoptext

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

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

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


Re: [NTG-context] register for biblical citations

2021-04-15 Thread jbf

My simple MWE:

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

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

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



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


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


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


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

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


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


Julian

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

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

best make some MWE and explain what you expect


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

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

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


Re: [NTG-context] Index formatting difference LMTX and MkIV redux

2020-11-17 Thread Rik Kabel

Bump.

This is still a problem. Can anyone acknowledge that the problem exists 
outside my own installation? If so, is there a work-around? An explanation?


On 10/21/2020 21:42, Rik Kabel wrote:


Hello list,

About two months ago (2020-08-26) I described a difference between 
LMTX and MkIV in the setting of index registers entries, and more 
particularly, in the trimming of text to fit the available width 
therein. I have now created a smallish example to demonstrate the problem.


I do notice that the problem is very sensitive to the width settings, 
and slight variations in width create different results with both engines.


This ConTeXt input:

\definepapersize [pinched crown quarto]
 [width=6.69in,
  height=9.61in]
\setuppapersize  [pinched crown quarto]
\setuplayout [width=fit,
  backspace=1.4in,    cutspace=1in,
  leftmargin=0.65in,  rightmargin=0.65in]

\setupregister   [index]
 [n=2, balance=no, maxwidth=4cm]

\starttext

\startchapter[title={Index Test}]

\index{Anonymous+Felix quem faciunt aliena pericula cautum}
\index{{Diderot, Denis}+Et des boyaux du dernier prêtre, Serrons
le cou du dernier roi}
\index{{Dunne, Finley Peter}+Thrust ivrybody, but cut th’ ca-ards}
\index{Eisenhower+Dwight D.+influence … by the military-industrial
complex}
\index{Eisenhower+Dwight D.+plundering, for our own ease and
convenience, the precious resources of tomorrow}

\placeindex

\stopchapter
\stoptext

produces, with MkIV:

and with LMTX:

The example code shows one other instance as well, in the fourth 
indexed entry.


Beside looking uglier, this results in a couple more pages for the 
same number of index entries.


As I noted in my first description of the problem, this may not be 
unique to register processing, and perhaps it is an issue with 
limitatetext or doboundtext, or something else entirely.


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


[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 formatting difference LMTX and MkIV redux

2020-10-21 Thread Rik Kabel

Hello list,

About two months ago (2020-08-26) I described a difference between LMTX 
and MkIV in the setting of index registers entries, and more 
particularly, in the trimming of text to fit the available width 
therein. I have now created a smallish example to demonstrate the problem.


I do notice that the problem is very sensitive to the width settings, 
and slight variations in width create different results with both engines.


This ConTeXt input:

   \definepapersize [pinched crown quarto]
 [width=6.69in,
  height=9.61in]
   \setuppapersize  [pinched crown quarto]
   \setuplayout [width=fit,
  backspace=1.4in,    cutspace=1in,
  leftmargin=0.65in,  rightmargin=0.65in]

   \setupregister   [index]
 [n=2, balance=no, maxwidth=4cm]

   \starttext

   \startchapter[title={Index Test}]

   \index{Anonymous+Felix quem faciunt aliena pericula cautum}
   \index{{Diderot, Denis}+Et des boyaux du dernier prêtre, Serrons le
   cou du dernier roi}
   \index{{Dunne, Finley Peter}+Thrust ivrybody, but cut th’ ca-ards}
   \index{Eisenhower+Dwight D.+influence … by the military-industrial
   complex}
   \index{Eisenhower+Dwight D.+plundering, for our own ease and
   convenience, the precious resources of tomorrow}

   \placeindex

   \stopchapter
   \stoptext

produces, with MkIV:

and with LMTX:

The example code shows one other instance as well, in the fourth indexed 
entry.


Beside looking uglier, this results in a couple more pages for the same 
number of index entries.


As I noted in my first description of the problem, this may not be 
unique to register processing, and perhaps it is an issue with 
limitatetext or doboundtext, or something else entirely.


--
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] force index entries without page number

2020-09-04 Thread mf

Il 04/09/20 11:01, Henning Hraban Ramm ha scritto:




Am 03.09.2020 um 13:32 schrieb mf :

Use check=yes


But I need check=no, because my author has several entries like


Miller, Carolyne, born Princess of Sayn-Wittgenstein   123–125

Sayn-Wittgenstein, Carolyne of  see Miller, Carolyne


i.e. the reference target often has a different wording from the entry,
and thus \seeindex{Something}{} always inserts a "see".

Now I understand.
Since I'm working with XML, I'm using registers in an even stricter way: 
the text I'm indexing is actually the ID of a person in a database.

Something like this:

Carolyne

in the main text results in a \index[miller_carolyne]{v18in231}

In another place of the XML there's a record like this:

Miller, Carolyne ... 



The deeptextcommand parameter of \setupregister is set to a macro that 
takes the ID and gives back the text of the person.


Maybe in the database there's also another record like this:

sort-key="sayn_wittgenstein_carolyne">Sayn-Wittgenstein, Carolyne 
Miller, Carolyne


that results in a 
\seeindex[sayn_wittgenstein_carolyne]{Sayn-Wittgenstein, 
Carolyne}{Miller, Carolyne}




I don’t know how common these "passim" entries are in scientific works; maybe I 
could use

Mainperson  firstpage–lastpage

instead to avoid the major hassle of tricking the index mechanisms.

in that case \startindex...\stopindex or \startregister...\stopregister 
could be your friends.


Massi
___
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] strange behavior with \groupedcommand in recent versions of LMTX

2020-09-01 Thread Hans Hagen

On 9/1/2020 5:47 PM, mf wrote:
\unexpanded\def\groupedwordorparagraphright{\dosingleempty\dogroupedwordorparagraphright} 

\def\dogroupedwordorparagraphright[#1]{\groupedcommand{\setbox\scratchbox\hbox\bgroup} 


{\egroup\ifdim\wd\scratchbox < \hsize
     \wordright{\unhbox\scratchbox}
   \else
     \par\penalty1
     \startalignment[flushright]\unhbox\scratchbox\stopalignment
   \fi}}

\unexpanded\def\wordorparagraphright#1{%
   \setbox\scratchbox\hbox{#1}
   \ifdim\wd\scratchbox < \hsize
     \wordright{#1}
   \else
     \par\penalty1
     \startalignment[flushright]\unhbox\scratchbox\stopalignment
   \fi}

\starttext
   \type{\wordorparagraphright} should use \type{\wordright} if its 
argument
   is narrower than \type{\hsize}, or make a right-aligned paragraph 
with it

   when it's wider.

   Below, \type{\wordorparagraphright} is tested with a short text, that
   has enough room on the same line.
   \blank

   Reference:

   \input ward\wordright{same line, right}

   \blank

   Implementation as a grouped command (it doesn't work):

   \input ward\groupedwordorparagraphright{same line, right}

   \blank

   Normal implementation, not as a grouped command (it works):

   \input ward\wordorparagraphright{same line, right}
\stoptext


Unfortunately the grouped version is the one I need, because it's used 
in a register, and it would give an error if not defined through 
\groupedcommand:


\setupregister[myregister]
   [pageleft=\wordorparagraphright\bgroup,pageright=\egroup]



fortunately there is a solution that takes less code:

\unexpanded\def\whatever
  {\dosingleempty\dowhatever}

\def\dowhatever[#1]%
  {\dowithnextbox
 {\ifdim\wd\nextbox<\hsize
\wordright{\box\nextbox}%
\par
  \else
\par
\penalty1
\startalignment[flushright]\unhbox\nextbox\stopalignment
  \fi}\hbox}

\starttext

  \input ward \whatever{same line, right}

  \blank

  \input ward \whatever{\input tufte }

\stoptext

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

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


[NTG-context] strange behavior with \groupedcommand in recent versions of LMTX

2020-09-01 Thread mf

Hello list,
this is a MWE that worked right in MkIV and in LMTX versions (at least) 
until April 22nd, 2020.


There's a macro, \wordorparagraphright, that takes one argument, makes a 
hbox with it and measures its width


- if its width is less than \hsize, then it calls \wordright

- if its width is more than \hsize, then it ends the current paragraph 
and starts a right-aligned paragraph with the argument


There are two implementations in the MWE: one is through 
\groupedcommand, and that's the one that worked once and doesn't now.



\unexpanded\def\groupedwordorparagraphright{\dosingleempty\dogroupedwordorparagraphright}
\def\dogroupedwordorparagraphright[#1]{\groupedcommand{\setbox\scratchbox\hbox\bgroup}
{\egroup\ifdim\wd\scratchbox < \hsize
\wordright{\unhbox\scratchbox}
  \else
\par\penalty1
\startalignment[flushright]\unhbox\scratchbox\stopalignment
  \fi}}

\unexpanded\def\wordorparagraphright#1{%
  \setbox\scratchbox\hbox{#1}
  \ifdim\wd\scratchbox < \hsize
\wordright{#1}
  \else
\par\penalty1
\startalignment[flushright]\unhbox\scratchbox\stopalignment
  \fi}

\starttext
  \type{\wordorparagraphright} should use \type{\wordright} if its argument
  is narrower than \type{\hsize}, or make a right-aligned paragraph with it
  when it's wider.

  Below, \type{\wordorparagraphright} is tested with a short text, that
  has enough room on the same line.
  \blank

  Reference:

  \input ward\wordright{same line, right}

  \blank

  Implementation as a grouped command (it doesn't work):

  \input ward\groupedwordorparagraphright{same line, right}

  \blank

  Normal implementation, not as a grouped command (it works):

  \input ward\wordorparagraphright{same line, right}
\stoptext


Unfortunately the grouped version is the one I need, because it's used 
in a register, and it would give an error if not defined through 
\groupedcommand:


\setupregister[myregister]
  [pageleft=\wordorparagraphright\bgroup,pageright=\egroup]

TIA,
Massi
___
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] Definition of \registerpagerange (Henning Hraban Ramm)

2020-05-06 Thread Hynek, Stefan
Am Mittwoch, den 06.05.2020, 06:55 +0200 schrieb ntg-context-
requ...@ntg.nl:
> This doesn’t answer your question, but I found:
> 
> \setupregister[index][compress=yes] % 14, 15 becomes 14-15
> \setupregister[index][compress=text] % 14, 15 becomes 14f.
> 
> To change the "f."/"ff." text, you’d use:
> 
> \setuplabeltext[de][following:singular=sq.,following:plural=sqq.]
> 
> This is defined in tex/context/base/mkiv/lang-txt.lua
> and addressed in context/base/mkiv/strc-reg.mkiv in the definition of
> \registerpagerange:
> 
> \unexpanded\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class
> #2:processor  content, content todo: -- configurable
>   {\pushcurrentregister{#1}%
>\edef\p_pagenumber{\registerparameter\c!pagenumber}%
>\ifx\p_pagenumber\v!no\else
>  \registerpageseparator
>  \global\setconstant\c_strc_registers_page_state\plusone
>  \dostarttagged\t!registerpagerange\empty
>  \dostarttagged\t!registerfrompage\empty
>  \withregisterpagecommand{#2}{#3}{#4}{#5}%
>  \dostoptagged
>  \ifconditional\c_strc_registers_following
>\ifnum#3=\numexpr#6-1\relax
>  \labeltext{following:\s!singular}%
>\else
>  \labeltext{following:\s!plural}%
>\fi
> \else
>\registeronepagerangeseparator
>\dostarttagged\t!registertopage\empty
>\withregisterpagecommand{#2}{#6}{#7}{#8}%
>  \fi
>  \dostoptagged
>  \dostoptagged
>\fi
>\popcurrentregister}
> 
> (see 
> https://source.contextgarden.net/tex/context/base/mkiv/strc-reg.mkiv?search=singular
> )
> 
> 
> You should be able to combine the two "else" branches.
Thank you for answering. I have had looked into this source before and
tried exactly the same approach you descrived but I am on TeXlive 2019
where this is defined differently: 
\unexpanded\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class
#2:processor  content, content todo: -- configurable
  {\pushcurrentregister{#1}%
   \edef\p_pagenumber{\registerparameter\c!pagenumber}%
   \ifx\p_pagenumber\v!no\else
 \registerpageseparator
 \global\setconstant\c_strc_registers_page_state\plusone
 \dostarttagged\t!registerpagerange\empty
 \dostarttagged\t!registerfrompage\empty
 \withregisterpagecommand{#2}{#3}{#4}{#5}%
 \dostoptagged
 \registeronepagerangeseparator
 \dostarttagged\t!registertopage\empty
 \withregisterpagecommand{#2}{#6}{#7}{#8}%
 \dostoptagged
 \dostoptagged
   \fi
   \popcurrentregister}

and, most importantly, does not work with this approach:
\unexpanded\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class
#2:processor  content, content todo: -- configurable
  { \pushcurrentregister{#1}%
\edef\p_pagenumber{\registerparameter\c!pagenumber}%
\ifx\p_pagenumber\v!no\else
  \registerpageseparator
  \global\setconstant\c_strc_registers_page_state\plusone
  \dostarttagged\t!registerpagerange\empty
  \dostarttagged\t!registerfrompage\empty
  \withregisterpagecommand{#2}{#3}{#4}{#5}%
  \dostoptagged
  \ifnum#3=\numexpr#6-1\relax
f.%
  \else
\registeronepagerangeseparator
\dostarttagged\t!registertopage\empty
\withregisterpagecommand{#2}{#6}{#7}{#8}%
  \fi
  \dostoptagged
  \dostoptagged
\fi
\popcurrentregister}

May it be that parameters have changed since then?
Best regards
Stefan


smime.p7s
Description: S/MIME cryptographic signature
___
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] Definition of \registerpagerange

2020-05-05 Thread Henning Hraban Ramm


> Am 05.05.2020 um 10:35 schrieb Hynek, Stefan :
> 
> Hello fellow ConTeXies, 
> 
> since April 2019 it is possible to use \setupregister with
> compress=text which is a fine addition and has its use cases.
> Unfortunately, I am confronted with the demand to style the registers
> with 'f.' for a following single page and else with page ranges. Since
> the Definition of \registerpagerange is not well documented I don't
> know which parameter to check for the conditional statement when
> rewriting it. Could you please give me a hint? 


This doesn’t answer your question, but I found:

\setupregister[index][compress=yes] % 14, 15 becomes 14-15
\setupregister[index][compress=text] % 14, 15 becomes 14f.

To change the "f."/"ff." text, you’d use:

\setuplabeltext[de][following:singular=sq.,following:plural=sqq.]

This is defined in tex/context/base/mkiv/lang-txt.lua
and addressed in context/base/mkiv/strc-reg.mkiv in the definition of 
\registerpagerange:

\unexpanded\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class #2:processor  
content, content todo: -- configurable
  {\pushcurrentregister{#1}%
   \edef\p_pagenumber{\registerparameter\c!pagenumber}%
   \ifx\p_pagenumber\v!no\else
 \registerpageseparator
 \global\setconstant\c_strc_registers_page_state\plusone
 \dostarttagged\t!registerpagerange\empty
 \dostarttagged\t!registerfrompage\empty
 \withregisterpagecommand{#2}{#3}{#4}{#5}%
 \dostoptagged
 \ifconditional\c_strc_registers_following
   \ifnum#3=\numexpr#6-1\relax
 \labeltext{following:\s!singular}%
   \else
 \labeltext{following:\s!plural}%
   \fi
\else
   \registeronepagerangeseparator
   \dostarttagged\t!registertopage\empty
   \withregisterpagecommand{#2}{#6}{#7}{#8}%
 \fi
 \dostoptagged
 \dostoptagged
   \fi
   \popcurrentregister}

(see 
https://source.contextgarden.net/tex/context/base/mkiv/strc-reg.mkiv?search=singular)


You should be able to combine the two "else" branches.

HTH
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] Definition of \registerpagerange

2020-05-05 Thread Hynek, Stefan
Hello fellow ConTeXies, 

since April 2019 it is possible to use \setupregister with
compress=text which is a fine addition and has its use cases.
Unfortunately, I am confronted with the demand to style the registers
with 'f.' for a following single page and else with page ranges. Since
the Definition of \registerpagerange is not well documented I don't
know which parameter to check for the conditional statement when
rewriting it. Could you please give me a hint? 

In ConTeXt that shipped with TeXlive 2015 it worked that way:
\unexpanded\def\registerpagerange#1#2#3#4#5#6#7%
{\registerpageseparator
 \global\setconstant\c_strc_registers_page_state\plusone
 \dostarttagged\t!registerpagerange\empty
 \dostarttagged\t!registerfrompage\empty
 \withregisterpagecommand{#1}{#2}{#3}{#4}%
 \dostoptagged
 \ifnum\the\numexpr#6-#3\relax=1
   f.%
 \else
   \registeronepagerangeseparator
   \dostarttagged\t!registertopage\empty
   \withregisterpagecommand{#1}{#5}{#6}{#7}%
   \dostoptagged
 \fi
 \dostoptagged}

With best regards
Stefan


smime.p7s
Description: S/MIME cryptographic signature
___
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 chapter and section numbers

2019-11-07 Thread Hans Hagen

On 11/7/2019 10:25 AM, Otared Kavian wrote:

Hi,

In a math text book, I would like to create an index of some material where 
chapter and section numbers are given instead of a page number.

For instance if the result « 3.2.5 Banach Fixed Point Theorem » is stated in 
section 2 of chapter 3, and is the fifth numbered statement in that section, I 
would like to create a \myindex command so that adding the command
\myindex{Banach Fixed Point Theorem}
at that location, I get in the index created by \myindex a line such as

Banach Fixed Point Theorem  3.2.5

Is this possible?


well, the info is actually there already so i added a new option (that 
you then wikify) ...


\setupregister
  [index]
  [pagesegments=1:4,
   pagemethod=section]

\starttext

\chapter {one} \section {alpha}

x\index {whatever 1}x\index {whatever 2}x\index {whatever 2}x \page
x\index {whatever 1}x\index {whatever 2}x\index {whatever 2}x \page

\chapter {one} \section {alpha}

x\index {whatever 1}x\index {whatever 2}x\index {whatever 2}x \page
x\index {whatever 1}x\index {whatever 2}x\index {whatever 2}x \page

\placeindex[n=1]

\stoptext

which then renders:

w
whatever 1 1.1, 2.1
whatever 2 1.1, 2.1

in next beta

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] formatting index entries: alphabetical order in Unicode

2019-08-22 Thread Robert Zydenbos
That helps!

But in any case, it looks like the problems are actually several (also the one 
of the precise order of the words in the index), and I think the 'fastest' 
solution for now is that I just compile the index (only 4 pages), make a 
separate component file and rearrange the contents by copy-and-paste. Not the 
most elegant of solutions, but it works. :-)

> On 22. Aug 2019, at 01:58, Richard Mahoney | Indica et Buddhica 
>  wrote:
> 
> Robert,
> 
> In IV one can do something such as this:
> 
> % Registers (Indices)
> 
> \defineregister[TIB]
> 
> \setupregister[TIB][indicator=yes,compress=yes]
> 
> and then in the body:
> 
> \TIB[don du gner ba]{don du gñer ba : patthanā : wish}don du gñer ba'i
> phyir rdzogs par byed do
> 
> \TIB[non mons]{ñon moṅs : kilesa : defilements}ñon moṅs pa śin tu che
> ba yin-no
> 
> 
> Richard


___
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] formatting index entries: alphabetical order in Unicode

2019-08-21 Thread Richard Mahoney | Indica et Buddhica
Robert,

In IV one can do something such as this:

% Registers (Indices)

\defineregister[TIB]

\setupregister[TIB][indicator=yes,compress=yes]

and then in the body:

\TIB[don du gner ba]{don du gñer ba : patthanā : wish}don du gñer ba'i
phyir rdzogs par byed do

\TIB[non mons]{ñon moṅs : kilesa : defilements}ñon moṅs pa śin tu che
ba yin-no


Richard


-- 
Richard Mahoney | Indica et Buddhica
 
Littledene  Bay Road  Oxford  NZ 
T: +6433121699  M: +64210640216 
r.maho...@indica-et-buddhica.org 

https://indica-et-buddhica.org/ 

-Original Message-
From: Robert Zydenbos 
Reply-To: mailing list for ConTeXt users 
To: mailing list for ConTeXt users 
Subject: [NTG-context] formatting index entries: alphabetical order in
Unicode
Date: Thu, 22 Aug 2019 01:42:40 +0200
Mailer: 

I seem to have a problem with Unicode in the indexing function for my
book: a word like āyitu (beginning with an 'a' with a macron over it)
is considered a word that starts with a 'y'; the word īga (beginning
with an i with a macron) is placed as if it is 'ga'.

Is there any way to tell the indexing function how to deal with such
special characters?

Robert

__
_
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] registers: subentry indentation different from word--number gap?

2019-07-12 Thread Sanjoy Mahajan
I don't think the current behavior is a bug, so the following is a
feature request:

With the following fairly minimal example

  \setupregister[index][indicator=no, distance=0.5em]

  \starttext

  ABC\index{x}DEF\index{x+yyz}

  \blank
  \placeindex
  \stoptext

the distance parameter sets (1) the hanging indentation of the 'yyz'
subentry and also (2) the distance between an entry and its pagenumber.
(That's what a look at strc-reg.mkiv shows too.)

It's a matter of taste, but my eye thinks that 0.5em is right for no. 2,
but too small for no. 1 -- whereas the default (1em) is just right for
no. 1 but too large for no. 2.

Thus, could the two dimensions be decoupled and bcome settable
indepently?  Perhaps keep 'distance' for the entry--pagenumber distance
(no. 2), which is its meaning on the wiki, and invent 'subdistance' for
the hanging indent (no. 1)?

I've just realized a cheap hack to do the same, so maybe it's not worth
messing with backward compatability by adding a new parameter.  The hack:

  \def\blah#1{#1\hskip-0.5em}
  \setupregister[index][indicator=no, distance=1em, textcommand=\blah]

-- 
-Sanjoy

<http://savelongwharfpark.org/>
Save Long Wharf Park in Boston Harbor!

<http://streetfightingmath.com/>
Six reasoning tools to make hard problems easy.
___
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] mapping seeregister command to xml

2019-07-04 Thread Thomas A. Schmitz

Hi,

I'm having trouble mapping the seeregister command to an xml setup. 
Example (looks somewhat messy, but explains why I need it):


\startbuffer[test]

  This is a test. IGRR 4, 988sort="IGRR4+988" target="TAM 2 677">IGRR 
4+988 = TAM 2, 677sort="TAM2+677">TAM 2+677


\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{#1}{*}{-}

\xmlsetsetup{#1}{document|p|inscription|seeinscription|emph|index}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
\xmlflush{#1} \par
\stopxmlsetups

\startxmlsetups xml:emph
{\em \xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:inscription
\expanded{\inscription[\xmlatt{#1}{sort}]{\xmlflush{#1}}}
\stopxmlsetups

\startxmlsetups xml:seeinscription

\expanded{\seeinscription[\xmlatt{#1}{sort}]{\xmlflush{#1}}{\xmlatt{#1}{target}}}
\stopxmlsetups

\defineregister[inscription][inscriptions]

\setupregister[inscription][pagestyle=,
textstyle=,
location=right,
prefix=none,
indicator=no]

\starttext
\xmlprocessbuffer{main}{test}{}
\blank [line]
\placeregister[inscription]
\stoptext

Maybe my problem is with expansion in index entries? I must admit that I 
haven't really grasped why the \expanded was necessary and what it does...


All best

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
___


[NTG-context] registers: setting pageleft parameter by index term

2019-04-29 Thread mf

Hello list, please consider this MWE:

\definenumber[p]
\setnumber[p][1]
\def\PageLeft{ p.~}
\def\TextCommand#1{\getnumber[p] 
#1\doif{\rawcountervalue[p]}{2}{\def\PageLeft{ P.~}}\incrementnumber[p]}

\setupindex[n=1,pageleft=\PageLeft,pageright=,textcommand=\TextCommand]
\starttext
Foo\index{foo}.
\page
Bar\index{bar}.
\page
Baz\index{baz}.
\page
\placeindex
\stoptext

The pageleft parameter of \setupindex (\setupregister) is normally set 
to " p.~", but it gets redefined to " P.~" for the second term in the 
index ("baz").


Here i'm using a counter and i check when it is 2, but i'd like to check 
if the term is "baz" (and i don't know how to do that test).


If you use deeptextcommand instead of textcommand, the pageleft 
parameter can't be redefined.


The following variation compiles, but it does not work, because pageleft 
is always " p.~":


\definenumber[p]
\setnumber[p][1]
\def\PageLeft{ p.~}
\def\TextCommand#1{\getnumber[p] 
#1\doif{\rawcountervalue[p]}{2}{\def\PageLeft{ P.~}}\incrementnumber[p]}

\setupindex[n=1,pageleft=\PageLeft,pageright=,deeptextcommand=\TextCommand]
\starttext
Foo\index{foo}.
\page
Bar\index{bar}.
\page
Baz\index{baz}.
\page
\placeindex
\stoptext

In my setup i must use deeptextcommand, and i want to set the pageleft 
and pageright parameters to a different value for some particular terms 
of the index.


Since the argument passed to deeptextcommand is not the text of the term 
(it's actually an id used to retrieve a much longer text), i can 
discriminate the terms by their id, but i can't setup pageleft and 
pageright accordingly from the command specified by deeptextcommand.


On the other hand, textcommand would let me set pageleft and pageright, 
but its argument is not pure text, and i don't know how to get the id 
from it.


How can i solve this problem?

Thanks,

Massimiliano

___
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 "compress" option / collapsing of page numbers

2019-04-03 Thread Henning Hraban Ramm
Am 2019-04-03 um 13:30 schrieb Hans Hagen :

> On 4/3/2019 10:56 AM, Henning Hraban Ramm wrote:
>> Am 2019-04-02 um 18:53 schrieb Hans Hagen :
>>> On 4/2/2019 11:54 AM, Henning Hraban Ramm wrote:
>>>> Ahoi,
>>>> with \setupregister[compress=yes], index entries 1,2,3,4 become 1–4. 
>>>> That’s great.
>>>> But (at least in German publications) it’s usual that 1,2 becomes 1f. and 
>>>> 1,2,3 becomes 1ff.
>>>> Is it possible to configure it that way?
>>> it should not be too hard to program but, it being german problem:
>>> 
>>> - you have to come up with an example
>>> - wolfgang has to come up with a proper keyword (compress=?)
>>> 
>> Thank you – it’s not only a German habit, even if we pronounce it 
>> “folgende”, “f.” stems from Latin “folio”, and “ff.” is a duplicated 
>> abbreviation, as was usual in mediaeval Latin.
>> So, this is at least used in English, German, Norwegian and Swedish, as far 
>> as I could find. In French they seem to use “sq.” and “sqq.” (sequens).
>> https://de.wiktionary.org/wiki/ff.
>> https://en.wiktionary.org/wiki/ff.
>> https://fr.wiktionary.org/wiki/sq.
>> I suggest the following setup options:
>> compress = no  —> don’t collapse (as now)
>> compress = yes —> always use – (as now)
>> compresssymbols={\,f.,\,ff.} (or how can you setup a list?)
>> compress = symbols —> use first symbol for one other page, second for more 
>> pages
>>  if there’s only one symbol, more than one sequential page should use – 
>> (like “yes”)
>> Is this feasible?
> 
> i'll add
> 
> \setuplabeltext % predefined
>  [en]
>  [following:singular=f.,
>   following:plural=ff.]
> 
> \setupregister[index][compress=text]


Great! Thank you!
I’ll document it.

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] index "compress" option / collapsing of page numbers

2019-04-03 Thread Hans Hagen

On 4/3/2019 10:56 AM, Henning Hraban Ramm wrote:

Am 2019-04-02 um 18:53 schrieb Hans Hagen :


On 4/2/2019 11:54 AM, Henning Hraban Ramm wrote:

Ahoi,
with \setupregister[compress=yes], index entries 1,2,3,4 become 1–4. That’s 
great.
But (at least in German publications) it’s usual that 1,2 becomes 1f. and 1,2,3 
becomes 1ff.
Is it possible to configure it that way?

it should not be too hard to program but, it being german problem:

- you have to come up with an example
- wolfgang has to come up with a proper keyword (compress=?)



Thank you – it’s not only a German habit, even if we pronounce it “folgende”, 
“f.” stems from Latin “folio”, and “ff.” is a duplicated abbreviation, as was 
usual in mediaeval Latin.
So, this is at least used in English, German, Norwegian and Swedish, as far as 
I could find. In French they seem to use “sq.” and “sqq.” (sequens).

https://de.wiktionary.org/wiki/ff.
https://en.wiktionary.org/wiki/ff.
https://fr.wiktionary.org/wiki/sq.

I suggest the following setup options:

compress = no  —> don’t collapse (as now)
compress = yes —> always use – (as now)

compresssymbols={\,f.,\,ff.} (or how can you setup a list?)
compress = symbols —> use first symbol for one other page, second for more pages
if there’s only one symbol, more than one sequential page should use – 
(like “yes”)

Is this feasible?


i'll add

\setuplabeltext % predefined
  [en]
  [following:singular=f.,
   following:plural=ff.]

\setupregister[index][compress=text]

-
  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] index "compress" option / collapsing of page numbers

2019-04-03 Thread Henning Hraban Ramm
Am 2019-04-02 um 18:53 schrieb Hans Hagen :

> On 4/2/2019 11:54 AM, Henning Hraban Ramm wrote:
>> Ahoi,
>> with \setupregister[compress=yes], index entries 1,2,3,4 become 1–4. That’s 
>> great.
>> But (at least in German publications) it’s usual that 1,2 becomes 1f. and 
>> 1,2,3 becomes 1ff.
>> Is it possible to configure it that way?
> it should not be too hard to program but, it being german problem:
> 
> - you have to come up with an example
> - wolfgang has to come up with a proper keyword (compress=?)
> 

Thank you – it’s not only a German habit, even if we pronounce it “folgende”, 
“f.” stems from Latin “folio”, and “ff.” is a duplicated abbreviation, as was 
usual in mediaeval Latin.
So, this is at least used in English, German, Norwegian and Swedish, as far as 
I could find. In French they seem to use “sq.” and “sqq.” (sequens).

https://de.wiktionary.org/wiki/ff.
https://en.wiktionary.org/wiki/ff.
https://fr.wiktionary.org/wiki/sq.

I suggest the following setup options:

compress = no  —> don’t collapse (as now)
compress = yes —> always use – (as now)

compresssymbols={\,f.,\,ff.} (or how can you setup a list?)
compress = symbols —> use first symbol for one other page, second for more pages
if there’s only one symbol, more than one sequential page should use – 
(like “yes”)

Is this feasible?

As far as I see, we need this only for index entries, i.e. \setupregister, 
since there’s no command like \at for more than one page anyway; or is there a 
need to collapse pages in bibliographies?


Test case:


\usemodule[visual]
\setuppapersize[A6]

\setupregister[index][
  compress=yes,
  %compresssymbols={\,f.,\,ff.},
  %compress=symbols,
]

\starttext
\placeindex\index{nonsense}
\page

\strut\index{something}\page
\strut\index{something}\page

\dorecurse{7}{
\fakewords{10}{100}\index{something}\par
\fakewords{20}{200}\index{other}\par
\fakewords{10}{100}\index{something}\par
}
\index{finis} % not flushed?

\stoptext



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] LMTX deeptextcommand issue

2019-04-02 Thread Hans Hagen

On 4/2/2019 8:41 PM, Jan Tosovsky wrote:

Dear All,

my document ends with the index

\startbackmatter
\chapter{Rejstřík jmenný}
\start
\switchtobodyfont[8pt]
\placeindexname
\stop
\stopbackmatter
\startbackmatter
\chapter{Rejstřík věcný}
\start
\switchtobodyfont[8pt]
\placeindexsubject
\stop
\stopbackmatter

At the beginning there is a condition for one word (kind of manual column
balancing) - but according to the log, see below, this seems to be an issue:
\newconditional\IndexState
\define[1]\IndexInternalCommand
  
{\doifelse{#1}{Dolsko}{\global\settrue\IndexState}{\global\setfalse\IndexSta

te}#1}

\define[1]\IndexCommand
   {\setfalse\IndexState
\setbox\scratchbox\hbox{#1}%
\ifconditional\IndexState
  \column
\fi
\box\nextbox}


does

\unexpanded\def\IndexCommand#1%
  {

work?


\defineregister[indexname][indexnames]
\setupregister[indexname][command=\Word, textcommand=\IndexCommand,
deeptextcommand=\IndexInternalCommand]

\defineregister[indexsubject][indexsubjects]
\setupregister[indexsubject][command=\Word]
\setupheadtext[indexname=Rejstřík jmenný]
\setupheadtext[indexsubject=Rejstřík věcný]


This worked in luatex 1.0.1, but in LMTX I am getting:

structures  > begin of sectionblock 'backpart'
structure   > sectioning > chapter @ level 2 : 0.1 -> Rejstřík jmenný
fonts   > defining > font 'palab', feature 'locl', script 'latn', no
language 'dflt'

tex error   > tex error on line 25 in file
D:/context-lmtx/tex/texmf-context/tex/context/base/mkiv/page-run.mkiv: ?

 [internal expandable lua function call]

\IndexInternalCommand ...\setfalse \IndexState }#1
   
\IndexCommand ...ate \setbox \scratchbox \hbox {#1

   }\ifconditional
\IndexStat...
\doapplyregisterentrycommand ...extcommand {#2
   \dostoptagged
\registerentry ...plyregisterentrycommand {#2}{#5}
   \fi \else \let
\currentreg...
l.25 }
 
...l.11633 \stop



15
16 \registerctxluafile{page-run}{}
17
18 \unprotect
19
20 \unexpanded\gdef\showprint{\dotripleempty\page_layouts_show_print}
21
22 \gdef\page_layouts_show_print[#1][#2][#3]% only english
23   {\setbuffer[crap]%
24   \unprotect
25 >>  \definepapersize[X][\c!width=4em, \c!height=6em]
26 \definepapersize[Y][\c!width=12em,\c!height=14em]
27 \setuppapersize[X,#1][Y,#2]
28 \setuplayout[#3]
29 \setuplayout[\v!page]
30 \framed
31   [\c!offset=\v!overlay,\c!strut=\v!no,
32\c!width=\paperwidth,\c!height=\paperheight]
33   {\ss ABC\par DEF}%
34   \protect
35\endbuffer


When I've seen that 'crap' and weird page dimensions, I thought it is part
of the April fool, like all that LMTX announcement.

This issue is not urgent, I was just curious how different the output is.

Thanks,

Jan

___
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] LMTX deeptextcommand issue

2019-04-02 Thread Jan Tosovsky
Dear All,

my document ends with the index

\startbackmatter
\chapter{Rejstřík jmenný}
\start
\switchtobodyfont[8pt]
\placeindexname
\stop
\stopbackmatter
\startbackmatter
\chapter{Rejstřík věcný}
\start
\switchtobodyfont[8pt]
\placeindexsubject
\stop
\stopbackmatter

At the beginning there is a condition for one word (kind of manual column
balancing) - but according to the log, see below, this seems to be an issue:
\newconditional\IndexState
\define[1]\IndexInternalCommand
 
{\doifelse{#1}{Dolsko}{\global\settrue\IndexState}{\global\setfalse\IndexSta
te}#1}

\define[1]\IndexCommand
  {\setfalse\IndexState
   \setbox\scratchbox\hbox{#1}%
   \ifconditional\IndexState
 \column
   \fi
   \box\nextbox}

\defineregister[indexname][indexnames]
\setupregister[indexname][command=\Word, textcommand=\IndexCommand,
deeptextcommand=\IndexInternalCommand]

\defineregister[indexsubject][indexsubjects]
\setupregister[indexsubject][command=\Word]
\setupheadtext[indexname=Rejstřík jmenný]
\setupheadtext[indexsubject=Rejstřík věcný]


This worked in luatex 1.0.1, but in LMTX I am getting:

structures  > begin of sectionblock 'backpart'
structure   > sectioning > chapter @ level 2 : 0.1 -> Rejstřík jmenný
fonts   > defining > font 'palab', feature 'locl', script 'latn', no
language 'dflt'

tex error   > tex error on line 25 in file
D:/context-lmtx/tex/texmf-context/tex/context/base/mkiv/page-run.mkiv: ?

 [internal expandable lua function call]
   
\IndexInternalCommand ...\setfalse \IndexState }#1
  
\IndexCommand ...ate \setbox \scratchbox \hbox {#1
  }\ifconditional
\IndexStat...
\doapplyregisterentrycommand ...extcommand {#2
  \dostoptagged 
\registerentry ...plyregisterentrycommand {#2}{#5}
  \fi \else \let
\currentreg...
l.25 }

...l.11633 \stop
   

15 
16 \registerctxluafile{page-run}{}
17 
18 \unprotect
19 
20 \unexpanded\gdef\showprint{\dotripleempty\page_layouts_show_print}
21 
22 \gdef\page_layouts_show_print[#1][#2][#3]% only english
23   {\setbuffer[crap]%
24   \unprotect
25 >>  \definepapersize[X][\c!width=4em, \c!height=6em]
26 \definepapersize[Y][\c!width=12em,\c!height=14em]
27 \setuppapersize[X,#1][Y,#2]
28 \setuplayout[#3]
29 \setuplayout[\v!page]
30 \framed
31   [\c!offset=\v!overlay,\c!strut=\v!no,
32\c!width=\paperwidth,\c!height=\paperheight]
33   {\ss ABC\par DEF}%
34   \protect
35\endbuffer


When I've seen that 'crap' and weird page dimensions, I thought it is part
of the April fool, like all that LMTX announcement.

This issue is not urgent, I was just curious how different the output is.

Thanks,

Jan

___
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 "compress" option / collapsing of page numbers

2019-04-02 Thread Hans Hagen

On 4/2/2019 11:54 AM, Henning Hraban Ramm wrote:

Ahoi,

with \setupregister[compress=yes], index entries 1,2,3,4 become 1–4. That’s 
great.

But (at least in German publications) it’s usual that 1,2 becomes 1f. and 1,2,3 
becomes 1ff.

Is it possible to configure it that way?

it should not be too hard to program but, it being german problem:

- you have to come up with an example
- wolfgang has to come up with a proper keyword (compress=?)

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] index "compress" option / collapsing of page numbers

2019-04-02 Thread Henning Hraban Ramm
Ahoi,

with \setupregister[compress=yes], index entries 1,2,3,4 become 1–4. That’s 
great.

But (at least in German publications) it’s usual that 1,2 becomes 1f. and 1,2,3 
becomes 1ff.

Is it possible to configure it that way?


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] Bidi-related register problem

2019-01-27 Thread Rik Kabel

On 1/27/2019 12:07, Hans Hagen wrote:

On 1/27/2019 12:59 AM, Rik Kabel wrote:

Here is a much-closer-to minimal example.


  \setupregister   [index] [maxwidth=4cm]
  \setupdirections [bidi=on,method=two]
  \starttext
  .\index{Mairzy doats and dozy doats and liddle lamzy divey}
  \placeindex
  \stoptext

With the \setupdirections line removed, all is well. However, that 
line is otherwise required. Setting bidi off around \placeindex is 
not an option either, since some index entries require it.
Tricky ... i'll catch it but better use method tree then (later this 
year i might redo some r2l code)


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
-


That allows the compilation to complete, but method=three breaks other 
stuff. Try this:


   \starttext
   \setupdirections [bidi=on,method=three]
   \rightaligned{(( How is this?}
   \stoptext

(I also see problems with boxes set in the margin where before they were 
set centered in the textblock, but cannot construct an example yet.)


--
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] Bidi-related register problem

2019-01-27 Thread Hans Hagen

On 1/27/2019 12:59 AM, Rik Kabel wrote:

Here is a much-closer-to minimal example.


  \setupregister   [index] [maxwidth=4cm]
  \setupdirections [bidi=on,method=two]
  \starttext
  .\index{Mairzy doats and dozy doats and liddle lamzy divey}
  \placeindex
  \stoptext

With the \setupdirections line removed, all is well. However, that line 
is otherwise required. Setting bidi off around \placeindex is not an 
option either, since some index entries require it.
Tricky ... i'll catch it but better use method tree then (later this 
year i might redo some r2l code)


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] Bidi-related register problem

2019-01-26 Thread Rik Kabel

Here is a much-closer-to minimal example.


 \setupregister   [index] [maxwidth=4cm]
 \setupdirections [bidi=on,method=two]
 \starttext
 .\index{Mairzy doats and dozy doats and liddle lamzy divey}
 \placeindex
 \stoptext

With the \setupdirections line removed, all is well. However, that line 
is otherwise required. Setting bidi off around \placeindex is not an 
option either, since some index entries require it.



--
Rik Kabel

___
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] Bidi-related register problem

2019-01-24 Thread Rik Kabel
Recent betas have introduced a bidi-related problem with register 
processing.


In the following example, compilation generates a recoverable error when 
register processing has to trim an entry to fit maxwidth. The error is:


luatex warning  > node filter: error: 
...eXt/tex/texmf-context/tex/context/base/mkiv/typo-dub.lua:496: attempt to index 
local 'stacktop' (a nil value)

Removing the maxwidth constraint, or setting it to a much wider value, 
allows error-free compilation.


Without \setupdirections[bidi=on,method=two] there is no problem, but 
without it RTL texts are not handled properly. This is a recent change; 
bidi=global worked a few months ago. (I have not tried with LTR text in 
a default-RTL document).


   % macros=mkvi
   \defineregister[Mindex]
   \setupregister [Mindex]
   [n=2,
maxwidth=4cm,
balance=no]

   \starttexdefinition unexpanded MIndex
  \dosinglegroupempty\doMIndex
   \stoptexdefinition

   \starttexdefinition unexpanded doMIndex #MARKER
  \def\Marker{#MARKER}%
  \dosinglegroupempty\doMIndexFull
   \stoptexdefinition

   \starttexdefinition doMIndexFull #ITEM
  \doifelse{#ITEM}{}
{\expanded{\Mindex{\Marker}}}
{\expanded{\Mindex{\Marker+#ITEM}}}
   \stoptexdefinition

   \setupdirections [bidi=on,method=two]

   \setupbodyfont   [libertinus,11pt]

   \starttext

   \startparagraph
  \MIndex{One}{Mairzy doats and dozy doats and liddle lamzy divey}

  \input jojomayer

   \stopparagraph

   \startparagraph
   סלאם שלום
   \stopparagraph

   \placeregister[Mindex]
   \stoptext

--
Rik Kabel


___
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] Sorting registers method for "uppercase like lowercase, diacritics ignored"

2019-01-20 Thread Henning Hraban Ramm
I don’t know if this setup is supposed to work with \place..., for me

\setupregister[method={zm,pm,zc,zm,uc}] works.

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

Am 2019-01-20 um 21:59 schrieb Marcus Vinicius Mesquita 
:

> Dear list,
> 
> In the wiki page https://wiki.contextgarden.net/Registers it is said that:
> 
> - There’s no preset for the combination "uppercase like lowercase, diacritics 
> ignored", try "zm,pm,zc,zm,uc".
> 
> Well, I tried all possible permutations thereof, and also the predefined 
> methods, and none gives what my editor wants, which is just "uppercase like 
> lowercase, diacritics ignored".
> See MWE attached. 
> Please, would somebody help me achieve the desired result?
> 
> TIA
> 
> ConTeXt version:
> ConTeXt Process Management 1.02
> current version: 2019.01.19 12:06
> 
> Marcus Vinicius 
> ___
> 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] Sorting registers method for "uppercase like lowercase, diacritics ignored"

2019-01-20 Thread Thomas A. Schmitz

On 20.01.19 21:59, Marcus Vinicius Mesquita wrote:

Well, I tried all possible permutations thereof, and also the predefined
methods, and none gives what my editor wants, which is just "uppercase like
lowercase, diacritics ignored".
See MWE attached.
Please, would somebody help me achieve the desired result?


Your example doesn't contain any uppercase letters. Which makes it a bit 
difficult to test what you're looking for. I must admit that I'm not 
very familiar with register "methods," I assume that Wolfgang or Hans 
will be able to tell you how to use them. For your case, if you merely 
want to get rid of all distinctions between upper- and lowercase, 
accents, etc., you could use

Lua (slightly modified example):

\mainlanguage[pt]
\defineregister [nome]
\setupregister  [nome] [
  language=pt,
  n=1,
]

\startluacode
  userdata = userdata or { }
  function userdata.indexing(s)
t = characters.lower(characters.shaped(s))
context.nome( { t }, s)
  end
\stopluacode

\def\mynome#1%
  {\ctxlua{userdata.indexing([==[#1]==])}}

\starttext

\mynome{árvore}árvore \mynome{Äard}Äard \mynome{água}água 
\mynome{Água}Água  \mynome{abnegação}abnegação \mynome{alegria}alegria 
\mynome{agrilhoado}agrilhoado \mynome{anjo}anjo \mynome{ódio}ódio 
\mynome{orgulho}orgulho \mynome{Åz}Åz \mynome{Åaaa}Åaaa \mynome{Özz}Özz 
\mynome{Öaa}Öaa


\page[yes]

\placeregister [nome]

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

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

[NTG-context] Documentation of change / Evolving documents

2019-01-19 Thread Axel Kielhorn
Hi,

I often have documents that are not finished but need to change over time.
A client changes their mind, laws are changed, …

While working with the document, I want to see the changes.
When the document is finally finished, I only want to see the change history.

I came up with the following.
When the mode is „change“  the date (or version) is shown in the margin and the 
change is printed in red.
Without mode „change“ only the change history is printed.

What I want now is to change the layout of the register.
Adding some vspace around the date and printing the date in bold.
Is there a way to achieve this or am I on the wrong way?
(Should the date be the indicator, thus giving me the layout I want?)

\enablemode[change]

\setuppapersize [A4][A4]
\setuplayout[width=middle,  backspace=1.5in, cutspace=1.5in,
 height=middle, topspace=0.75in, bottomspace=0.75in]

\setupbodyfont[11pt]

\defineregister [change]
\setupregister  [change] [
  indicator=no  %% no letter
  style=sansbold,   %% headings
  textstyle=slanted,%% entries
  pagestyle=bolditalic, %% page refs
  n=1,  %% columns
]

\def\ChangeV#1#2{\change{#1+#2}\doifmode{change}{\inmargin{\tx #1}{\red 
#2\par}}}
\def\ChangeD#1#2{\change{#1+#2}\doifmode{change}{\inmargin{\tx #1}{\red 
#2\par}}}

\starttext

\ChangeV{V. 1.0}{Fertig!}
\input knuth

\ChangeD{2018-12-22}{Fertig!}

\ChangeD{2018-12-23}{Letzter Fehler beseitigt.}
\input knuth

\ChangeD{2018-12-23}{Allerletzter Fehler beseitigt.}

Ende

\startsection[title={History}]

\placechange

\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] Possible seeindex enhancement

2018-10-27 Thread Rik Kabel

On 10/25/2018 16:39, Rik Kabel wrote:


List,

I am looking for a way to modify the text used for \seeindex (in 
English, "see") to have two types of seeindex result in the same index 
register. I would like to produce, for example,


pseudepigraphy, 103,/see also obliteration/

and at the same time be able to produce the standard

Marut, Ret,/see Traven, B./

For the first of these in print documents (no interaction required) I 
can use \seeindex{pseudepigraphy}{also obliteration}, but that does 
not produce an interactive link.


Can anyone suggest how to accomplish this?

--
Rik



Following up on my post, here is an MWE demonstrating the lack of 
interaction, which is expected because {also obliteration} is not indexed:


   \setupinteraction [state=start]
   \setupregister[index]
  [check=no]
   \seeindex {pseudepigraphy}
   {also obliteration}
   \seeindex {Matilda effect}
   {obliteration}
   \seeindex {Marut, Ret}
   {Traven, B.}
   \starttext
  Something, but could be only \tex{dontleavhmode}.
  \index{obliteration}
  \index{pseudepigraphy}
  \index{Traven, B.}
   \placeindex
   \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] index with more than one column?

2018-08-26 Thread Wolfgang Schuster

Try it without the columns environment in your document, i.e.

\startchapter[title=\mytitle{Register}]
\placeregister[index]
\stopchapter


Hans van der Meer schrieb am 26.08.18 um 17:48:

Could the following setup I used be the culprit?

\setupregister[index][pagestyle=slanted,textstyle=small,alternative=A]


On 26 Aug 2018, at 17:43, Wolfgang Schuster 
<mailto:wolfgang.schuster.li...@gmail.com>> wrote:


The real question is why do you get an index without two columns.

\starttext

\dorecurse{26}{\convertnumber{a}{#1}\expanded{\index{\convertnumber{a}{#1

\placeregister[index]%[n=3]

\stoptext



Hans van der Meer schrieb am 26.08.18 um 17:37:

How do I produce an index with more than one column?

This produces one column only:
\startchapter[title=\mytitle{Register}]
\startcolumns[n=2]
\placeregister[index]
\stopcolumns

Nor did \placeregister[index][n=2] or \placeindex[n=2], with or 
without the columns envirenment, produce the result wanted.
The \startsimplecolumns[n=2] environment did produce two columns, 
but then played havoc with the textheight.


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




met vriendelijke groet
dr. 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
___

Re: [NTG-context] seeindex problem with recent betas

2018-08-09 Thread Rik Kabel

On 8/8/2018 23:48, Wolfgang Schuster wrote:

\setupregister[index][check=no]

Wolfgang


Thank you, Wolfgang. I saw the discussion on the list, but missed it in 
i-context.pdf.


Wiki updated.

--
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] seeindex problem with recent betas

2018-08-08 Thread Wolfgang Schuster

\setupregister[index][check=no]

Wolfgang


Rik Kabel schrieb am 09.08.18 um 04:32:


With older versions of ConTeXt (including that in TL18) seeindex 
entries pointing to a multi-level (plussed) index entry worked 
(visually, at least) without complaint. The output might look like:


Digby, John 73
Dilbert see Adams+Scott
Dirac, Paul 287

or

Digby, John 73
Dilbert see Adams, Scott
Dirac, Paul 287

where the second part is a literal repeat of what is in  the second 
argument of seeindex. (It is not, however, linked to the plussed entry 
as it would be to a single-level entry.)  However, current version 
(2018.07.27 19:12) generates a result like:


Digby, John 73
Dilbert
Dirac, Paul 287

along with the warning:

structure   > registers > invalid crosslink : Adams+Scott, ignored

Surely it is better to display the non-linked see entry as before 
(together with the warning message so that the non-linking is pointed 
out) and have a printable document than it is to display an empty entry!


--
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] issue with balanced columns

2018-07-15 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\showframe
\showgrid

\setuplanguage[agr][patterns={agr, us}]
\mainlanguage[agr]

\definepapersize[HippPaper][width=6in, height=9in]
\setuppapersize[HippPaper]

\setupbodyfont[dejavu, 13pt]

\setupbodyfontenvironment[default][em=italic, x=.95]

\setupregister[index]
[language=gr,
 indicator=no,
 before=,
 after=,
 distance=3ex,
 textstyle=\tfx,
 pagenumber=no,
 n=2,
 align={verybroad, hz,hanging},
 method={zm,zc}]

\starttext
\mbox{}
\index{ἀδελφός, ὁ: brother}
\index{ἀδικίη, ἡ: wrongdoing, injustice}
\index{ἀκρόησις, –ιος, ἡ: hearing, listening}
\index{ἄνευ: without (\char43\ gen.)}
\index{ἄρρην, –εν: male}
\index{γένος, –εος, τό: race, family}
\index{δήλησις, –ιος, ἡ: ruin, bane}
\index{διαίτημα, –ατος, τό: regimen, diet}
\index{ἐπικρίνω: decide, consider}
\index{ἰητρικός, –ή, –όν: of a physician, medical}
\index{κάμνω: be sick, suffer from illness}
\index{λοιπός, –ή, –όν: remaining, rest}
\index{μάθησις, –ιος, ἡ: learning}
\index{μαθητής, –οῦ, ὁ: learner, pupil}
\index{μανθάνω: learn}
\index{μισθός, ὁ: wages, pay, hire}
\index{νόμος, ὁ: custom, law}
\index{ὁρκίζω: bind by oath}
\index{υἱός, ὁ: son}
\index{χρέομαι: use}
\index{ὠφέλειη, ἡ: help, aid, benefit}
\placeindex
\stoptext

Although colums are balanced, I get unbalanced columns.

Is there a command that prevents the wrong balanced columns?

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] Overriding / redefining / disabling standard commands

2018-06-26 Thread Wolfgang Schuster



Alan Braslau <mailto:braslau.l...@comcast.net>
26. Juni 2018 um 04:00
On Mon, 25 Jun 2018 20:50:51 -0400

\setupregister[index][referencing=off]


This option doesn’t exist in MkIV and there is no other option to 
disable \index.


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] Overriding / redefining / disabling standard commands

2018-06-25 Thread Rik Kabel

On 6/25/2018 22:00, Alan Braslau wrote:

On Mon, 25 Jun 2018 20:50:51 -0400
Rik Kabel  wrote:


On 6/25/2018 20:11, Alan Braslau wrote:

On Mon, 25 Jun 2018 19:11:30 -0400
Rik  wrote:


On 6/25/2018 17:52, Wolfgang Schuster wrote:

\startmode[ebook]
\setupbackend[export=yes]
\stopmode

\starttext

\index{Knuth}\input knuth

\index{Ward}\input ward

\index{Zapf}\input zapf

\startnotmode[*export]
\completeregister[index]
\stopnotmode

\stoptext

Unfortunately, this does not suppress generation of index
references in the exported output. Here is a snippet of the
-div.html file generated by the example you provided:

  Thus,
I came to the conclusion that the designer of a new system must not
  only be the implementer and first large--scale user; the
designer should also write the first user manual.

and a snip of the output with the default css:

Thus the request for a (simple) mechanism to redefine or disable
standard commands. There are commands other than \index that might
also benefit from similar treatment.


\def\MyIndex#1{\index{#1}}

is one route.

Another might be

\let\index\gobbleoneargument

(use at your risk)

Alan


This would work if \index took one argument, but it takes as well an
optional argument preceding the required argument, and so these fail.

The best solution would seem to be one which does not require
knowledge of the number of required and optional arguments, but that
might be a stretch.

That is why I asked for help.

\setupregister[index][referencing=off]

Besides, if you use \index, why object to index reference tags in the
export?

Alan


Alan (and list),

This option still leaves the registerlocation entries in the html file, 
and so accomplishes nothing that Wolfgang's suggestion did. Being 
implemented in the environment file, it does have the advantage of not 
requiring changes to the content source file.


As to why I object to index reference tags in the export: There are a 
few constructs beyond indexes that I wish to exclude in export output -- 
indices are one and the problem is easily demonstrated. Referencetags 
themselves are not a significant problem -- a little css will hide them. 
I have not explored the other constructs yet (among them margin notes 
and cross-references) but was hoping for a generic solution, or at least 
an easily adapted per command solution.


There are a few options I can see. In order of least to most preferred, 
I can maintain separate sources; I can invoke a filter in my makefile to 
preprocess the source, removing \index commands (or margin notes, or 
...); I can redefine \index (or margin notes, or ...) to be no-ops.


As much as possible I would like to use the same content source files 
for different output formats with some unique environment files. Filters 
are an added step and fragile, depending on correctly identifying the 
target constructs. So, I have been looking at redefinition.


I thought that the ability to override a command like \index might be 
generally useful, and so brought it up to the list when I could not find 
a way to do it.


--
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] Overriding / redefining / disabling standard commands

2018-06-25 Thread Alan Braslau
On Mon, 25 Jun 2018 20:50:51 -0400
Rik Kabel  wrote:

> On 6/25/2018 20:11, Alan Braslau wrote:
> > On Mon, 25 Jun 2018 19:11:30 -0400
> > Rik  wrote:
> >
> >> On 6/25/2018 17:52, Wolfgang Schuster wrote:
> >>> \startmode[ebook]
> >>> \setupbackend[export=yes]
> >>> \stopmode
> >>>
> >>> \starttext
> >>>
> >>> \index{Knuth}\input knuth
> >>>
> >>> \index{Ward}\input ward
> >>>
> >>> \index{Zapf}\input zapf
> >>>
> >>> \startnotmode[*export]
> >>> \completeregister[index]
> >>> \stopnotmode
> >>>
> >>> \stoptext
> >> Unfortunately, this does not suppress generation of index
> >> references in the exported output. Here is a snippet of the
> >> -div.html file generated by the example you provided:
> >>
> >>   >>  onclick="location.href=#aut-1">Thus,
> >> I came to the conclusion that the designer of a new system must not
> >>  only be the implementer and first large--scale user; the
> >> designer should also write the first user manual.
> >>
> >> and a snip of the output with the default css:
> >>
> >> Thus the request for a (simple) mechanism to redefine or disable
> >> standard commands. There are commands other than \index that might
> >> also benefit from similar treatment.
> >>
> > \def\MyIndex#1{\index{#1}}
> >
> > is one route.
> >
> > Another might be
> >
> > \let\index\gobbleoneargument
> >
> > (use at your risk)
> >
> > Alan
> >
> This would work if \index took one argument, but it takes as well an 
> optional argument preceding the required argument, and so these fail.
> 
> The best solution would seem to be one which does not require
> knowledge of the number of required and optional arguments, but that
> might be a stretch.
> 
> That is why I asked for help.

\setupregister[index][referencing=off]

Besides, if you use \index, why object to index reference tags in the
export?

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] sort order in registers (indexes)

2018-06-10 Thread Henning Hraban Ramm
Am 2018-06-10 um 20:50 schrieb Henning Hraban Ramm :

> Ah, thanks for the hint. But how can I employ these definitions with 
> index/list ordering?
> Setting mainlanguage and method "*,uc" doesn’t seem to do the trick.

Sorry, found it. In my test file there was still "language=cz" in the setup, 
and the language key is not documented.

> Hans, please add the replacement
> { "ß", "ss" }
> to definitions['DIN 5007-1'] and definitions['DIN 5007-2']
> Thank you!

Wikified:
http://wiki.contextgarden.net/Command/setupregister
http://wiki.contextgarden.net/Command/keyword:method

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] sort order in registers (indexes)

2018-06-10 Thread Henning Hraban Ramm
Am 2018-06-10 um 14:11 schrieb Henning Hraban Ramm :

> Am 2018-06-10 um 13:07 schrieb Henning Hraban Ramm :
> 
>>> I think this may achieve what you want:
>>> \setupregister[index][method={zm,zc}]
>>> I hope it helps,
>> 
>> Thank you very much!
>> 
>> I overlooked that there is indeed some documentation:
>> http://wiki.contextgarden.net/Command/keyword:method
> 
> But reading through that and the source I’m still confused.
> 
> I’d like to write a proper explanation for the wiki (and my book).
> 
> Is there anywhere documentation about the meaning/goal of the presets or 
> algorithms?
> 
> Are these codes translatable into something like "ignore diacritics", "ignore 
> upper/lowercase" etc.?

Ok, I think I got it...
For a proper sorting, you first apply a "mapping", then a "casing" and finally 
"unicode".

Presets:
default = upper like lowercase, diacritics separate
before  = upper before lower, diacritics ignored
after   = lower before upper, diacritics ignored
first   = lower before upper, diacritics separate
last= upper before lower, diacritics separate

* If you don’t set the sorting method, the preset "first" ist used (and not 
"default").

* There’s no preset for the (in my eyes most meaningful) combination "upper 
like lowercase, diacritics ignored" (zm,zc,uc).

* Aren’t language specific sorting rules possible at the current state? Or does 
"unicode" handle that?
E.g.
-- DIN 5007-1 (German default sorting) is like zm,zc,uc, but ß should be sorted 
like ss.
-- DIN 5007-2 (German phonebook sorting) would additionally require umlauts to 
be sorted as ä = ae etc.
-- Austrian phonebook sorting sorts umlauts after base vocals, i.e. a, ä, o, ö, 
u, ü, s, ß.
-- Danish and Norwegian: x, y, z, æ, ø, å
-- Finnish and Swedish: x, y = ü, z, æ, ä, ö, ø, å (until 2006 v = w)
-- etc.
(according to https://de.wikipedia.org/wiki/Alphabetische_Sortierung)

If nobody objects I’ll add this to the wiki.

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] sort order in registers (indexes)

2018-06-10 Thread Henning Hraban Ramm
Am 2018-06-10 um 13:07 schrieb Henning Hraban Ramm :

>> I think this may achieve what you want:
>> \setupregister[index][method={zm,zc}]
>> I hope it helps,
> 
> Thank you very much!
> 
> I overlooked that there is indeed some documentation:
> http://wiki.contextgarden.net/Command/keyword:method

But reading through that and the source I’m still confused.

Source snippet:

local validmethods  = tohash {
"ch", -- raw character (for tracing)
"mm", -- minus mapping
"zm", -- zero  mapping
"pm", -- plus  mapping
"mc", -- lower case - 1
"zc", -- lower case
"pc", -- lower case + 1
"uc", -- unicode
}

local predefinedmethods = {
[v_default] = "zc,pc,zm,pm,uc",
[v_before]  = "mm,mc,uc",
[v_after]   = "pm,mc,uc",
[v_first]   = "pc,mm,uc",
[v_last]= "pc,mm,uc",
}

I’d like to write a proper explanation for the wiki (and my book).

Is there anywhere documentation about the meaning/goal of the presets or 
algorithms?

Are these codes translatable into something like "ignore diacritics", "ignore 
upper/lowercase" etc.?


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] sort order in registers (indexes)

2018-06-10 Thread Henning Hraban Ramm
Am 2018-06-10 um 12:42 schrieb Pablo Rodriguez :

> On 06/10/2018 11:49 AM, Henning Hraban Ramm wrote:
>> Ahoi,
>> 
>> usually, uppercase index entries are sorted before all lowercase entries.
>> Is there a simple setup to change that?
>> 
>> i.e. I need the sorting
>> sum - Sun - sunny
>> instead of
>> Sun - sum - sunny
>> 
>> I know I can influence sort order for single entries, but I’d like a general 
>> setting.
> 
> Hi Hraban,
> 
> I think this may achieve what you want:
> 
>  \setupregister[index][method={zm,zc}]
> 
> I hope it helps,

Thank you very much!

I overlooked that there is indeed some documentation:
http://wiki.contextgarden.net/Command/keyword:method

(Source: 
http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/sort-ini.lua)


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] sort order in registers (indexes)

2018-06-10 Thread Pablo Rodriguez
On 06/10/2018 11:49 AM, Henning Hraban Ramm wrote:
> Ahoi,
> 
> usually, uppercase index entries are sorted before all lowercase entries.
> Is there a simple setup to change that?
> 
> i.e. I need the sorting
> sum - Sun - sunny
> instead of
> Sun - sum - sunny
> 
> I know I can influence sort order for single entries, but I’d like a general 
> setting.

Hi Hraban,

I think this may achieve what you want:

  \setupregister[index][method={zm,zc}]

I hope it helps,

Pablo



> (Diacritics are handled as wanted.)
> 
> 
> \starttext
> \strut
> \index{Sun}\index{sun}\index{Suomi}\index{suave}
> \index{sunny}\index{sum}\index{Sumatra}\index{summon}
> \index{sample}\index{super}
> \index{şample}\index{südlich}\index{súper}
> \index{şun}\index{sün}\index{şüñ}
> 
> \completeindex
> 
> \stoptext
> 
> 
> 
> 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
> ___
> 


-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] \seeindex with subentries

2018-06-08 Thread Alan Braslau
This has been reported before...

BTW, how should cat+Siamese be formatted?

cat 1
  Burmese 1
  obese, see Siamese

or

cat 1
  Burmese 1
  obese, see cat, Siamese


Clearly the second case would be needed for
\seeindex{pet+obese}{cat+Siamese}
with

pet
  obese, see cat, Siamese


Alan


On Fri, 8 Jun 2018 21:44:13 +0200
Henning Hraban Ramm  wrote:

> This MWE:
> 
> """
> \setupinteraction[state=start]
> \setupregister[index][n=1]
> 
> \starttext
> My \index{dog}dog is a \index{dog+bullterrier}bullterrier.
> He doesn't like \index{cat}cats.
> There are a lot of \index{cat+stray}stray cats, but only a few of
> them are \index{cat+Siamese}Siamese. I don’t think there are
> \index{cat+Burmese}Burmese cats.
> 
> \seeindex{cat+obese}{cat+Siamese}
> \seeindex{hound}{dog}
> 
> \completeindex
> 
> \stoptext
> """
> 
> ... shows two problems at once:
> 
> """
> c
> cat 1
>   Burmese 1, see cat+Siamese
>   Siamese 1
>   stray 1
> d
> dog 1
>   bullterrier 1
> h
> hound see dog
> """
> 
> While the reference "hound see dog" is properly formatted, cat+obese
> is missing (i.e. sorted under Burmese) while there is no
> \index{cat+obese}, and the reference "cat+Siamese" is shown as-is,
> not properly formatted.
> 
> That means, refering to index sub-entries is broken at the moment
> (current beta and at least several previous).
> 
> 
> 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] \seeindex with subentries

2018-06-08 Thread Henning Hraban Ramm
This MWE:

"""
\setupinteraction[state=start]
\setupregister[index][n=1]

\starttext
My \index{dog}dog is a \index{dog+bullterrier}bullterrier.
He doesn't like \index{cat}cats.
There are a lot of \index{cat+stray}stray cats, but only a few of them are 
\index{cat+Siamese}Siamese. I don’t think there are \index{cat+Burmese}Burmese 
cats.

\seeindex{cat+obese}{cat+Siamese}
\seeindex{hound}{dog}

\completeindex

\stoptext
"""

... shows two problems at once:

"""
c
cat 1
  Burmese 1, see cat+Siamese
  Siamese 1
  stray 1
d
dog 1
  bullterrier 1
h
hound see dog
"""

While the reference "hound see dog" is properly formatted, cat+obese is missing 
(i.e. sorted under Burmese) while there is no \index{cat+obese}, and the 
reference "cat+Siamese" is shown as-is, not properly formatted.

That means, refering to index sub-entries is broken at the moment (current beta 
and at least several previous).


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


seeindex.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] roadmap

2018-05-15 Thread MF

> > * References: see Massimiliano’s question, apparently there are
> > options missing for code before/after the list of pages
> 
> These hooks were added; adding a few more hooks is normally no big
> deal 
> ... the main problem with such additions is that they seldom get 
> documented (in fact that imo is also a it up to the one requesting
> such 
> features).
> 

Touché! I've added them to the wiki.

I was already updating that page of the wiki (\setupregister) on
Friday, but also realized that it was way behind the syntax you can
check with setup-en.pdf (the Commands manual).
It missed the brand new "pageleft" and "pageright" parameters, but even
much more than them. So i asked myself about the opportunity to
document a brand new feature without the missing ones that have been
already in place for a much longer time.
Anyway, that's the spirit of a wiki: everybody can add his 2 cents of
knowledge.

The table of the command parameters was also difficult to read and
modify in the wiki source, so i gave up for that moment and wondered
about a more general solution for command documentation.
Your messages today motivated me to update that page anyway.

The setup-en.pdf manual is a great source of documentation and it's
synchronized with every new version, because it's automatically
generated from sources.

It lets you know the commands, their parameters and their types.
I've looked a bit into the "i-" files in the "interface" directory of
the ConTeXt distribution, and i've seen that the commands are also
classified into categories.

What you miss in that manual is the parameters' meaning and some
example of usage.
I'm thinking about some companion files to the "i-" ones that carry the
information about the parameters' meaning and usage.
Some of those texts could be "recycled" from the current wiki pages.
Then we could generate some automatic, up to date wiki pages directly
from the combination of those files.

I'm not going to work on that before the meeting and i've already
promised more than i can achieve.
But we could discuss that at the meeting.

Greetings,
Massi
___
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] registers: how can I place a command around the whole of the page numbers of an index term?

2018-05-10 Thread MF
\wordright is ok until the numbers don't exceed the text width.

It manages these two cases right:

Index term, and some
text  21, 34, 45, 72

Index term, and some
text
  21, 34, 45, 72, 89

When the numbers exceed the text width, it fails:

Index term, and some
text
21, 34, 45, 72, 89, 101, 103, 109

It fails because it uses a hbox, that can't do nothing but running
beyond the right margin.

This would be a solution:

Index term, and some
text
 21, 34, 45, 72, 89,
   101, 103, 109

where the rule is: when the numbers exceed the text width, close the
paragraph, then start a new, right aligned one.

So i wrote this:

---
\def\wordorparagraphright#1{\let\scratchWidth\relax
  \setbox\scratchbox=\hbox{#1}\newdimen\scratchWidth
  \scratchWidth=\wd\scratchbox
  \ifdim\scratchWidth < 0.9\textwidth
\wordright{#1}%
  \else
\par
\startalignment[flushright]#1\stopalignment
  \fi}

\starttext
\input sapolsky \wordorparagraphright{\it other text} \par
\blank
\input sapolsky \wordorparagraphright{\it other text, this time longer}
\par
\blank
\input sapolsky \wordorparagraphright{\it other text, this time
much much much much much much much much much much much much 
much much much much much much much much much much longer} \par
\stoptext
---

But it doesn't work with

---
\unprotect

\unexpanded\def\startregisterpages
   {\begingroup
\dostarttagged\t!registerpages\empty
\useregisterstyleandcolor\c!pagestyle\c!pagecolor
\registerparameter\c!pageleft}

\unexpanded\def\stopregisterpages
   {\registerparameter\c!pageright
\dostoptagged
\endgroup}

\protect

\def\wordorparagraphright#1{\let\scratchWidth\relax
 
\setbox\scratchbox=\hbox{#1}\newdimen\scratchWidth
 
\scratchWidth=\wd\scratchbox
  \ifdim\scratchWidth < 0.9\textwidth
\w
ordright{#1}%
  \else
\par
\startalignment[flushright]#1\stopalign
ment
  \fi}

\setupregister
   [index]
   [n=1,
alternative=A,
distance=0pt,
pageleft=\wordorparagraphright\bgroup,
pageright=\egroup]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\placeindex
\stoptext
---

I suppose it's related to the problem that \groupedcommand solves.
Is there a solution?

An even better solution would be:

Index term, and some
text 21, 34, 45, 72,
   89, 101, 103, 109

where the rule is: put the text until it fills the current line, than
proceed flushing the remainder of the paragraph lines to the right.

Here i tried changing \leftskip in the middle of a paragraph, but it
works globally.

I think this is even harder to implement, at least in the middle of the
register macros.
___
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] registers: how can I place a command around the whole of the page numbers of an index term?

2018-05-10 Thread Hans Hagen

On 5/10/2018 12:35 PM, MF wrote:

This is a more polite version, that lets you restore the original
macros.

\let\origstartregisterpages=\startregisterpages%
\let\origstopregisterpages=\stopregisterpages%
\def\setupregisterpagescommand#1{%
   \unexpanded\def\startregisterpages{\origstartregisterpages#1\bgroup }
   \unexpanded\def\stopregisterpages{\egroup\origstopregisterpages}}
\def\resetregisterpagescommand{%
   \let\startregisterpages=\origstartregisterpages%
   \let\stopregisterpages=\origstopregisterpages}

\setupregister[index][n=1,alternative=A]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\setupregisterpagescommand{\wordright}
\placeindex
\page
\resetregisterpagescommand
\placeindex
\stoptext

btw, Hans, are you going to add an option to \setupregister? :)

knowing that wolfgang looked into it i just wait till he cooks up something

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] registers: how can I place a command around the whole of the page numbers of an index term?

2018-05-10 Thread Wolfgang Schuster
The following solution which adds two additional keys (pageleft and 
pageright)

is cleaner because it doesn’t have to overload commands.


\unprotect

\unexpanded\def\startregisterpages
  {\begingroup
   \dostarttagged\t!registerpages\empty
   \useregisterstyleandcolor\c!pagestyle\c!pagecolor
   \registerparameter\c!pageleft}

\unexpanded\def\stopregisterpages
  {\registerparameter\c!pageright
   \dostoptagged
   \endgroup}

\protect

\setupregister
  [index]
  [n=1,
   alternative=A,
   distance=0pt,
   pageleft=\wordright\bgroup,
   pageright=\egroup]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\placeindex
\stoptext


Wolfgang

MF <mailto:mass...@fastwebnet.it>
10. Mai 2018 um 12:35
This is a more polite version, that lets you restore the original
macros.

\let\origstartregisterpages=\startregisterpages%
\let\origstopregisterpages=\stopregisterpages%
\def\setupregisterpagescommand#1{%
\unexpanded\def\startregisterpages{\origstartregisterpages#1\bgroup }
\unexpanded\def\stopregisterpages{\egroup\origstopregisterpages}}
\def\resetregisterpagescommand{%
\let\startregisterpages=\origstartregisterpages%
\let\stopregisterpages=\origstopregisterpages}

\setupregister[index][n=1,alternative=A]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\setupregisterpagescommand{\wordright}
\placeindex
\page
\resetregisterpagescommand
\placeindex
\stoptext

btw, Hans, are you going to add an option to \setupregister? :)
___
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] registers: how can I place a command around the whole of the page numbers of an index term?

2018-05-10 Thread MF
This is a more polite version, that lets you restore the original
macros.

\let\origstartregisterpages=\startregisterpages%
\let\origstopregisterpages=\stopregisterpages%
\def\setupregisterpagescommand#1{%
  \unexpanded\def\startregisterpages{\origstartregisterpages#1\bgroup }
  \unexpanded\def\stopregisterpages{\egroup\origstopregisterpages}}
\def\resetregisterpagescommand{%
  \let\startregisterpages=\origstartregisterpages%
  \let\stopregisterpages=\origstopregisterpages}

\setupregister[index][n=1,alternative=A]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\setupregisterpagescommand{\wordright}
\placeindex
\page
\resetregisterpagescommand
\placeindex
\stoptext

btw, Hans, are you going to add an option to \setupregister? :)
___
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] registers: how can I place a command around the whole of the page numbers of an index term?

2018-05-10 Thread MF
Thanks Wolfgang and sorry if i reply to my mail, since i've downloaded
yours on another PC.

I've found these macros in strc-reg.mkiv, that are called right before
and after the page numbers:

\unexpanded\def\startregisterpages
  {\begingroup
   \dostarttagged\t!registerpages\empty
   \useregisterstyleandcolor\c!pagestyle\c!pagecolor}

\unexpanded\def\stopregisterpages
  {\dostoptagged
   \endgroup}

And this seems to work:

\let\origstartregisterpages=\startregisterpages%
\let\origstopregisterpages=\stopregisterpages%
\unexpanded\def\startregisterpages{\origstartregisterpages\wordright\bg
roup }
\unexpanded\def\stopregisterpages{\egroup\origstopregisterpages}

\setupregister[index][n=1,alternative=A]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\placeindex
\stoptext

I've also learned about \groupedcommand, which i did not know.
Again, thanks for you help.

Best wishes,
Massi


___
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] registers: how can I place a command around the whole of the page numbers of an index term?

2018-05-09 Thread Wolfgang Schuster

There is no option to apply a command to all page numbers but you can
add something after the register entry with the textcommand key.

Be aware this solution isn’t perfect because in the worst case
(narrow columns for the register or long entries) page numbers
can be split on multiple lines.

\setupregister
  [index]
  [n=1,
   alternative=A,
   textcommand=\groupedcommand{}{\hfill\quad}]

Wolfgang

MF <mailto:mass...@fastwebnet.it>
9. Mai 2018 um 17:09
Hello list,
i'd like moving the page numbers in my index to the right, with a
\wordright.

\setupregister[index][n=1,alternative=A]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\placeindex
\stoptext

The index is at page 4. I want to move the numbers "1,3" and "2" to the
right.
The parameter pagecommand is for the single page number, i want to put
a command (\wordright) around the whole block of page numbers.
How can i do that?

Greetings,
Massi


___
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] registers: how can I place a command around the whole of the page numbers of an index term?

2018-05-09 Thread MF
Hello list,
i'd like moving the page numbers in my index to the right, with a
\wordright.

\setupregister[index][n=1,alternative=A]

\starttext
\CONTEXT\index{\ConTeXt}
\page
\LATEX\index{\LaTeX}
\page
\CONTEXT\index{\ConTeXt}
\page
\placeindex
\stoptext

The index is at page 4. I want to move the numbers "1,3" and "2" to the
right.
The parameter pagecommand is for the single page number, i want to put
a command (\wordright) around the whole block of page numbers.
How can i do that?

Greetings,
Massi


___
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] Fwd: Custom sorting of "pseudo-language" in a register

2018-03-22 Thread Hans Hagen

On 3/22/2018 9:25 AM, luigi scarso wrote:

-- Forwarded message --
From: John Grasty <johnpgra...@gmail.com>
Date: Fri, Mar 16, 2018 at 4:15 PM
Subject: [NTG-context] Custom sorting of "pseudo-language" in a register
To: mailing list for ConTeXt users <ntg-context@ntg.nl>


Hello all,

I’m just getting acquainted with ConTeXt, and I am finding it so much
more suitable for my work and needs. Thanks for the great software.
Here’s my situation. I write in Slovene and in English, and I need to
make numerous references to biblical passages. I want to create an
index of these citations, but I want them in the order they appear in
the Bible rather than alphabetical order. Henri Menke provided a
perfectly workable solution on TeX StackExchange[^1], but because this
is a multi-year project, I wanted to find a bit more permanent
solution. I discovered I can use Lua LPEG to parse and normalize my
citations so they are referenced in a uniform style.

My problem comes in the register sorting. Hans, I saw where in the
paste you have recommended a “pseudo-language” to implement a custom
sort in such a situation. I have almost figured out how to accomplish
this. (See the MWE below.) I have no problem with single word sections
(Genesis, Exodus, etc.). I can turn off indicators, do the custom sort
(see below), and I get the intended result. If I have a multiple word
title (Evangelij po Janezu), that technique doesn’t work. The
replacement for more than one word (or if a number is involved, like
1John) doesn’t seem to work. I have no doubt there is a good reason;
I’m just a newbie!

It seems my options are to:

1. Figure out how to do a replacement for a phrase or a book with a
number in its name. Then this technique seems to work ok.
2. Or to add an entries and figure out some way to not print the first
level in the index. So the indicator will be the book name, and
underneath the chapter and verses will be listed with out the book
name being repeated.


Are there any ideas to point me in the right direction?


You're bitten by the cleaner that kind of normalizes entries as you can 
see when you say


\enabletrackers[*sort*]

replacing spaces by \0 can help but that sort of assumes that you know 
what happens inside


So, i added some code to handle that. I also added a helper so that you 
can do:


\startluacode
local list = {
-- old testament
"Genesis", "Exodus", "Leviticus", "Numbers", "Deuteronomy", 
"Joshua",

"Judges", "Ruth", "1 Samuel", "2 Samuel", "1 Kings", "2 Kings",
"1 Chronicles", "2 Chronicles", "Ezra", "Nehemiah", "Esther", 
"Job", "Psalms",

"Proverbs", "Ecclesiastes", "Canticles", "Isaiah", "Jeremiah",
"Lamentations", "Ezekiel", "Daniel", "Hosea", "Joel", "Amos", 
"Obadiah",
"Jonah", "Micah", "Nahum", "Habakkuk", "Zephaniah", "Haggai", 
"Zechariah",

"Malachi",
-- new testament
"Matthew", "Mark", "Luke", "John", "Acts", "Romans", "1 
Corinthians",
"2 Corinthians", "Galatians", "Ephesians", "Philippians", 
"Colossians",
"1 Thessalonians", "2 Thessalonians", "1 Timothy", "2 Timothy", 
"Titus",
"Philemon", "Hebrews", "James", "1 Peter", "2 Peter", "1 John", 
"2 John",

"3 John", "Jude", "Revelation",
}

sorters.definitions['bbt'] = {
replacements = sorters.replacementlist(list),
}
\stopluacode

\defineregister
  [booksort]
  [language=bbt,
   n=1,
   indicator=no]

\starttext

One   \booksort{Genesis+5.2}
Two   \booksort{Exodus+2}
Three \booksort{Genesis+45}
Four  \booksort{Philemon+2}
Five  \booksort{John+45}
Six   \booksort{1 John 1+45}
Seven \booksort{2 John 2+45}

\blank[3*line]

\placeregister[booksort][language=bbt]

\stoptext

It probably makes sense to make this into a module but then we need to 
collect a few lists.


I'll upload a beta.

Hans


Thanks so much for your help,
John Grasty



[1]: 
https://tex.stackexchange.com/questions/418575/custom-ordering-for-a-index-register-in-context/

- - - -

\startluacode

local utfchar, utfbyte  = utf.char, utf.byte
local sorters   = sorters
local definitions   = sorters.definitions
local replacementoffset = sorters.constants.replacementoffset
local variables = interfaces.variabl

Re: [NTG-context] \completeindex and \setuparranging

2018-03-20 Thread Wolfgang Schuster



survoje <mailto:surv...@free.fr>
19. März 2018 um 21:26

Bonsoir Wolfgang !

I tried according to your method (without arrangement and extra run) 
without result, I tried others possibilities without result. The index 
page is never ok with \setuparranging... Surely I did not understand.


I wanted to make a booklet of musical scores in A5 (24 pages), just 
with successive png and index for each score : 


\starttext
\externalfigure[Alaude][width=\textwidth]\index{Alaude}
\blank
\externalfigure[Amazing][width=\textwidth]\index{Amazing}

\externalfigure[Valse_5T][width=\textwidth]\index{Valse a 5 temps}
\blank
\externalfigure[Valse8Temps][width=\textwidth]\index{Valse à 8 temps}

\externalfigure[ValseEcossaise][width=\textwidth]\index{Valse écossaise}
\page
\setupregister[index]
 [n=2,pagestyle=bold]
\completeindex
\stoptext

Your index doesn’t work because you have no paragraphs in your document. 
When you

add \dontleavehmode before each \externalfigure the entries are correct.


\setupwhitespace[line]

\defineexternalfigure[score][width=\textwidth]

\starttext

\dontleavehmode\externalfigure[Alaude][score]\index{Alaude}

\dontleavehmode\externalfigure[Amazing][score]\index{Amazing}

\dontleavehmode\externalfigure[Valse_5T][score]\index{Valse a 5 temps}

\dontleavehmode\externalfigure[Valse8Temps][score]\index{Valse à 8 temps}

\dontleavehmode\externalfigure[ValseEcossaise][score]\index{Valse écossaise}

\page

\completeindex

\stoptext


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

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

Re: [NTG-context] \completeindex and \setuparranging

2018-03-19 Thread survoje

Bonsoir Wolfgang !

I tried according to your method (without arrangement and extra run) 
without result, I tried others possibilities without result. The index 
page is never ok with \setuparranging... Surely I did not understand.


I wanted to make a booklet of musical scores in A5 (24 pages), just with 
successive png and index for each score : 


\starttext
\externalfigure[Alaude][width=\textwidth]\index{Alaude}
\blank
\externalfigure[Amazing][width=\textwidth]\index{Amazing}


\externalfigure[Valse_5T][width=\textwidth]\index{Valse a 5 temps}
\blank
\externalfigure[Valse8Temps][width=\textwidth]\index{Valse à 8 temps}

\externalfigure[ValseEcossaise][width=\textwidth]\index{Valse écossaise}
\page
\setupregister[index]
   [n=2,pagestyle=bold]

\completeindex
\stoptext

- Never mind ! I will do it in A4.

Thank you for your attention !

Gérard with help de "google translate" 8-)


Le 19/03/2018 à 12:00, Wolfgang Schuster a écrit :


Try to produce a document without arrangement and make an extra
run afterwards where you arrange the pages. You can use modes for this.

\startnotmode[arrange]
\setuppapersize[A5][A5]
\stopnotmode

\startmode[arrange]
\setuppapersize[A5][A4,landscape]
\setuparranging[2UP]
\stopmode


Process your document first with

    context my_document.tex

and make an extra run at the end with

    context --once --mode=arrange my_document.tex


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] \completeindex and \setuparranging

2018-03-19 Thread Wolfgang Schuster




Gerard <mailto:surv...@free.fr>
19. März 2018 um 11:22
Bonjour, Hi !

Pablo, ok for the remark ! I leave the previous subject and I open 
mine because it's not solved



Le 18/03/2018 à 23:21, Gerard a écrit


Thank you Wolfgang for the solution :

context --arrange my_document.tex


I responded too quickly. Look at the two pictures attached :

- \placeindex does not mark the pages
- \completeindex only marks page 19 (the last page)


Your example doesn’t help because it doesn’t show the problem.


That's the context :

---

\setuppapersize[A5][A4,landscape]

\setuparranging[2UP]


\setupregister[index][n=2,
pagestyle=bold]


\starttext

\externalfigure[Alaude][width=\textwidth]\index{Alaude}
\blank
\externalfigure[Andro][width=\textwidth]\index{Andro}

\page
\completeindex
\stoptext
-

and running by "context --arrange my_document.tex"

It's ok with :
-

\setuppapersize[A5]%[A4,landscape]

%\setuparranging[2UP]

-



Try to produce a document without arrangement and make an extra
run afterwards where you arrange the pages. You can use modes for this.

\startnotmode[arrange]
\setuppapersize[A5][A5]
\stopnotmode

\startmode[arrange]
\setuppapersize[A5][A4,landscape]
\setuparranging[2UP]
\stopmode


Process your document first with

context my_document.tex

and make an extra run at the end with

context --once --mode=arrange my_document.tex


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] \completeindex and \setuparranging

2018-03-19 Thread Gerard

Bonjour, Hi !

Pablo, ok for the remark ! I leave the previous subject and I open mine 
because it's not solved



Le 18/03/2018 à 23:21, Gerard a écrit


Thank you Wolfgang for the solution :

context --arrange my_document.tex


I responded too quickly. Look at the two pictures attached :

- \placeindex does not mark the pages
- \completeindex only marks page 19 (the last page)


That's the context :

---

\setuppapersize[A5][A4,landscape]

\setuparranging[2UP]


\setupregister[index][n=2,
    pagestyle=bold]


\starttext

\externalfigure[Alaude][width=\textwidth]\index{Alaude}
\blank
\externalfigure[Andro][width=\textwidth]\index{Andro}

\page
\completeindex
\stoptext
-

and running by "context --arrange my_document.tex"

It's ok with :
-

\setuppapersize[A5]%[A4,landscape]

%\setuparranging[2UP]

-


Thanks for the help.


Gérard... and thanks to "google translate" :)




Le 18/03/2018 à 20:32, Wolfgang Schuster a écrit :



survoje <mailto:surv...@free.fr>
18. März 2018 um 19:37

Bonjour,

\completeindex (or \placeindex) works in this case :

\setuppapersize[A5]%[A4,landscape]

%\setuparranging[2UP]


with %


but does not work in this case :


\setuppapersize[A5][A4,landscape]

\setuparranging[2UP]

I do not understand where is my mistake !


You have to use the arrange option for the context command, e.g.

    context --arrange my_document.tex

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] Custom sorting of "pseudo-language" in a register

2018-03-16 Thread John Grasty
Hello all,

I’m just getting acquainted with ConTeXt, and I am finding it so much more 
suitable for my work and needs. Thanks for the great software. Here’s my 
situation. I write in Slovene and in English, and I need to make numerous 
references to biblical passages. I want to create an index of these citations, 
but I want them in the order they appear in the Bible rather than alphabetical 
order. Henri Menke provided a perfectly workable solution on TeX 
StackExchange[^1], but because this is a multi-year project, I wanted to find a 
bit more permanent solution. I discovered I can use Lua LPEG to parse and 
normalize my citations so they are referenced in a uniform style.

My problem comes in the register sorting. Hans, I saw where in the paste you 
have recommended a “pseudo-language” to implement a custom sort in such a 
situation. I have almost figured out how to accomplish this. (See the MWE 
below.) I have no problem with single word sections (Genesis, Exodus, etc.). I 
can turn off indicators, do the custom sort (see below), and I get the intended 
result. If I have a multiple word title (Evangelij po Janezu), that technique 
doesn’t work. The replacement for more than one word (or if a number is 
involved, like 1John) doesn’t seem to work. I have no doubt there is a good 
reason; I’m just a newbie!

It seems my options are to:

1. Figure out how to do a replacement for a phrase or a book with a number in 
its name. Then this technique seems to work ok.
2. Or to add an entries and figure out some way to not print the first level in 
the index. So the indicator will be the book name, and underneath the chapter 
and verses will be listed with out the book name being repeated.


Are there any ideas to point me in the right direction?

Thanks so much for your help,
John Grasty



[1]: 
https://tex.stackexchange.com/questions/418575/custom-ordering-for-a-index-register-in-context/

- - - -

\startluacode

local utfchar, utfbyte  = utf.char, utf.byte
local sorters   = sorters
local definitions   = sorters.definitions
local replacementoffset = sorters.constants.replacementoffset
local variables = interfaces.variables

local gen  = utfchar(replacementoffset + 1), utfchar(replacementoffset + 11)
local exo = utfchar(replacementoffset + 2), utfchar(replacementoffset + 220)
local jn = utfchar(replacementoffset + 4), utfchar(replacementoffset + 27)


sorters.definitions['bbt'] = {
replacements = {
{ "Geneza", gen },
{ "Eksodus", exo }, 
{ "Janez", jn },
},

orders = {
gen, exo, jn
}
}
\stopluacode

\mainlanguage[sl]

\defineregister[booksort]
\setupregister[booksort]
 [language=bbt,
  n=1,
  indicator=yes,
  ]
  

\starttext

\booksort{Janez+5.2}One
\booksort{Eksodus+2}Two
\booksort{Geneza+45}Three

\page

\placeregister[booksort][language=bbt]

\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] about \placeindex: uppercase initial and lowercase initial, two languages

2018-01-28 Thread Pablo Rodriguez
On 01/28/2018 03:16 PM, Jeong Dal wrote:
> Hi, 
> 
> To place the index at the end of the book, I put \placeindex before 
> \stopproduct.
> It is compiled well.
> But, for the better output, I have two questions about the index.
> 
> 1. In the output, it distinguished uppercase and lowercase initial.
> [...] 
> Is there a way to make index combining the lowercase and the uppercase 
> together as follows?
> 
> s
> set
> simple statements
> …
> Squeeze theorem

Hi Jeong,

"method={zm, zc}" is your friend here:

\setupregister[method={zm, zc}]
\starttext
\startTEXpage[offset=2em]
\index{Squeeze theorem}
\index{simple statements}
\index{set}
\index{sweat}
\placeindex
\stopTEXpage
\stoptext

> 2. The index shows the English letters first and the Koren letters follows. 
> Although it is OK that English words are shown first, is there a way
> to make Korean words are shown first since the main language is Korean?

I wonder whether two different indices would make sense here.

I guess register order is related to the position in any charset you
take. The ASCII characters come before any other range you select (not
only CJK, but Greek or Cyrillic).

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

  1   2   3   >