Re: [NTG-context] Word wrap of 'part' titles
> On 18 Apr 2022, at 22:10, Wolfgang Schuster via ntg-context > wrote: > > Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46: >> In the MWE below the 'part' title is centred but on one line only and, >> because it is a long title, the beginning and end are lost off the sides of >> the page. >> >> If it were a 'chapter' title then I could insert '\\' to cause a line break >> at that point. However this does not seem to work for 'part'. >> >> Is there a way of making 'part' titles wrap the same way that 'chapter' >> titles do? >> >> % ---begin--- >> \define[2]\placePartTitle{\midaligned{#2}} >> >> \definehead [Part] [part] >> \setuphead[Part] >> [ placehead=yes, >> style={\tfd}, >> command=\placePartTitle, >> ] > > \setuphead > [Part] > [placehead=yes, > style=\tfd, > align=middle, > number=no] Thanks very much for the quick and helpful reply. — Bruce Horrocks Hampshire, UK ___ 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] How to create a more human-readable syntax for displaying workbook activities?
I am creating a student workbook. There are ~30 chapters, each containing ~20 activities, called "Activity A", "Activity B", and so on. The `workbook.tex` itself uses a recurse function, so it prints chapter 1-30. The reason I use this, is if I need to do a fast test of the code, I can compile a specific range of chapters, not the whole workbook. \define\activityA{} \define\activityB{} \dostepwiserecurse{1}{30}{1}{ \chapter{\recurselevel} \activityA \activityB } \activityA prints the workbook activity "Activity A". \activityB prints the workbook activity "Activity B". The problem comes in that some activities have varied versions. Just as an example, "Activity C might be a crossword puzzle in some chapters, but a word search in other chapters. My poor solution has been to use registercyclist: \define\altCa{print a crossword} \define[3]\altCb{print a word search} \registercyclelist{activityClist}{\altCa, \altCb{}{}{}, \altCb{}{}{}} \define\activityC{% \usecyclelist{activityClist} } This code works okay, but becomes broken if I try to change the page range in `dostepwiserecurse` when testing my code. The other problem is the syntax is super messy. Within this single line, tones of data is crammed in: \registercyclelist{activityClist}{\altCa, \altCb{}{}{}, \altCb{}{}{}} ...not only is it not easy to read which chapter gets which activity, I also have to fill in the {}{}{} with data, making it more difficult to read. How can I create a much cleaner, human-readable syntax for storing this? Is there some simpler way to tell ConTeXt Chapter 1 gets one variant, Chapter 2, 3, and 4 get another, etc.? ___ 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] Word wrap of 'part' titles
On Mon, 18 Apr 2022, Wolfgang Schuster via ntg-context wrote: > Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46: > > In the MWE below the 'part' title is centred but on one line only and, > because it is a long title, the beginning and end are lost off the sides of > the page. > > > > If it were a 'chapter' title then I could insert '\\' to cause a line break > at that point. However this does not seem to work for 'part'. > > > > Is there a way of making 'part' titles wrap the same way that 'chapter' > titles do? > > > > % ---begin--- > > \define[2]\placePartTitle{\midaligned{#2}} > > > > \definehead [Part] [part] > > \setuphead[Part] > >[ placehead=yes, > > style={\tfd}, > > command=\placePartTitle, > >] > > \setuphead > [Part] > [placehead=yes, > style=\tfd, > align=middle, > number=no] Or use: align={middle,broad}, which has slightly better alignment for titles, IMHO. There is also `alternative=middle`. 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] Word wrap of 'part' titles
Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46: In the MWE below the 'part' title is centred but on one line only and, because it is a long title, the beginning and end are lost off the sides of the page. If it were a 'chapter' title then I could insert '\\' to cause a line break at that point. However this does not seem to work for 'part'. Is there a way of making 'part' titles wrap the same way that 'chapter' titles do? % ---begin--- \define[2]\placePartTitle{\midaligned{#2}} \definehead [Part] [part] \setuphead[Part] [ placehead=yes, style={\tfd}, command=\placePartTitle, ] \setuphead [Part] [placehead=yes, style=\tfd, align=middle, number=no] 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] Word wrap of 'part' titles
In the MWE below the 'part' title is centred but on one line only and, because it is a long title, the beginning and end are lost off the sides of the page. If it were a 'chapter' title then I could insert '\\' to cause a line break at that point. However this does not seem to work for 'part'. Is there a way of making 'part' titles wrap the same way that 'chapter' titles do? % ---begin--- \define[2]\placePartTitle{\midaligned{#2}} \definehead [Part] [part] \setuphead[Part] [ placehead=yes, style={\tfd}, command=\placePartTitle, ] \starttext \startPart[title={A very long part title that needs to be wrapped manually}] Some body text \stopPart \stoptext %---end--- — Bruce Horrocks Hampshire, UK ___ 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 ___