Hi, I'm trying to set up a header: if a page contains only one marking, it should display this, if it has more than one, display the first and last. Here's what I tried, unsuccessfully: \definemarking [test] \startsetups [test header] \doifelse {\expanded{\getmarking[test][top]}} {\expanded{\getmarking[test][bottom]}} {\getmarking[test][top]} {\getmarking[test][top] and \getmarking[test][bottom]} \stopsetups \setupheadertexts [\setups{test header}] \starttext \marking[test] {One} \input knuth \marking [test] {Two} \page \marking [test] {Three} \input tufte \stoptext How can I make the \doifelse work? I'm not sure I understand the keywords top/bottom, first/last, and previous/next. Thomas
Thomas A. Schmitz mailto:thomas.schmitz@uni-bonn.de 22. Oktober 2015 um 13:51 Hi,
I'm trying to set up a header: if a page contains only one marking, it should display this, if it has more than one, display the first and last. Here's what I tried, unsuccessfully:
\definemarking [test]
\startsetups [test header] \doifelse {\expanded{\getmarking[test][top]}} {\expanded{\getmarking[test][bottom]}} {\getmarking[test][top]} {\getmarking[test][top] and \getmarking[test][bottom]} \stopsetups
\setupheadertexts [\setups{test header}]
\starttext
\marking[test] {One}
\input knuth
\marking [test] {Two}
\page
\marking [test] {Three}
\input tufte
\stoptext
How can I make the \doifelse work? I'm not sure I understand the keywords top/bottom, first/last, and previous/next. You have to use the \fetchmark command (which is currently broken but I sent a fix to the dev list) to check the content of both marks because \getmarking isn’t expandable.
\startsetups [test header] \doifelse{\fetchmark[test][top]}{\fetchmark[test][bottom]} {\getmarking[test][top]} {\getmarking[test][top] and \getmarking[test][bottom]} \stopsetups Wolfgang
On 10/22/2015 05:59 PM, Wolfgang Schuster wrote:
You have to use the \fetchmark command (which is currently broken but I sent a fix to the dev list) to check the content of both marks because \getmarking isn’t expandable.
\startsetups [test header] \doifelse{\fetchmark[test][top]}{\fetchmark[test][bottom]} {\getmarking[test][top]} {\getmarking[test][top] and \getmarking[test][bottom]} \stopsetups
Thank you, Wolfgang! I'll wait for the next beta (and hope that the problem with xml entities will disappear too). All best Thomas
participants (2)
-
Thomas A. Schmitz
-
Wolfgang Schuster