Re: [NTG-context] no frontmatter head on recto page

2020-09-30 Thread jbf
No, Taco, that is not resolving the problem. I added your suggestion 
(header=start) to what I already had for \setuphead for 'foreword':


\setuphead
  [foreword]
  [frontpartlabel=foreword,
   conversion=empty,
   header=start]

but it makes no difference.

I am already aware that chapter, on which my foreword definition is 
based, by default does not give a header on the first page. It is 
subsequent recto pages that are the problem. So, for example, the 
Foreword (which starts on a recto page) has three pages. The first, 
correctly, has no header. The second carries the book title header 
(called in by [{\hfill\documentvariable{metadata:title}\hfill}][] I 
presume). But the third and final page does not have the header 
'Foreword' which my publisher wants. The same is happening with other 
frontmatter items (and indeed, appendices too) I have defined, but if I 
solve the Foreword problem, I will know how to solve those too.


When I had this problem with another book I was working on, having 'yes' 
in \setupsectionblock[frontpart][page=yes] seemed to solve the problem, 
but I didn't understand why it did! And it does not work in this 
instance. It may be that something else in my preamble is missing 
something or indeed preventing something! Any other thoughts on this?


I could, offlist, send you my entire preamble (too long for the list I 
think) just in case something else is causing the problem that I am 
unaware of, but maybe you or someone else can still identify just what 
it is that might stopping the 'Foreword' recto header from appearing in 
this case.


Julian


On 30/9/20 9:44 pm, Taco Hoekwater wrote:



On 30 Sep 2020, at 11:46, jbf  wrote:

For some reason that I cannot work out, the recto page header is not appearing 
in frontmatter sections like Foreword. It is important to note that for this 
item I am using:

\definehead
   [foreword] [chapter]…

‘chapter' suppresses the header by default on the first page.

at a guess:

   \setuphead[foreword][header=start]

Best wishes,
Taco

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

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

___
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] no frontmatter head on recto page

2020-09-30 Thread jbf
For some reason that I cannot work out, the recto page header is not 
appearing in frontmatter sections like Foreword. It is important to note 
that for this item I am using:


\definehead
  [foreword] [chapter]...

\setuphead
  [foreword]
  [frontpartlabel=foreword,
   conversion=empty]

Then starting this section in the main body with 
\startforeword...\stopforeword.


As 'foreword' is based on chapter, I thought it would all work correctly 
given that I already have:


 [{\hfill\getmarking[chapter]\hfill}][]
  [{\hfill\documentvariable{metadata:title}\hfill}][]

And I also have:

\setupsectionblock[frontpart][page=yes] in case that is important as well.

I am getting the verso page header (the book's title, obviously coming 
from the \documentvariable{metadata:title}), but not the recto header 
(in this case 'Foreword'). What am I doing wrong?


I tried two solutions to solve the problem, neither worked:

1. In \setuphead I thought perhaps I might need to add placehead=yes, 
but that did nothing.


2. I also tried  [{\hfill\getmarking[chapter, foreword]\hfill}][] in 
case I needed to add in 'foreword', having defined it as a head. That 
did nothing either. Any clues as to what I am missing?


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
___


[NTG-context] correct vertical alignment in ToC

2020-09-29 Thread jbf
A quick look at the attached pdf extract from my current Table of 
Contents will demonstrate the problem. I need authors names, chapter 
titles and/or date range to line up correctly underneath each other, but 
because of the definitions I am working with (see below how the current 
result has been acheived) I do not know how to get these precise margin 
(I presume?) distances.


So, for example, the author for the Preface needs to line up directly 
under the author for the Foreword. And the title for Chapters One/Two 
and the date range for Chapter Three likewise. The 'Context' item is a 
\section and I have got that more or less to line up by using an \hspace 
definition, but I know that using two very different definitions is 
likely to cause problems. (Alternatively, they could all line up under 
the title for Chapter One, so a bit further in. What *has to happen* is 
that they all line up accurately under each other, whichever solution I 
use).


My real problem  is that I do not know how get these specific distances 
from the left-hand side using the definitions I have. If I knew how to 
get, say, 3cm in from the margin for Chapter authors/titles/date ranges 
(given the definition below) and section authors (given its definition 
below), I could solve this problem, but everything I have tried does not 
seem to work. Wolfgang had given me the ChapterListCommand definition, 
and I think Hraban the SectionTocentry:


(1) CHAPTERLISTCOMMAND

\define[3]\ChapterListCommand
  {\hbox\bgroup
 \hbox to 2.5cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-2.5cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{author}}
 {\crlf{\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

Is there somewhere in here that I can specify my distances other than 
the \hbox 2.5cm? Note that I obviously also have (e.g. for the Preface, 
but I have others for Foreword, etc.):


\setuplist
  [preface]
  [label=preface,
   alternative=command,
   command=\ChapterListCommand]

(2) SECTIONTOCENTRY

 \definehspace[twoem][2.5 em]

   \define[1]\SectionTocEntry{%
  #1\hspace[twoem]% title
  \structurelistuservariable{author}%
}

\setuplist[section][
  textcommand=\SectionTocEntry,
  margin=.5cm]

The [twoem] definition (in fact it is 2.5 em) was how I got the 
'Context' author to roughly line up under the other items, but I have 
noticed that in some repetitions of this section, they do not line up 
exactly even so.


Hope somebody can help - in the end I suppose I can open it in a PDF 
editing program and shift items under each other, but I want to achieve 
the correct result using ConTeXt, understandably.


Julian



toc.pdf
Description: Adobe PDF document
___
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] Full page image and caption in another page?

2020-09-23 Thread Taco Hoekwater
Hi,

This sounds quite complicated, really. 

I am not at all sure how this page rotation should work but I assume you plan a 
pdf-only document then?  Otherwise, I would expect rotating the figure instead 
of the whole page. Also, rotating the paper does not rotate the layout, at 
least not if you use a fixed height and width. You would need something like 
this for auto-resizing \textheight and \textwidth:

\definelayout[default][topspace=0.6cm, topdistance=0cm, header=1cm, 
headerdistance=0cm,
   height=fit, footer=0cm,
   backspace=4.2cm, width=fit]

Another problem is that setting the width and height of a float does not affect 
any externafigure side. You need to do a \setupexternalfigure for that.

And there is (afaik) no support for having a “two-page” float. The “opposite” 
key is used to put the float (including caption) on the opposite side of the 
current page.

But at least there is a command to typeset a caption standalone, so perhaps 
that will help? You would then *not* use the \startplacebigfigure, but place 
the caption and the image manually:

\page
\placefloatcaption[bigfigure][title={A cow}]
\page
\externalfigure[cow]
\page

Best wishes,
Taco


> On 22 Sep 2020, at 19:42, José de Mattos Neto  wrote:
> 
> Hi, it's my first message on this list.
> I've searched in ConTeXt manuals, TeX.SX and here, but couldn't find a way to 
> achieve these 4 requirements altogether:
> 
>   • Place a figure as full-page figure
>   • Change orientation accordingly (if it's a landscape PDF, for instance)
>   • Make that using \setupfloat (or other setup), not directly in 
> \placefloat
>   • Place captions in another page (ideally on opposite page)
> Problems:
>   • I can't get # 1 and # 3 at same time
>   • \setupfloat doesn't have before option, which I could use to change 
> orientation
>   • I have no idea how to accomplish # 4
> A minimal working example (PDF in attachment):
> 
> %%%
> \definepapersize[default][A4, portrait]
> \definelayout[default][topspace=0.6cm, topdistance=0cm, header=1cm, 
> headerdistance=0cm,
>height=27.3cm, footer=0cm,
>backspace=4.2cm, width=13.6cm]
> \setuppapersize[default]
> \setuplayout[default]
> \setuppagenumbering[alternative=doublesided, location={header}]
> \setupexternalfigures[location={default}]
> 
> \definepapersize[rotate][A4, landscape]
> \definefloat[bigfigure][bigfigures][figure]
> \setupfloat[bigfigure][default={page},
>width=1\textwidth, height=1\textheight,
>before={\setuppapersize[rotate]}] % there's no before 
> in setupfloat
> \setupcaption[bigfigure][location={opposite}] % there's no opposite location 
> in setupcaption
> 
> \starttext
> \showframe
> \dorecurse{2}{\input{knuth}}
> 
> \setuppapersize[rotate] % this doesn't work because is in same page
> \startplacebigfigure[title={A cow}]{\externalfigure[cow]}\stopplacebigfigure
> \setuppapersize[default]
> 
> \dorecurse{2}{\input{knuth}}
> \stoptext
> %%%
> 
> Thanks in advance!
> José Neto
> ___
> 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
___


[NTG-context] Full page image and caption in another page?

2020-09-22 Thread José de Mattos Neto
Hi, it's my first message on this list.

I've searched in ConTeXt manuals, TeX.SX and here, but couldn't find a way
to achieve these 4 requirements altogether:

   1. Place a figure as full-page figure
   2. Change orientation accordingly (if it's a landscape PDF, for instance)
   3. Make that using \setupfloat (or other setup), not directly in
   \placefloat
   4. Place captions in another page (ideally on opposite page)

Problems:

   - I can't get # 1 and # 3 at same time
   - \setupfloat doesn't have before option, which I could use to change
   orientation
   - I have no idea how to accomplish # 4

A minimal working example (PDF in attachment):

%%%
\definepapersize[default][A4, portrait]
\definelayout[default][topspace=0.6cm, topdistance=0cm, header=1cm,
headerdistance=0cm,
   height=27.3cm, footer=0cm,
   backspace=4.2cm, width=13.6cm]
\setuppapersize[default]
\setuplayout[default]
\setuppagenumbering[alternative=doublesided, location={header}]
\setupexternalfigures[location={default}]

\definepapersize[rotate][A4, landscape]
\definefloat[bigfigure][bigfigures][figure]
\setupfloat[bigfigure][default={page},
   width=1\textwidth, height=1\textheight,
   before={\setuppapersize[rotate]}] % there's no
before in setupfloat
\setupcaption[bigfigure][location={opposite}] % there's no opposite
location in setupcaption

\starttext
\showframe
\dorecurse{2}{\input{knuth}}

\setuppapersize[rotate] % this doesn't work because is in same page
\startplacebigfigure[title={A cow}]{\externalfigure[cow]}\stopplacebigfigure
\setuppapersize[default]

\dorecurse{2}{\input{knuth}}
\stoptext
%%%

Thanks in advance!
José Neto


mwe.pdf
Description: Adobe PDF document
___
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] footnotes in captions in floatcombinations

2020-09-20 Thread Henning Hraban Ramm


> Am 20.09.2020 um 13:59 schrieb Henning Hraban Ramm :
>>>> In MkIV I get images and footnotes, but the width of the footnotes is 
>>>> always that of the image.
>>>> 
>>>> In LMTX I don’t get anything.
>>> Current state (v. 2020.09.18 20:32):
>>> Some progress: Footnotes are still as wide as the image they belong to (in 
>>> both versions), but in LMTX some footnotes are missing.
>> mwe missing
> 
> Regarding the width it’s still the same MWE (slightly adapted), apparently 
> not related to floatcombinations but a general problem of footnotes in 
> captions; couldn’t reproduce “some missing” in an MWE yet.

I found another problem with captions in floatcombinations: They are always 
bottom-aligned to each other, so that the distance between image and caption 
differs. This is the same in current LMTX and MkIV.

Hraban


\usemodule[visual]
\definecolor[fakerulecolor][c=.2,m=.1,k=.2]
\useMPlibrary[dum]
\automigrateinserts % nop in LMTX
\showframe
\setupcaptions[
  headstyle={\ss\bfx},
  align={flushleft,high},
  hang=yes,
]

\starttext

\fakewords{10}{30}

% Footnotes, but no combination
%\startplacefigure[location=none]
%\startfloatcombination[2*1]
\startplacefigure[title={\fakewords{5}{10}\footnote[f:1]{\fakewords{10}{30}}}]
\externalfigure[001][width=.34\textwidth]
\stopplacefigure
\startplacefigure[title={\fakewords{5}{10}\footnote[f:2]{\fakewords{10}{30}}}]
\externalfigure[002][width=.62\textwidth]
\stopplacefigure
%\stopfloatcombination
%\stopplacefigure

\fakewords{20}{30}

% both
\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={\fakewords{5}{10}\footnote[f:3]{\fakewords{10}{30}}}]
\externalfigure[003][width=.34\textwidth]
\stopplacefigure
\startplacefigure[title={\fakewords{5}{10}\footnote[f:4]{\fakewords{10}{30}}}]
\externalfigure[004][width=.62\textwidth]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\fakewords{10}{30}

% combination without footnotes
\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={\fakewords{5}{10}}]
\externalfigure[005][width=.34\textwidth]
\stopplacefigure
\startplacefigure[title={\fakewords{5}{10}}]
\externalfigure[006][width=.62\textwidth]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\fakewords{5}{10}

\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] \startstructurelevel

2020-09-20 Thread Denis Maier

Hi Otared,
thanks! That worked.
Best,
Denis

Am 20.09.2020 um 11:23 schrieb Otared Kavian:

Hi Denis,

Does

\startstructurelevel[title={Bibliography},number=no]

\stopstructurelevel

give what you want?

Best regards: Otared K.


On 20 Sep 2020, at 10:39, Denis Maier  wrote:

Hi,

I'm using \startstructurelevel so I can nest sections without having to worry about 
where I am at the moment. (Actually I'm typesetting JATS XML, and there's only one 
 tag, and using \startstructurelevel makes the mapping easier.)
Now, for the bibliography, I need an unnumbered heading. How can I get that?

Browsing through the source I came across this: 
https://source.contextgarden.net/tex/context/base/mkiv/strc-lev.mkvi?search=startstructurelevel#l65

So, it seems that \startstructurelevel is just an alias for \startsectionlevel. 
Right?
Unnumbered headings can be produced with \startsubjectlevel

So, is there a way to let \startstructurelevel the unnumbered variant, or 
should I just use \startsubjectlevel instead?

By the way, is there a reason for the existence \startstructurelevel next to 
\startsectionlevel? What's the exact purpose of this?

Best,
Denis
___
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
___




___
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] footnotes in captions in floatcombinations

2020-09-20 Thread Henning Hraban Ramm


> Am 20.09.2020 um 13:34 schrieb Hans Hagen :
> 
> On 9/19/2020 6:36 PM, Henning Hraban Ramm wrote:
>>> Am 16.09.2020 um 13:48 schrieb Henning Hraban Ramm :
>>> 
>>> In MkIV I get images and footnotes, but the width of the footnotes is 
>>> always that of the image.
>>> 
>>> In LMTX I don’t get anything.
>> Current state (v. 2020.09.18 20:32):
>> Some progress: Footnotes are still as wide as the image they belong to (in 
>> both versions), but in LMTX some footnotes are missing.
> mwe missing

Regarding the width it’s still the same MWE (slightly adapted), apparently not 
related to floatcombinations but a general problem of footnotes in captions; 
couldn’t reproduce “some missing” in an MWE yet.

Hraban


\useMPlibrary[dum]
\automigrateinserts % nop in LMTX
\showframe

\starttext

\input knuth

% Footnotes, but no combination
%\startplacefigure[location=none]
%\startfloatcombination[2*1]
\startplacefigure[title={1 Image with footnote\footnote[f:1]{\input lorem }}]
\externalfigure[001][width=.34\textwidth]
\stopplacefigure
\startplacefigure[title={2 Another image with footnote\footnote[f:2]{\input 
tufte }}]
\externalfigure[002][width=.62\textwidth]
\stopplacefigure
%\stopfloatcombination
%\stopplacefigure

\input lorem

% both
\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={3 Left Image\footnote[f:3]{\input knuth }}]
\externalfigure[003][width=.34\textwidth]
\stopplacefigure
\startplacefigure[title={4 Right Image\footnote[f:4]{\input dawkins }}]
\externalfigure[004][width=.62\textwidth]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\input lorem

% combination without footnotes
\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={5 Left Image}]
\externalfigure[005][width=.34\textwidth]
\stopplacefigure
\startplacefigure[title={6 Right Image}]
\externalfigure[006][width=.62\textwidth]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\input tufte

\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] \startstructurelevel

2020-09-20 Thread Otared Kavian
Hi Denis,

Does 

\startstructurelevel[title={Bibliography},number=no]

\stopstructurelevel

give what you want?

Best regards: Otared K.

> On 20 Sep 2020, at 10:39, Denis Maier  wrote:
> 
> Hi,
> 
> I'm using \startstructurelevel so I can nest sections without having to worry 
> about where I am at the moment. (Actually I'm typesetting JATS XML, and 
> there's only one  tag, and using \startstructurelevel makes the mapping 
> easier.)
> Now, for the bibliography, I need an unnumbered heading. How can I get that?
> 
> Browsing through the source I came across this: 
> https://source.contextgarden.net/tex/context/base/mkiv/strc-lev.mkvi?search=startstructurelevel#l65
> 
> So, it seems that \startstructurelevel is just an alias for 
> \startsectionlevel. Right?
> Unnumbered headings can be produced with \startsubjectlevel
> 
> So, is there a way to let \startstructurelevel the unnumbered variant, or 
> should I just use \startsubjectlevel instead?
> 
> By the way, is there a reason for the existence \startstructurelevel next to 
> \startsectionlevel? What's the exact purpose of this?
> 
> Best,
> Denis
> ___
> 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] Best way to store text for later use

2020-09-18 Thread Hans van der Meer
A possibility is saving the data as text in a Lua-table. If you are not afraid 
to use some Lua, I can send my code for saving files and data for repeated use.

dr. Hans van der Meer


> On 18 Sep 2020, at 15:36, Denis Maier  wrote:
> 
> Hi,
> 
> For typesetting XML I'm wondering how to best store text for later use:
> 
> I've tried using buffers, but this here doesn't work:
> 
> ==
> \startxmlsetups xml:article-meta
> \setupdocument [
> pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
> volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
> doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
> elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
> title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
> author={\AuthorList},
> ]
>   \startbuffer[abstract]
>   \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)}
>   \stopbuffer
>\xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:article-meta:abstract
> \xmlflush{#1}
> \stopxmlsetups
> ===
> 
> This here works:
> 
> ==
> \startxmlsetups xml:article-meta
> \setupdocument [
> pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
> volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
> doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
> elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
> title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
> author={\AuthorList},
> abstract=\xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)},
> ]
>\xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:article-meta:abstract
> \xmlflush{#1}
> \stopxmlsetups
> ===
> 
> But has using a variable for the abstract any drawbacks? (The abstract might 
> contain multiple paragraphs.)
> 
> Best,
> Denis
> ___
> 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] Best way to store text for later use

2020-09-18 Thread Denis Maier

Hi,

For typesetting XML I'm wondering how to best store text for later use:

I've tried using buffers, but this here doesn't work:

==
\startxmlsetups xml:article-meta
    \setupdocument [
pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
        author={\AuthorList},
    ]
  \startbuffer[abstract]
  \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)}
  \stopbuffer
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:article-meta:abstract
    \xmlflush{#1}
\stopxmlsetups
===

This here works:

==
\startxmlsetups xml:article-meta
    \setupdocument [
pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
        author={\AuthorList},
abstract=\xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)},
    ]
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:article-meta:abstract
    \xmlflush{#1}
\stopxmlsetups
===

But has using a variable for the abstract any drawbacks? (The abstract 
might contain multiple paragraphs.)


Best,
Denis
___
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] footnotes in captions in floatcombinations

2020-09-16 Thread Henning Hraban Ramm

> Am 16.09.2020 um 13:39 schrieb Hans Hagen :
> 
> On 9/16/2020 12:08 PM, Henning Hraban Ramm wrote:
> 
>> \automigrateinserts
> 
> that one does nothing in lmtx

