Help on tweaking alignment, page numbers and ToC
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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
On 8/11/20 1:32 PM, Nicola wrote:
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).
Hi Nicola, Garulfo invested a lot of time and effort in the new wiki layout and contents. Taco is always improving the software that runs the wiki (and the source). Many thanks to them and to all other developers.
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).
Well, \setupalignment tweaks position in line (I’d rather say). Bottom isn’t an option there. Adding \null\vfill before the alignment does the job.
1. Increase the space between Roman numbers and titles in the ToC.
distance with dimension is the key in \setuplist.
2. Vertically center the ToC (wrt to the text area).
Use a makeup for the TOC (if and only if it takes a single page).
3. Suppress page numbers and headers in all blank pages.
Break pages with \page[yes, blank].
4. Suppress headers in the front matter.
This would be my educated guess: \startsectionblockenvironment[frontpart] \setupheader[state=stop] \stopsectionblockenvironment
5. Style and position page numbers differently in the front and body matter (e.g., centered only in the front matter).
Alignment only (style comes with the proper option 😉): \setuppagenumbering[location={bottom, inmargin}] \startsectionblockenvironment[frontpart] \setuppagenumbering[location={bottom, centered}] \stopsectionblockenvironment
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?
Either you create and set up a \chapter command for the TOC (such as \chapterTOC) to use it only once, or you create a sectionblock that you apply only for the TOC (and define the chapter settings for that sectionblock). I never used environments (other than the ones to typeset XML sources), so this is my best option 😅. I hope it helps, Pablo -- http://www.ousia.tk
Pablo Rodriguez schrieb am 11.08.2020 um 14:53:
On 8/11/20 1:32 PM, Nicola wrote:
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).
Hi Nicola,
Garulfo invested a lot of time and effort in the new wiki layout and contents.
Taco is always improving the software that runs the wiki (and the source).
Many thanks to them and to all other developers.
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).
Well, \setupalignment tweaks position in line (I’d rather say). Bottom isn’t an option there.
Adding \null\vfill before the alignment does the job.
I think a makeup environment fits here better. \definemakeup [copyright] [page=yes, pagestate=start, doublesided=no, align=flushright, bottom=] \startmakeup[copyright] Copyright © 2020 Author \stopmakeup
1. Increase the space between Roman numbers and titles in the ToC.
distance with dimension is the key in \setuplist.
Correct but it's also important to set "width" to a value which is large enough to fit the number.
2. Vertically center the ToC (wrt to the text area).
Use a makeup for the TOC (if and only if it takes a single page).
3. Suppress page numbers and headers in all blank pages.
Break pages with \page[yes, blank].
Not the best solution for empty pages before a new chapter. \setuphead [chapter] [page={yes,header,footer,right}]
4. Suppress headers in the front matter.
This would be my educated guess:
\startsectionblockenvironment[frontpart] \setupheader[state=stop] \stopsectionblockenvironment
5. Style and position page numbers differently in the front and body matter (e.g., centered only in the front matter).
Alignment only (style comes with the proper option 😉):
\setuppagenumbering[location={bottom, inmargin}]
\startsectionblockenvironment[frontpart] \setuppagenumbering[location={bottom, centered}] \stopsectionblockenvironment
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?
Either you create and set up a \chapter command for the TOC (such as \chapterTOC) to use it only once, or you create a sectionblock that you apply only for the TOC (and define the chapter settings for that sectionblock).
I never used environments (other than the ones to typeset XML sources), so this is my best option 😅.
A environment is nothing more than a external file for the style, the only difference between \input{...} and \environment[...] is that ConTeXt loads environment files only once. Wolfgang
Thank Pablo, Wolfgang, I have learned more by reading your replies than by myself in the rest of the afternoon. Just one more thing:
1. Increase the space between Roman numbers and titles in the ToC.
distance with dimension is the key in \setuplist.
Correct but it's also important to set "width" to a value which is large enough to fit the number.
Chapters in the front matter have no number, so the Preface gets aligned with the numbers of the other chapters: Preface I XYZ ... VIII XYZ ... 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. Nicola
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? I hope it helps, Pablo -- http://www.ousia.tk
On 2020-08-11, Pablo Rodriguez
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. Nicola
Nicola schrieb am 11.08.2020 um 22:21:
On 2020-08-11, Pablo Rodriguez
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
On 2020-08-12, Wolfgang Schuster
Nicola schrieb am 11.08.2020 um 22:21:
On 2020-08-11, Pablo Rodriguez
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
Thanks, nice trick! Nicola
On 8/11/20 8:34 PM, Wolfgang Schuster wrote:
Pablo Rodriguez schrieb am 11.08.2020 um 14:53:
On 8/11/20 1:32 PM, Nicola wrote: [...]
3. Suppress page numbers and headers in all blank pages.
Break pages with \page[yes, blank].
Not the best solution for empty pages before a new chapter.
When I copied the code, I removed right from the \page. Now I realize that without page, that pagebreak is almost useless.
I never used environments (other than the ones to typeset XML sources), so this is my best option 😅.
A environment is nothing more than a external file for the style, the only difference between \input{...} and \environment[...] is that ConTeXt loads environment files only once.
Many thanks for the explanation. Pablo -- http://www.ousia.tk
Hi, I still have an issue with blank pages...
2. Vertically center the ToC (wrt to the text area).
Use a makeup for the TOC (if and only if it takes a single page).
Yes, the ToC takes a single page. The makeup seems to insert a blank page afterwards. MWE: \setuppagenumbering[alternative=doublesided] \definemakeup[ToC][align=middle,pagestate=start] \starttext \startfrontmatter \startmakeup[ToC] \placecontent \stopmakeup \input{knuth} \stopfrontmatter \startbodymatter \dorecurse{10}{\chapter{Foo}} \stopbodymatter \stoptext How do I suppress the blank page after the ToC? Nicola
On 8/13/20 5:17 PM, Nicola wrote:
Hi, I still have an issue with blank pages...
2. Vertically center the ToC (wrt to the text area).
Use a makeup for the TOC (if and only if it takes a single page).
Yes, the ToC takes a single page. The makeup seems to insert a blank page afterwards. MWE:
Hi Nicola, all makeups do that by default. "doublesided=no" is what you need. My warning about only taking a page is that makeups don’t split content in pages. I hope it helps, Pablo -- http://www.ousia.tk
On 2020-08-13, Pablo Rodriguez
On 8/13/20 5:17 PM, Nicola wrote:
Hi, I still have an issue with blank pages...
2. Vertically center the ToC (wrt to the text area).
Use a makeup for the TOC (if and only if it takes a single page).
Yes, the ToC takes a single page. The makeup seems to insert a blank page afterwards. MWE:
Hi Nicola,
all makeups do that by default.
"doublesided=no" is what you need.
Thanks. That works with my MWE, but in my document I actually have a chapter, and chapters start on the right page, even if I add page=no to \setuppagenumbering: \setuppagenumbering[alternative=doublesided,page=no] \definemakeup[ToC][align=middle,pagestate=start,doublesided=no] \starttext \startfrontmatter \startmakeup[ToC] \placecontent \stopmakeup \chapter{Preface} \stopfrontmatter \startbodymatter \dorecurse{10}{\chapter{Foo}} \stopbodymatter \stoptext I have no idea how to allow chapters to start at arbitrary pages when alternative=doublesided. Nicola
On 8/13/20 6:06 PM, Nicola wrote:
[...] Thanks. That works with my MWE, but in my document I actually have a chapter, and chapters start on the right page, even if I add page=no to \setuppagenumbering: [...] I have no idea how to allow chapters to start at arbitrary pages when alternative=doublesided.
Use \page[yes, blank] instead of \page[yes, blank, right]. I hope this helps, Pablo -- http://www.ousia.tk
On 2020-08-13, Pablo Rodriguez
On 8/13/20 6:06 PM, Nicola wrote:
[...] Thanks. That works with my MWE, but in my document I actually have a chapter, and chapters start on the right page, even if I add page=no to \setuppagenumbering: [...] I have no idea how to allow chapters to start at arbitrary pages when alternative=doublesided.
Use \page[yes, blank] instead of \page[yes, blank, right].
I hope this helps,
Thank you both. I had tried `yes` already, but I had mixed it with other interfering settings, which got me confused. Now that I have cleand up my code, everything is as expected. Nicola
Nicola schrieb am 13.08.2020 um 18:06:
Thanks. That works with my MWE, but in my document I actually have a chapter, and chapters start on the right page, even if I add page=no to \setuppagenumbering:
Can you start a new thread when you have a new question. When other people have the same problem they can see on the subject if this is the right thread to find a solution for it.
\setuppagenumbering[alternative=doublesided,page=no]
The page key in \setuppagenumbering is used to add the final page in a doublesided document to have a even number of pages.
\definemakeup[ToC][align=middle,pagestate=start,doublesided=no] \starttext \startfrontmatter \startmakeup[ToC] \placecontent \stopmakeup \chapter{Preface} \stopfrontmatter \startbodymatter \dorecurse{10}{\chapter{Foo}} \stopbodymatter \stoptext
I have no idea how to allow chapters to start at arbitrary pages when alternative=doublesided.
\setuphead[chapter][page=yes] Wolfgang
participants (3)
-
Nicola
-
Pablo Rodriguez
-
Wolfgang Schuster