[NTG-context] styling individual parts of ToC entry

2020-09-04 Thread jbf
Now that with Hraban's invaluable assistance I am able to include title, 
subtitle, author as and when necessary in the ToC and put them on the 
same line if I need to, I have two questions that I have not found a 
satisfactory solution to after playing around with various possibilities.


I need:

(1) the author's names lined up vertically throughout the ToC, and

(2) the first part of the entry (e.g. Foreword) to be bold, but the 
author name to be regular text.


An adjusted version of Hraban's setup can show what I have tried by way 
of example:


%

\define[1]\TitleTocEntry{%
  #1\hskip 1cm% title
   \structurelistuservariable{author}%
  }

\setuplist[title][textstyle=bold,
  textcommand=\TitleTocEntry,
]

%---

/Question 1:/ /How to get the two author names to line up vertically./ 
Given that I have both a Foreword and a Preface, I am using \title for 
these. And both have separate authors. The titles will be simply 
'Foreword' and 'Preface', obviously.


*Foreword Author name*

*Preface    Author name*

I am using \hskip 1cm to separate the authors' names from either of 
those two words. But this does not give me the kind of exact positioning 
I need to get the two author names directly underneath each other in the 
list. I have tried various alternatives to \hskip, but none of them can 
give me the correct proportional distance. The distance is obviously 
being controlled by the fact that 'Foreword' is 8 characters and 
'Preface' is 7. Is what I want only obtainable with a table setup?


The issue might or might not be more complicated when I get to main 
chapters, where the author names need to line up with the Foreword and 
Preface author names as well. There will be, e.g.


Chapter One  Title

   Author name
//

/Question 2:/ /How to independently get Foreword and Preface to be bold, 
but the authors' names to be regular./ \setuplist offers me options like 
textstyle, pagestyle, numberstyle, but they apply to everything (both 
Foreword/Preface and Authors' name are bold). I thought perhaps I could 
control it from within the document, e.g.


\starttitle[title={\ss\bf Foreword}][author={A. Uthor}]

But that does the same - both Foreword and A. Uthor end up bold. And 
besides, I also want to style the ToC independently of the heads if I can.


The wiki and various manuals do offer various tips on modifying the ToC, 
but I cannot find anything regarding the two questions above - not yet, 
anyway. If someone knows where, please point me to it.


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] Quotation with footnote

2020-09-04 Thread Henning Hraban Ramm

> Am 04.09.2020 um 16:20 schrieb Wolfgang Schuster 
> :
> 
> \startsetups [userdata:myquote]
> \startnarrow [left=2em,right=1.5em]
> %\dontleavehmode\llap{\symbol[leftquotation]}\getinlineuserdata\symbol[rightquotation]
> \symbol[leftquotation]\getinlineuserdata\symbol[rightquotation]
> \doifsomething{\userdataparameter{source}}
> {\footnote[\userdataparameter{reference}]{\userdataparameter{source}}}
> \stopnarrow
> \stopsetups
> 
> \defineuserdataalternative
>   [myquote]
>   [renderingsetup=userdata:myquote]
> 
> \defineuserdata
>   [myquote]
>   [alternative=myquote]
> 
> \showframe
> 
> \definefontfeature [default] [default] [protrusion=quality]
> 
> \setupalign [hanging]
> 
> \starttext
> 
> \startuserdata [myquote] [reference={f:9},source={Kaspar Hauser (Kurt 
> Tucholsky), Weltbühne 24, 16.\,6.\,1931}]
> Im übrigen ist der Mensch ein Lebewesen, das klopft, schlechte Musik macht 
> und seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, aber dann ist er tot.
> \stopuserdata
> 
> \stoptext

Thank you! This is quite sophisticated and I’ll keep it for next time, but for 
my current book, Taco’s solutions needs less adaption.

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] Quotation with footnote

2020-09-04 Thread Henning Hraban Ramm

> Am 04.09.2020 um 16:04 schrieb Taco Hoekwater :
> 
> Something like this?
> 
> \definenarrower[myquote]
> \setupnarrower[myquote]
>  [left=2em,
>   right=1.5em,
>   before=\dontleavehmode\hskip-0.33em\startquote,
>   after=\stopquote]
> 
> \startmyquote
> Im übrigen ist der Mensch ein Lebewesen, das klopft, schlechte Musik macht 
> und seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, aber dann ist er tot.
> \stopmyquote \footnote[f:9]{Kaspar Hauser (Kurt Tucholsky), Weltbühne 24, 
> 16.\,6.\,1931}
> 
> But there may be smarter solutions.

Thank you, that works and requires minimal adaptions to my code.

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] Typing efficiency

2020-09-04 Thread Wolfgang Schuster

Taco Hoekwater schrieb am 04.09.2020 um 15:51:


Hi,

Sounds like a job for the blocks mechanism more so than buffers:


