I have the following code in my ConTeXt environment:
\startsetups[sectioninfo]
\ss
\rlap{\userpagenumber}
\hfill
§ \getmarking[sectionnumber][current]
\emspace
\bf \getmarking[section][current]
\hfill
\llap{}
\stopsetups
\setupheadertexts[\setups{chapterinfo}][]
[] [\setups{sectioninfo}]
My intention here is pretty simple; I want the page number on the left and the section name in the middle. However, if there's no section defined in this chapter yet, it will show the name of the last section defined in the previous chapter, or the one before that, and so forth, which is undesirable. It's also undesirable in the front matter, where no sections have yet been defined, to see the § in the header.
So I'm asking three questions:
- How does one conditionally display one thing or another, in particular if one thing is blank or empty in some sense? I think I mean this in a TeX sense primarily, but if there's a ConTeXt-specific way of doing this, that's fine too.
- How does one determine if
\getmarking[section][current]is giving me something from the previous chapter, or is there a different parameter to\getmarkingthat can be passed to get the most recent section in this chapter only?
Any resources you can point me towards would be greatly appreciated! Thanks!