Re: [NTG-context] structureuservariable in ToC

2018-01-23 Thread Henning Hraban Ramm
Am 2018-01-23 um 21:24 schrieb Wolfgang Schuster :

>> Henning Hraban Ramm 14. Januar 2018 um 21:44
>> Now, my second issue with user variables:
>> 
>> """
>> \define[1]\ChapterTocEntry{%
>> \doifnotempty{\structureuservariable{author}}{\structureuservariable{author}\crlf
>>  }%
>> #1%
>> \doifnotempty{\structureuservariable{subtitle}}{\crlf\structureuservariable{subtitle}}}
> To access the variables in a list you have to use the 
> \structurelistuservariable command.

Thank you, now I have:

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

But author/subtitle still don’t show up in the ToC.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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] Fwd: Correct usage of \placebookmarks

2018-01-23 Thread Lars

Bumb



 Weitergeleitete Nachricht 
Betreff:Correct usage of \placebookmarks
Datum:  Thu, 18 Jan 2018 21:03:41 +0100
Von:Lars 
An: ntg-context@ntg.nl



Hello there,

I've stumbled upon a behaviour in CTX that I don't fully understand. My 
goal is to create a multipage document *without* heads (title, chapter, 
etc) but only text. Yet I would like to create bookmarks. So my MWE 
looks the following:


\setupinteraction[state=start]
\setupinteractionscreen[option=bookmark]
\definelist[Marks]
\placebookmarks[Marks][Marks][force=yes]

\starttext

  \bookmark[Marks]{Bookmark one}
  \input tufte

  \page

  \bookmark[Marks]{Bookmark two}
  \input knuth

\stoptext

Yet CTX doesn't create bookmarks in that case. I first have to add a 
blank predefined header like chapter or section anywhere in the text:


\setupinteraction[state=start]
\setupinteractionscreen[option=bookmark]
\definelist[Marks]
\placebookmarks[Marks][Marks][force=yes]

\starttext

  \bookmark[Marks]{Bookmark one}
  \input tufte

  \page

  \bookmark[Marks]{Bookmark two}
  \input knuth

  \startchapter[title={},marking={}]
  \stopchapter

\stoptext

Although I haven't added chapter key to \placebookmarks, so that it also 
doesn't show up in the bookmarks window, only then CTX seems to create 
bookmarks for the list which I created called Marks.


Is there a way to circumvent this? I'd like boomarks only where I place 
them manually, without using headers.


Thanks in advance, Lars.

___
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] Error at \stoplines

2018-01-23 Thread Aditya Mahajan

On Tue, 23 Jan 2018, Henning Hraban Ramm wrote:


Am 2018-01-23 um 10:29 schrieb r.erm...@hccnet.nl:

in my current project, every time I use \startlines .. \stoplines (for poems), 
I run into this error:
structure   > sectioning > chapter @ level 2 : 5.2 -> Example
tex error   > tex error on line 27 in file ka34/c_example.tex: ! Extra }, 
or forgotten \endgroup

1. count the number of \startlines, do this with grep -e '^\\startlines' | wc | 
less
2. count the number of \stoplines, do this with grep -e ‘^\\stoplines' | wc | 
less

But you probably already thought of this yourself.


That’s not the problem, there are only a few "lines" sections, and of course I 
checked these first.
I also checked all(?) other \start/stops, braces and brackets - of course I 
could have overlooked some, it’s a whole book, but most cases are caught on 
their own.

I guess it might be something in my setups, but not in \setuplines, but don’t 
know for what I should look, there’s too much...

Which other setups affect \start/stoplines?


The error could be due to some other mismatched group. Have you tried:

mtxrun --script concheck filename.tex

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

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

[NTG-context] chapter setup with subtitle in margin

2018-01-23 Thread Henning Hraban Ramm
Hi again,

I have this nice/complicated chapter setup (see attachments):



Chapter titleChapter subtitle
can have several lines   in margin
 smaller font



Three problems I cannot get rid of:

- There’s always an indent in front of the title (red box); it should not.
- The subtitle should start on the same line as the main title.
- The subtitle should have an appropriate line spacing.

Please, I’m running out of time...

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



marginsubtitle.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] notes in the margin

2018-01-23 Thread Henning Hraban Ramm
These issues are still open, I attached my current test file.

1)
There’s always space/indent in front of the note text, I’d like to get rid of 
that.
Notes should look like:

texttext text
texttext12 text   12
text texttext Some remarks

But at the moment they’re like:

texttext text
texttext12 text   12
text texttext __Some remarks


2)
If there is a possibility to influence the page breaking algorithm for notes, 
I’d like to know about that.
Stacking works nicely most of the time, but I have a few pages where the notes 
don’t fit.
The only option I know of is \adaptlayout to move lines of the main text. 
Something similar for note lines would be nice.

Another possibility would be to have some (very long) notes as footnotes 
instead of margin notes.
Is it possible to switch placement but keep the numbering? Maybe via different 
note setups and manually setting the counter?


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

Am 2017-10-24 um 09:54 schrieb Henning Hraban Ramm :

> Am 2017-04-09 um 21:46 schrieb Wolfgang Schuster 
> :
> 
>>> Henning Hraban Ramm 30. März 2017 um 10:30
>>> While I’m still waiting for answers to my other questions, I got some more:
>>> 
>>> In my layout, left margin width is zero, but \inmargin always uses left 
>>> margin.
>>> I didn’t find a setup to change that – should 
>>> \setupmargindata[location=right] do the trick? (it doesn’t, also not with 
>>> left)
>>> 
>>> Further I’d like to place "foot"notes into the margin.
>>> It works like this:
>>> 
>>> \setupnote[footnote][location=none]
>>> \setupnotation[footnote][
>>> align=flushleft,
>>> location=serried,
>>> width=broad,
>>> ]
>>> \setuptexttexts[margin][]
>>> [{\framed[%
>>> align=right,
>>> frame=off,
>>> height=\textheight,
>>> width=\rightmarginwidth 
>>> ]{\placenotes[footnote]}}]
>>> 
>>> But I’d like the notes to start in the line of the marker, if there’s space.
>>> How can I achieve that?
>> The only way I found to achieve this is by flushing the notes at the end of 
>> each footnote
>> entry which can be done with the next key. The positioning of each margin 
>> text is tricky
>> because \placenotes adds skips at the begin of the block (which can be 
>> reduced with
>> \placelocalnotes) but a inline version of the command (e.g. 
>> \placeinlinenotes) which
>> flushes the notes without vertical skips and a rule at the begin would help.
>> 
>> \define\PlaceFootnote
>>  {\inrightmargin{\vtop{\placelocalnotes[footnote][before=,after=]}}}
>> 
>> \setupnote
>>  [footnote]
>>  [location=text,
>>   bodyfont=,
>>   next=\PlaceFootnote]
>> 
>> \setupnotation
>>  [footnote]
>>  [alternative=serried]
>> 
>> \setuplayout
>>  [width=12cm,
>>   rightmargindistance=0.5cm,
>>   rightmargin=5cm]
>> 
>> \starttext
>> \dorecurse{6}{\input ward\expanded{\footnote{This is a footnote 
>> \recurselevel}} }
>> \stoptext
> 
> Oh, seems like I didn’t answer to that, sorry.
> 
> Thank you very much, this solves my problem for the most part.
> 
> Coming back to this now, since I completed my previous book project (with the 
> register issues) and attacking the next one (that needs those numbered 
> marginal notes).
> 
> It would be nice if we had a solution how those notes won’t collide; is there 
> some trick how I can shift a note up or down manually?
> 
> Additionally, since my note number gets its own line, I’d like to get rid of 
> the indenting, but couldn’t find the right parameter.
> This setup adds to Wolfgang’s:
> 
> \def\FNo#1{#1\crlf}
> 
> \setupnotation
>  [footnote]
>  [alternative=serried,
>  width=broad,
>  align=flushleft,
>  numbercommand=\FNo]
> 
> 
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> GPG Key ID 1C9B22FD



sidenotetest.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] structureuservariable in ToC

2018-01-23 Thread Wolfgang Schuster



Henning Hraban Ramm 
14. Januar 2018 um 21:44
Now, my second issue with user variables:

"""
\define[1]\ChapterTocEntry{%
\doifnotempty{\structureuservariable{author}}{\structureuservariable{author}\crlf 
}%

#1%
\doifnotempty{\structureuservariable{subtitle}}{\crlf\structureuservariable{subtitle}}}
To access the variables in a list you have to use the 
\structurelistuservariable command.


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] structureuservariable in ToC