\defineblock[entext]
\defineblock[nltext]
   
\defineselector [language] [max=2,n=1]

\startmode[en]
 \setupselector[language][n=1]
 \keepblocks[entext]
\stopmode
\startmode[nl]
 \setupselector[language][n=2]
 \keepblocks[nltext]
\stopmode
  
\starttext
  
\startsection[title=\select{language}{English title}{Dutch title}]
  
\beginentext

 This is English text.
\endentext
\beginnltext
 This is Dutch text.
\endnltext
  
\stopsection
  
\stoptext



It can also be done with buffers.

\definebuffer [entext]
\definebuffer [nltext]

\defineselector [language] [max=2,n=1]

\startmode[en]
\setupselector[language][n=1]
\def\stopentext{\getentext}
\stopmode

\startmode[nl]
\setupselector[language][n=2]
\def\stopnltext{\getnltext}
\stopmode

\starttext

\startsection[title=\select{language}{English title}{Dutch title}]

\startentext
This is English text.
\stopentext
\startnltext
This is Dutch text.
\stopnltext

\stopsection

\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] Quotation with footnote

2020-09-04 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 04.09.2020 um 15:34:

Am 04.09.2020 um 13:25 schrieb Henning Hraban Ramm :

My current book contains a lot of quotations with their sources marked as 
footnotes, e.g.


\definedelimitedtext[Zitat][
  %setups=Zitat, % doesn’t work!?
  left=»,
  right=«,
  leftmargin=2em,
  rightmargin=1.5em,
]

\startZitat
A rose is a rose is a rose.\footnote{Marx brothers}
\stopZitat


Now, since the quotations are whole sentences or paragraphs, the footnote 
marker needs to be placed _after_ the closing quotation mark. (German 
typography, I learned it’s different at least in US English.)

I tried several approaches e.g. with my own single start/stop macros that call 
\start/stopnarrower or \start/stopZitat – that always lead to unclosed 
environments.

This looks as I want it to:

\setupnarrower[left=2em,right=1.5em]

\startnarrower
\hskip-0.33em\quotation{Im übrigen ist der Mensch ein Lebewesen, das klopft, 
schlechte Musik macht und seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, 
aber dann ist er tot.}\footnote[f:9]{Kaspar Hauser (Kurt Tucholsky), Weltbühne 
24, 16.\,6.\,1931}
\stopnarrower

But how can I make that into a single environment?


\startsetups [userdata:myquote]
    \startnarrow [left=2em,right=1.5em]
%\dontleavehmode\llap{\symbol[leftquotation]}\getinlineuserdata\symbol[rightquotation]
    \symbol[leftquotation]\getinlineuserdata\symbol[rightquotation]
    \doifsomething{\userdataparameter{source}}
{\footnote[\userdataparameter{reference}]{\userdataparameter{source}}}
    \stopnarrow
\stopsetups

\defineuserdataalternative
  [myquote]
  [renderingsetup=userdata:myquote]

\defineuserdata
  [myquote]
  [alternative=myquote]

\showframe

\definefontfeature [default] [default] [protrusion=quality]

\setupalign [hanging]

\starttext

\startuserdata [myquote] [reference={f:9},source={Kaspar Hauser (Kurt 
Tucholsky), Weltbühne 24, 16.\,6.\,1931}]
Im übrigen ist der Mensch ein Lebewesen, das klopft, schlechte Musik 
macht und seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, aber dann 
ist er tot.

\stopuserdata

\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] Quotation with footnote

2020-09-04 Thread Taco Hoekwater

Something like this?


\definenarrower[myquote]
\setupnarrower[myquote]
  [left=2em,
   right=1.5em,
   before=\dontleavehmode\hskip-0.33em\startquote,
   after=\stopquote]

\startmyquote
Im übrigen ist der Mensch ein Lebewesen, das klopft, schlechte Musik macht und 
seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, aber dann ist er tot.
\stopmyquote \footnote[f:9]{Kaspar Hauser (Kurt Tucholsky), Weltbühne 24, 
16.\,6.\,1931}


But there may be smarter solutions.

Best wishes,
Taco

