ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Nicola <nvitacolonna@gmail.com>
Subject: Re: Help on tweaking alignment, page numbers and ToC
Date: Wed, 12 Aug 2020 06:12:21 +0200	[thread overview]
Message-ID: <10e266e9-0b15-9f95-fb8b-f727393d2e48@gmail.com> (raw)
In-Reply-To: <rguuk2$p20$2@ciao.gmane.io>

Nicola schrieb am 11.08.2020 um 22:21:
> On 2020-08-11, Pablo Rodriguez <oinos@gmx.es> wrote:
>> On 8/11/20 9:24 PM, Nicola wrote:
>>> Thank Pablo, Wolfgang,
>>> I have learned more by reading your replies than by myself in the rest
>>> of the afternoon.
>>
>> Hi Nicola,
>>
>> if you found replies useful, please update the wiki (this may help others).
>>
>>> Just one more thing:
>>> [...]
>>> I'd prefer all the titles to be aligned:
>>>
>>>           Preface
>>>     I     XYZ
>>>    ...
>>> VIII     XYZ
>>>    ...
>>>
>>> I have tried to do my homework by playing with \setuphead, but I am
>>> afraid I need your help on this.
>>
>> Sorry, but too tired to type a sample.
>>
>> How about setting distance for \setuplist[chapter] in the sectionblock
>> frontpart with the desired width?
> 
> That does not seem to change the layout, unfortunately. I have tried
> with `margin` and `aligntitle` as well:
> 
> \setuplist[chapter][distance=1cm,aligntitle=yes]
> \startsectionblockenvironment[frontpart]
> \setuplist[chapter][aligntitle=yes,margin=2cm,distance=2cm]
> \stopsectionblockenvironment
> 
> I'll take a fresh look tomorrow.

When you a unnumbered section with the list alternatives a-c your're out 
of luck with the regular \setuplist options because it always use a 
width of 0pt for regular section number. The aligntitle works only for 
numbered entries to align them when you disable the number entry in the TOC.

To show the section entry and align all entries on the same line you can 
use the following method:

   1. Set the width and distance for the section number to 0pt.

   2. Set the margin key to a value large enough to fit all numbers

   3. Apply a command to the numbercommand key where you shift the 
number to the left in the margin area you set in the previous step

%%%% begin example
\define[1]\ChapterListNumbercommand
   {\offset[x=-1cm,width=0pt]{\simplealignedbox{1cm}{flushleft}{#1}}}

\setuplist
   [chapter]
   [distance=0cm,
    width=0cm,
    margin=1cm,
    numbercommand=\ChapterListNumbercommand]

\starttext

\startfrontmatter
   \completecontent
   \chapter{Preface}
\stopfrontmatter

\startbodymatter
   \chapter{Introduction}
   \chapter{Workflow}
   \chapter{Input}
   \chapter{Output}
\stopbodymatter

\startbackmatter
   \chapter{Index}
\stopbackmatter

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

  reply	other threads:[~2020-08-12  4:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 11:32 Nicola
2020-08-11 12:53 ` Pablo Rodriguez
2020-08-11 18:34   ` Wolfgang Schuster
2020-08-11 19:24     ` Nicola
2020-08-11 20:08       ` Pablo Rodriguez
2020-08-11 20:21         ` Nicola
2020-08-12  4:12           ` Wolfgang Schuster [this message]
2020-08-12  7:10             ` Nicola
2020-08-11 20:15     ` Pablo Rodriguez
2020-08-13 15:17   ` Nicola
2020-08-13 15:31     ` Pablo Rodriguez
2020-08-13 16:06       ` Nicola
2020-08-13 16:34         ` Pablo Rodriguez
2020-08-13 19:45           ` Nicola
2020-08-13 17:07         ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10e266e9-0b15-9f95-fb8b-f727393d2e48@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=nvitacolonna@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).