Conditional formatting with *frontpart, *bodypart, *backpart modes
Hi, I was curious about the possibility of handling general formatting settings (e.g., page layout, headers and footers, page numbering, alignment, default body font assignment, etc.) conditionally for front, body, and back matter using modes. According to the wiki page at https://wiki.contextgarden.net/Modes, this should be doable with blocks like \startmode[*frontpart] ... \stopmode, but even in the following minimal example, the conditional formatting isn't getting applied: ``` \startmode[*frontpart] \setupbodyfont[modern, 12pt] \stopmode \startmode[*bodypart] \setupbodyfont[pagella, 12pt] \stopmode \startmode[*backpart] \setupbodyfont[termes, 12pt] \stopmode \starttext \startfrontmatter \input knuth\par \stopfrontmatter \startbodymatter \input knuth\par \stopbodymatter \startbackmatter \input knuth\par \stopbackmatter \stoptext ``` Is there something obvious that I'm missing? Or is there a different recommended approach to conditional formatting by front/body/back matter division? Thank you! Joey
On 8/13/21 5:34 AM, Joey McCollum via ntg-context wrote:
Hi,
I was curious about the possibility of handling general formatting settings (e.g., page layout, headers and footers, page numbering, alignment, default body font assignment, etc.) conditionally for front, body, and back matter using modes. [...]
Hi Joey, the command is just different: \startsectionblockenvironment[frontpart] \setupbodyfont[modern] \stopsectionblockenvironment \startsectionblockenvironment[bodypart] \setupbodyfont[pagella] \stopsectionblockenvironment \startsectionblockenvironment[backpart] \setupbodyfont[termes] \stopsectionblockenvironment \startsectionblockenvironment[appendix] \setupbodyfont[helvetica] \stopsectionblockenvironment \starttext \startfrontmatter \input knuth\par \stopfrontmatter \startbodymatter \input knuth\par \stopbodymatter \startbackmatter \input knuth\par \stopbackmatter \startappendices \input knuth\par \stopappendices \stoptext I hope it helps, Pablo -- http://www.ousia.tk
participants (2)
-
Joey McCollum
-
Pablo Rodriguez