> On 4 Sep 2020, at 13:25, Henning Hraban Ramm  wrote:
> 
> My current book contains a lot of quotations with their sources marked as 
> footnotes, e.g.
> 
> 
> \definedelimitedtext[Zitat][
>  %setups=Zitat, % doesn’t work!?
>  left=»,
>  right=«,
>  leftmargin=2em,
>  rightmargin=1.5em,
> ]
> 
> \startZitat
> A rose is a rose is a rose.\footnote{Marx brothers}
> \stopZitat
> 
> 
> Now, since the quotations are whole sentences or paragraphs, the footnote 
> marker needs to be placed _after_ the closing quotation mark. (German 
> typography, I learned it’s different at least in US English.)
> 
> I tried several approaches e.g. with my own single start/stop macros that 
> call \start/stopnarrower or \start/stopZitat – that always lead to unclosed 
> environments.
> 
> * Only the delimitedtext approach gives a hanging opening quotation mark 
> (which looks nice and I’d like to have).
> 
> * \stopnarrower within a macro doesn’t seem to work (all following text stays 
> narrower).
> 
> * I can’t get rid of that space introduced by the CR before \stop – didn’t 
> find a place where \gobblespacetokens works, maybe that’s the wrong command.
> 
> 
> Most preferred would be a solution that checked if there’s a footnote in 
> front of \stopZitat and would put the closing quotation mark in front instead 
> of after. Without a footnote it would just place the mark.
> 
> Something like \stopZitat\footnote{...} would also be nice, but I guess 
> that’s too far outside of TeX’s logic.
> 
> In the worst case I’d need to typeset the closing mark manually.
> 
> Some hints please?
> 
> 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
> ___

Taco Hoekwater
Elvenkind BV




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

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

2020-09-04 Thread Taco Hoekwater

Hi,

Sounds like a job for the blocks mechanism more so than buffers:


\defineblock[entext]
\defineblock[nltext]
  
\defineselector [language] [max=2,n=1]
\startmode[en]
\setupselector[language][n=1]
\keepblocks[entext]
\stopmode
\startmode[nl]
\setupselector[language][n=2]
\keepblocks[nltext]
\stopmode
 
\starttext
 
\startsection[title=\select{language}{English title}{Dutch title}]
 
\beginentext
This is English text.
\endentext
\beginnltext
This is Dutch text.
\endnltext
 
\stopsection
 
\stoptext


Best wishes,
Taco

> On 4 Sep 2020, at 14:02, Jan Willem Flamma  wrote:
> 
> Dear list member,
>  
> Following up from:
> https://www.mail-archive.com/ntg-context@ntg.nl/msg94719.html
>  
> The below MWE works but how can I avoid having to type
> \startmode[en]
> \getbuffer[en]
> \stopmode
> \startmode[nl]
> \getbuffer[nl]
> \stopmode
>  
> after every block of text? 
>  
> I tried to define a new start/stop pair as follows:
> \definestartstop[Bufen][
> before={\startmode[en]
> \startbuffer[en]},
> after={\stopbuffer
> \getbuffer[en]
> \stopmode}]
>  
> but that fails.
>  
> No doubt a clever solution exists that minimizes the typing. 
>  
> Kind regards,
> Jan Willem
>  
>  
> ===
> \setupinteraction[state=start]
>  
> %\enablemode[nl]
> \enablemode[en]
>  
> \defineselector [language] [max=2,n=1]
> \startmode[en]
> \setupselector[language][n=1]
> \stopmode
> \startmode[nl]
> \setupselector[language][n=2]
> \stopmode
>  
> \starttext
>  
> \startsection[title=\select{language}{English title}{Dutch title}]
>  
> \startbuffer[en]
> This is English text.
> \stopmode
> \stopbuffer
> \startbuffer[nl]
> This is Dutch text.
> \stopbuffer
>  
> \startmode[en]
> \getbuffer[en]
> \stopmode
> \startmode[nl]
> \getbuffer[nl]
> \stopmode
>  
> \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
> ___

Taco Hoekwater
Elvenkind BV




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

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

2020-09-04 Thread Henning Hraban Ramm


> Am 04.09.2020 um 13:25 schrieb Henning Hraban Ramm :
> 
> My current book contains a lot of quotations with their sources marked as 
> footnotes, e.g.
> 
> 
> \definedelimitedtext[Zitat][
>  %setups=Zitat, % doesn’t work!?
>  left=»,
>  right=«,
>  leftmargin=2em,
>  rightmargin=1.5em,
> ]
> 
> \startZitat
> A rose is a rose is a rose.\footnote{Marx brothers}
> \stopZitat
> 
> 
> Now, since the quotations are whole sentences or paragraphs, the footnote 
> marker needs to be placed _after_ the closing quotation mark. (German 
> typography, I learned it’s different at least in US English.)
> 
> I tried several approaches e.g. with my own single start/stop macros that 
> call \start/stopnarrower or \start/stopZitat – that always lead to unclosed 
> environments.

This looks as I want it to:

\setupnarrower[left=2em,right=1.5em]

\startnarrower
\hskip-0.33em\quotation{Im übrigen ist der Mensch ein Lebewesen, das klopft, 
schlechte Musik macht und seinen Hund bellen läßt. Manchmal gibt er auch Ruhe, 
aber dann ist er tot.}\footnote[f:9]{Kaspar Hauser (Kurt Tucholsky), Weltbühne 
24, 16.\,6.\,1931}
\stopnarrower