2018-01-23 Thread Henning Hraban Ramm
Some hint on that would be nice.
Is it maybe related to the "Registers and getparameters" problem?
I tried a few things WRT expansion, but it seems like I didn’t find the right 
command in the right place.

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

Am 2018-01-14 um 21:44 schrieb Henning Hraban Ramm :

> Now, my second issue with user variables:
> 
> """
> \define[1]\ChapterTocEntry{%
>  
> \doifnotempty{\structureuservariable{author}}{\structureuservariable{author}\crlf
>  }%
>  #1%
>  
> \doifnotempty{\structureuservariable{subtitle}}{\crlf\structureuservariable{subtitle}}}
> 
> \setuplist[chapter][textcommand=\ChapterTocEntry]
> 
> \starttext
> \completelist[chapter][criterium=all]
> 
> \startchapter[
>  title={The Use of Typefaces}][%
>  author={Hermann Zapf},
>  subtitle={Ein zapfiges Zitat}]
> 
> \input zapf
> 
> \stopchapter
> 
> \startchapter[
>  title={Sheep and Goats}][%
>  author={Siegfried Tufte},
>  subtitle={Tofte Tufte-Zitat}]
> 
> \input tufte
> 
> \stopchapter
> 
> \stoptext
> """
> 
> I’m trying to get author and subtitle into the ToC (while in the content, 
> subtitle goes to the margin and author to the end of the chapter).
> But in this example, both are empty (but not empty enough for doifnotempty), 
> while in my actual project I always get author and subtitle from the first 
> chapter.
> I guess this is an expansion problem?
> 
> 
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> 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] Error at \stoplines

