0

I am trying to typeset a two-column text in a right-to-left language using ConTeXt. Because I want footnotes in this text to be set ragged-bottom, I am using pagecolumns instead of standard columns (see Ragged-bottom footnotes in ConTeXt). I also want to track the first and last textual division markers on each page using markings. Combining all of these ingredients seems to create a problem in ConTeXt: when the pagecolumns are set in right-to-left order, the top and bottom marks fetched are always the top and bottom marks in the left column, while the true top mark should be the top mark of the right column. I've observed this behavior using text in an actual right-to-left language, but the following minimal (non-)working example with an English sample text demonstrates the same behavior:

%Create a new markset to use:
\definemarking[TestMark]
%Setup header to reflect top and bottom marks:
\setupheadertexts[top: {\fetchmark[TestMark][top]}][bottom: {\fetchmark[TestMark][bottom]}][top: {\fetchmark[TestMark][top]}][bottom: {\fetchmark[TestMark][bottom]}] %even left, even right, odd left, odd right
%Setup the columns layout:
\definepagecolumns [example] [
    n=2, %number of columns
    direction=reverse, %does not work if ending comma is removed!
]
\starttext
\startpagecolumns[example]
    \marking[TestMark]{1}(1) \input knuth\par
    \marking[TestMark]{2}(2) \input knuth\par
    \marking[TestMark]{3}(3) \input knuth\par
    \marking[TestMark]{4}(4) \input knuth\par
    \marking[TestMark]{5}(5) \input knuth\par
    \marking[TestMark]{6}(6) \input knuth\par
    \marking[TestMark]{7}(7) \input knuth\par
    \marking[TestMark]{8}(8) \input knuth\par
\stoppagecolumns
\stoptext

I typeset this using ConTeXt version 2020.03.10, as released with TeXLive 2020. As my comment in the MWE points out, there also seems to be a bug in the key-value parsing of \definepagecolumns that causes it not to parse the direction=reverse input unless it is followed by a comma.

Is there some way I can improve my syntax to avoid this issue, or is it just a bug that needs to be fixed? I've tried fetching other marks (e.g., first and last), but the only marks that ConTeXt seems to find are the ones for the left column.

0

Okay, a bit of searching on the ntg-context mailing list got me to an answer. For a multi-column layout, the wrapper function \getmarking should be used, and the column number should be specified as the second argument.

In my case, changing \fetchmark[TestMark][top] and \fetchmark[TestMark][bottom] to \getmarking[TestMark][1][top] and \getmarking[TestMark][2][bottom] in my MWE made everything work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.