At least it doesn’t interfere. ;)
But good to know it’s becoming obsolete.

>> \showframe
>> \starttext
>> \input lorem
>> \startplacefigure[location=none]
>> \startfloatcombination[2*1]
>> \startplacefigure[title={Left Image\footnote[f:3]{\input knuth }}]
>> \externalfigure[003][width=.48\textwidth]
>> \stopplacefigure
>> \startplacefigure[title={Right Image\footnote[f:4]{Anything}}]
>> \externalfigure[004][width=.48\textwidth]
>> \stopplacefigure
>> \stopfloatcombination
>> \stopplacefigure
>> \input tufte
>> \stoptext
> It was kind of tricky to identify (as i first though that you meant that it 
> also happened in mkiv)

In MkIV I get images and footnotes, but the width of the footnotes is always 
that of the image.

In LMTX I don’t get anything.

> but I managed to find a solution. New bin needed so not yet uploaded.

Thank you! Looking forward to it.


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] Fwd: Re: footnotes in captions in floatcombinations

2020-09-16 Thread Hans Hagen




 Forwarded Message 
Subject: Re: [NTG-context] footnotes in captions in floatcombinations
Date: Wed, 16 Sep 2020 13:38:44 +0200
From: Hans Hagen 
To: Henning Hraban Ramm 

On 9/16/2020 12:08 PM, Henning Hraban Ramm wrote:


\useMPlibrary[dum]
\automigrateinserts


that one does nothing in lmtx


\showframe

\starttext

\input lorem

\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={Left Image\footnote[f:3]{\input knuth }}]
\externalfigure[003][width=.48\textwidth]
\stopplacefigure
\startplacefigure[title={Right Image\footnote[f:4]{Anything}}]
\externalfigure[004][width=.48\textwidth]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\input tufte

\stoptext
It was kind of tricky to identify (as i first though that you meant that 
it also happened in mkiv) but I managed to find a solution. New bin 
needed so not yet uploaded.


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] sidefloats and narrower

2020-09-16 Thread Henning Hraban Ramm
Hi again,
this is related to “quotation with footnote“.

If you compile the example with (latest) LMTX, all is good.
But MkIV (--luatex) lets the quotations (“Zitat”) run over the float.

Without the \setupdelimitedtext line, distances between paragraphs become 
irregular in both versions (but differently).


\useMPlibrary[dum]
\usemodule[visual]

\setupwhitespace[halfline]

\setupdelimitedtext[quotation][method=font]
\setupnarrower[left=2em,right=1.5em]

\definenarrower[Zitat]
\setupnarrower[Zitat]
 [left=2em,
  right=1.5em,
  before=\dontleavehmode\hskip-0.33em\startquotation,
  after=\stopquotation]

\starttext

%\fakewords{50}{60}

\startplacefigure[location={right,-line},title={\fakewords{7}{10}}]
\externalfigure[022][width=0.33\textwidth,height=0.75\textheight]
\stopplacefigure
\startZitat
\fakewords{30}{60}
\stopZitat

\fakewords{30}{60}

\startZitat
\fakewords{15}{20}
\stopZitat

\fakewords{30}{60}

\stoptext


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] footnotes in captions in floatcombinations

2020-09-16 Thread Henning Hraban Ramm
Thank you, Otared!

I updated to LMTX/MkIV 2020.09.15 18:11:

The images appear if I use --luatex (i.e. MkIV vs. LMTX),
but the footnotes use the width of the image.
The old MWE can’t show that.

Without \automigrateinserts I get both images and the short footnote, but not 
the long one.


\useMPlibrary[dum]
\automigrateinserts
\showframe

\starttext

\input lorem

\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={Left Image\footnote[f:3]{\input knuth }}]
\externalfigure[003][width=.48\textwidth]
\stopplacefigure
\startplacefigure[title={Right Image\footnote[f:4]{Anything}}]
\externalfigure[004][width=.48\textwidth]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\input tufte

\stoptext




Am 14.09.2020 um 22:43 schrieb Otared Kavian :
> 
> Hi Hraban,
> 
> Your are right, your file is typeset correctly as expected with ConTeXt mkiv 
> version 2020.06.25 10:55, but not with the current lmtx.
> (I am sending you the output with this message).
> 
> Best regards: Otared K.
> 
> 
> 
>> On 14 Sep 2020, at 21:40, Henning Hraban Ramm  wrote:
>> 
>> Hi,
>> I got a problem with current LMTX as well as with other versions – while I’m 
>> sure it used to work at some point:
>> 
>> As soon as there’s a footnote in the caption of a placefigure within a 
>> floatcombination, the figure won’t get placed. There’s no problem outside of 
>> floatcombinations or with floatcombinations without footnotes.
>> 
>> Please let there be an easy fix...
>> 
>> Hraban
>> 
>> 
>> \useMPlibrary[dum]
>> \automigrateinserts
>> \showframe
>> 
>> \starttext
>> 
>> \input knuth
>> 
>> %\startplacefigure[location=none]
>> %\startfloatcombination[2*1]
>> \startplacefigure[title={Image with footnote\footnote[f:1]{foo bar baz}}]
>> \externalfigure[001][width=.48\textwidth]
>> \stopplacefigure
>> \startplacefigure[title={Another image with 
>> footnote\footnote[f:2]{Something}}]
>> \externalfigure[002][width=.48\textwidth]
>> \stopplacefigure
>> %\stopfloatcombination
>> %\stopplacefigure
>> 
>> \input lorem
>> 
>> \startplacefigure[location=none]
>> \startfloatcombination[2*1]
>> \startplacefigure[title={Left Image\footnote[f:3]{doo be doo}}]
>> \externalfigure[003][width=.48\textwidth]
>> \stopplacefigure
>> \startplacefigure[title={Right Image%\footnote[f:4]{Anything}
>> }]
>> \externalfigure[004][width=.48\textwidth]
>> \stopplacefigure
>> \stopfloatcombination
>> \stopplacefigure
>> 
>> \startplacefigure[location=none]
>> \startfloatcombination[2*1]
>> \startplacefigure[title={Left Image}]
>> \externalfigure[005][width=.48\textwidth]
>> \stopplacefigure
>> \startplacefigure[title={Right Image}]
>> \externalfigure[006][width=.48\textwidth]
>> \stopplacefigure
>> \stopfloatcombination
>> \stopplacefigure
>> 
>> \input tufte
>> 
>> \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
>> ___
> 

___
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] Footnote font size equal to main text font size

2020-09-16 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 15.09.2020 um 04:38:
Hi, list. I've adapted the following example from the mailing list. My 
aim is to use endnotes for each chapter:


\mainlanguage[es]
\definehead[footnotetitle][title]
\startsetups[chapter:after]
\ifcase\rawcountervalue[footnote]\relax
      \else
          \startfootnotetitle[title={Notas}]
              \placefootnotes
          \stopfootnotetitle
      \fi
\stopsetups

\setupnotes[location=none]
\setupnotation[way=bychapter]
\setupfootnotedefinition[style={\switchtobodyfont[12pt]}]

\setuphead[chapter][aftersection=\setups{chapter:after}]

\starttext

\startchapter[title={Chapter One}]

Here comes \footnote{a footnote}. Aquí \footnote{otra nota a pie de página}.

\stopchapter

\stoptext

However, I'm concerned by \switchtobodyfont. How should I make footnote 
size the same as the default font size, even when an arbitrary font size 
is used.



\starttext

First paragraph\footnote{Footnote one}

\page

\setupnote[footnote][bodyfont=]
%\setupnotation[footnote][numbercommand=]

Second paragraph\footnote{Footnote two}

\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] Footnote font size equal to main text font size

2020-09-16 Thread Henning Hraban Ramm


> Am 15.09.2020 um 04:38 schrieb Jairo A. del Rio :
> 
> Hi, list. I've adapted the following example from the mailing list. My aim is 
> to use endnotes for each chapter:
> 
> \mainlanguage[es]
> \definehead[footnotetitle][title]
> \startsetups[chapter:after]
> \ifcase\rawcountervalue[footnote]\relax
>  \else
>  \startfootnotetitle[title={Notas}]
>  \placefootnotes
>  \stopfootnotetitle
>  \fi
> \stopsetups
> 
> \setupnotes[location=none]
> \setupnotation[way=bychapter]
> \setupfootnotedefinition[style={\switchtobodyfont[12pt]}]
> 
> \setuphead[chapter][aftersection=\setups{chapter:after}]
> 
> \starttext
> 
> \startchapter[title={Chapter One}]
> 
> Here comes \footnote{a footnote}. Aquí \footnote{otra nota a pie de página}.
> 
> \stopchapter
> 
> \stoptext
> 
> However, I'm concerned by \switchtobodyfont. How should I make footnote size 
> the same as the default font size, even when an arbitrary font size is used.
> 
> E.g.:
> 
> \setupbodyfont[24pt] % It could be another number instead of 24
> \setupfootnotedefinition[style={\switchtobodyfont[???]}]
> 
> Thank you in advance.

Try

\newdimen\Mybodyfontsize
\Mybodyfontsize=24pt

\setupbodyfont[\Mybodyfontsize]

etc.


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] Footnote font size equal to main text font size

2020-09-14 Thread Jairo A. del Rio
Hi, list. I've adapted the following example from the mailing list. My aim
is to use endnotes for each chapter:

\mainlanguage[es]
\definehead[footnotetitle][title]
\startsetups[chapter:after]
\ifcase\rawcountervalue[footnote]\relax
 \else
 \startfootnotetitle[title={Notas}]
 \placefootnotes
 \stopfootnotetitle
 \fi
\stopsetups

\setupnotes[location=none]
\setupnotation[way=bychapter]
\setupfootnotedefinition[style={\switchtobodyfont[12pt]}]

\setuphead[chapter][aftersection=\setups{chapter:after}]

\starttext

\startchapter[title={Chapter One}]

Here comes \footnote{a footnote}. Aquí \footnote{otra nota a pie de página}.

\stopchapter

\stoptext

However, I'm concerned by \switchtobodyfont. How should I make footnote
size the same as the default font size, even when an arbitrary font size is
used.

E.g.:

\setupbodyfont[24pt] % It could be another number instead of 24
\setupfootnotedefinition[style={\switchtobodyfont[???]}]

Thank you in advance.

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] footnotes in captions in floatcombinations

2020-09-14 Thread Henning Hraban Ramm
Hi,
I got a problem with current LMTX as well as with other versions – while I’m 
sure it used to work at some point:

As soon as there’s a footnote in the caption of a placefigure within a 
floatcombination, the figure won’t get placed. There’s no problem outside of 
floatcombinations or with floatcombinations without footnotes.

Please let there be an easy fix...

Hraban


\useMPlibrary[dum]
\automigrateinserts
\showframe

\starttext

\input knuth

%\startplacefigure[location=none]
%\startfloatcombination[2*1]
\startplacefigure[title={Image with footnote\footnote[f:1]{foo bar baz}}]
\externalfigure[001][width=.48\textwidth]
\stopplacefigure
\startplacefigure[title={Another image with footnote\footnote[f:2]{Something}}]
\externalfigure[002][width=.48\textwidth]
\stopplacefigure
%\stopfloatcombination
%\stopplacefigure

\input lorem

\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={Left Image\footnote[f:3]{doo be doo}}]
\externalfigure[003][width=.48\textwidth]
\stopplacefigure
\startplacefigure[title={Right Image%\footnote[f:4]{Anything}
}]
\externalfigure[004][width=.48\textwidth]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={Left Image}]
\externalfigure[005][width=.48\textwidth]
\stopplacefigure
\startplacefigure[title={Right Image}]
\externalfigure[006][width=.48\textwidth]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\input tufte

\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] Fwd: Re: styling individual parts of ToC entry

2020-09-09 Thread jbf


After making silly mistakes, for which I apologize, I finally got the 
ToC to work for frontmatter and chapters, creating new \defineheads as 
required, and including the earlier \ChapterListCommand, with the 
results correctly showing.


To add some named sections with authors, I did the following, using an 
idea Hraban had floated:


 \setupsectionblock
 [bodypart]
 [number=no]

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

\setuplist[section][
  textcommand=\SectionTocEntry,
]

I need to adjust the \setuplist[section] so these section entries move 
across under the Chapter titles (not be left-aligned as they are now 
under Chapter number. The earlier \ChapterListCommand has titles and 
authors moved across 3cm.


I have tried:

\setuplist[section][width=3cm,
  textcommand=\SectionTocEntry,
  ]

The width=3cm is not doing anything, so I've got that wrong. How do I 
move sections across by a specific amount in the TOC?


Julian





On 9/9/20 5:10 pm, Wolfgang Schuster wrote:

jbf schrieb am 09.09.2020 um 08:04:
Have to confess I am still not getting far with the final problem in 
a book that is now fully laid out: frontmatter through to appendices 
is all correct and working, but the Table of Contents not the way I 
need it (as explained earlier and listed in a previous email).


My latest effort focuses on just one item, the Foreword, since if I 
get that right, I can apply the same logic to sections. Chapters are 
already working correctly, thanks to Wolfgang's ChapterListCommand 
and I am assuming I need that for the several frontmatter 'chapters'.


I was earlier using \title for foreword, preface and notes to 
contributors, but have abandoned that as complicating things, and am 
now using \chapter, since it does not produce a numbered item - 
however, it is producing the label 'Chapter' which I don't want for 
these item. You can see below how I tried to avoid that, but it 
failed. My MWE addition to what Wolfgang provided is:


\definehead [foreword] [chapter]

\setuphead [foreword]

\setuplist [foreword]
  [label=foreword,
  alternative=command,
  command=\ChapterListCommand]% definition not included here. It was 
given in an earlier response from Wolfgang.


 And in the frontmatter itself:

\startchapter[foreword][title={\ss Foreword}][author={A. Uthor}]

..


You can set the forword string as labeltext and ignore the title (but 
use a empty argument when set userdata like the author).


\definehead
  [forword] [chapter]

\setuplabeltext
  [en]
  [forword=Forword,
   chapter=Chapter ]

\setuphead
  [forword]
  [frontpartlabel=forword,
   conversion=empty]

\setupsectionblock
  [frontpart]
  [number=yes]

\setuplist
  [forword]
  [label=forword,
   width=2cm]

\setuplist
  [chapter]
  [label=chapter,
   width=2cm]

\starttext

\startfrontmatter

\placelist [chapter,forword]

\startforword [] [author={A. u. thor}] \stopforword

\stopfrontmatter

\startbodymatter

\startchapter [title=Chapter 1] [author={A. u. thor}] \stopchapter

\stopbodymatter

\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] styling individual parts of ToC entry

2020-09-09 Thread jbf
Thanks. Just two clarifications (also noting that I altered 'forword' in 
yours to 'foreword' in mine in every instance, just to get the spelling 
right):


1. Compiling your example just as it is below produces a result like:

[foreword: – – 2]Chapter 1 Chapter 1
   A. u. thor  3

We obviously should not be getting [foreword: --2] in our result, nor a 
doubling up of Chapter 1


2. Where do I stand now with the earlier definition  (I mean the 
\define[3]\ChapterListCommand. Is that still used? Including its 
\setuplist part? What you have just given me now makes no reference to 
\ChapterListCommand, so perhaps it is no longer relevant?


Julian





On 9/9/20 5:10 pm, Wolfgang Schuster wrote:

jbf schrieb am 09.09.2020 um 08:04:
Have to confess I am still not getting far with the final problem in 
a book that is now fully laid out: frontmatter through to appendices 
is all correct and working, but the Table of Contents not the way I 
need it (as explained earlier and listed in a previous email).


My latest effort focuses on just one item, the Foreword, since if I 
get that right, I can apply the same logic to sections. Chapters are 
already working correctly, thanks to Wolfgang's ChapterListCommand 
and I am assuming I need that for the several frontmatter 'chapters'.


I was earlier using \title for foreword, preface and notes to 
contributors, but have abandoned that as complicating things, and am 
now using \chapter, since it does not produce a numbered item - 
however, it is producing the label 'Chapter' which I don't want for 
these item. You can see below how I tried to avoid that, but it 
failed. My MWE addition to what Wolfgang provided is:


\definehead [foreword] [chapter]

\setuphead [foreword]

\setuplist [foreword]
  [label=foreword,
  alternative=command,
  command=\ChapterListCommand]% definition not included here. It was 
given in an earlier response from Wolfgang.


 And in the frontmatter itself:

\startchapter[foreword][title={\ss Foreword}][author={A. Uthor}]

..


You can set the forword string as labeltext and ignore the title (but 
use a empty argument when set userdata like the author).


\definehead
  [forword] [chapter]

\setuplabeltext
  [en]
  [forword=Forword,
   chapter=Chapter ]

\setuphead
  [forword]
  [frontpartlabel=forword,
   conversion=empty]

\setupsectionblock
  [frontpart]
  [number=yes]

\setuplist
  [forword]
  [label=forword,
   width=2cm]

\setuplist
  [chapter]
  [label=chapter,
   width=2cm]

\starttext

\startfrontmatter

\placelist [chapter,forword]

\startforword [] [author={A. u. thor}] \stopforword

\stopfrontmatter

\startbodymatter

\startchapter [title=Chapter 1] [author={A. u. thor}] \stopchapter

\stopbodymatter

\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] styling individual parts of ToC entry

2020-09-09 Thread Wolfgang Schuster

jbf schrieb am 09.09.2020 um 08:04:
Have to confess I am still not getting far with the final problem in a 
book that is now fully laid out: frontmatter through to appendices is 
all correct and working, but the Table of Contents not the way I need it 
(as explained earlier and listed in a previous email).


My latest effort focuses on just one item, the Foreword, since if I get 
that right, I can apply the same logic to sections. Chapters are already 
working correctly, thanks to Wolfgang's ChapterListCommand and I am 
assuming I need that for the several frontmatter 'chapters'.


I was earlier using \title for foreword, preface and notes to 
contributors, but have abandoned that as complicating things, and am now 
using \chapter, since it does not produce a numbered item - however, it 
is producing the label 'Chapter' which I don't want for these item. You 
can see below how I tried to avoid that, but it failed. My MWE addition 
to what Wolfgang provided is:


\definehead [foreword] [chapter]

\setuphead [foreword]

\setuplist [foreword]
  [label=foreword,
  alternative=command,
  command=\ChapterListCommand]% definition not included here. It was 
given in an earlier response from Wolfgang.


 And in the frontmatter itself:

\startchapter[foreword][title={\ss Foreword}][author={A. Uthor}]

..


You can set the forword string as labeltext and ignore the title (but 
use a empty argument when set userdata like the author).


\definehead
  [forword] [chapter]

\setuplabeltext
  [en]
  [forword=Forword,
   chapter=Chapter ]

\setuphead
  [forword]
  [frontpartlabel=forword,
   conversion=empty]

\setupsectionblock
  [frontpart]
  [number=yes]

\setuplist
  [forword]
  [label=forword,
   width=2cm]

\setuplist
  [chapter]
  [label=chapter,
   width=2cm]

\starttext

\startfrontmatter

\placelist [chapter,forword]

\startforword [] [author={A. u. thor}] \stopforword

\stopfrontmatter

\startbodymatter

\startchapter [title=Chapter 1] [author={A. u. thor}] \stopchapter

\stopbodymatter

\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] styling individual parts of ToC entry

2020-09-09 Thread jbf
Have to confess I am still not getting far with the final problem in a 
book that is now fully laid out: frontmatter through to appendices is 
all correct and working, but the Table of Contents not the way I need it 
(as explained earlier and listed in a previous email).


My latest effort focuses on just one item, the Foreword, since if I get 
that right, I can apply the same logic to sections. Chapters are already 
working correctly, thanks to Wolfgang's ChapterListCommand and I am 
assuming I need that for the several frontmatter 'chapters'.


