ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Conditional formatting with *frontpart, *bodypart, *backpart modes
@ 2021-08-13  3:34 Joey McCollum via ntg-context
  2021-08-13  5:50 ` Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Joey McCollum via ntg-context @ 2021-08-13  3:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Joey McCollum


[-- Attachment #1.1: Type: text/plain, Size: 1042 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 2216 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Conditional formatting with *frontpart, *bodypart, *backpart modes
  2021-08-13  3:34 Conditional formatting with *frontpart, *bodypart, *backpart modes Joey McCollum via ntg-context
@ 2021-08-13  5:50 ` Pablo Rodriguez via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2021-08-13  5:50 UTC (permalink / raw)
  To: Joey McCollum via ntg-context; +Cc: Pablo Rodriguez

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-13  5:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13  3:34 Conditional formatting with *frontpart, *bodypart, *backpart modes Joey McCollum via ntg-context
2021-08-13  5:50 ` Pablo Rodriguez via ntg-context

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).