But how can I make that into a single environment?


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] Combining modes and MetaFun

2020-09-04 Thread Hans Hagen

On 9/4/2020 2:20 PM, Jan Willem Flamma wrote:

Dear list members,

Is it possible to combine modes and MetaFun?

In the below MWE, the \doifmode construction does not work.

Kind regards,

Jan Willem Flamma

===

\enablemode[en]

%\enablemode[nl]

\starttext

\startbuffer[square]

     u := 2cm ;

     draw unitsquare scaled u ;

     drawdblarrow (0,-0.2u)..(u,-0.2u) ;

     drawdblarrow (1.2u, 0)..(1.2u, u) ;

     %\doifmode{en}{label(\sometxt{length},  (0.5u,-0.4u)) ;}

     %\doifmode{nl}{label(\sometxt{lengte},  (0.5u,-0.4u)) ;}

     %\doifmode{en}{label(\sometxt{width},   (1.6u, 0.5u)) ;}

     %\doifmode{nl}{label(\sometxt{breedte}, (1.6u, 0.5u)) ;}

\stopbuffer

\placefigure

     [here,none][]{}

     {\scale[width=0.5\textwidth]{\processMPbuffer[square]}}

\stoptext

You need to compensate these solutions by "wikifying" them:

\starttext

\startuseMPgraphic{whatever}{s::mode}
u := 2cm ;
draw unitsquare scaled u ;
drawdblarrow (0,-0.2u)..(u,-0.2u) ;
drawdblarrow (1.2u, 0)..(1.2u, u) ;
if "\MPvar{mode}" = "en" :
label("e", (0.5u,-0.4u)) ;
label("n", (1.6u, 0.5u)) ;
else :
label("n", (0.5u,-0.4u)) ;
label("l", (1.6u, 0.5u)) ;
fi ;
\stopuseMPgraphic

\useMPgraphic{whatever}{mode=en} \blank
\useMPgraphic{whatever}{mode=nl} \blank

\startuseMPgraphic{whatever}
u := 2cm ;
draw unitsquare scaled u ;
drawdblarrow (0,-0.2u)..(u,-0.2u) ;
drawdblarrow (1.2u, 0)..(1.2u, u) ;
if texmode("en") :
label("e", (0.5u,-0.4u)) ;
label("n", (1.6u, 0.5u)) ;
else :
label("n", (0.5u,-0.4u)) ;
label("l", (1.6u, 0.5u)) ;
fi ;
\stopuseMPgraphic

{ \enablemode[en] \useMPgraphic{whatever} } \blank
{ \useMPgraphic{whatever} } \blank

\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] Combining modes and MetaFun

2020-09-04 Thread Jan Willem Flamma
Dear list members, Is it possible to combine modes and MetaFun? In the below MWE, the \doifmode construction does not work. Kind regards,Jan Willem Flamma ===\enablemode[en]%\enablemode[nl] \starttext \startbuffer[square]    u := 2cm ;    draw unitsquare scaled u ; drawdblarrow (0,-0.2u)..(u,-0.2u) ;    drawdblarrow (1.2u, 0)..(1.2u, u) ; %\doifmode{en}{label(\sometxt{length},  (0.5u,-0.4u)) ;}    %\doifmode{nl}{label(\sometxt{lengte},  (0.5u,-0.4u)) ;} %\doifmode{en}{label(\sometxt{width},   (1.6u, 0.5u)) ;}    %\doifmode{nl}{label(\sometxt{breedte}, (1.6u, 0.5u)) ;}\stopbuffer \placefigure    [here,none][]{}    {\scale[width=0.5\textwidth]{\processMPbuffer[square]}} \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] Typing efficiency

2020-09-04 Thread Jan Willem Flamma
Dear list member, Following up from:https://www.mail-archive.com/ntg-context@ntg.nl/msg94719.html The below MWE works but how can I avoid having to type    \startmode[en]    \getbuffer[en]    \stopmode    \startmode[nl]    \getbuffer[nl]    \stopmode after every block of text?  I tried to define a new start/stop pair as follows:\definestartstop[Bufen][    before={\startmode[en]    \startbuffer[en]},    after={\stopbuffer    \getbuffer[en]    \stopmode}] but that fails. No doubt a clever solution exists that minimizes the typing.  Kind regards,Jan Willem  ===\setupinteraction[state=start] %\enablemode[nl]\enablemode[en] \defineselector [language] [max=2,n=1]\startmode[en]    \setupselector[language][n=1]\stopmode\startmode[nl]    \setupselector[language][n=2]\stopmode \starttext \startsection[title=\select{language}{English title}{Dutch title}] \startbuffer[en]    This is English text.    \stopmode    \stopbuffer    \startbuffer[nl]    This is Dutch text.    \stopbuffer \startmode[en]    \getbuffer[en]    \stopmode    \startmode[nl]    \getbuffer[nl]    \stopmode \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
___