2018-01-23 Thread Henning Hraban Ramm
Am 2018-01-23 um 10:29 schrieb r.erm...@hccnet.nl:
>> in my current project, every time I use \startlines .. \stoplines (for 
>> poems), I run into this error:
>> structure   > sectioning > chapter @ level 2 : 5.2 -> Example
>> tex error   > tex error on line 27 in file ka34/c_example.tex: ! Extra 
>> }, or forgotten \endgroup
> 1. count the number of \startlines, do this with grep -e '^\\startlines' | wc 
> | less
> 2. count the number of \stoplines, do this with grep -e ‘^\\stoplines' | wc | 
> less
> 
> But you probably already thought of this yourself.

That’s not the problem, there are only a few "lines" sections, and of course I 
checked these first.
I also checked all(?) other \start/stops, braces and brackets - of course I 
could have overlooked some, it’s a whole book, but most cases are caught on 
their own.

I guess it might be something in my setups, but not in \setuplines, but don’t 
know for what I should look, there’s too much...

Which other setups affect \start/stoplines?


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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] Registers and getparameters

2018-01-23 Thread Otared Kavian
On 23 Jan 2018, at 10:19, Hans Hagen  wrote:
> 
> On 1/22/2018 8:26 PM, Wolfgang Schuster wrote:
>>> […]
>> You have to add \expanded, i.e. \expanded{\speakers{...}}.
> 
> or maybe try the 'expanded' option
> 
> \setupregister
>  [speakers]
>  [style=sansbold,
>   n=2,
>   expansion=yes]

Hi Hans,

Thanks for your input (which I added to the wiki), but even though it works 
fine as expected in the example code sent by Wolfgang, it does not work 
properly on the longer document I have, for some reason unknown to me…

Best regards: OK
___
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] Error at \stoplines

2018-01-23 Thread r . ermers
Hi Hraban,

try:

1. count the number of \startlines, do this with grep -e '^\\startlines' | wc | 
less
2. count the number of \stoplines, do this with grep -e ‘^\\stoplines' | wc | 
less

The resulting counts obviously have to be the same.

If they are not, you can (again with grep -e) extract all  \startlines | 
\stoplines and determine after which occurrence (the nth) there is a sequence 
of two (or more) \startlines or \stoplines. At this point your file is 
corrupted.