I was earlier using \title for foreword, preface and notes to 
contributors, but have abandoned that as complicating things, and am now 
using \chapter, since it does not produce a numbered item - however, it 
is producing the label 'Chapter' which I don't want for these item. You 
can see below how I tried to avoid that, but it failed. My MWE addition 
to what Wolfgang provided is:


\definehead [foreword] [chapter]

\setuphead [foreword]

\setuplist [foreword]
 [label=foreword,
 alternative=command,
 command=\ChapterListCommand]% definition not included here. It was 
given in an earlier response from Wolfgang.


 And in the frontmatter itself:

\startchapter[foreword][title={\ss Foreword}][author={A. Uthor}]

..

Of course, even if it did work, given the ChapterListCommand, it would 
probably put the author on a line below Foreword, instead of on the same 
line. There are four different components in the ToC, all needing to be 
arranged a bit differently, which is why I haven't got my head around 
what I need to do. They are:


(1) Foreword    author name

(2) Chapter no.   Title

  author name

(3) Chapter no.   Title 1

    Title 2 or subtitle

  author name

(4) Chapter no.   Title

   Section

  author name

Julian




On 7/9/20 4:57 pm, Wolfgang Schuster wrote:

jbf schrieb am 07.09.2020 um 01:31:


Yes, Wolfgang, that corrects the minor problem of including the 
author name correctly, even when there is no year range. Thank you.


But since I use \title, not \chapter, for the frontmatter items, ( 
Foreword, Preface, A note on Contributors), the ChapterListCommand 
clearly does not apply, so currently my ToC looks as follows (leaving 
out the pg numbers which correctly align right):



                 Foreword
                 A. Uthor
                        Preface
                 A. Uthor
                         A note on contributors
Chapter One        Year range
                A. Uthor

What I want is for 'Foreword', 'Preface' and 'A note on Contributors' 
to align flushleft with Chapter One, but with author names still 
where they should be (Foreword and Preface have authors, 'A note...' 
does not have an author).


So I tried creating a TitleListCommand which copies the 
ChapterListCommand. But where I run into difficulties then is with a 
new lot of \setuplist to accommodate that. There are three different 
labels involved (Foreword, Preface, and A note on Contributors).


And why is it that even with the current setup, 'Foreword' has 
aligned with author name, not with 'Preface' and 'A note...'? All 
three are \title, after all.


All in all this is a most complicated ToC! What I need is for the ToC 
to look like I show it below, and you will note the additional 
complication of Chapter Two which does not have an author, but 
instead it is the SECTIONS in the Chapter that have authors!


I'm sure if I can get on top of all this somehow, no future ToC is 
ever going to cause me problems! The body of the book is all looking 
good, all 300 pages of it. It is just the automatically produced ToC 
that is causing the headaches.


Foreword                   A. Uthor    pg no.
Preface                 A. Uthor   "
A note on Contributors "
Chapter One         Chapter Title
                      A. Uthor  "
Chapter Two     Chapter title
A section  Context
  A. Uthor "
Another section    Reflection
  A. Author   "

So what I have below as an MWE is fundamentally what you gave me (I 
have left out the correctly working ChapterListCommand), altered for 
\title, but I haven't got the setups below correct because I don't 
know how to do it. I have replaced unknowns with a question mark!


And at the moment I have nothing for the 'sections' with authors I 
need for Chapter Two. I assume I would set up a third definition 
called \SectionListCommand. Sections will have different labels too - 
one will be called 'Context', the other 'Reflection'.


\define[3]\TitleListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dime

Re: [NTG-context] Fullwidth topfigure with caption in the margin

2020-09-08 Thread Mikael Sundqvist
On Mon, Sep 7, 2020 at 9:26 PM Mikael Sundqvist  wrote:

> Hi,
>
> Is there a way to have a fullwith topfigure with caption in the margin so
> that the figure does not interfere with the text? My try is
>
>
> %%%
> \setuplayout[
> rightmargin=2in,
> rightmargindistance=0.375in,
> width=4.125in,
> ]
>
> \showframe
>
> \definecolor [transparentred] [r=1,t=.5,a=1]
>
> \definefloat[topfigure][topfigures][figure]
>
> \setupfloat[topfigure][
> default={margin},
> location=flushleft,
> maxwidth=6.5in,
> ]
>
> \setupcaption[topfigure][
> number=no,
> location=bottom,
> style={\switchtobodyfont[8bp]},
> ]
> \starttext
> \dorecurse{4}{\samplefile{knuth}}
>
> \startplacetopfigure[title={\samplefile{ward}}]
> \blackrule[width=6.5in,height=2in,color=transparentred]
> \stopplacetopfigure
>
> \samplefile{knuth}
> \stoptext
> %%
>
> but, as one can see on page two, the text from the previous page just
> continues under the image. I want the "larg-scale user..." to start below
> the image. It would be good if it was also possible to configure the
> distance between the image and the text.
>
> (I guess one option would be to not use a margin figure, and use
> default=top, but then I don't know how to handle the caption.)
>
> /Mikael
>

An update: I am now able to get something closer to what I want. The figure
is where I want it, the caption is where I want it. The code might be bad
and there might be better ways to do it. For example, I could not find how
to use the title text but only the subtitle in the figure. The spacing is
also a bit manual in the \TopFigureCaption command. Any comments for
improvements (or completely different solutions) are very welcome.

/Mikael

\setuplayout[
rightmargin=2in,
rightmargindistance=0.375in,
width=4.125in,
]

\showframe

\definecolor [transparentred] [r=1,t=.5,a=1]

\definefloat[topfigure][topfigures][figure]

\setupfloat[topfigure][
default={top,none},
location=flushright,
maxwidth=6.5in,
]

\setupcaption[topfigure][
number=no,
]

\define\TopFigureCaption{%
\blank[-line,force,overlay]
\vsmash{%
\blank[line]
\framed[align=flushright,width=6.5in,frame=off,offset=overlay]{%
\startframedtext[
width=\rightmarginwidth,
frame=off,
offset=overlay,
style={\switchtobodyfont[8bp]},
align=flushleft,
]\floatuserdataparameter{subtitle}
\stopframedtext}}}


\starttext
\dorecurse{3}{\samplefile{knuth}}

\startplacetopfigure[title=This is the title][subtitle={\samplefile{ward}}]
\blackrule[width=6.5in,height=2in,color=transparentred]
\TopFigureCaption
\stopplacetopfigure

\dorecurse{3}{\samplefile{knuth}}

\startplacetopfigure[title=This is the title][subtitle={\samplefile{ward}}]
\blackrule[width=6.5in,height=2in,color=transparentred]
\TopFigureCaption
\stopplacetopfigure

\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] Fwd: Re: styling individual parts of ToC entry

2020-09-07 Thread jbf




 Forwarded Message 
Subject:Re: [NTG-context] styling individual parts of ToC entry
Date:   Tue, 8 Sep 2020 12:39:05 +1000
From:   jbf 
To: Wolfgang Schuster 



Wolfgang, I have tried an MWE below but I think I am hopelessly lost at 
this point. It is not producing anything like what I want.


But at least let me indicate what I have tried:

(1) I have defined two different 'title' items (Foreword and Preface 
unnumbered) since both of these require an author name of the kind 
produced by the \ChapterListCommand. Do I also need a \TitleListCommand 
for these? The \ChapterListCommand seems to call in a chapter number, 
and I don't want one in the Frontmatter items like foreword and preface. 
I didn't know how to adjust that definition to leave out the number. I 
did try a renamed copy of it, leaving out the line: \hbox to 
3cm{\currentlistsymbol\hss}, but that made no difference.


(2) And since I also need some sections with an author (but the chapter 
they are in has no author), I defined a 'mysection', though I have only 
tried to 'call in' the Foreword so far in the text below, to see if that 
at least worked - but it doesn't.


(3) I also assumed that having defined foreword, preface and mysection, 
they would need to be in a \setupcombinedlist.


(4) And finally, I thought I would then need a \setuplist and 
\setuplabeltext for Foreword (as indeed I might for the other two as 
well, but to start with, I wanted to get one of them working at least).


MWE:

\definehead [foreword] [title]
\definehead [preface] [title]
\definehead [mysection] [section]

\setupcombinedlist[chapter,foreword,preface,mysection,section, subsection]

\define[3]\ChapterListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{author}}
 {\crlf{\bf\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

   \define[3]\TitleListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{author}}
 {\crlf{\bf\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

\definehead [foreword] [title]
\definehead [preface] [title]
\definehead [mysection] [section]

\setupcombinedlist[chapter,foreword,preface,mysection,section, subsection]

\setuplist
  [chapter]
  [label=chapter,
   alternative=command,
   command=\ChapterListCommand]

\setuplabeltext
  [en]
  [chapter=Chapter ]

\setuplist
  [foreword]
  [label=foreword,
  alternative=command,
   command=\TitleListCommand]

\setuplabeltext
  [en]
  [title=Foreword ]

\starttext

\completecontent
\starttitle [title={Foreword}] [author={Author Name}]
\unknown
\stoptitle
\startchapter
\startchapter [title={Chapter title}] [author={Author 
Name},year={1980--2000}]

\unknown
\stopchapter

\stoptext

%%%

Let me remind you of what I am trying to achieve. If I can grasp some 
basic principles about this layout, I can experiment further.


Foreword                    A. Uthor     pg no.
  
Preface                 A. Uthor     "


A note on Contributors   "

Chapter One                 Chapter Title

                        A. Uthor     "

Chapter Two     Chapter title

A section   Context

    A. Uthor     "

 
Another section Reflection


    A. Author    "


Julian

On 7/9/20 4:57 pm, Wolfgang Schuster wrote:

\definehead [forward] [chapter]
    \definehead [preface] [chapter] 
___
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] Fullwidth topfigure with caption in the margin

2020-09-07 Thread Mikael Sundqvist
Hi,

Is there a way to have a fullwith topfigure with caption in the margin so
that the figure does not interfere with the text? My try is


%%%
\setuplayout[
rightmargin=2in,
rightmargindistance=0.375in,
width=4.125in,
]

\showframe

\definecolor [transparentred] [r=1,t=.5,a=1]

\definefloat[topfigure][topfigures][figure]

\setupfloat[topfigure][
default={margin},
location=flushleft,
maxwidth=6.5in,
]

\setupcaption[topfigure][
number=no,
location=bottom,
style={\switchtobodyfont[8bp]},
]
\starttext
\dorecurse{4}{\samplefile{knuth}}

\startplacetopfigure[title={\samplefile{ward}}]
\blackrule[width=6.5in,height=2in,color=transparentred]
\stopplacetopfigure

\samplefile{knuth}
\stoptext
%%

but, as one can see on page two, the text from the previous page just
continues under the image. I want the "larg-scale user..." to start below
the image. It would be good if it was also possible to configure the
distance between the image and the text.

(I guess one option would be to not use a margin figure, and use
default=top, but then I don't know how to handle the caption.)

/Mikael
___
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] styling individual parts of ToC entry

2020-09-07 Thread Wolfgang Schuster

jbf schrieb am 07.09.2020 um 01:31:


Yes, Wolfgang, that corrects the minor problem of including the author 
name correctly, even when there is no year range. Thank you.


But since I use \title, not \chapter, for the frontmatter items, ( 
Foreword, Preface, A note on Contributors), the ChapterListCommand 
clearly does not apply, so currently my ToC looks as follows (leaving 
out the pg numbers which correctly align right):



                     Foreword
                     A. Uthor
                            Preface
                     A. Uthor
                             A note on contributors
Chapter One        Year range
                    A. Uthor

What I want is for 'Foreword', 'Preface' and 'A note on Contributors' 
to align flushleft with Chapter One, but with author names still where 
they should be (Foreword and Preface have authors, 'A note...' does 
not have an author).


So I tried creating a TitleListCommand which copies the 
ChapterListCommand. But where I run into difficulties then is with a 
new lot of \setuplist to accommodate that. There are three different 
labels involved (Foreword, Preface, and A note on Contributors).


And why is it that even with the current setup, 'Foreword' has aligned 
with author name, not with 'Preface' and 'A note...'? All three are 
\title, after all.


All in all this is a most complicated ToC! What I need is for the ToC 
to look like I show it below, and you will note the additional 
complication of Chapter Two which does not have an author, but instead 
it is the SECTIONS in the Chapter that have authors!


I'm sure if I can get on top of all this somehow, no future ToC is 
ever going to cause me problems! The body of the book is all looking 
good, all 300 pages of it. It is just the automatically produced ToC 
that is causing the headaches.


Foreword                    A. Uthorpg no.
Preface                 A. Uthor"
A note on Contributors  "
Chapter One                 Chapter Title
                             A. Uthor"
Chapter Two     Chapter title
A section   Context
 A. Uthor"
Another section Reflection
 A. Author   "

So what I have below as an MWE is fundamentally what you gave me (I 
have left out the correctly working ChapterListCommand), altered for 
\title, but I haven't got the setups below correct because I don't 
know how to do it. I have replaced unknowns with a question mark!


And at the moment I have nothing for the 'sections' with authors I 
need for Chapter Two. I assume I would set up a third definition 
called \SectionListCommand. Sections will have different labels too - 
one will be called 'Context', the other 'Reflection'.


\define[3]\TitleListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{author}}
 {\crlf{\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

\setuplist
  [chapter]
  [label=chapter,
  alternative=command,
   command=\ChapterListCommand]

\setuplist
  [title]
  [label=?,
  alternative=command,
   command=\TitleListCommand]

\setuplabeltext
  [en]
  [chapter={\bf Chapter }]

\setuplabeltext
  [en]
  [title={\bf ? }] %There needs to be three different labels


You need extra headings for the forward and preface

    \definehead [forward] [chapter]
    \definehead [preface] [chapter]

to have full control about their layout.

I can provide you a solution for your problems but you have to create a 
complete minimal example (including forward and preface titles) first.


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] styling individual parts of ToC entry

2020-09-06 Thread jbf
Yes, Wolfgang, that corrects the minor problem of including the author 
name correctly, even when there is no year range. Thank you.


But since I use \title, not \chapter, for the frontmatter items, ( 
Foreword, Preface, A note on Contributors), the ChapterListCommand 
clearly does not apply, so currently my ToC looks as follows (leaving 
out the pg numbers which correctly align right):



                    Foreword

                    A. Uthor

                           Preface

                    A. Uthor

                            A note on contributors

Chapter One        Year range

                   A. Uthor


What I want is for 'Foreword', 'Preface' and 'A note on Contributors' to 
align flushleft with Chapter One, but with author names still where they 
should be (Foreword and Preface have authors, 'A note...' does not have 
an author).


So I tried creating a TitleListCommand which copies the 
ChapterListCommand. But where I run into difficulties then is with a new 
lot of \setuplist to accommodate that. There are three different labels 
involved (Foreword, Preface, and A note on Contributors).


And why is it that even with the current setup, 'Foreword' has aligned 
with author name, not with 'Preface' and 'A note...'? All three are 
\title, after all.


All in all this is a most complicated ToC! What I need is for the ToC to 
look like I show it below, and you will note the additional complication 
of Chapter Two which does not have an author, but instead it is the 
SECTIONS in the Chapter that have authors!


I'm sure if I can get on top of all this somehow, no future ToC is ever 
going to cause me problems! The body of the book is all looking good, 
all 300 pages of it. It is just the automatically produced ToC that is 
causing the headaches.


Foreword                    A. Uthorpg no.

Preface                 A. Uthor"

A note on Contributors  "

Chapter One                 Chapter Title

                            A. Uthor"
Chapter Two     Chapter title
A section   Context
A. Uthor"
Another section Reflection
A. Author   "


So what I have below as an MWE is fundamentally what you gave me (I have 
left out the correctly working ChapterListCommand), altered for \title, 
but I haven't got the setups below correct because I don't know how to 
do it. I have replaced unknowns with a question mark!


And at the moment I have nothing for the 'sections' with authors I need 
for Chapter Two. I assume I would set up a third definition called 
\SectionListCommand. Sections will have different labels too - one will 
be called 'Context', the other 'Reflection'.


\define[3]\TitleListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{author}}
 {\crlf{\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

\setuplist
  [chapter]
  [label=chapter,
  alternative=command,
   command=\ChapterListCommand]

\setuplist
  [title]
  [label=?,
  alternative=command,
   command=\TitleListCommand]

\setuplabeltext
  [en]
  [chapter={\bf Chapter }]

\setuplabeltext
  [en]
  [title={\bf ? }] %There needs to be three different labels



Julian
On 6/9/20 5:36 pm, Wolfgang Schuster wrote:

jbf schrieb am 06.09.2020 um 02:03:
Thanks Wolfgang, while I don't pretend to fully understand the setup 
you have provided (but am working on doing so!), of course it 
provides the correct result for a chapter that has a title, an 
author, and a year.


My ever-so-complicated book (and its authors!) however, throws one 
small further complication into the mix.


Where a chapter does not have a year-range, and I either omit that 
declaration, or I leave the curly brackets empty (e.g. year={}), then 
I find that the author name also does not appear in the ToC. What 
adjustment to the \ChapterListCommand do I need to make to 
accommodate the following? Possibly an \else statement, but not sure 
how to include that:


\startchapter [title={Chapter title}] [author={Author Name}]


I forgot to change the argument for the check off the author entry, 
this should fix it.


\define[3]\ChapterListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\raw

Re: [NTG-context] \setupuserpagenumber not working as expected

2020-09-06 Thread Jan Willem Flamma
Dear Wolfgang, Thank you for taking the time to go through the example and indicating these improvements. I will definitely evaluate and start applying this to my own code. Kind regards,Jan WillemFrom: Wolfgang SchusterSent: Friday, 4 September 2020 10:47To: mailing list for ConTeXt users; Jan Willem FlammaSubject: Re: [NTG-context] \setupuserpagenumber not working as expected 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 / htt

Re: [NTG-context] Typing efficiency

2020-09-06 Thread Jan Willem Flamma
Thank you Taco and Wolfgang. I will have a look at both solutions. Kind regards,Jan Willem Flamma From: Wolfgang SchusterSent: Friday, 4 September 2020 16:26To: mailing list for ConTeXt usersSubject: Re: [NTG-context] Typing efficiency 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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : 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] styling individual parts of ToC entry

2020-09-06 Thread Wolfgang Schuster

jbf schrieb am 06.09.2020 um 02:03:
Thanks Wolfgang, while I don't pretend to fully understand the setup you 
have provided (but am working on doing so!), of course it provides the 
correct result for a chapter that has a title, an author, and a year.


My ever-so-complicated book (and its authors!) however, throws one small 
further complication into the mix.


Where a chapter does not have a year-range, and I either omit that 
declaration, or I leave the curly brackets empty (e.g. year={}), then I 
find that the author name also does not appear in the ToC. What 
adjustment to the \ChapterListCommand do I need to make to accommodate 
the following? Possibly an \else statement, but not sure how to include 
that:


\startchapter [title={Chapter title}] [author={Author Name}]


I forgot to change the argument for the check off the author entry, this 
should fix it.


\define[3]\ChapterListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{author}}
 {\crlf{\bf\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

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] styling individual parts of ToC entry

2020-09-05 Thread jbf
Thanks Wolfgang, while I don't pretend to fully understand the setup you 
have provided (but am working on doing so!), of course it provides the 
correct result for a chapter that has a title, an author, and a year.


My ever-so-complicated book (and its authors!) however, throws one small 
further complication into the mix.


Where a chapter does not have a year-range, and I either omit that 
declaration, or I leave the curly brackets empty (e.g. year={}), then I 
find that the author name also does not appear in the ToC. What 
adjustment to the \ChapterListCommand do I need to make to accommodate 
the following? Possibly an \else statement, but not sure how to include 
that:


\startchapter [title={Chapter title}] [author={Author Name}]

Julian



On 5/9/20 7:16 pm, Wolfgang Schuster wrote:

jbf schrieb am 05.09.2020 um 03:35:
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.


\define[3]\ChapterListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{year}}
 {\crlf{\bf\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

\setuplist
  [chapter]
  [label=chapter,
   alternative=command,
   command=\ChapterListCommand]

\setuplabeltext
  [en]
  [chapter=Chapter ]

\starttext

\completecontent

\startchapter [title={Chapter title}] [author={Author 
Name},year={1980--2000}]

\unknown
\stopchapter

\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] styling individual parts of ToC entry

2020-09-05 Thread Wolfgang Schuster

jbf schrieb am 05.09.2020 um 03:35:
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.


\define[3]\ChapterListCommand
  {\hbox\bgroup
 \hbox to 3cm{\currentlistsymbol\hss}% number + labeltext
 \vtop\bgroup
   \hsize\dimexpr\makeupwidth-3cm\relax
   \doifsomething{\rawstructurelistuservariable{year}}
 {{\it\structurelistuservariable{year}}\crlf}%
   \currentlistentrytitle % title
   \doifsomething{\rawstructurelistuservariable{year}}
 {\crlf{\bf\structurelistuservariable{author}}}%
   \hfill\currentlistentrypagenumber % pagenumber
 \egroup
   \egroup}

\setuplist
  [chapter]
  [label=chapter,
   alternative=command,
   command=\ChapterListCommand]

\setuplabeltext
  [en]
  [chapter=Chapter ]

\starttext

\completecontent

\startchapter [title={Chapter title}] [author={Author 
Name},year={1980--2000}]

\unknown
\stopchapter

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


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


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


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] \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] 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 name    iii
> 
> Chapter One   Chapter title
> 
> Author's name   1
> 
> Chapter Two    1820-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] [][numbers]\startsectionblockenvironment[frontpart]\setupuserpagenumber[numberconv

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

2020-09-03 Thread jbf
Very much at the conclusion of a complicated book where most if not all 
issues in the body of the text are resolved, but now comes the really 
difficult part: the Table of Contents.


Here is what I am currently using (but it does not produce what I have 
been asked for, which is explained below this MWE):


%--

\setuphead [subject] [incrementnumber=list]
\setuphead [title] [incrementnumber=list]
\setupcombinedlist
  [content]
[list={chapter,title,section,subsection}]\switchtobodyfont[10.5pt]
\setuplist[chapter][style=normal,alternative=b, before=]

And then I place the ToC using:

\definehead
  [tochead]
  [title]
\starttochead[title={Contents}]
  \placecombinedlist[content]
\stoptochead

%-

The last bit ensures that I get the word 'Contents' as the toc title, 
and avoid then getting 'contents' listed as an item with its page 
number. And if I want a relatively straightforward Table of Contents, 
then this mostly works, giving me (e.g.):


Foreword                    iii

One   Chapter title  1

Two    Chapter title  10

etc.

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:


Foreword            Author's name        iii

Chapter One       Chapter title

                            Author's name   1

Chapter Two    1820-1880

    Chapter title

    Author's name   10

I need to add that the current setup to obtain Chapter Two is with 
\setuplabeltext[chapter={{Chapter },{:1820-1880}}] which gives me 
Chapter Two:1820-1880


I had thought that maybe I could get the author with something like

\starttitle[title={\ss Foreword}][author={Author Name}]

Foreword content

\stoptitle

But that does not produce any author name in the ToC, and in fact the 
Author's name in the Chapter opening page is simply placed manually as a 
right-aligned item in the position where I want it, nothing to do with 
the setup for \chapter (or \title in this case).


Given the above complicated design (or so it seems to me) will I have to 
just set the ToC up manually with a table, or can it be achieved otherwise?


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

2020-09-03 Thread jbf
Thanks Jan, that is an extensive bit of work below! Might take me a 
while to digest, but I'll explore it carefully.


Julian

On 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: *jbf <mailto:roma83...@gmail.com>
*Sent: *Thursday, 3 September 2020 06:05
*To: *mailing list for ConTeXt users <mailto:ntg-context@ntg.nl>
*Subject: *[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] [][numbers]
\startsectionblockenvironment[frontpart]
\setupuserpagenumber[numberconversion=romannumerals]
\setuplist[chapter][pageconversionset=pagenumber]
\setuppagenumber[number=1]
\stopsectionblockenvironment

\startsectionblockenvironment[bodypart]
\setuppagenumber[number=1]
\stopsectionblockenvironment

The frontma

Re: [NTG-context] defining font family for several options

2020-09-03 Thread jbf
The MWE was really just the only line affecting headers, which you 
suggested should be written as it is now written below, rather than the 
way I had it earlier (a leftover from a lack of understanding about font 
switches which Otared kindly explained to me).


\setupheader [style={\switchtobodyfont[10pt,ss]}]

This proper way of setting out the \setupheader has in fact resolved the 
situation and it now applies to both recto and verso headers. Thank you

Julian

On 4/9/20 7:16 am, Aditya Mahajan wrote:

On Fri, 4 Sep 2020, jbf wrote:


Thanks Otared. That clears up that little item :-)

