[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] OK, I Don't Quite Understand \definefontfamily

2020-09-29 Thread Michael Urban

OK, that worked.  Thank you for your help.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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] Unwanted whitespace at beginning of document

2020-09-29 Thread Wolfgang Schuster

Denis Maier schrieb am 29.09.2020 um 14:26:

Hi,

I have ended up with unwanted whitespace at the beginning of my 
document. The environment definition is already quite complex, so I 
cannot easily tell where the whitespace is coming from. Any advice how 
I could track that down? Are there some tricks for this?


1. Create a dummy document where you load your environment, e.g.

\environment[myenvironment]
\starttext
I'm a placeholder!
\stoptext


2. Change the position of \stopenvironment in your style file until the 
whitespace disappears.



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] Unwanted whitespace at beginning of document

2020-09-29 Thread Hans van der Meer
Of old I have found the wolf fence tactics useful: Put for example an X at the 
beginning of a suspected section and somewhat further a Y. OIf they bracket the 
culprit the offending space will be between them. Otherwise narrow the fence.

dr. Hans van der Meer


> On 29 Sep 2020, at 14:26, Denis Maier  wrote:
> 
> Hi,
> 
> I have ended up with unwanted whitespace at the beginning of my document. The 
> environment definition is already quite complex, so I cannot easily tell 
> where the whitespace is coming from. Any advice how I could track that down? 
> Are there some tricks for 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] OK, I Don't Quite Understand \definefontfamily

2020-09-29 Thread Wolfgang Schuster

Michael Urban schrieb am 28.09.2020 um 23:49:




On Sep 28, 2020, at 12:39 PM, Wolfgang Schuster 
 wrote:

Michael Urban schrieb am 25.09.2020 um 21:12:

I don't seem quite able to put it all together, forgive the question.
I have a 'Bookman' font setup, pretty vanilla:
\definetypeface [Bookman] [rm] [serif] [bonum] [sl=name:unituscndboldoblique]
\definetypeface [Bookman] [tt] [mono]  [modern] [default]
\definetypeface [Bookman] [ss] [sans] [unitus] [default]
\definetypeface [Bookman] [mm] [math] [modern] [default]
(Unitus is the fontsite 500 'Univers' substitute, works fine)
Now, the built-in gyre bonum font doesn't have a slanted/oblique variant, so if 
I have Bookman as my main body
font, \sl  produces (unsurprisingly) the same result as \it, 
TexGyreBonum-Italic.   If I want \sl to summon
Latin Modern for the variant, I have tried variations on
\definetypeface [Bookman] [rm] [serif] [bonum] [sl=file:Latin Modern Roman 
Slanted]
but to no avail — not helped by the fact that the \definetypeface contextgarden 
page doesn't have any pointer to just what that fifth
argument can contain.


https://wiki.contextgarden.net/Command/definetypeface


How do I accomplish this?


Use \definefontfamily which is missing in your example.

\definefontfamily [Bookman] [rm] [TeX Gyre Bonum]
  [sl=features:{*,slanted},
   bs=features:{*,slanted}]

\definetypeface [Bookman] [mm] [math] [modern] [default]

\setupbodyfont [Bookman]

\starttext
\tf upright \it italic \sl slanted \bf bold \bi bolditalic \bs boldslanted
\stoptext

Wolfgang


Except that this does not work, because, as I said, the Gyre Bonum font has no 
builtin slanted version.


Have you even taken a look at the output of my example?


So, I want to use some other font (like Latin Modern) for a substitute for \sl .


I still think my version looks better (even with bold Latin Modern).

\definefontfamily [slantedbookman] [rm] [TeX Gyre Bonum]
  [sl={style:regular,features:{*,slanted}},
   bs={style:bold,features:{*,slanted}}]

\definefontfamily [modernbookman] [rm] [TeX Gyre Bonum]
  [sl={file:lmromanslant10-regular},
   bs={file:lmromanslant10-bold}]

% \definefontfamily [modernbookman] [rm] [TeX Gyre Bonum]
%   [sl={file:lmromanslant10-regular,features:{*,boldened}},
%bs={file:lmromanslant10-bold,features:{*,boldened}}]

\starttext

\setupbodyfont [slantedbookman]

\it italic \sl slanted \bi bolditalic \bs boldslanted

\setupbodyfont [modernbookman]

\it italic \sl slanted \bi bolditalic \bs boldslanted

\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] Unwanted whitespace at beginning of document

2020-09-29 Thread Denis Maier

Hi,

I have ended up with unwanted whitespace at the beginning of my 
document. The environment definition is already quite complex, so I 
cannot easily tell where the whitespace is coming from. Any advice how I 
could track that down? Are there some tricks for 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
___