But you probably already thought of this yourself.

Robert


> Op 23 jan. 2018, om 10:11 heeft Henning Hraban Ramm  het 
> volgende geschreven:
> 
> Hi,
> in my current project, every time I use \startlines .. \stoplines (for 
> poems), I run into this error:
> 
> """
> structure   > sectioning > chapter @ level 2 : 5.2 -> Example
> 
> tex error   > tex error on line 27 in file ka34/c_example.tex: ! Extra }, 
> or forgotten \endgroup
> 
>  \egroup 
> 
> l.27 \stoplines
> 
> ...
> 24 Fragen nicht danach, greifen weise zum Wein,
> 25 der löst uns die Zunge mit Salomo, wir wissen von ihm,
> 26 was besser tut.
> 27 >>  \stoplines
> 28 \stopparagraph
> """
> 
> The error must be somewhere in my project, I couldn’t come up with a minimal 
> example to reproduce the problem.
> But if I comment all \start/stoplines (or the components containing them), it 
> runs through.
> 
> Do you have an idea where I should look?
> 
> 
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> GPG Key ID 1C9B22FD
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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

Re: [NTG-context] Registers and getparameters

2018-01-23 Thread Hans Hagen

On 1/22/2018 8:26 PM, Wolfgang Schuster wrote:



Otared Kavian 
22. Januar 2018 um 19:53
Hi all,

I have a list of speakers (and abstracts of their talk) in a rather 
long document, and the name of each speaker is written to a register 
named speakers.
Then with the command \getparameters[Talk] I get the name of each 
speaker and try to write it to the register with


\speakers{\TalkSpeakerName}


You have to add \expanded, i.e. \expanded{\speakers{...}}.


or maybe try the 'expanded' option

\setupregister
  [speakers]
  [style=sansbold,
   n=2,
   expansion=yes]


Indeed this does not work to obtain the result I am looking for: the 
sorting is indeed under the letter « t », and most importantly the 
register gets only the last name in the list instead of getting each 
speaker name.


The following is a (not so minimal…) example. Can anyone help me in 
this matter?


When you replace \getparameters with \setvariables you can set a command
which is applied each time when you set new values.


\defineregister[speakers]

\setupregister
   [speakers]
   [style=sansbold,
    n=2]

\startbuffer[pagetalk]
   \doflushatpar
     {\expanded{\speakers{\getvariable{talk}{speakername}}}%
  \expanded{\pagereference[talk:\getvariable{talk}{speakername}]}}%
   \starttabulate[|f{\bi}l|p|]
   \NC Speaker \EQ \getvariable{talk}{speakername} \NC\NR
   \NC Title   \EQ \getvariable{talk}{title}   \NC\NR
   \NC Time    \EQ \getvariable{talk}{time}    \NC\NR
   \NC Room    \EQ \getvariable{talk}{room}    \NC\NR
   \HL
   \stoptabulate
\stopbuffer

\setvariable{talk}{set}{\getbuffer[pagetalk]}

\showframe[text][text]

\starttext

\setvariables
   [talk]
   [speakername={Gauss},
    title={Remarks on Number Theory},
    time={10:30},
    room={A}]

The talk about Gauss was on \at{page}[talk:Gauss].

\completeregister[speakers]

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




--

-
  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] Error at \stoplines

2018-01-23 Thread Henning Hraban Ramm
Hi,
in my current project, every time I use \startlines .. \stoplines (for poems), 
I run into this error:

"""
structure   > sectioning > chapter @ level 2 : 5.2 -> Example

tex error   > tex error on line 27 in file ka34/c_example.tex: ! Extra }, 
or forgotten \endgroup

 \egroup 

l.27 \stoplines
 
...
24 Fragen nicht danach, greifen weise zum Wein,
25 der löst uns die Zunge mit Salomo, wir wissen von ihm,
26 was besser tut.
27 >>  \stoplines
28 \stopparagraph
"""

The error must be somewhere in my project, I couldn’t come up with a minimal 
example to reproduce the problem.
But if I comment all \start/stoplines (or the components containing them), it 
runs through.

Do you have an idea where I should look?


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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
___