BTW I know how to reduce font size in the headers (chapter titles) that
appear on the recto pages, which I can do with something like
\setupheader [style={\ss\switchtobodyfont[10pt]}], but it doesn't seem

Better to use style={\switchtobodyfont[10pt,ss]} or 
\switchtobodyfont[10pt]\ss...


to affect the header (title of the book) on the verso pages, which is
drawn from the simple statement:

\startdocument
    [metadata:title={Book title}]

Shouldn't  \setupheader affect both headers? Or is it possible I have
left something out of my \setupheader declaration?

A minimal example will make the debugging process much easier.

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
___
___
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] defining font family for several options

2020-09-03 Thread Aditya Mahajan
On Fri, 4 Sep 2020, jbf wrote:

> Thanks Otared. That clears up that little item :-)
> 
> BTW I know how to reduce font size in the headers (chapter titles) that 
> appear on the recto pages, which I can do with something like 
> \setupheader [style={\ss\switchtobodyfont[10pt]}], but it doesn't seem 

Better to use style={\switchtobodyfont[10pt,ss]} or 
\switchtobodyfont[10pt]\ss...

> to affect the header (title of the book) on the verso pages, which is 
> drawn from the simple statement:
> 
> \startdocument
>    [metadata:title={Book title}]
> 
> Shouldn't  \setupheader affect both headers? Or is it possible I have 
> left something out of my \setupheader declaration?

A minimal example will make the debugging process much easier.

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
___


Re: [NTG-context] defining font family for several options

2020-09-03 Thread jbf

Thanks Otared. That clears up that little item :-)

BTW I know how to reduce font size in the headers (chapter titles) that 
appear on the recto pages, which I can do with something like 
\setupheader [style={\ss\switchtobodyfont[10pt]}], but it doesn't seem 
to affect the header (title of the book) on the verso pages, which is 
drawn from the simple statement:


\startdocument
  [metadata:title={Book title}]

Shouldn't  \setupheader affect both headers? Or is it possible I have 
left something out of my \setupheader declaration?


Julian

On 4/9/20 5:30 am, Otared Kavian wrote:

Hi Julian,

The tilde ~ in {\bf\ss #1.~#2} is only there to have an unbreakable fixed space 
between the dot and the first character of the chapter title.  Also in this way 
one can see that one has put a space there… :-)

Best tegards: Otared


On 2 Sep 2020, at 23:29, jbf  wrote:

Thanks Otared,

Still off list. You are very patient but also very thorough, and this is making 
a huge difference to what is in fact a considerable challenge for me, but one I 
am coming to grips with. I believe this aspect of things is now clear to me. No 
hurry, but when you have a moment can you explain the significance of the ~ in 
the {\bf\ss #1.~#2}}part of the definition, before the 2nd element?

After this I'll go back on list! I still have a couple of other queries (not 
font related) about things that are not functioning as they ought at the 
moment, which means I'll need either some understanding or some tweaking, but 
as always there are people on the list like yourself who are prompt with their 
assistance.

Kind regards,

Julian

On 3/9/20 12:34 am, Otared Kavian wrote:

Hi Julian,

First of all, your definition of mychapterfont is incomplete: a font family 
should contain also math fonts, because even if you don't have mathematics in 
your text where you use that font, ConTeXt may pick some characters from math 
fonts. So in my opinion you should define a whole font family named 
mychapterfont, where in particular the sans serif comes from what you are 
indicating.

The second point is that you should not setup bodyfont twice: when you say 
twice \setupbodyfont, ConTeXt will take the last one for the rest of your 
document…
So you say only once
\setupbodyfont[mainface]
and then only where you want to change the font you say
\start \switchtobodyfont[mychapterfont] \ss My special text. \stop

By the way, as we said earlier, you can also use braces instead of \start\stop, 
and even better you can say

\start \switchtobodyfont[mychapterfont,sans] My special text. \stop

A third point is that if you are using mychapterfont only to set the titles of 
chapters, in my opinion it would be better to define a command which takes care 
of all the formatting you are wishing, and then use it in the chapter header. 
Something like

