Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am setting up a ConTeXt document that requires a very particular style for the footers. I need the first and last \subjects followed by the page number in the right corner of the page, like so:

Subject A - Subject C - 9

The purpose is similar to how a dictionary's pages are marked, with the first and last words on that page listed in the top corner, so it's easy to skip to the correct page.

I'm currently trying to make \setupfootertexts work for me. There are two problems I'm running into.

First, the subject key only appears to work if it is the sole argument to one of the parameters of \setupfootertexts, which is preventing me from putting even one subject name in the same corner as the page number. The documentation for how to use this is nearly non-existent, even in the newest revision of the manual, only mentioning that they can be used but not addressing this problem.

Second, I haven't a clue how to collect the necessary subject headings from the page and process them into a form that can be injected into the footer. I looked at registers, but the output of \placeregister appears to be too special-purpose for this use.

share|improve this question
add comment

2 Answers 2

up vote 9 down vote accepted

Without an example, I'm not sure that the following will do what you want, but from section 9.4 of Hans Hagen's old Context manual, \definemarking seems to be what you want: \definemarking[subject], then for each subject, \mark[subject]{...}, and then use \getmarking[subject][first] and \getmarking[subject][last] in \setupfootertexts.

I have the idea that heads can be set up so that they are tied to markings automatically, but I don't know how that works: it would save you having to issue the \mark after each \subject.

share|improve this answer
    
In fact, this is exactly the solution that I just discovered, but you beat me to the answer. Thank you! And yes, it does look like headings have a built-in mark, but \marking can be used to override the heading text if a short version is needed. –  SevenSidedDie Nov 9 '10 at 23:30
    
You can hide the contents that you do not want in a header by using \nomarking{...}. In MkIV, you can also use the \startsubject ... \stopsubject variants and set marking, toc list, bookmark, and reference independently using \startsubject[label=...,title=...,marking=....,list=...,bookmark=....,reference‌​=....] ... \stopsubject –  Aditya Nov 10 '10 at 5:23
add comment

Just to augment what Charles Stewart said earlier, in current MkIV, \getmarking[subject][both] gets you both the first and the last subject on this page, separated with an em-dash. At least, it does with other markings (chapter, section), and I assume it would in this case as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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