[NTG-context] Quotation with footnote

2020-09-04 Thread Henning Hraban Ramm
My current book contains a lot of quotations with their sources marked as 
footnotes, e.g.


\definedelimitedtext[Zitat][
  %setups=Zitat, % doesn’t work!?
  left=»,
  right=«,
  leftmargin=2em,
  rightmargin=1.5em,
]

\startZitat
A rose is a rose is a rose.\footnote{Marx brothers}
\stopZitat


Now, since the quotations are whole sentences or paragraphs, the footnote 
marker needs to be placed _after_ the closing quotation mark. (German 
typography, I learned it’s different at least in US English.)

I tried several approaches e.g. with my own single start/stop macros that call 
\start/stopnarrower or \start/stopZitat – that always lead to unclosed 
environments.

* Only the delimitedtext approach gives a hanging opening quotation mark (which 
looks nice and I’d like to have).

* \stopnarrower within a macro doesn’t seem to work (all following text stays 
narrower).

* I can’t get rid of that space introduced by the CR before \stop – didn’t find 
a place where \gobblespacetokens works, maybe that’s the wrong command.


Most preferred would be a solution that checked if there’s a footnote in front 
of \stopZitat and would put the closing quotation mark in front instead of 
after. Without a footnote it would just place the mark.

Something like \stopZitat\footnote{...} would also be nice, but I guess that’s 
too far outside of TeX’s logic.

In the worst case I’d need to typeset the closing mark manually.

Some hints please?

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] author in ToC and other design complications

2020-09-04 Thread Henning Hraban Ramm

> Am 04.09.2020 um 12:08 schrieb jbf :
> 
> Thanks, and I am sure that this entry into the wiki will be also helpful for 
> others. For me it will be step by step, and using your information I can now 
> at least get an author's name into the toc! But that's about all. 

And that’s what the wiki entry is about and what I can tell.

> Just know that when you say (in the new wiki addition) 'check on 
> \rawstructurelistuservariable' that  link simply tells me 'There is currently 
> no text in this page'. That leaves someone like me without a lot of the 
> long-gained knowledge that others have, quite lost :-)

Sorry that the command is still undocumented but I thought the example would be 
clear enough:

You can’t check (i.e. use \doifnot) on \structurelistuservariable because that 
always contains at least some invisible tokens, you must use 
\rawstructurelistuservariable instead.

But if all of your chapters have the author set, you don’t need that check.

> But I took your example and adjusted it for, say, a chapter which has just a 
> title (no subtitle) and an author, and added, below what I already have in 
> the preamble:
> 
> \define[1]\ChapterTocEntry{%
>   \structurelistuservariable{author}\crlf%
>   #1\crlf% title
>   %\structurelistuservariable{subtitle}}%
> }
> 
> \setuplist[chapter][
>   textcommand=\ChapterTocEntry,
> ]
> 
> So, in other words I swapped the word 'section' in your example with 
> 'chapter'. That now gives me in the ToC, something like the following:
> 
> One   Author name
> 
>  Titlepg no.
> 
> Which is pretty much what I am after. Hooray! But how do I get that in 
> reverse?

Have another look at your \ChapterTocEntry: you call the author by 
\structurelistuservariable{author} and set the title as #1 in the next line. 
Just adapt this to your needs.


> And how do I get the word 'chapter' to also appear in front of 'One'?

Try \labeltext{chapter} in the right place.


Good luck & have fun!
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] author in ToC and other design complications

2020-09-04 Thread jbf
Thanks, and I am sure that this entry into the wiki will be also helpful 
for others. For me it will be step by step, and using your information I 
can now at least get an author's name into the toc! But that's about 
all. Just know that when you say (in the new wiki addition) 'check on 
\rawstructurelistuservariable' that  link simply tells me 'There is 
currently no text in this page'. That leaves someone like me without a 
lot of the long-gained knowledge that others have, quite lost :-)


But I took your example and adjusted it for, say, a chapter which has 
just a title (no subtitle) and an author, and added, below what I 
already have in the preamble:


\define[1]\ChapterTocEntry{%
  \structurelistuservariable{author}\crlf%
  #1\crlf% title
  %\structurelistuservariable{subtitle}}%
}

\setuplist[chapter][
  textcommand=\ChapterTocEntry,
]

So, in other words I swapped the word 'section' in your example with 
'chapter'. That now gives me in the ToC, something like the following:


One   Author name

 Title    pg no.

Which is pretty much what I am after. Hooray! But how do I get that in 
reverse? And how do I get the word 'chapter' to also appear in front of 
'One'? You see what I mean by needing step-by-step. Maybe there are not 
too many nearly 75+-year-olds still surviving Covid and working with 
ConTeXt! But I don't give up too easily, so let me just get this next 
step right with a bit of help.