\define[2]\MyChapterCommand{\switchtobodyfont[mychapterfont,12pt] {\bf\ss 
#1.~#2}}
\setuphead[chapter][command=\MyChapterCommand]

In this way you can just say

\startchapter[title={This is my first chapter}]

\input ward.tex

\stopchapter

without the hassles of formatting each title. If only some chapters have the 
special font, then you can define a new family of chapters which may share the 
same counter as the rest of your chapters.

Best regards: Otared


On 2 Sep 2020, at 03:30, jbf  wrote:

Otared, I thought I had it right - and it is partly right, but that newly 
declared font now applies to everything, not just the chapter title. So I 
haven't got it quite right! Maybe I shouldn't bother the list with these extra 
bits so am writing off list. Here is what my font definitions now look like 
(new one highlighted):

\definefontfamily [mainface] [rm] [alegreya] [sc=file:alegreyasc-bold]
\definefontfamily [mainface] [ss] [dax][tf=file:dax-regular,bf=file:dax-medium]
\definefontfamily [mainface] [mm] [alegreya]
\definefontfamily [mychapterfont] [ss] [itcavantgardepromd] 
[ss=file:itcavantgardepro-md]
\setupbodyfont[mainface]
\setupbodyfont[mychapterfont]

I presumed I would have to \setupbodyfont[mychapterfont], but is this where I 
have gone wrong?.

Then in the first chapter, I wrote as follows:

\chapter{{\switchtobodyfont[mychapterfont] \ss Introduction to the BDACE Online 
Project}} and I am getting my AvanteGardePro-MD font alright, but it now 
applies to the whole document!

I tried following title with \start switchtobodyfont[mainface] \rm and then my 
body text (followed by \stop obviously, at the end of the chapter). But this 
did not work.

I then thought that I could use this [mychapterfont] and include it somehow in 
my \setuphead[chapter] so it would work for all chapter titles, along the lines 
of: \setuphead [chapter] [header=empty, {\switchtobodyfont[mychapterfont] \ss}] 
but that hasn't worked either - my body text throughout is still in the sans 
serif, not the usual [mainface] [rm]

I think the problem is that if I define two or more \setupbodyfont items, it is 
the last

Re: [NTG-context] \setupuserpagenumber not working as expected

2020-09-03 Thread Jan Willem Flamma
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] [][numbers]\startsectionblockenvironment[frontpart]\setupuserpagenumber[numberconversion=romannumerals]\setuplist[chapter][pageconversionset=pagenumber]\setuppagenumber[number=1]\stopsectionblockenvironment\startsectionblockenvironment[bodypart]\setuppagenumber[number=1]\stopsectionblockenvironmentThe frontmatter is some 16 pages worth (ends on a verso page but that verso carries the arabic number 1 instead of page xvi which it should be, since the final paragraph on that page ends

Re: [NTG-context] odd behaviour with \definefontfamily

2020-08-25 Thread jbf

I get it now. Thanks to you both.

Julian

On 26/8/20 2:20 pm, Wolfgang Schuster wrote:

jbf schrieb am 26.08.2020 um 05:42:

MWE as follows:

\definefontfamily [mainface] [rm] [baskervaldadfstd] 
[tf=file:BaskervaldADFStd.otf]
\definefontfamily [mainface] [ss] [librisadfstd] 
[tf=file:LibrisADFStd-Regular.otf]

\definefontfamily [mainface] [mm] [TeX Gyre Pagella Math]

\setupbodyfont[mainface]

\starttext
\tf ffi,

\it ffi,

\bf ffi,

\bi ffi.

\ss THIS IS A TITLE IN SANS SERIF

\tt Monospaced

\stoptext

Context then tells me that:

/mkiv lua stats  > loaded fonts: 6 files: baskervaldadfstd-bold.otf, 
baskervaldadfstd-bolditalic.otf, baskervaldadfstd-italic.otf, 
baskervaldadfstd.otf, librisadfstd-bolditalic.otf, 
texgyrepagella-math.otf/


So, in this instance, and as you explained would be the case, it is 
loading the sans serif family (Libris) but I note that it is not 
giving me what I asked for, which was /LibrisADFStd-Regular.otf/. 
Instead it has given me /LibrisADFStd-BoldItalic.otf/


And I deliberately did not include any maths, or itemize or anything 
that might involve those symbols, thinking it would not then load the 
Pagella Maths file, but it did. So my two questions now are


1. Why is it loading Libris BoldItalic and not Regular as asked for?


You used \bi before you switched to the sans serif font and the style 
is still active. To prevent this problem add around around style 
changes, e.g. {\bi ...}.


2. If I am not using Maths so far, why is it loading the Pagella math 
file?


ConTeXt checks the math font when you change the font with 
\setupbodyfont and at this point the math font gets loaded.


You can prevent the loading of the math font with \textonly but you 
should use this only when you're 100% sure you never use math in your 
document. As Aditya already ConTeXt can use math for itemize symbols 
(which isn't the default behavior anymore) and it's better to keep 
math to avoid problems.


%% begin example
\textonly

\starttext
\unknown
\stoptext
%% end example

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] odd behaviour with \definefontfamily

2020-08-25 Thread Wolfgang Schuster

jbf schrieb am 26.08.2020 um 05:42:

MWE as follows:

\definefontfamily [mainface] [rm] [baskervaldadfstd] 
[tf=file:BaskervaldADFStd.otf]
\definefontfamily [mainface] [ss] [librisadfstd] 
[tf=file:LibrisADFStd-Regular.otf]

\definefontfamily [mainface] [mm] [TeX Gyre Pagella Math]

\setupbodyfont[mainface]

\starttext
\tf ffi,

\it ffi,

\bf ffi,

\bi ffi.

\ss THIS IS A TITLE IN SANS SERIF

\tt Monospaced

\stoptext

Context then tells me that:

/mkiv lua stats  > loaded fonts: 6 files: baskervaldadfstd-bold.otf, 
baskervaldadfstd-bolditalic.otf, baskervaldadfstd-italic.otf, 
baskervaldadfstd.otf, librisadfstd-bolditalic.otf, texgyrepagella-math.otf/


So, in this instance, and as you explained would be the case, it is 
loading the sans serif family (Libris) but I note that it is not giving 
me what I asked for, which was /LibrisADFStd-Regular.otf/. Instead it 
has given me /LibrisADFStd-BoldItalic.otf/


And I deliberately did not include any maths, or itemize or anything 
that might involve those symbols, thinking it would not then load the 
Pagella Maths file, but it did. So my two questions now are


1. Why is it loading Libris BoldItalic and not Regular as asked for?


You used \bi before you switched to the sans serif font and the style is 
still active. To prevent this problem add around around style changes, 
e.g. {\bi ...}.



2. If I am not using Maths so far, why is it loading the Pagella math file?


ConTeXt checks the math font when you change the font with 
\setupbodyfont and at this point the math font gets loaded.


You can prevent the loading of the math font with \textonly but you 
should use this only when you're 100% sure you never use math in your 
document. As Aditya already ConTeXt can use math for itemize symbols 
(which isn't the default behavior anymore) and it's better to keep math 
to avoid problems.


%% begin example
\textonly

\starttext
\unknown
\stoptext
%% end example

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] odd behaviour with \definefontfamily

2020-08-25 Thread jbf

MWE as follows:

\definefontfamily [mainface] [rm] [baskervaldadfstd] 
[tf=file:BaskervaldADFStd.otf]
\definefontfamily [mainface] [ss] [librisadfstd] 
[tf=file:LibrisADFStd-Regular.otf]

\definefontfamily [mainface] [mm] [TeX Gyre Pagella Math]

\setupbodyfont[mainface]

\starttext
\tf ffi,

\it ffi,

\bf ffi,

\bi ffi.

\ss THIS IS A TITLE IN SANS SERIF

\tt Monospaced

\stoptext

Context then tells me that:

/mkiv lua stats  > loaded fonts: 6 files: baskervaldadfstd-bold.otf, 
baskervaldadfstd-bolditalic.otf, baskervaldadfstd-italic.otf, 
baskervaldadfstd.otf, librisadfstd-bolditalic.otf, texgyrepagella-math.otf/


So, in this instance, and as you explained would be the case, it is 
loading the sans serif family (Libris) but I note that it is not giving 
me what I asked for, which was /LibrisADFStd-Regular.otf/. Instead it 
has given me /LibrisADFStd-BoldItalic.otf/


And I deliberately did not include any maths, or itemize or anything 
that might involve those symbols, thinking it would not then load the 
Pagella Maths file, but it did. So my two questions now are


1. Why is it loading Libris BoldItalic and not Regular as asked for?

2. If I am not using Maths so far, why is it loading the Pagella math file?

Julian

On 26/8/20 1:18 pm, Aditya Mahajan wrote:

On Wed, 26 Aug 2020, jbf wrote:


I intend to use it! So, yes, I had not used it at this point, and your
explanation now makes sense.

In the test example I have, I have now placed a line:  \ss My text, and I see
that it now loads the sans serif font. But can you explain why it loads the
math font, given that I have not, as yet, used that anywhere (and may not - it
is there for insurance in case such a glyph is needed)?

A complete minimal working example will help ... (some symbols, like the bullet 
in itemize is taken from the math font).

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
___


Re: [NTG-context] Overriding the number on a float

2020-08-25 Thread Duncan Hothersall
Thanks all for useful tips. I ended up doing something similar as a short
term fix for my float number override issue, basically setting up a new
float type to use for the deviant ones and then resetting the numbering of
the existing ones. It would be great if there was a facility to just drop
in an override on an individual float using the equivalent of
ownnumber={27.1b}, but I appreciate this may be much more complex under the
hood than it seems to a mere mortal. Certainly my brief perusal of the
sources left me baffled, as usual!

Thanks again.

Duncan

On Mon, 24 Aug 2020 at 22:51, Taco Hoekwater  wrote:

>
>
> > On 24 Aug 2020, at 19:59, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> wrote:
> >
> >>
> >>
> >> \setcounter[figure][5] % next figure is no.6
>
> For this subfigure stuff, perhaps this is useful?
>
> % setup definitions
> \definecounter[subfigure][way=bytext,prefix=no]
> \setupcounter[subfigure][state=start,numberconversion=a]
> \setcounter[subfigure][1]
>
> \def\setsubfigures
>   {\setcounter[subfigure][1]
>\incrementcounter[figure]
>
>  
> \setupcaption[figure][state=stop,numberstopper={\convertedcounter[subfigure]}]}
>
> \def\unsetsubfigures
>   {\setupcaption[figure][state=start,numberstopper=]}
>
> %usage
> \setsubfigures
>
> \startplacefigure[title=Test figure]
> \externalfigure[dummy]
> \stopplacefigure
>
> \incrementnumber[subfigure]
>
> \startplacefigure[title=Test another figure]
> \externalfigure[dummy]
> \stopplacefigure
>
> \unsetsubfigures
>
>
> I could not find a safe way to increment the subfigure number
> automatically, unfortunately.
>
> Best wishes,
> Taco
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


-- 
Duncan Hothersall, Operations Director
CAPDM Limited - Online Program Enablers
0131 677 2400  www.capdm.com
Registered in Scotland: SC168970   VAT: 682 846 983
Registered address: 20 Forth Street Edinburgh EH1 3LH UK
<https://maps.google.com/?q=22+Forth+Street,+Edinburgh,+EH1+3LH,+UK=gmail=g>

Capture, author, publish, deliver and manage your learning materials.


*Sign up to the CAPDM newsletter here <http://eepurl.com/bqzBQn>*
___
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 the number on a float

2020-08-24 Thread Taco Hoekwater


> On 24 Aug 2020, at 19:59, Wolfgang Schuster 
>  wrote:
> 
>> 
>> 
>> \setcounter[figure][5] % next figure is no.6

For this subfigure stuff, perhaps this is useful?

% setup definitions
\definecounter[subfigure][way=bytext,prefix=no]
\setupcounter[subfigure][state=start,numberconversion=a]
\setcounter[subfigure][1]

\def\setsubfigures
  {\setcounter[subfigure][1]
   \incrementcounter[figure]
   
\setupcaption[figure][state=stop,numberstopper={\convertedcounter[subfigure]}]}

\def\unsetsubfigures
  {\setupcaption[figure][state=start,numberstopper=]}

%usage
\setsubfigures

\startplacefigure[title=Test figure]
\externalfigure[dummy]
\stopplacefigure

\incrementnumber[subfigure]

\startplacefigure[title=Test another figure]
\externalfigure[dummy]
\stopplacefigure

\unsetsubfigures


I could not find a safe way to increment the subfigure number automatically, 
unfortunately.

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

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


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Otared Kavian
Hi,

If there are a few special numberings of floats, and one wants floats numbered 
1.6a and 1.6b, the following seems to work:

Best regards: Otared

%%% begin ownnumber-in-floats.tex
\useMPlibrary[dum]

\starttext

\startsection[title=One]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\startsection[title=Two]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[figure][5] % next figure is no.6

\startsection[ownnumber=10,title={A section}] 
\start
\setupcaptions[numberstopper={a}]
\startplacefigure[title=Test figure]
\externalfigure[dummy]
\stopplacefigure
\stop
\stopsection

\setcounter[figure][5]

\startsection[ownnumber=11,title={Another section}] % ownnumber doesn’t work
\start
\setupcaptions[numberstopper={b}]
\startplacefigure[title=Test another figure]
\externalfigure[dummy]
\stopplacefigure
\stop

\startplacefigure[title=Test another figure]
\externalfigure[dummy]
\stopplacefigure

\stopsection

\stoptext
%%% end ownnumber-in-floats.tex

> On 24 Aug 2020, at 19:37, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 24.08.2020 um 17:36 schrieb Wolfgang Schuster 
>> :
>> 
>> Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:
>>>> Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :
>>>> 
>>>> I think there was a question on this very recently but I don;t think it 
>>>> got an answer and I can't find it to reply to, so apologies for the extra 
>>>> noise. I have a large text with floats numbered sequentially by chapter 
>>>> and then figure/table number, but at the last minute I've had a request 
>>>> for two figures in a particular chapter to become 27.1a and 27.1b instead 
>>>> of 27.1 and 27.2. It's not a combination - they are separate figures on 
>>>> different pages.
>>>> 
>>>> I've experimented with the options I can see, but it's not obvious if 
>>>> there is a facility to override the numbering of two figures in a stream 
>>>> of normally numbered figures like this. I was thinking of the equivalent 
>>>> of the old \sym{symbol} command that used to work as a way to override a 
>>>> single item in an otherwise sequential list.
>>>> 
>>>> I guess there's a brute force method of setting up a new type of figure 
>>>> with the label "Figure 27.1" and having them numbered as lowercase alpha, 
>>>> but if there's an easier way that would be great.
>>> I’m also interested in overriding automatical numbering, e.g. of chapters 
>>> or itemization items.
>>> E.g. in my songbook, I’d like to have the verses numbered but interrupted 
>>> by a chorus numbered as "C" (i.e. "R" in German).
>>> Similarly the paragraphs of some (by)laws that were changed a lot and use a 
>>> numbering like 1, 2, 3, 3a, 4, 7...
>>> Something like
>>> \startitem[number={R}]
>>> or
>>> \startsection[number={3a}]
>>> would be nice.
>>> If I set it to an integer, ConTeXt should set the counter accordingly, 
>>> otherwise continue counting from the previous calculated number. Would that 
>>> be possible?
>> 
>> 
>> You can set your own section numbers but the counter isn't stopped.
> 
> Thank you! I overlooked "ownnumber". It works for sections, but not for items 
> or floats.
> 
> \setnumber[section][10] doesn’t work, \setcounter the same (according to the 
> source they’re synonymous) – does section use a different counter name or is 
> it no counter at all?
> 
> \setnumber[figure][10] works (but only with integers, not some alphanumerical 
> stuff, sorry Duncan).
> 
> Hraban
> 
> 
> \useMPlibrary[dum]
> 
> \starttext
> 
> \startsection[title=One]
> \startplacefigure[title=Test]
> \externalfigure[dummy]
> \stopplacefigure
> \stopsection
> 
> \startsection[title=Two]
> \startplacefigure[title=Test]
> \externalfigure[dummy]
> \stopplacefigure
> \stopsection
> 
> \setcounter[figure][5] % next figure is no.6
> 
> \startsection[ownnumber=10,title=???] % ownnumber doesn’t work
> \startplacefigure[title=Test,ownnumber=10]
> \externalfigure[dummy]
> \stopplacefigure
> \stopsection
> 
> \setcounter[section][5] % doesn’t work
> 
> \startsection[title=Three]
> \startitemize[n]
>  \item one
>  \item two
>  \item three
>  \startitem[ownnumber=9] five\stopitem  % ownnumber doesn’t work
> \stopitemize
> \stopsection
> 
> \stoptext
> 
> ___
> If your question is of interest to others as well, ple

Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 24.08.2020 um 19:37:

Am 24.08.2020 um 17:36 schrieb Wolfgang Schuster 
:

Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:

Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :

I think there was a question on this very recently but I don;t think it got an 
answer and I can't find it to reply to, so apologies for the extra noise. I 
have a large text with floats numbered sequentially by chapter and then 
figure/table number, but at the last minute I've had a request for two figures 
in a particular chapter to become 27.1a and 27.1b instead of 27.1 and 27.2. 
It's not a combination - they are separate figures on different pages.

I've experimented with the options I can see, but it's not obvious if there is 
a facility to override the numbering of two figures in a stream of normally 
numbered figures like this. I was thinking of the equivalent of the old 
\sym{symbol} command that used to work as a way to override a single item in an 
otherwise sequential list.

I guess there's a brute force method of setting up a new type of figure with the label 
"Figure 27.1" and having them numbered as lowercase alpha, but if there's an 
easier way that would be great.

I’m also interested in overriding automatical numbering, e.g. of chapters or 
itemization items.
E.g. in my songbook, I’d like to have the verses numbered but interrupted by a chorus numbered as 
"C" (i.e. "R" in German).
Similarly the paragraphs of some (by)laws that were changed a lot and use a 
numbering like 1, 2, 3, 3a, 4, 7...
Something like
\startitem[number={R}]
or
\startsection[number={3a}]
would be nice.
If I set it to an integer, ConTeXt should set the counter accordingly, 
otherwise continue counting from the previous calculated number. Would that be 
possible?


You can set your own section numbers but the counter isn't stopped.

Thank you! I overlooked "ownnumber". It works for sections, but not for items 
or floats.

\setnumber[section][10] doesn’t work, \setcounter the same (according to the 
source they’re synonymous) – does section use a different counter name or is it 
no counter at all?

\setnumber[figure][10] works (but only with integers, not some alphanumerical 
stuff, sorry Duncan).


\setupnumber is a synonym of \setupcounter and exists for backwards 
compatibility.



Hraban


\useMPlibrary[dum]

\starttext

\startsection[title=One]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\startsection[title=Two]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[figure][5] % next figure is no.6

\startsection[ownnumber=10,title=???] % ownnumber doesn’t work
\startplacefigure[title=Test,ownnumber=10]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[section][5] % doesn’t work


\setupheadnumber[section][5]


\startsection[title=Three]
\startitemize[n]
   \item one
   \item two
   \item three
   \startitem[ownnumber=9] five\stopitem  % ownnumber doesn’t work



\starttext
\startitemize
\txt{I.} \unknown
\sym{7.} \unknown
\stopitemize
\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] Overriding the number on a float

2020-08-24 Thread Henning Hraban Ramm


> Am 24.08.2020 um 17:36 schrieb Wolfgang Schuster 
> :
> 
> Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:
>>> Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :
>>> 
>>> I think there was a question on this very recently but I don;t think it got 
>>> an answer and I can't find it to reply to, so apologies for the extra 
>>> noise. I have a large text with floats numbered sequentially by chapter and 
>>> then figure/table number, but at the last minute I've had a request for two 
>>> figures in a particular chapter to become 27.1a and 27.1b instead of 27.1 
>>> and 27.2. It's not a combination - they are separate figures on different 
>>> pages.
>>> 
>>> I've experimented with the options I can see, but it's not obvious if there 
>>> is a facility to override the numbering of two figures in a stream of 
>>> normally numbered figures like this. I was thinking of the equivalent of 
>>> the old \sym{symbol} command that used to work as a way to override a 
>>> single item in an otherwise sequential list.
>>> 
>>> I guess there's a brute force method of setting up a new type of figure 
>>> with the label "Figure 27.1" and having them numbered as lowercase alpha, 
>>> but if there's an easier way that would be great.
>> I’m also interested in overriding automatical numbering, e.g. of chapters or 
>> itemization items.
>> E.g. in my songbook, I’d like to have the verses numbered but interrupted by 
>> a chorus numbered as "C" (i.e. "R" in German).
>> Similarly the paragraphs of some (by)laws that were changed a lot and use a 
>> numbering like 1, 2, 3, 3a, 4, 7...
>> Something like
>> \startitem[number={R}]
>> or
>> \startsection[number={3a}]
>> would be nice.
>> If I set it to an integer, ConTeXt should set the counter accordingly, 
>> otherwise continue counting from the previous calculated number. Would that 
>> be possible?
> 
> 
> You can set your own section numbers but the counter isn't stopped.

Thank you! I overlooked "ownnumber". It works for sections, but not for items 
or floats.

\setnumber[section][10] doesn’t work, \setcounter the same (according to the 
source they’re synonymous) – does section use a different counter name or is it 
no counter at all?

\setnumber[figure][10] works (but only with integers, not some alphanumerical 
stuff, sorry Duncan).

Hraban


\useMPlibrary[dum]

\starttext

\startsection[title=One]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\startsection[title=Two]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[figure][5] % next figure is no.6

\startsection[ownnumber=10,title=???] % ownnumber doesn’t work
\startplacefigure[title=Test,ownnumber=10]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[section][5] % doesn’t work

\startsection[title=Three]
\startitemize[n]
  \item one
  \item two
  \item three
  \startitem[ownnumber=9] five\stopitem  % ownnumber doesn’t work
\stopitemize
\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] Overriding the number on a float

2020-08-24 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:




Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :

I think there was a question on this very recently but I don;t think it got an 
answer and I can't find it to reply to, so apologies for the extra noise. I 
have a large text with floats numbered sequentially by chapter and then 
figure/table number, but at the last minute I've had a request for two figures 
in a particular chapter to become 27.1a and 27.1b instead of 27.1 and 27.2. 
It's not a combination - they are separate figures on different pages.

I've experimented with the options I can see, but it's not obvious if there is 
a facility to override the numbering of two figures in a stream of normally 
numbered figures like this. I was thinking of the equivalent of the old 
\sym{symbol} command that used to work as a way to override a single item in an 
otherwise sequential list.

I guess there's a brute force method of setting up a new type of figure with the label 
"Figure 27.1" and having them numbered as lowercase alpha, but if there's an 
easier way that would be great.


I’m also interested in overriding automatical numbering, e.g. of chapters or 
itemization items.

E.g. in my songbook, I’d like to have the verses numbered but interrupted by a chorus numbered as 
"C" (i.e. "R" in German).
Similarly the paragraphs of some (by)laws that were changed a lot and use a 
numbering like 1, 2, 3, 3a, 4, 7...

Something like
\startitem[number={R}]
or
\startsection[number={3a}]
would be nice.
If I set it to an integer, ConTeXt should set the counter accordingly, 
otherwise continue counting from the previous calculated number. Would that be 
possible?



You can set your own section numbers but the counter isn't stopped.

\starttext

\startsection[title=One]
\stopsection

\startsection[title=Two]
\stopsection

\startsection[ownnumber=X,title=???]
\stopsection

\startsection[title=Three]
\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] Label to delete in the table of contents

2020-08-24 Thread Fabrice Couvreur
Thanks !!

Le lun. 24 août 2020 à 15:41, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 24.08.2020 um 15:32:
>
> Hi Wolfgang,
> Thank you for your reply. Probably my fault but now I get the number 0 on
> the word "Summary".
> Fabrice
> [image: contents.png]
>
>
> \setuphead
>   [title]
>   [command=,
>numbercommand=]
>
> 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] Label to delete in the table of contents

2020-08-24 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 24.08.2020 um 15:32:

Hi Wolfgang,
Thank you for your reply. Probably my fault but now I get the number 0 
on the word "Summary".

Fabrice
contents.png


\setuphead
  [title]
  [command=,
   numbercommand=]

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] Label to delete in the table of contents

2020-08-24 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you for your reply. Probably my fault but now I get the number 0 on
the word "Summary".
Fabrice
[image: contents.png]

Le lun. 24 août 2020 à 15:12, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 23.08.2020 um 16:02:
>
> Hello,
> For the title of the chapters I use the following command.
>
> \unexpanded\def\HeadTitle#1#2%
>{\framed
>   [frame=off,
>width=fit,
>align=flushleft]
>{\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
> \blank#1\blank#2}
>
> When I compile my project, I have the label "Chapitre" above the word
> "Sommaire" in the table of contents : how to delete it ?
>
>
> 1. Don't apply the command to \title
>
> \setuphead[title][command=]
>
>
> 2. Make the command local to bodypart of your document, this works only
> when you use section blocks (e.g. \startbodymatter)
>
> \startsectionblockenvironment[bodypart]
> \setuphead[chapter][command=\HeadTitle]
> \stopsectionblockenvironment
>
>
> 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] Label to delete in the table of contents

2020-08-24 Thread Wolfgang Schuster

Fabrice Couvreur schrieb am 23.08.2020 um 16:02:

Hello,
For the title of the chapters I use the following command.

\unexpanded\def\HeadTitle#1#2%
   {\framed
[frame=off,
       width=fit,
       align=flushleft]
 {\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
\blank#1\blank#2}

When I compile my project, I have the label "Chapitre" above the word 
"Sommaire" in the table of contents : how to delete it ?


1. Don't apply the command to \title

\setuphead[title][command=]


2. Make the command local to bodypart of your document, this works only 
when you use section blocks (e.g. \startbodymatter)


\startsectionblockenvironment[bodypart]
    \setuphead[chapter][command=\HeadTitle]
\stopsectionblockenvironment


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] Label to delete in the table of contents

2020-08-23 Thread Fabrice Couvreur
Hello,
For the title of the chapters I use the following command.

\unexpanded\def\HeadTitle#1#2%
   {\framed
  [frame=off,
   width=fit,
   align=flushleft]
   {\color[darkgray]{\tfxx\cap\bf\labeltext{chapter}}
\blank#1\blank#2}

When I compile my project, I have the label "Chapitre" above the word
"Sommaire" in the table of contents : how to delete it ?
Thanks for your help
Fabrice
___
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] Chapter heading with rules

2020-08-21 Thread Otared Kavian
Hi Julian,

Indeed you can acchieve what you want, but it is better to define a command 
which takes care of the number and the title of the chapter at the same time 
(as in \ myChapterCommand below).

%% begin example.tex
\definefiller[ChapterRule]
[alternative=rule,
color=gray,
height=0.8ex,
depth=-0.6ex]

\definefiller[ChapterLeftRule]
[ChapterRule]
[left=\zerowidthnobreakspace,
right=\quad]

\definefiller[ChapterRightRule]
[ChapterRule]
[left=\quad,
right=\zerowidthnobreakspace]

\define[2]\myChapterCommand{%
\midaligned{{\filler[ChapterLeftRule]}#1.~#2{\filler[ChapterRightRule]}}
}

\setuphead[chapter]
[textstyle={\setcharactercasing[WORD]\ssa},
command=\myChapterCommand]

\starttext

\startchapter[title={My Chapter Title}]
\input knuth.tex
\stopchapter

\stoptext

%% end example.tex

Best regards: Otared K.

> On 21 Aug 2020, at 03:53, jbf  wrote:
> 
> Have achieved a Chapter title with rules either side (see below - not an 
> original invention!) but I want the chapter number to be part of 'My Chapter 
> Title'; instead, the following MWE means it comes before the ChapterLeftRule. 
> I know I can do it by actually putting the number before My Chapter title 
> (e.g. 1 My Chapter Title), since the proper numbered version still appears in 
> the TOC, but my preference would be to include a command in the \setuphead, 
> if possible (so long as it still allows the numbered chapter to appear in the 
> TOC of course). Possible?
> 
> \definefiller
>   [ChapterRule]
>   [alternative=rule,
>color=gray,
>height=0.8ex,
>depth=-0.6ex]
> 
> \definefiller
>   [ChapterLeftRule]
>   [ChapterRule]
>   [left=\zerowidthnobreakspace,
>right=\quad]
> 
> \definefiller
>   [ChapterRightRule]
>   [ChapterRule]
>   [left=\quad,
>right=\zerowidthnobreakspace]
> 
> \setuphead
>   [chapter]
>   [%align=middle,
>textstyle={\setcharactercasing[WORD]\ssa},
> textcommand=\groupedcommand{\filler[ChapterLeftRule]}{\filler[ChapterRightRule]}]
> 
> \starttext
> 
> \chapter{My Chapter Title}
> 
> \stoptext
> 
> 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] Chapter heading with rules

2020-08-20 Thread jbf
Have achieved a Chapter title with rules either side (see below - not an 
original invention!) but I want the chapter number to be part of 'My 
Chapter Title'; instead, the following MWE means it comes before the 
ChapterLeftRule. I know I can do it by actually putting the number 
before My Chapter title (e.g. 1 My Chapter Title), since the proper 
numbered version still appears in the TOC, but my preference would be to 
include a command in the \setuphead, if possible (so long as it still 
allows the numbered chapter to appear in the TOC of course). Possible?


\definefiller
  [ChapterRule]
  [alternative=rule,
   color=gray,
   height=0.8ex,
   depth=-0.6ex]

\definefiller
  [ChapterLeftRule]
  [ChapterRule]
  [left=\zerowidthnobreakspace,
   right=\quad]

\definefiller
  [ChapterRightRule]
  [ChapterRule]
  [left=\quad,
   right=\zerowidthnobreakspace]

\setuphead
  [chapter]
  [%align=middle,
   textstyle={\setcharactercasing[WORD]\ssa},
textcommand=\groupedcommand{\filler[ChapterLeftRule]}{\filler[ChapterRightRule]}]

\starttext

\chapter{My Chapter Title}

\stoptext

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] TOC chapter and section numbering

2020-08-19 Thread Adrian
Excellent, this was the solution.  I'm certain to learn a great
deal from it.

Thanks again,

Adrian


Sent with ProtonMail Secure Email.

‐‐‐ Original Message ‐‐‐
On Wednesday, August 19, 2020 9:44 AM, Wolfgang Schuster 
 wrote:

> Adrian schrieb am 18.08.2020 um 06:40:
>
> > Hello,
> > I'm attempting to typeset a short book using ConTeXt
> > (current version: 2020.08.09 22:03).
> > EXAMPLE:
> > [...]
> > I would like all the chapters to be prefixed with "Chapter RN." and the
> > sections to keep a single count,
> > for example:
> > Chapter I. Introductory .
> >    1. The concept of a function
> >    2. Extension and intension
> >    3. Functions of several variables
> >    4. Abstraction
> > Chapter II. Lambda Conversion .
> >    5. Primitive symbols and formulas
> >    6. Conversion
> >    7. Fundamental theorems on well-formed formulas and on the normal form
> > I tried to the following for the chapters:
> > \defineconversion[church][Chapter \Romannumerals.\quad]
> > \setuphead[chapter][conversion=church]
> > Which appeared to generate the prefix correctly but it overlapped the
> > title.
>
> \setuplabeltext
> [en] [chapter=Chapter ]
>
> \defineresetset
> [default] [0,0,0] [1]
>
> \defineconversionset
> [section] [n,R,n] [n]
>
> \setuphead
> [chapter]
> [sectionconversionset=section,
> sectionstopper=.]
>
> \setuphead
> [section]
> [sectionsegments=section,
> sectionconversionset=section,
> sectionstopper=.]
>
> \setuphead
> [title]
> [alternative=middle,
> style=WORD]
>
> \setuplist
> [chapter]
> [label=yes,
> style=bold,
> width=fit,
> distance=\spaceamount]
>
> \setuplist
> [section]
> [margin=3em,
> width=1.5em]
>
> \starttext
>
> \completecontent
>
> ...
>
> \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] TOC chapter and section numbering

2020-08-19 Thread Wolfgang Schuster

Adrian schrieb am 18.08.2020 um 06:40:

Hello,

I'm attempting to typeset a short book using ConTeXt 
(current version: 2020.08.09 22:03).


*EXAMPLE*:

[...]

I would like all the chapters to be prefixed with "Chapter RN." and the 
sections to keep a single count,

for example:

*Chapter I. Introductory .*
    1. The concept of a function
    2. Extension and intension
    3. Functions of several variables
    4. Abstraction
*Chapter II. Lambda Conversion .*
    5. Primitive symbols and formulas
    6. Conversion
    7. Fundamental theorems on well-formed formulas and on the normal form

I tried to the following for the chapters:

\defineconversion[church][Chapter \Romannumerals.\quad]
\setuphead[chapter][conversion=church]

Which appeared to generate the prefix correctly but it overlapped the 
title.


\setuplabeltext
  [en] [chapter=Chapter ]

\defineresetset
  [default] [0,0,0] [1]

\defineconversionset
  [section] [n,R,n] [n]

\setuphead
  [chapter]
  [sectionconversionset=section,
   sectionstopper=.]

\setuphead
  [section]
  [sectionsegments=section,
   sectionconversionset=section,
   sectionstopper=.]

\setuphead
  [title]
  [alternative=middle,
   style=WORD]

\setuplist
  [chapter]
  [label=yes,
   style=bold,
   width=fit,
   distance=\spaceamount]

\setuplist
  [section]
  [margin=3em,
   width=1.5em]

\starttext

\completecontent

...

\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] memoir-style chapter heading

