Good evening. Is there some command simmilar to \headnumber[section] that would tell me the name of the current chapter/section/...? I want to have the headertext on the left like this: [pagenumber] [chapter title] (chap. [chapter number]) and on the right side like this: [section title] (sec. [section number]) [pagenumber] where [x] is value of x, e.g. [pagenumber] is the number of the current page. How can I do it? Many thanks Michal Kvasnicka
Hi, Humble, I thought that your layout kan be setup with \setupheadertexts[location][left text][right text][left .][right .] \setupoutput[pdftex] \usetypescript[palatino][texnansi] \setupbodyfont[palatino,rm,12pt] \setuppagenumbering[alternative=doublesided, location={header,marginedge}] \setupheadertexts [section][{\headnumber[section]}][chapter][{\headnumber[chapter]}] %leftpage: [pagenumber] [chapter title] (chap. [chapter number]) %rightpage: [section title] (sec. [section number]) [pagenumber] \starttext \chapter{Cheese} \section{Parmiggiano Reggiano} \blank[15cm] \section{Grana Padano} \blank[15cm] \section{Gruy\`ere} \blank[15cm] \section{Tilsiter} \blank[15cm] \section{Appenzeller} \chapter{Wine} \section{Cabernet Sauvignon} \blank[15cm] \section{Pinot noir} \blank[15cm] \section{M\"uller-Thurgau} \blank[15cm] \section{Chasselat} \stoptext Willi Michal Kvasnicka wrote:
Good evening.
Is there some command simmilar to \headnumber[section] that would tell me the name of the current chapter/section/...?
I want to have the headertext on the left like this: [pagenumber] [chapter title] (chap. [chapter number]) and on the right side like this: [section title] (sec. [section number]) [pagenumber] where [x] is value of x, e.g. [pagenumber] is the number of the current page.
How can I do it?
Many thanks Michal Kvasnicka
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Hi. Many thanks for your kind answer.
\setuppagenumbering[alternative=doublesided, location={header,marginedge}] \setupheadertexts [section][{\headnumber[section]}][chapter][{\headnumber[chapter]}]
Your code is rather nice (I have learned one nice trick from it), but it doesn't what I need. I want all the header stuff to go just separated by spaces, not on different sides of the header. Something like this 117_This_is_an_chapter_name_(chap._5)___________________________________________________________________ where "_" stands for a space. Well, with your trick I could possibly to it with some \hfill, but it's a rather tricky solution. Moreover, I may need the name of a current chapter and section in the document itself. I guess there must be some system solution for such a case in the ConTeXt (I think there is almost everything in it.) :-) Of course, as the last instance I can redefine \chapter and \section in a way like this \let\OriChapter=\chapter \def\chapter#1{\def\currentchaptername{#1}\chapter{#1}} but I don't want to do it -- it is dirty and involves more programming to cover crossreferences. Any more hint how to get the name of current chapter/section? With best regards Michal Kvasnicka
Hi.
Many thanks for your kind answer.
\setuppagenumbering[alternative=doublesided, location={header,marginedge}] \setupheadertexts [section][{\headnumber[section]}][chapter][{\headnumber[chapter]}]
Your code is rather nice (I have learned one nice trick from it), but it doesn't what I need. I want all the header stuff to go just separated by spaces, not on different sides of the header. Something like this
117_This_is_an_chapter_name_(chap._5)___________________________________________________________________ where "_" stands for a space.
Well, with your trick I could possibly to it with some \hfill, but it's a rather tricky solution. Moreover, I may need the name of a current chapter and section in the document itself. I guess there must be some system solution for such a case in the ConTeXt (I think there is almost everything in it.) :-)
Of course, as the last instance I can redefine \chapter and \section in a way like this \let\OriChapter=\chapter \def\chapter#1{\def\currentchaptername{#1}\chapter{#1}} but I don't want to do it -- it is dirty and involves more programming to cover crossreferences.
Any more hint how to get the name of current chapter/section?
With best regards Michal Kvasnicka
I found this in one of my old docs. Is that what you want? \setupheadertexts [{\headnumber[section]\quad\getmarking[section][current]}] [] [] [{Chapter \headnumber[chapter]:\quad\getmarking[chapter][current]}] Regards, Micke P
Dear Mikael. Many thanks. Your solution
\setupheadertexts [{\headnumber[section]\quad\getmarking[section][current]}] [] [] [{Chapter \headnumber[chapter]:\quad\getmarking[chapter][current]}]
is precisely what I searched for. Many thanks once more. With best regards M.K.
participants (3)
-
Michal Kvasnicka
-
Mikael Persson
-
Willi Egger