Julian

n 4/9/20 5:38 pm, Henning Hraban Ramm wrote:




Am 04.09.2020 um 06:44 schrieb jbf :


Of course, I would prefer it to say 'Chapter One' not just 'One', so that is a 
minor problem I still have to resolve. But in fact, the publisher wants 
something quite different and I really do not know how to go about it. I did 
look at 'Author in ToC' in the wiki, but that referred me to a somewhat 
complicated Proceedings style, and given that my Chapters are all set up 
anyway, I just couldn't follow that. Am hoping there is some other way I can 
achieve the design that follows:

ForewordAuthor's nameiii

Chapter One   Chapter title

 Author's name   1

Chapter Two1820-1880

 Chapter title

 Author's name   10

I just replaced the according section 
https://wiki.contextgarden.net/Table_of_Contents#Author_in_ToC for you.

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

2020-09-04 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 03.09.2020 um 10:17:

Hi,

I’d like to have an (person) index entry like

Ramm, Hraban   passim

i.e. without actual page number.
How can I force that?

I also need to be able to refer to it like
\seeindex{Hraban}{Ramm, Hraban)



You can use this when the entry appears only once which replaces the 
page number with "passim".


\define[1]\Passim
  {passim}

\defineprocessor [passim] [command=\Passim]

\starttext

xxx\index{First}

yyy\index[passim->]{Second}

zzz\seeindex{Third}{Second}

\placeindex

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

2020-09-04 Thread Henning Hraban Ramm


> 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".


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.


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] \setupuserpagenumber not working as expected

2020-09-04 Thread Wolfgang Schuster

Jan Willem Flamma schrieb am 03.09.2020 um 10:29:

Dear Julian,

I use something similar using a main product file, an environment file 
that contain the styling and several components that build up the 
frontmatter, the manual and the appendices.


Below my setup where I start the roman numbering on the table of 
contents page (page 5 or v in roman)


Once the bodymatter starts the pagenumber is set  to the arabic 1 (see 
below in the main product file)


You should be able to copy and adapt to your needs.


There are lot of things which can be improved in your example.

1. Pass the filename of the component/product to \startcomponent and not 
some dummy name (or just use *), this allows you to print the filename 
with \currentcomponent or \currentproduct


2. Use \setvariables or \setupdocument to set the document title, 
revision etc.


3. Use \startsectionblockenvironment to move setups from the document 
content into the environment file.


4. Use pagestate=start to increase the page counter with 
\startstandardmakeup.


5. Set search path for figures (\copypages use the figure mechanism) 
with \setupexternalfigure[location=...].


Below is a modified (but untested) version of your sample document.

Wolfgang


 begin product
\startproduct product

\environment env-WA

% \setvariables
%   [document]
%   [ manual={Course Manual},
%  title={Title},
%subtitleone={Subtitle 1},
%subtitletwo={Subtitle 2},
%  revnumber={Revision number}]

\setupdocument
  [ manual={Course Manual},
 title={Title},
   subtitleone={Subtitle 1},
   subtitletwo={Subtitle 2},
 revnumber={Revision number}]

\startfrontmatter

  \component fm-frontpage
  \component fm-titlepage
  \component fm-tableofcontents

\stopfrontmatter

\startbodymatter

  \component co-01
  \component co-02

\stopbodymatter

\startappendices

  \component co-ap-01
  \component co-ap-02

\stopappendices

\startbackmatter

  \copypages[app1.pdf][n=4]

\stopbackmatter

\stopproduct
 end product

 begin environment
\startenvironment env-WA

\setuppagenumbering
  [alternative=doublesided, 

   location=right] 



\defineconversionset
  [frontpart:pagenumber] [] [romannumerals]

\setupexternalfigures
  [directory={External PDF}]

\startsectionblockenvironment [frontpart]

  \setupbackgrounds
[leftpage]
[setups=pagenumber:left]

  \setupbackgrounds
[rightpage]
[setups=pagenumber:right]

\stopsectionblockenvironment

\startsectionblockenvironment [bodypart]

  \setupbackgrounds
[leftpage]
[setups=pagenumber:left]

  \setupbackgrounds
[rightpage]
[setups=pagenumber:right]

  \setuppagenumber
[number=1]

\stopsectionblockenvironment

\startsectionblockenvironment [appendix]

  \setupbackgrounds
[leftpage]
[setups=pagenumber:left]

  \setupbackgrounds
[rightpage]
[setups=pagenumber:right]

\stopsectionblockenvironment

\startsectionblockenvironment [backpart]

  \setuppagenumber[state=stop]

\stopsectionblockenvironment

\stopenvironment
 end environment

 begin component
\startcomponent fm-frontpage

\product product

\startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue]

% \dontleavehmode\externalfigure[frontpage-logo.png][width=12cm]