2020-08-18 Thread jbf
Thank you Otared. The power of ConTeXt never ceases to amaze me, though 
despite the excellent work done on the wiki recently, it is the little 
things like the use of \raise that could be better described, especially 
in a range of applied instances. We find it, combined with hbox, in 
reference to marginal and centered headers, but it is not intuitive - 
for me at least - to be able to apply it as you have done in your 
example. The little process we have gone through, which is step-by-step, 
is most helpful, and I feel that I can now use these ideas in other 
instances and in slightly different ways. Thank you.


How important is the 'lohi' addition you made to \framed? I removed it 
to see what would happen and did not notice any appreciable difference 
in the output.


Julian

On 18/8/20 11:19 pm, Otared Kavian wrote:

Hi Julian,

Actually one can tweak more or less the height at which the chapter number 
appears: below is an example in which one uses \raise and \hbox.

\setuppagenumbering[state=start,location=footer]
\setuphead[chapter]
[
%   numberstyle={\switchtobodyfont[48pt]},
numbercolor=gray,
alternative=command,
command=\MemoirChapter,
]

%\define[2]\MemoirChapter
%   {\startoverlay
%   {#1}
%   {#2}
%   \stopoverlay}


\define[2]\MemoirChapter
{\framed[frame=off,width=broad,align={middle,lohi}]
{\startoverlay
{\raise1.5ex\hbox{\switchtobodyfont[48pt]#1}}
{#2}
\stopoverlay}
}

\starttext
\startchapter[title={This is a test},ownnumber=1234]
\input knuth.tex

\stopchapter

\stoptext

Best regards: Otared


On 18 Aug 2020, at 11:47, jbf  wrote:

Thanks Otared - and whether using the earlier example (Aditya's with my minor 
'centering' adjustment)) or yours, I agree - the number is just a bit too low, 
and of course, using this method we probably can't make adjustments to that. So 
ultimately it looks like I'll have to get my skills up to working with layers 
as well as overlays, where minute adjustments of the kind can be made. But 
wouldn't it be great if we could just do a bit of vertical adjustment in the 
overlay!

Julian

On 18/8/20 6:45 pm, Otared Kavian wrote:

Hi Julian,

Indeed you can modify slightly what Aditya said to obtain what you want: you 
can put the overlay into a framed environment as in the following example. 
Though, to my taste the number is a little bit too low…

%% begin example
\setuppagenumbering[state=start,location=footer]
\setuphead[chapter]
[
numberstyle={\switchtobodyfont[48pt]},
numbercolor=gray,
alternative=command,
command=\MemoirChapter,
]

\define[2]\MemoirChapter
{\framed[frame=off,width=broad,align=middle]
{\startoverlay
{#1}
{#2}
\stopoverlay}
}

\starttext
\startchapter[title={This is a test}]
\input knuth.tex

\stopchapter

\stoptext
%% end example

Best regards: Otared


On 18 Aug 2020, at 01:18, jbf  wrote:

I meant to include an example of what I mean, since at least it seems to work 
(am including just the definition part of your example), So at least I can get 
middle and right alignment.

\define[2]\MemoirChapter
  {\midaligned{\startoverlay
   {#1}
   {#2}
 \stopoverlay}}

Julian

On 17/8/20 4:54 pm, Aditya Mahajan wrote:

On Mon, 17 Aug 2020, jbf wrote:


Am completely new to using Metafun, which I presume I would need to use
to achieve a Hansen Memoir-style Chapter heading (chapter title
overlayed on a large lightgray number). Of course, I am assuming I would
need to use Metafun to create this...

So my first question is to ask if I could achieve the same effect
without Metafun?

I have read through the Metafun manual, and I think I can understand how
to overlay text on a graphic (MP), but it would be currently beyond me
to draw numbers of the kind we find in, say, the Memoir examples.

Has anyone created such an example? I was keenly looking for one in the
manual and elsewhere, in terms of ConTeXt/Metafun commands, but could
not find one. But I'd be quite prepared to 'have a go' at this, if I had
some pointers of just where to start! I assume I would have to
\defineoverlay[number] and then add text on top \framed (but without the
frame borders). Am I at least correct about this?

You don't need metafun for something this simple. Here is a crude 
implementation:

\setuphead[chapter]
   [
 numberstyle={\switchtobodyfont[48pt]},
 numbercolor=gray,
 alternative=command,
 command=\MemoirChapter,
   ]

\define[2]\MemoirChapter%
   {\startoverlay
   {#1}
   {#2}
 \stopoverlay}
   \starttext
\startchapter[title={This is a test}]
\stopchapter

\stoptext

Overlays don't allow tuning the location...for that you need layers. See the 
chapter

[NTG-context] Chapter number with Luametafun

2020-08-18 Thread Fabrice Couvreur
Hello,
How to get the number of the current chapter ?
How to get the label "Chapitre" ?
Thanks for your help.
Fabrice

%%% Begin example

\mainlanguage[fr]

\setcharacterspacing [frenchpunctuation]

\setuplabeltext[fr][chapter=Chapitre~]

\startuseMPgraphic{fun}
  definecolor[name="Mycolor", s = 0.85 ]
  draw lmt_outline
   [
text = "1",
kind = "fillup",
fillcolor = "Mycolor",
rulethickness = 1,
   ]
  xsized 1cm;
\stopuseMPgraphic

\unexpanded\def\MyNumber#1{\useMPgraphic{fun}#1}

\unexpanded\def\Title#1#2{\framed[frame=off,width=fit,align=flushleft]
  {#1\blank#2}}

\setuphead[chapter]
  [style=\bfd,
   align={flushleft,broad},
   command=\Title,
   textcommand=\MyNumber,
   numbercommand=\groupedcommand{}{\MyNumber},
   number=no]

\starttext
\startchapter
  [title={First chapter}]
  \input knuth.tex
\stopchapter
\startchapter
  [title={Second chapter}]
  \input knuth.tex
\stopchapter
\stoptext

%%% end example
___
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] TOC chapter and section numbering

2020-08-18 Thread Adrian
Hello,

I'm attempting to typeset a short book using ConTeXt (current version: 
2020.08.09 22:03).

EXAMPLE:

\setuplist[content][alternative=c]

\setuphead[title][alternative=middle,style=cap]

\setuphead[chapter][number=no]

\setuphead[section][sectionsegments=section]

\setuplist[section][width=1.5em,margin=3em]

\starttext
\title{contents}
\placecontent

\startchapter[title={Introductory}]
\startsection[title={The concept of a function}]
\stopsection
\startsection[title={Extension and intension}]
\stopsection
\startsection[title={Functions of several variables}]
\stopsection
\startsection[title={Abstraction}]
\stopsection
\stopchapter

\startchapter[title={Lambda-Conversion}]

\startsection[title={Primitive symbols, and formulas}]
\stopsection
\startsection[title={Conversion}]
\stopsection
\startsection[title={Fundamental theorems on well-formed formulas and on the 
normal form}]
\stopsection
\stopchapter

\stoptext

I would like all the chapters to be prefixed with "Chapter RN." and the 
sections to keep a single count,
for example:

Chapter I. Introductory .
1. The concept of a function
2. Extension and intension
3. Functions of several variables
4. Abstraction
Chapter II. Lambda Conversion .
5. Primitive symbols and formulas
6. Conversion
7. Fundamental theorems on well-formed formulas and on the normal form

I tried to the following for the chapters:

\defineconversion[church][Chapter \Romannumerals.\quad]

\setuphead[chapter][conversion=church]

Which appeared to generate the prefix correctly but it overlapped the title.

Any help would be greatly appreciated. Thanks

Adrian___
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] memoir-style chapter heading

2020-08-18 Thread Otared Kavian
Hi Julian,

Indeed you can modify slightly what Aditya said to obtain what you want: you 
can put the overlay into a framed environment as in the following example. 
Though, to my taste the number is a little bit too low…

%% begin example
\setuppagenumbering[state=start,location=footer]
\setuphead[chapter]
[
numberstyle={\switchtobodyfont[48pt]},
numbercolor=gray,
alternative=command,
command=\MemoirChapter,
]

\define[2]\MemoirChapter
{\framed[frame=off,width=broad,align=middle]
{\startoverlay
{#1}
{#2}
\stopoverlay}
}

\starttext
\startchapter[title={This is a test}]
\input knuth.tex

\stopchapter

\stoptext
%% end example

Best regards: Otared

> On 18 Aug 2020, at 01:18, jbf  wrote:
> 
> I meant to include an example of what I mean, since at least it seems to work 
> (am including just the definition part of your example), So at least I can 
> get middle and right alignment.
> 
> \define[2]\MemoirChapter
>  {\midaligned{\startoverlay
>   {#1}
>   {#2}
> \stopoverlay}}
> 
> Julian
> 
> On 17/8/20 4:54 pm, Aditya Mahajan wrote:
>> On Mon, 17 Aug 2020, jbf wrote:
>> 
>>> Am completely new to using Metafun, which I presume I would need to use
>>> to achieve a Hansen Memoir-style Chapter heading (chapter title
>>> overlayed on a large lightgray number). Of course, I am assuming I would
>>> need to use Metafun to create this...
>>> 
>>> So my first question is to ask if I could achieve the same effect
>>> without Metafun?
>>> 
>>> I have read through the Metafun manual, and I think I can understand how
>>> to overlay text on a graphic (MP), but it would be currently beyond me
>>> to draw numbers of the kind we find in, say, the Memoir examples.
>>> 
>>> Has anyone created such an example? I was keenly looking for one in the
>>> manual and elsewhere, in terms of ConTeXt/Metafun commands, but could
>>> not find one. But I'd be quite prepared to 'have a go' at this, if I had
>>> some pointers of just where to start! I assume I would have to
>>> \defineoverlay[number] and then add text on top \framed (but without the
>>> frame borders). Am I at least correct about this?
>> You don't need metafun for something this simple. Here is a crude 
>> implementation:
>> 
>> \setuphead[chapter]
>>   [
>> numberstyle={\switchtobodyfont[48pt]},
>> numbercolor=gray,
>> alternative=command,
>> command=\MemoirChapter,
>>   ]
>> 
>> \define[2]\MemoirChapter%
>>   {\startoverlay
>>   {#1}
>>   {#2}
>> \stopoverlay}
>>   
>> \starttext
>> \startchapter[title={This is a test}]
>> \stopchapter
>> 
>> \stoptext
>> 
>> Overlays don't allow tuning the location...for that you need layers. See the 
>> chapter on ornaments in the details manual, which also explains an 
>> alternative method to set title of chapters (toward the end of that 
>> chapter), which is useful if you need absolute positioning.
>> 
>> 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
>> ___
> ___
> 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] memoir-style chapter heading

2020-08-17 Thread jbf
I meant to include an example of what I mean, since at least it seems to 
work (am including just the definition part of your example), So at 
least I can get middle and right alignment.


\define[2]\MemoirChapter
 {\midaligned{\startoverlay
  {#1}
  {#2}
    \stopoverlay}}

Julian

On 17/8/20 4:54 pm, Aditya Mahajan wrote:

On Mon, 17 Aug 2020, jbf wrote:


Am completely new to using Metafun, which I presume I would need to use
to achieve a Hansen Memoir-style Chapter heading (chapter title
overlayed on a large lightgray number). Of course, I am assuming I would
need to use Metafun to create this...

So my first question is to ask if I could achieve the same effect
without Metafun?

I have read through the Metafun manual, and I think I can understand how
to overlay text on a graphic (MP), but it would be currently beyond me
to draw numbers of the kind we find in, say, the Memoir examples.

Has anyone created such an example? I was keenly looking for one in the
manual and elsewhere, in terms of ConTeXt/Metafun commands, but could
not find one. But I'd be quite prepared to 'have a go' at this, if I had
some pointers of just where to start! I assume I would have to
\defineoverlay[number] and then add text on top \framed (but without the
frame borders). Am I at least correct about this?

You don't need metafun for something this simple. Here is a crude 
implementation:

\setuphead[chapter]
   [
 numberstyle={\switchtobodyfont[48pt]},
 numbercolor=gray,
 alternative=command,
 command=\MemoirChapter,
   ]

\define[2]\MemoirChapter%
   {\startoverlay
   {#1}
   {#2}
 \stopoverlay}
   


\starttext
\startchapter[title={This is a test}]
\stopchapter

\stoptext

Overlays don't allow tuning the location...for that you need layers. See the 
chapter on ornaments in the details manual, which also explains an alternative 
method to set title of chapters (toward the end of that chapter), which is 
useful if you need absolute positioning.

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
___

___
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] memoir-style chapter heading

2020-08-17 Thread jbf
Thanks Aditya. The 'quick and simple' explanation below helps me to 
grasp some concepts I had not been clear about earlier. While you say 
that overlays 'don't allow tuning' for positioning, is this only in 
terms of absolute positioning?


It would be so helpful if we could get at least a middle or right 
alignment with this simple approach.


I have read the 'Details' approach you have indicated, though am still 
to get my head around it. Understanding overlays is one thing. 
Understanding layers yet another.


Julian

On 17/8/20 4:54 pm, Aditya Mahajan wrote:

On Mon, 17 Aug 2020, jbf wrote:


Am completely new to using Metafun, which I presume I would need to use
to achieve a Hansen Memoir-style Chapter heading (chapter title
overlayed on a large lightgray number). Of course, I am assuming I would
need to use Metafun to create this...

So my first question is to ask if I could achieve the same effect
without Metafun?

I have read through the Metafun manual, and I think I can understand how
to overlay text on a graphic (MP), but it would be currently beyond me
to draw numbers of the kind we find in, say, the Memoir examples.

Has anyone created such an example? I was keenly looking for one in the
manual and elsewhere, in terms of ConTeXt/Metafun commands, but could
not find one. But I'd be quite prepared to 'have a go' at this, if I had
some pointers of just where to start! I assume I would have to
\defineoverlay[number] and then add text on top \framed (but without the
frame borders). Am I at least correct about this?

You don't need metafun for something this simple. Here is a crude 
implementation:

\setuphead[chapter]
   [
 numberstyle={\switchtobodyfont[48pt]},
 numbercolor=gray,
 alternative=command,
 command=\MemoirChapter,
   ]

\define[2]\MemoirChapter%
   {\startoverlay
   {#1}
   {#2}
 \stopoverlay}
   


\starttext
\startchapter[title={This is a test}]
\stopchapter

\stoptext

Overlays don't allow tuning the location...for that you need layers. See the 
chapter on ornaments in the details manual, which also explains an alternative 
method to set title of chapters (toward the end of that chapter), which is 
useful if you need absolute positioning.

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
___

___
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] memoir-style chapter heading

2020-08-17 Thread Aditya Mahajan
On Mon, 17 Aug 2020, jbf wrote:

> Am completely new to using Metafun, which I presume I would need to use 
> to achieve a Hansen Memoir-style Chapter heading (chapter title 
> overlayed on a large lightgray number). Of course, I am assuming I would 
> need to use Metafun to create this...
> 
> So my first question is to ask if I could achieve the same effect 
> without Metafun?
> 
> I have read through the Metafun manual, and I think I can understand how 
> to overlay text on a graphic (MP), but it would be currently beyond me 
> to draw numbers of the kind we find in, say, the Memoir examples.
> 
> Has anyone created such an example? I was keenly looking for one in the 
> manual and elsewhere, in terms of ConTeXt/Metafun commands, but could 
> not find one. But I'd be quite prepared to 'have a go' at this, if I had 
> some pointers of just where to start! I assume I would have to 
> \defineoverlay[number] and then add text on top \framed (but without the 
> frame borders). Am I at least correct about this?

You don't need metafun for something this simple. Here is a crude 
implementation:

\setuphead[chapter]
  [
numberstyle={\switchtobodyfont[48pt]},
numbercolor=gray,
alternative=command,
command=\MemoirChapter,
  ]

\define[2]\MemoirChapter%
  {\startoverlay
  {#1}
  {#2}
\stopoverlay}
  

\starttext
\startchapter[title={This is a test}]
\stopchapter

\stoptext

Overlays don't allow tuning the location...for that you need layers. See the 
chapter on ornaments in the details manual, which also explains an alternative 
method to set title of chapters (toward the end of that chapter), which is 
useful if you need absolute positioning.

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] memoir-style chapter heading

2020-08-16 Thread jbf
Am completely new to using Metafun, which I presume I would need to use 
to achieve a Hansen Memoir-style Chapter heading (chapter title 
overlayed on a large lightgray number). Of course, I am assuming I would 
need to use Metafun to create this...


So my first question is to ask if I could achieve the same effect 
without Metafun?


I have read through the Metafun manual, and I think I can understand how 
to overlay text on a graphic (MP), but it would be currently beyond me 
to draw numbers of the kind we find in, say, the Memoir examples.


Has anyone created such an example? I was keenly looking for one in the 
manual and elsewhere, in terms of ConTeXt/Metafun commands, but could 
not find one. But I'd be quite prepared to 'have a go' at this, if I had 
some pointers of just where to start! I assume I would have to 
\defineoverlay[number] and then add text on top \framed (but without the 
frame borders). Am I at least correct about this?


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] reading a single element from XML

2020-08-16 Thread Pablo Rodriguez
On 8/16/20 11:46 AM, Taco Hoekwater wrote:
> \xmlfilter is your friend:
>
>  \startxmlsetups xml:initialize
>\xmlsetsetup{#1}{html}{xml:gen}
>  \stopxmlsetups
>
>  \xmlregistersetup{xml:initialize}
>
> \startxmlsetups xml:gen
> \xmlfilter{#1}{/**/span[@class='special']/command(xml:special)}
> \stopxmlsetups
>
>  \startxmlsetups xml:special
>\bgroup\bfd\ssd\xmlflush{#1}\egroup
>  \stopxmlsetups

Many thanks for your reply, Taco.

This was extremely handy and helpful (it is also the first time I
understand what \xmlfilter is used for).

My final solution required nesting filters, which worked perfectly fine
(included below).

Many thanks for your help,

Pablo


Just for the record:

  \startbuffer[demo]
  

  
This is
  One a paragraph.
This is another paragraph.
This is another
  Two paragraph.
This is another
  Three paragraph.
This is another
  Four paragraph.
  
  
This is
  A a paragraph.
This is another paragraph.
This is another
  B paragraph.
This is another
  C paragraph.
This is another
  D paragraph.
  

  
  \stopbuffer

  \startxmlsetups xml:initialize
\xmlsetsetup{#1}{html}{xml:gen}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:gen
 \xmlfilter{#1}{/**/div/command(xml:chapter)}
  \stopxmlsetups

  \startxmlsetups xml:chapter
\startsection[title=\xmlatt{#1}{id}]
  \startitemize[packed]
\xmlfilter{#1}{**/span[@class='special']/command(xml:special)}
  \stopitemize
\stopsection
  \stopxmlsetups

  \startxmlsetups xml:special
\startitem\xmlflush{#1}\stopitem
  \stopxmlsetups

  \starttext
\xmlprocessbuffer{main}{demo}{}
  \stoptext
--
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] About documented code

2020-08-16 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 15.08.2020 um 16:24:
Hi list! I have some questions about the template used by module 
documentation. When I apply


context --extra=module t-mymodule.mkvi --autopdf

I obtain a nice file, but, among other things, 1) the cover page seems 
to be a bit... greenish? So I want to know how to customize it, at 
least at a minimum, and 2) \showframe is enabled by default. How to 
disable it? Maybe 1) can answer 2) too. Thank you very much.


There is no way to change the color of the title page from your module 
itself, the only way is to change the value module (s-module-basic.mkiv) 
which is used to create the formatted source.


The same has to be done to disable the frame where you have to comment 
the \showframe line in the module mentioned above.


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] headers again

2020-08-14 Thread Wolfgang Schuster

jbf schrieb am 14.08.2020 um 02:28:


I will let the people with far superior knowledge than I have work 
through this, but I am following it with interest. All I can say is 
that by adopting Aditya's solution, ensuring that for the unnumbered 
titles I also included 'number=no', the numbered chapters did 
increment correctly, after being interrupted by an unnumbered one.





\starttext

\startchapter[title={Chapter one}] \stopchapter

\startchapter[title={Chapter two},number=no] \stopchapter

\startchapter[title={Chapter three}] \stopchapter

\startchapter[title={Chapter four},number=no] \stopchapter

\startchapter[title={Chapter five}] \stopchapter

\startchapter[title={Chapter six},number=no] \stopchapter

\startchapter[title={Chapter seven}] \stopchapter

\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] headers again

2020-08-14 Thread Hans Hagen

On 8/14/2020 1:44 AM, Aditya Mahajan wrote:

On Thu, 13 Aug 2020, Wolfgang Schuster wrote:


Aditya Mahajan schrieb am 13.08.2020 um 04:53:

On Thu, 13 Aug 2020, jbf wrote:


Where running heads (headers) are concerned, if I use \chapter I have no
problems, nor should I expect any. But because I am also using \title,
given that I need some unnumbered chapters interspersed  among them, I
run into difficulties with headers. Numbered chapters have the correct
headers, unnumbered ones (with \title) either don't have them, or do not
have the proper chapter header (they pick up the header from the
previous numbered chapter).

At the moment the only thing I have in the preamble is the expected set
of commands for the numbered chapters:

    [{\hfill\getmarking[chapter]\hfill}][]
     [{\hfill\documentvariable{metadata:title}\hfill}][]

I thought that might work for the unnumbered ones (\title), thinking
that maybe \title inherits from \chapter, but it doesn't. But no amount
of variations on the above commands (repeating them but replacing
'chapter' with 'title'; adding [title] or just title, in the first set
of commands in various positions...) gives me the correct result.

I am assuming, of course, that there is a solution to this difficulty,
and that it may be simple. But I haven't found it. Is the problem that I
am using \title in the main body to get my unnumbered chapters? I
wouldn't think so? It produces the correct result, utlimatley, in the
TOC, Is it possible that I may have something else in my preamble that
is causing the problem? If so, I can't expect someone to 'guess' that
from outside! But at the moment I don't think that is the problem.

If not a direct solution, are there any clues someone might give me that
will lead me to finding my own solution? It would be much appreciated.


A rose by any other name would smell as sweet ...

\showframe
\setupheadertexts[\setups{header}]

\startsetups header
\getmarking[chapter]
\stopsetups

\starttext
\startchapter[title={This is a chapter}]
\input knuth
\page
\input knuth
\stopchapter

\startchapter[title={This is a title}, number=no]
\input ward
\page
\input knuth
\stopchapter
\stoptext


Don't do this, unnumbered chapter still increase the counter and
when you add another chapter afterwards you wonder why the number
is wrong.


(this reply is in jest )

incrementnumber=no,


The correct way here is to reset the marking entries
at the begin of a new chapter or title with

\setuphead
   [chapter,title]
   [marking=reset]


Agreed. This is a better solution. Any idea why this is not the default?


because this is all kind of tricky wrt when to reset ... chapters can 
start a new page or not ... esp in a double sided layout it can be that 
one does or doesn't do things that neeed to be reflected on a following 
page (so in a complex setup when one changes headers or other properties 
oneself, one also might have to make sure a \page happens at the right 
spot)


changing something like this for sure will break something else

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] headers again

2020-08-13 Thread jbf
I will let the people with far superior knowledge than I have work 
through this, but I am following it with interest. All I can say is that 
by adopting Aditya's solution, ensuring that for the unnumbered titles I 
also included 'number=no', the numbered chapters did increment 
correctly, after being interrupted by an unnumbered one.


Julian

On 14/8/20 9:44 am, Aditya Mahajan wrote:

On Thu, 13 Aug 2020, Wolfgang Schuster wrote:


Aditya Mahajan schrieb am 13.08.2020 um 04:53:

On Thu, 13 Aug 2020, jbf wrote:


Where running heads (headers) are concerned, if I use \chapter I have no
problems, nor should I expect any. But because I am also using \title,
given that I need some unnumbered chapters interspersed  among them, I
run into difficulties with headers. Numbered chapters have the correct
headers, unnumbered ones (with \title) either don't have them, or do not
have the proper chapter header (they pick up the header from the
previous numbered chapter).

At the moment the only thing I have in the preamble is the expected set
of commands for the numbered chapters:

    [{\hfill\getmarking[chapter]\hfill}][]
     [{\hfill\documentvariable{metadata:title}\hfill}][]

I thought that might work for the unnumbered ones (\title), thinking
that maybe \title inherits from \chapter, but it doesn't. But no amount
of variations on the above commands (repeating them but replacing
'chapter' with 'title'; adding [title] or just title, in the first set
of commands in various positions...) gives me the correct result.

I am assuming, of course, that there is a solution to this difficulty,
and that it may be simple. But I haven't found it. Is the problem that I
am using \title in the main body to get my unnumbered chapters? I
wouldn't think so? It produces the correct result, utlimatley, in the
TOC, Is it possible that I may have something else in my preamble that
is causing the problem? If so, I can't expect someone to 'guess' that
from outside! But at the moment I don't think that is the problem.

If not a direct solution, are there any clues someone might give me that
will lead me to finding my own solution? It would be much appreciated.

A rose by any other name would smell as sweet ...

\showframe
\setupheadertexts[\setups{header}]

\startsetups header
\getmarking[chapter]
\stopsetups

\starttext
\startchapter[title={This is a chapter}]
\input knuth
\page
\input knuth
\stopchapter

\startchapter[title={This is a title}, number=no]
\input ward
\page
\input knuth
\stopchapter
\stoptext

Don't do this, unnumbered chapter still increase the counter and
when you add another chapter afterwards you wonder why the number
is wrong.

(this reply is in jest )

incrementnumber=no,


The correct way here is to reset the marking entries
at the begin of a new chapter or title with

\setuphead
   [chapter,title]
   [marking=reset]

Agreed. This is a better solution. Any idea why this is not the default?

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

2020-08-13 Thread Aditya Mahajan
On Thu, 13 Aug 2020, Wolfgang Schuster wrote:

> Aditya Mahajan schrieb am 13.08.2020 um 04:53:
> > On Thu, 13 Aug 2020, jbf wrote:
> > 
> > > Where running heads (headers) are concerned, if I use \chapter I have no
> > > problems, nor should I expect any. But because I am also using \title,
> > > given that I need some unnumbered chapters interspersed  among them, I
> > > run into difficulties with headers. Numbered chapters have the correct
> > > headers, unnumbered ones (with \title) either don't have them, or do not
> > > have the proper chapter header (they pick up the header from the
> > > previous numbered chapter).
> > > 
> > > At the moment the only thing I have in the preamble is the expected set
> > > of commands for the numbered chapters:
> > > 
> > >    [{\hfill\getmarking[chapter]\hfill}][]
> > >     [{\hfill\documentvariable{metadata:title}\hfill}][]
> > > 
> > > I thought that might work for the unnumbered ones (\title), thinking
> > > that maybe \title inherits from \chapter, but it doesn't. But no amount
> > > of variations on the above commands (repeating them but replacing
> > > 'chapter' with 'title'; adding [title] or just title, in the first set
> > > of commands in various positions...) gives me the correct result.
> > > 
> > > I am assuming, of course, that there is a solution to this difficulty,
> > > and that it may be simple. But I haven't found it. Is the problem that I
> > > am using \title in the main body to get my unnumbered chapters? I
> > > wouldn't think so? It produces the correct result, utlimatley, in the
> > > TOC, Is it possible that I may have something else in my preamble that
> > > is causing the problem? If so, I can't expect someone to 'guess' that
> > > from outside! But at the moment I don't think that is the problem.
> > > 
> > > If not a direct solution, are there any clues someone might give me that
> > > will lead me to finding my own solution? It would be much appreciated.
> > 
> > A rose by any other name would smell as sweet ...
> > 
> > \showframe
> > \setupheadertexts[\setups{header}]
> > 
> > \startsetups header
> >\getmarking[chapter]
> > \stopsetups
> > 
> > \starttext
> > \startchapter[title={This is a chapter}]
> >\input knuth
> >\page
> >\input knuth
> > \stopchapter
> > 
> > \startchapter[title={This is a title}, number=no]
> >\input ward
> >\page
> >\input knuth
> > \stopchapter
> > \stoptext
> 
> Don't do this, unnumbered chapter still increase the counter and
> when you add another chapter afterwards you wonder why the number
> is wrong. 

(this reply is in jest )

incrementnumber=no, 

> The correct way here is to reset the marking entries
> at the begin of a new chapter or title with
> 
> \setuphead
>   [chapter,title]
>   [marking=reset]

Agreed. This is a better solution. Any idea why this is not the default?

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
___


Re: [NTG-context] headers again

2020-08-13 Thread Wolfgang Schuster

Aditya Mahajan schrieb am 13.08.2020 um 04:53:

On Thu, 13 Aug 2020, jbf wrote:


Where running heads (headers) are concerned, if I use \chapter I have no
problems, nor should I expect any. But because I am also using \title,
given that I need some unnumbered chapters interspersed  among them, I
run into difficulties with headers. Numbered chapters have the correct
headers, unnumbered ones (with \title) either don't have them, or do not
have the proper chapter header (they pick up the header from the
previous numbered chapter).

At the moment the only thing I have in the preamble is the expected set
of commands for the numbered chapters:

   [{\hfill\getmarking[chapter]\hfill}][]
    [{\hfill\documentvariable{metadata:title}\hfill}][]

I thought that might work for the unnumbered ones (\title), thinking
that maybe \title inherits from \chapter, but it doesn't. But no amount
of variations on the above commands (repeating them but replacing
'chapter' with 'title'; adding [title] or just title, in the first set
of commands in various positions...) gives me the correct result.

I am assuming, of course, that there is a solution to this difficulty,
and that it may be simple. But I haven't found it. Is the problem that I
am using \title in the main body to get my unnumbered chapters? I
wouldn't think so? It produces the correct result, utlimatley, in the
TOC, Is it possible that I may have something else in my preamble that
is causing the problem? If so, I can't expect someone to 'guess' that
from outside! But at the moment I don't think that is the problem.

If not a direct solution, are there any clues someone might give me that
will lead me to finding my own solution? It would be much appreciated.


A rose by any other name would smell as sweet ...

\showframe
\setupheadertexts[\setups{header}]

\startsetups header
   \getmarking[chapter]
\stopsetups

\starttext
\startchapter[title={This is a chapter}]
   \input knuth
   \page
   \input knuth
\stopchapter

\startchapter[title={This is a title}, number=no]
   \input ward
   \page
   \input knuth
\stopchapter
\stoptext


Don't do this, unnumbered chapter still increase the counter and
when you add another chapter afterwards you wonder why the number
is wrong. The correct way here is to reset the marking entries
at the begin of a new chapter or title with

\setuphead
  [chapter,title]
  [marking=reset]

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] headers again

2020-08-12 Thread jbf
Rightly so, and as I was producing such an MWE (stripping away a lot of 
other 'clutter') I found what was causing the problem. At one stage, 
trying to solve the problem, I had created a MyChapter definition and 
had left a command referencing it in the following:


\setuphead
  [chapter][header=empty,alternative=middle,style=\tfa, 
numbercommand=\groupedcommand{}{\blank[1cm]},after={\blank[3cm]},command=\MyChapter]


Give that I was now no longer using MyChapter to solve the problem, that 
command=\MyChapter was causing a conflict. I removed it and, using your 
earlier


\setupheadertexts[\setups{header}]

\startsetups header
  \getmarking[chapter]
\stopsetups

and referencing it in the \chapter or \title items, was able to achieve 
the desired result in every way, including that missing  header on one page.

Thank you.
J

On 13/8/20 3:36 pm, Aditya Mahajan wrote:

On Thu, 13 Aug 2020, jbf wrote:


Almost as perfect as Shakespeare's Juliet! Is there any reason why the header
for the Introduction, done using your approach (it is in frontmatter), does
not produce the header on the last recto page? This intro consists of 8 pages.
Page 7 does not produce the 'Introduction' header. The other relevant recto
pages are all headed 'Introduction' as they should be.

A minimal working example will help in diagnosing what is going on ...

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
___

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

2020-08-12 Thread jbf
Almost as perfect as Shakespeare's Juliet! Is there any reason why the 
header for the Introduction, done using your approach (it is in 
frontmatter), does not produce the header on the last recto page? This 
intro consists of 8 pages. Page 7 does not produce the 'Introduction' 
header. The other relevant recto pages are all headed 'Introduction' as 
they should be.


J

On 13/8/20 12:53 pm, Aditya Mahajan wrote:

On Thu, 13 Aug 2020, jbf wrote:


Where running heads (headers) are concerned, if I use \chapter I have no
problems, nor should I expect any. But because I am also using \title,
given that I need some unnumbered chapters interspersed  among them, I
run into difficulties with headers. Numbered chapters have the correct
headers, unnumbered ones (with \title) either don't have them, or do not
have the proper chapter header (they pick up the header from the
previous numbered chapter).

At the moment the only thing I have in the preamble is the expected set
of commands for the numbered chapters:

   [{\hfill\getmarking[chapter]\hfill}][]
    [{\hfill\documentvariable{metadata:title}\hfill}][]

I thought that might work for the unnumbered ones (\title), thinking
that maybe \title inherits from \chapter, but it doesn't. But no amount
of variations on the above commands (repeating them but replacing
'chapter' with 'title'; adding [title] or just title, in the first set
of commands in various positions...) gives me the correct result.

I am assuming, of course, that there is a solution to this difficulty,
and that it may be simple. But I haven't found it. Is the problem that I
am using \title in the main body to get my unnumbered chapters? I
wouldn't think so? It produces the correct result, utlimatley, in the
TOC, Is it possible that I may have something else in my preamble that
is causing the problem? If so, I can't expect someone to 'guess' that
from outside! But at the moment I don't think that is the problem.

If not a direct solution, are there any clues someone might give me that
will lead me to finding my own solution? It would be much appreciated.

A rose by any other name would smell as sweet ...

\showframe
\setupheadertexts[\setups{header}]

\startsetups header
   \getmarking[chapter]
\stopsetups

\starttext
\startchapter[title={This is a chapter}]
   \input knuth
   \page
   \input knuth
\stopchapter

\startchapter[title={This is a title}, number=no]
   \input ward
   \page
   \input knuth
\stopchapter
\stoptext

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

2020-08-12 Thread Aditya Mahajan
On Thu, 13 Aug 2020, jbf wrote:

> Where running heads (headers) are concerned, if I use \chapter I have no 
> problems, nor should I expect any. But because I am also using \title, 
> given that I need some unnumbered chapters interspersed  among them, I 
> run into difficulties with headers. Numbered chapters have the correct 
> headers, unnumbered ones (with \title) either don't have them, or do not 
> have the proper chapter header (they pick up the header from the 
> previous numbered chapter).
> 
> At the moment the only thing I have in the preamble is the expected set 
> of commands for the numbered chapters:
> 
>   [{\hfill\getmarking[chapter]\hfill}][]
>    [{\hfill\documentvariable{metadata:title}\hfill}][]
> 
> I thought that might work for the unnumbered ones (\title), thinking 
> that maybe \title inherits from \chapter, but it doesn't. But no amount 
> of variations on the above commands (repeating them but replacing 
> 'chapter' with 'title'; adding [title] or just title, in the first set 
> of commands in various positions...) gives me the correct result.
> 
> I am assuming, of course, that there is a solution to this difficulty, 
> and that it may be simple. But I haven't found it. Is the problem that I 
> am using \title in the main body to get my unnumbered chapters? I 
> wouldn't think so? It produces the correct result, utlimatley, in the 
> TOC, Is it possible that I may have something else in my preamble that 
> is causing the problem? If so, I can't expect someone to 'guess' that 
> from outside! But at the moment I don't think that is the problem.
> 
> If not a direct solution, are there any clues someone might give me that 
> will lead me to finding my own solution? It would be much appreciated.

A rose by any other name would smell as sweet ...

\showframe
\setupheadertexts[\setups{header}]

\startsetups header
  \getmarking[chapter]
\stopsetups

\starttext
\startchapter[title={This is a chapter}]
  \input knuth
  \page
  \input knuth
\stopchapter

\startchapter[title={This is a title}, number=no]
  \input ward
  \page
  \input knuth
\stopchapter
\stoptext

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] headers again

2020-08-12 Thread jbf
Understandably, with work going on for the new \command pages, 
heatwaves, upcoming ConTeXt meeting, people are very busy. I understand 
that. In the meantime, I haven't yet found a solution (though I have 
tried many) to my own problem, small though it is by comparison. So let 
me try again, putting it  simply:


Where running heads (headers) are concerned, if I use \chapter I have no 
problems, nor should I expect any. But because I am also using \title, 
given that I need some unnumbered chapters interspersed  among them, I 
run into difficulties with headers. Numbered chapters have the correct 
headers, unnumbered ones (with \title) either don't have them, or do not 
have the proper chapter header (they pick up the header from the 
previous numbered chapter).


At the moment the only thing I have in the preamble is the expected set 
of commands for the numbered chapters:


 [{\hfill\getmarking[chapter]\hfill}][]
  [{\hfill\documentvariable{metadata:title}\hfill}][]

I thought that might work for the unnumbered ones (\title), thinking 
that maybe \title inherits from \chapter, but it doesn't. But no amount 
of variations on the above commands (repeating them but replacing 
'chapter' with 'title'; adding [title] or just title, in the first set 
of commands in various positions...) gives me the correct result.


I am assuming, of course, that there is a solution to this difficulty, 
and that it may be simple. But I haven't found it. Is the problem that I 
am using \title in the main body to get my unnumbered chapters? I 
wouldn't think so? It produces the correct result, utlimatley, in the 
TOC, Is it possible that I may have something else in my preamble that 
is causing the problem? If so, I can't expect someone to 'guess' that 
from outside! But at the moment I don't think that is the problem.


If not a direct solution, are there any clues someone might give me that 
will lead me to finding my own solution? It would be much appreciated.


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] \checkpage in the TOC

2020-08-12 Thread Willi Egger
Beste Hans!

thank you so much for your solution!

After plying I will remember your last statement in your answer :-)

Kind regards

Willi

> On 12 Aug 2020, at 02:04, Hans Hagen  wrote:
> 
> On 8/10/2020 11:02 PM, Willi Egger wrote:
>> Hello!
>> humble, in another book I am trying to improve the list of contents. On 
>> different places occur page breaks which should be addressed and corrected.
>> I tried to use the method \checkpage[][], however my attempts are not 
>> succesful.
>> For your reference I include a screenshot of the problematic pagebreak.
>> \definepagechecker
>>   [willi]
>>   [method=1,before=,after=,inbetween={\page}]
>> \setuplist
>> [chapter]
>> [prefix=no,
>> sectionnumber=no,
>> headnumber=no,
>>   alternative=command,
>>   command=\Mychaptercommand,
>>  inbetween={\checkpage[willi][lines=4]}
>> Thank you for advice!
>> Kind regards
>> Willi
>> ]
> Here's an example of an actually already quite old mechanism ..
> 
> \showinjector
> 
> \setinjector[register][3][\column]
> \setinjector[list][2][{\blank[3*big]}]
> 
> \starttext
>   \placelist[section][criterium=text]
>   \blank[3*big]
>   \placeregister[index][criterium=text]
>   \page
>   \startsection[title=Alpha] first  \index{first}  \stopsection
>   \startsection[title=Beta]  second \index{second} \stopsection
>   \startsection[title=Gamma] third  \index{third}  \stopsection
>   \startsection[title=Delta] fourth \index{fourth} \stopsection
> \stoptext
> 
> .. so you now have something to wikify ..
> 
> 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
> ___

___
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] \title with extra content in toc

2020-08-11 Thread Mikael Sundqvist
I do not recommend against the start/stop variant, but in this case I think
you can also do

\chapter[title=..., list=..., bookmark=...]

/Mikael

Den ons 12 aug. 2020 05:46jbf  skrev:

> That is clear enough and works (of course!) and reminds me that I'm
> better off using the \starttitle...\stoptitle format than just \title as
> I have been.
>
> J
>
> On 12/8/20 1:23 pm, Aditya Mahajan wrote:
>
> > [
> >   title={Title of chapter},
> >   list={What appears in TOC},
> >   bookmark={What appears in bookmarks},
> > ]
>
> ___
> 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] further to the earlier header question

2020-08-11 Thread jbf
Clearly I am now getting myself quite confused where headers are 
concerned, and have sought as much info as I can on the wiki, but am not 
getting the desired results. We are talking about ConTeXt MkIV and a 
doublesided document.


If I only use \chapter throughout and have my setup as:

\setupheadertexts
  [{\hfill\getmarking[chapter]\hfill}][]
  [{\hfill\documentvariable{metadata:title}\hfill}][]

then everything works as it should: Chapter title as header on recto 
pages and book title as header on verso pages. And as chapters change so 
does the header on the recto page.


But this book has some 'chapters' that need to be unnumbered, for which 
I am using \title in the main body (as well as in frontmatter). 
Everything else about this choice works, except for the recto headers.


If I use ONLY the setup above, then fairly obviously the numbered 
Chapters work, but those with \title continue to use the previous 
Chapter header for the recto pages (the verso pages with the book title 
is okay). So I understand that I may need to also give a command for the 
\title 'chapters' to act the way the other numbered chapters do. So I 
thought I could do this by simply adding the same set of commands above, 
but this time using title:


\setupheadertexts
  [{\hfill\getmarking[*chapter*]\hfill}][]
  [{\hfill\documentvariable{metadata:title}\hfill}][]

\setupheadertexts
  [{\hfill\getmarking[*title*]\hfill}][]
  [{\hfill\documentvariable{metadata:title}\hfill}][]

However, when I do this, I get strange behaviour: now the numbered 
chapters do not show their recto header at all (the verso book title 
still appears though). The unnumbered \title chapters now show the 
headers but the same behaviour as indicated above occurs - the next 
numbered chapter after that carries the previous unnumbered chapter's title.


Obviously I cannot do things the way I am doing it, but I cannot find 
how to do it.


The other behaviour is the one I noted in an earlier post -  if I get 
\title (used for an introduction) in the frontmatter to work with the 
correct headers, in the case of this Introduction (which is seven 
pages), the last of the recto pages does not bear the header 
'Introduction'. Perhaps this is expected behaviour?


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] \title with extra content in toc

2020-08-11 Thread jbf
That is clear enough and works (of course!) and reminds me that I'm 
better off using the \starttitle...\stoptitle format than just \title as 
I have been.


J

On 12/8/20 1:23 pm, Aditya Mahajan wrote:


[
  title={Title of chapter},
  list={What appears in TOC},
  bookmark={What appears in bookmarks},
    ] 

___
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] \title with extra content in toc

2020-08-11 Thread Aditya Mahajan

On Wed, 12 Aug 2020, jbf wrote:

Still dealing with \title, but am creating a separate thread because the 
question is different.


As well as using \title within frontmatter (my previous question was 
about the header not appearing on final page if it is an odd/recto page) 
I am also using it in the main body for 'chapters' that I don't want 
numbered, and of course, have ensured that such \title items can appear 
in the TOC. But I want to add a one-word comment in brackets to the 
title that appears in the TOC, so that I get:


Chapter title (comment).. 5  or whatever the page number is.

Is there are way I can add  extra content to an item that appears in the 
TOC?


\startchapter
[
  title={Title of chapter},
  list={What appears in TOC},
  bookmark={What appears in bookmarks},
]


\stopchapter

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
___


Re: [NTG-context] \checkpage in the TOC

2020-08-11 Thread Hans Hagen

On 8/10/2020 11:02 PM, Willi Egger wrote:

Hello!

humble, in another book I am trying to improve the list of contents. On 
different places occur page breaks which should be addressed and corrected.


I tried to use the method \checkpage[][], however my attempts are not 
succesful.


For your reference I include a screenshot of the problematic pagebreak.

\definepagechecker
    [willi]
    [method=1,before=,after=,inbetween={\page}]

\setuplist
[chapter]
[prefix=no,
sectionnumber=no,
headnumber=no,
    alternative=command,
    command=\Mychaptercommand,
   inbetween={\checkpage[willi][lines=4]}

Thank you for advice!
Kind regards
Willi
]

Here's an example of an actually already quite old mechanism ..

\showinjector

\setinjector[register][3][\column]
\setinjector[list][2][{\blank[3*big]}]

\starttext
\placelist[section][criterium=text]
\blank[3*big]
\placeregister[index][criterium=text]
\page
\startsection[title=Alpha] first  \index{first}  \stopsection
\startsection[title=Beta]  second \index{second} \stopsection
\startsection[title=Gamma] third  \index{third}  \stopsection
\startsection[title=Delta] fourth \index{fourth} \stopsection
\stoptext

.. so you now have something to wikify ..

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] \title with extra content in toc

2020-08-11 Thread jbf
Still dealing with \title, but am creating a separate thread because the 
question is different.


As well as using \title within frontmatter (my previous question was 
about the header not appearing on final page if it is an odd/recto page) 
I am also using it in the main body for 'chapters' that I don't want 
numbered, and of course, have ensured that such \title items can appear 
in the TOC. But I want to add a one-word comment in brackets to the 
title that appears in the TOC, so that I get:


Chapter title (comment).. 5  or whatever the page number is.

Is there are way I can add  extra content to an item that appears in the 
TOC? In this case it would be the same comment in each instance, but my 
question assumes that there could also be a need for different comments, 
none of which appear in the 'chapter' title in the main body.


Am using MkIV BTW,

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
___


[NTG-context] header text on final page of section

2020-08-11 Thread jbf
I am using \title within frontmatter for an introduction. The 
\setupheadertexts for title (recto and verso pages) is:


\setupheadertexts
  [{\hfill\getmarking[title]\hfill}][]
  [{\hfill\documentvariable{metadata:title}\hfill}][]

Now, that setup (this time for [chapter]) works correctly for chapters 
in the main body of text, but for some reason that I am unaware of, in 
the case of the 'Introduction', I get a header text ('Introduction' is 
the text) where I should */except for the last page of the 
introduction/* (There are seven pages in the intro, so it is the 7th, 
therefore odd-numbered page that is missing the header).


I would like to understand why this is happening and, of course, be able 
to adjust something so that I do get the header on that page, as I do 
for the other pages.


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] Page number 0 in Table of Contents with makeup

2020-08-11 Thread Nicola
On 2020-08-11, Pablo Rodriguez  wrote:
> On 8/11/20 10:11 PM, Nicola wrote:
>> Consider this example:
>>
>> \definemakeup[toc][align=middle]
>> \setuppagenumbering[alternative=doublesided]
>> \starttext
>>   \startfrontmatter
>> \startmakeup[toc]
>>   \placecontent
>> \stopmakeup
>> %\setuppagenumber[number=1]
>>     \startchapter[title={A}]\stopchapter
>> \startchapter[title={B}]\stopchapter
>>   \stopfrontmatter
>> \stoptext
>>
>> The first entry in the ToC has page number 0. I can fix it by
>> uncommenting the commented line or by removing the makeup. Is this
>> expected behaviour? If so, why?
>
> Hi Nicola,
>
> makeups have pagestate set to stop by default.
>
> \definemakeup[toc][align=middle, pagestate=start] solves your issue.
>
> I hope it helps,

Yes, it does!

Thanks,
Nicola

___
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] Page number 0 in Table of Contents with makeup

2020-08-11 Thread Pablo Rodriguez
On 8/11/20 10:11 PM, Nicola wrote:
> Consider this example:
>
> \definemakeup[toc][align=middle]
> \setuppagenumbering[alternative=doublesided]
> \starttext
>   \startfrontmatter
> \startmakeup[toc]
>   \placecontent
> \stopmakeup
> %\setuppagenumber[number=1]
> \startchapter[title={A}]\stopchapter
> \startchapter[title={B}]\stopchapter
>   \stopfrontmatter
> \stoptext
>
> The first entry in the ToC has page number 0. I can fix it by
> uncommenting the commented line or by removing the makeup. Is this
> expected behaviour? If so, why?

Hi Nicola,

makeups have pagestate set to stop by default.

\definemakeup[toc][align=middle, pagestate=start] solves your issue.

I hope 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
___


[NTG-context] Page number 0 in Table of Contents with makeup

2020-08-11 Thread Nicola
Consider this example:

\definemakeup[toc][align=middle]
\setuppagenumbering[alternative=doublesided]
\starttext
  \startfrontmatter
\startmakeup[toc]
  \placecontent
\stopmakeup
%\setuppagenumber[number=1]
\startchapter[title={A}]\stopchapter
\startchapter[title={B}]\stopchapter
  \stopfrontmatter
\stoptext

The first entry in the ToC has page number 0. I can fix it by
uncommenting the commented line or by removing the makeup. Is this
expected behaviour? If so, why?

Nicola


___
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] Help on tweaking alignment, page numbers and ToC

2020-08-11 Thread Nicola
Hi,
first of all, let me say *thank you* for the vast improvements on
ConTeXt Garden! Browsing the documentation and finding stuff is so
much easier and pleasant than it used to be (also the site seems
faster).

Thanks to the docs, dropcaps and protrusion have no secrets for me,
but I am still struggling with some basic tasks (see the document
below):

0. Push text to the bottom of the text area (see copyright).
1. Increase the space between Roman numbers and titles in the ToC.
2. Vertically center the ToC (wrt to the text area).
3. Suppress page numbers and headers in all blank pages.
4. Suppress headers in the front matter.
5. Style and position page numbers differently in the front and body
   matter (e.g., centered only in the front matter).

As my full document uses environments, I would like most setups to
be in the environment, if possible. E.g., is it possible to replace

\setuphead[chapter][after={}]

(see below) with an environment setup that applies only to the ToC?

Nicola

%%%
\definepapersize[lsda][width=128.4mm,height=198.3mm]
\setuppapersize[lsda]

\setuplayout[
  backspace=22.9mm,
  width=90.3mm,
  topspace=8.9mm,
  height=181.1mm,
  header=4mm,
  headerdistance=6.4mm,
  footerdistance=6.4mm,
  footer=4mm,
  leftmargin=15.2mm,
  leftmargindistance=0mm,
  rightmargindistance=0mm,
  rightmargin=15.2mm,
]

\setuplabeltext[it][chapter=]
\setuphead[chapter][
  header=empty,
  alternative=middle,
  conversion=Romannumerals,
  numbercommand=\groupedcommand{\blank[20mm]}{\blank[10mm]},
  after={\blank[3cm]},
]
\setupheadtext[content=]

\setupheadertexts[]
\setupheadertexts[\setups{text a}][][][\setups{text b}]
\startsetups[text a]
  \rlap{whatever}
  \hfill
  \getmarking[chapter]
  \hfill
  \llap{whatever}
\stopsetups

\startsetups[text b]
  \rlap{}
  \hfill
  Some text goes here
  \hfill
  \llap{}
\stopsetups

\setuppagenumbering[
  alternative=doublesided,
  location={text,footer,right},
  style=\tfx
]
\definestructureconversionset[frontpart:pagenumber][][romannumerals]
\definestructureconversionset[bodypart:pagenumber] [][numbers]

\starttext
\startfrontmatter
\page[even]
\startalignment[bottom,flushright]
Copyright © 2020 Author
\stopalignment
\start
\setuphead[chapter][after={}]
\completecontent
\stop
\page[odd]
\startchapter[title={Preface}]\input{knuth}\stopchapter
\stopfrontmatter
\startbodymatter
\setuppagenumber[number=1]
\dorecurse{10}{\startchapter[title={XYZ}]\input{tufte}\stopchapter}
\stopbodymatter
\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] floats side by side

2020-08-08 Thread Henning Hraban Ramm


> Am 08.08.2020 um 18:32 schrieb Wolfgang Schuster 
> :
> 
> Henning Hraban Ramm schrieb am 08.08.2020 um 17:51:
>> Hello again,
>> I need to place several figures side by side (e.g. pictures of persons).
>> I know I can use combinations, but I need the figures with captions included 
>> in the usual numbering of figures and not one number & caption for the 
>> combination.
>> How can I achieve this?
> 
> Use a float combination:
> 
> \startplacefigure[location=none]
>\startfloatcombination[2*1]
>\startplacefigure[title={Left dummy}]
>\externalfigure[dummy]
>\stopplacefigure
>\startplacefigure[title={Right dummy}]
>\externalfigure[dummy]
>\stopplacefigure
>\stopfloatcombination
> \stopplacefigure

Thank you very much!

It works like it should.

I learn something new about ConTeXt every day.

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] floats side by side

2020-08-08 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 08.08.2020 um 17:51:

Hello again,

I need to place several figures side by side (e.g. pictures of persons).
I know I can use combinations, but I need the figures with captions included in the 
usual numbering of figures and not one number & caption for the combination.
How can I achieve this?


Use a float combination:

\useMPlibrary[dum]

\starttext

\input ward

\startplacefigure[title={Dummy}]
\externalfigure[dummy]
\stopplacefigure

\input jojomayer

\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={Left dummy}]
\externalfigure[dummy]
\stopplacefigure
\startplacefigure[title={Right dummy}]
\externalfigure[dummy]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\input weisman

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


[NTG-context] Wrong counting of lines and paragraphs

2020-08-07 Thread Marcus Vinicius Mesquita
Dear list,

In the MWE below you don't get lines and paragraphs numbered correctly:

\setuplinenumbering[location=inner,align=right,style=\tfxx,distance=10pt,color=red]
\setupparagraphnumbering[state=start,style=bold,distance=0pt,color=darkblue]

\setuphead[title][alternative=text,style=bold]
\setuphead[subject][alternative=text,style=bolditalic]
\setuphead[subsubject][alternative=text,style=\ss]
\setuphead[subsubsubject][alternative=text,style=\ss\it]

\startbuffer[waltham]
  \input waltham
\stopbuffer

\starttext
\startlinenumbering

\starttitle[title={Waltham}]
\dorecurse{4}{\getbuffer[waltham]\par}

\startsubject[title={Waltham}]
\dorecurse{5}{\getbuffer[waltham]\par}

\startsubsubject[title={Waltham}]
\dorecurse{5}{\getbuffer[waltham]\par}

\startsubsubsubject[title={Waltham}]
\dorecurse{2}{\getbuffer[waltham]\par}
\stopsubsubsubject

\stopsubsubject
\stopsubject
\stoptitle

\stoplinenumbering

\stoptext

Have I hit a bug?

Regards

Marcus Vinicius


-- 
Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo
nem seus membros, por ser descanso da alma, primavera do coração, distração
do aflito, entretenimento do solitário, e viático do viajante.

Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
\setuplinenumbering [location=inner,align=right,style=\tfxx,distance=10pt,color=red]
\setupparagraphnumbering[state=start,style=bold,distance=0pt,color=darkblue]

\setuphead[title][alternative=text,style=bold]
\setuphead[subject][alternative=text,style=bolditalic]
\setuphead[subsubject][alternative=text,style=\ss]
\setuphead[subsubsubject][alternative=text,style=\ss\it]

\startbuffer[waltham]
  \input waltham
\stopbuffer

\starttext
\startlinenumbering

\starttitle[title={Waltham}]
\dorecurse{4}{\getbuffer[waltham]\par}

\startsubject[title={Waltham}]
\dorecurse{5}{\getbuffer[waltham]\par}

\startsubsubject[title={Waltham}]
\dorecurse{5}{\getbuffer[waltham]\par}

\startsubsubsubject[title={Waltham}]
\dorecurse{2}{\getbuffer[waltham]\par}
\stopsubsubsubject

\stopsubsubject
\stopsubject
\stoptitle

\stoplinenumbering

\stoptext


MWE.pdf
Description: Adobe PDF document
___
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
___


<    8   9   10   11   12   13   14   15   16   17   >