\framed
  [height=5cm,width=broad,frame=off]
  {\externalfigure[frontpage-logo.png][width=12cm]}

\blank[6*big]

{\bfc \documentvariable{manual}}

\blank[4*big]

{\tfc \documentvariable{title}}

\blank[2*big]

{\tfc \documentvariable{subtitleone}}

\blank[2*big]

{\tfc \documentvariable{subtitletwo}}

\stopstandardmakeup

\stopcomponent
 end component

 begin component
\startcomponent fm-titlepage

\product product

\startstandardmakeup [top=,pagestate=start,align=middle,color=Modu_Blue]

{\tfb \documentvariable{manual}}

\blank[2*big]

{\tfb \documentvariable{title}}

\blank[2*big]

{\tfb \documentvariable{subtitleone}}

\blank[2*big]

{\tfb \documentvariable{subtitletwo}}

\blank[10*big]

{\tfb \documentvariable{revnumber}}

\blank

{\tfb \currentdate[month,year]}

\blank[10*big]

{\tfb Written by:}

\blank

{\tfb Company name}

\blank

{\tfb City, Country}

\stopstandardmakeup

\stopcomponent
 end component

 begin component
\startcomponent fm-tableofcontents

\product product

\starttitle [title=Table of Contents]

\placecontent

\stoptitle

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Problems with tikz plot file

2020-09-04 Thread Hans Hagen

On 9/4/2020 8:32 AM, Christian Prim wrote:

Hi everyone

Following MWE produces an error on newest lmtx (current version: 
2020.09.03 20:03):


\usemodule[tikz]
\starttext
\placefigure[here][]{}{\hbox{\starttikzpicture
    \draw plot file {data.table};
\stoptikzpicture}}
\stoptext

with data.table:

150 -0.102
150.1 -0.15
150.2 -0.389
150.3 -0.15
150.4 -0.389
150.5 -0.15
150.6 -0.293
150.7 -0.341
150.8 -0.485
150.9 -0.293

(data.table could be any x-y-pair)

The error says:
tex error on line 5 in file ./plot.tex: Argument of \pgf@parsexyline has 
an extra }


It doesn't seem to be directly related to 
https://unix.stackexchange.com/questions/10267/how-to-find-unmatched-brackets-in-a-text-file as 
I have tested to convert data.table to dos-Format with unix2dos. No success.


I'm working on linux (debian).

What am I missing? Or is this a bug?

seems that i need to append a space to the lines read in .. i'll fix it

Hans


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

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


Re: [NTG-context] author in ToC and other design complications

2020-09-04 Thread Henning Hraban Ramm


> Am 04.09.2020 um 06:44 schrieb jbf :
> 
> 
> Of course, I would prefer it to say 'Chapter One' not just 'One', so that is 
> a minor problem I still have to resolve. But in fact, the publisher wants 
> something quite different and I really do not know how to go about it. I did 
> look at 'Author in ToC' in the wiki, but that referred me to a somewhat 
> complicated Proceedings style, and given that my Chapters are all set up 
> anyway, I just couldn't follow that. Am hoping there is some other way I can 
> achieve the design that follows:
> 
> ForewordAuthor's nameiii
> 
> Chapter One   Chapter title
> 
> Author's name   1
> 
> Chapter Two1820-1880
> 
> Chapter title
> 
> Author's name   10

I just replaced the according section 
https://wiki.contextgarden.net/Table_of_Contents#Author_in_ToC for you.

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] \setupuserpagenumber not working as expected

2020-09-04 Thread Jan Willem Flamma
Credits to Pragma who helped me to set this up a few years ago. From: jbfSent: Friday, 4 September 2020 00:20To: Jan Willem FlammaCc: ntg >> mailing list for ConTeXt usersSubject: Re: [NTG-context] \setupuserpagenumber not working as expected Thanks Jan, that is an extensive bit of work below! Might take me a while to digest, but I'll explore it carefully.JulianOn 3/9/20 6:29 pm, Jan Willem Flamma wrote:Dear Julian, I use something similar using a main product file, an environment file that contain the styling and several components that build up the frontmatter, the manual and the appendices.  Below my setup where I start the roman numbering on the table of contents page (page 5 or v in roman) Once the bodymatter starts the pagenumber is set  to the arabic 1 (see below in the main product file) You should be able to copy and adapt to your needs. Kind regards,Jan Willem Flamma   The main product file==\environment env-WA \startproduct currentproduct % Document definitions\define\MyManual{Course Manual}\define\MyTitle{Title}\define\MySubtitleOne{Subtitle 1}\define\MySubtitleTwo{Subtitle 2}\define\MyRevnumber{Revision number} % Load frontmatter files\startfrontmatter    \component fm-frontpage    \component fm-titlepage    \component fm-tableofcontents\stopfrontmatter % Load bodymatter file\startbodymatter\setupbackgrounds    [leftpage]    [setups=pagenumber:left]\setupbackgrounds    [rightpage]    [setups=pagenumber:right]\setuppagenumber[number=1]    \component co-01    \component co-02\stopbodymatter % Load backmatter files\startbackmatter\setupbackgrounds   [leftpage]   [setups=pagenumber:left]\setupbackgrounds   [rightpage]   [setups=pagenumber:right]\startappendices   \component co-ap-01   \component co-ap-02\stopappendices\stopbackmatter % Load external PDF documents\setuppagenumber[state=stop]\copypages[External PDF/app1.pdf][n=4] \stopproduct=   The env-WA.tex file (below is about pagenumbering only)=% Start chapter on right (odd) page, pagenumber = bottom right\setuppagenumbering    [alternative=doublesided,  location=right]    % Pagenumbering style\definestructureconversionset    [frontpart:pagenumber][][romannumerals]\definestructureconversionset    [bodypart:pagenumber] [][numbers]\definestructureconversionset    [appendix:pagenumber] [][numbers]=   The fm-frontpage.tex file\startcomponent currentcomponent \product product % Front page layout\startstandardmakeup % Place logo centered on page\framed[height=5cm,width=broad,frame=off]{\externalfigure[frontpage-logo.png][width=12cm]} % Place course titles\blank[6*big]\color[Modu_Blue]{\midaligned{\bfc \MyManual}} \blank[4*big]\color[Modu_Blue]{\midaligned{\tfc \MyTitle}} \blank[2*big]\color[Modu_Blue]{\midaligned{\tfc \MySubtitleOne}} \blank[2*big]\color[Modu_Blue]{\midaligned{\tfc \MySubtitleTwo}} \vfill \stopstandardmakeup \stopcomponent   The fm-titlepage.tex file\startcomponent currentcomponent \product product \startstandardmakeup \color[Modu_Blue]{\midaligned{\tfb \MyManual}}    \blank[2*big]    \color[Modu_Blue]{\midaligned{\tfb \MyTitle}}    \blank[2*big]    \color[Modu_Blue]{\midaligned{\tfb \MySubtitleOne}}    \blank[2*big]    \color[Modu_Blue]{\midaligned{\tfb \MySubtitleTwo}} \blank[10*big] \color[Modu_Blue]{\midaligned{\tfb \MyRevnumber}}    \blank    \midaligned{\color[Modu_Blue]{\tfb \currentdate[month,year]}} \blank[10*big] \midaligned{\color[Modu_Blue]{\tfb Written by:}}    \blank    \midaligned{\color[Modu_Blue]{\tfb Company name}}    \blank    \midaligned{\color[Modu_Blue]{\tfb City, Country}} \vfill \stopstandardmakeup \stopcomponent The fm-tableofcontents.tex file\startcomponent currentcomponent \product product \setupbackgrounds   [leftpage]   [setups=pagenumber:left]\setupbackgrounds   [rightpage]   [setups=pagenumber:right] % This is where I want the roman numbering to start\setuppagenumber[number=5] \starttitle[title=Table of Contents]\placecontent\stoptitle \stopcomponent  From: jbfSent: Thursday, 3 September 2020 06:05To: mailing list for ConTeXt usersSubject: [NTG-context] \setupuserpagenumber not working as expected Am seeking to have frontmatter pages in roman numerals and from Chapter 1 onwards in arabic numerals. I have achieved something of the kind, but page 1 (arabic) is appearing on the last page of the frontmatter and not the first page of Chapter 1. I do not know why this is happening. My setup for page numbering is as follows (something I found somewhere - wiki? elsewhere? Not sure. I didn't make it up!):\definestructureconversionset[frontpart:pagenumber][][romannumerals]\definestructureconversionset[bodypart:pagenumber] 

[NTG-context] Problems with tikz plot file

2020-09-04 Thread Christian Prim
Hi everyone

Following MWE produces an error on newest lmtx (current version: 2020.09.03
20:03):

\usemodule[tikz]
\starttext
\placefigure[here][]{}{\hbox{\starttikzpicture
   \draw plot file {data.table};
\stoptikzpicture}}
\stoptext

with data.table:

150 -0.102
150.1 -0.15
150.2 -0.389
150.3 -0.15
150.4 -0.389
150.5 -0.15
150.6 -0.293
150.7 -0.341
150.8 -0.485
150.9 -0.293

(data.table could be any x-y-pair)

The error says:
tex error on line 5 in file ./plot.tex: Argument of \pgf@parsexyline has an
extra }

It doesn't seem to be directly related to
https://unix.stackexchange.com/questions/10267/how-to-find-unmatched-brackets-in-a-text-file
as
I have tested to convert data.table to dos-Format with unix2dos. No success.

I'm working on linux (debian).

What am I missing? Or is this a bug?

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

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