11

I haven't written an article since I paid my attention to ConTeXt. Now it is a chance to do it. I have tried to set the header, but failed.

The structure of this article is like this:

... title ...(Line-Breaking Algorithm)
\section{...}
...
\section{...}
...
\section{...}
...

My question is that how can I disable the header at page 1 but enable it other than page 1, and the header text is always Line-Breaking Algorithm ?

2
  • Do you use any structure element like title, chapter, section, or makeup on the first page?
    – Aditya
    Apr 6, 2013 at 14:18
  • @Aditya the title was designed by using some boxes and the first section was at the same page with the title. No chapters.
    – Lucas
    Apr 8, 2013 at 15:44

1 Answer 1

14

You can use the command setupheader to temporarily suspend the header. Here's an example:

\setupheadertexts [Line-Breaking Algorithm]
\starttext

Header present \page

\setupheader [state=stop]
No header \page

\setupheader [state=start]
And the header is back

\stoptext

If you use chapters or sections, those commands might change the settings you made manually. You can control the header behaviour of the sectioning commands with the \setuphead[header=…] setting.

If you want to disable the header on a title page, the command startmakeup may be useful. It disables the header by default and has a headerstate setting for further fine tuning.

Edit: Here's another solution using a conditional:

\setupheadertexts [\doifnot\pagenumber1{Line-Breaking Algorithm}]
\starttext
  No header \page
  Header present
\stoptext
5
  • Thanks,Marco. But when I write the words, I won't know where the ConTeXt begins a new page because I don't use \page to force a new page. Also, the title, the author are at the same page with the first section.
    – Lucas
    Apr 6, 2013 at 12:57
  • In plain TeX, I can use the \if-like commands to compare the page number with number 1, so if the page number equals 1, it won't display the header. In ConTeXt, it seems as if I can't modify the output routine.
    – Lucas
    Apr 6, 2013 at 13:05
  • Aha! That's it! thanks, Marco. By the way, where can I learn this \if-like tricky in ConTeXt?
    – Lucas
    Apr 6, 2013 at 13:37
  • 2
    @TimLi To get started have a look at the ConTeXt wiki - System Macros or if you feel more adventurous have a look at syst-aux.mkiv. Or start reading some of the modules included in the distrubution for some use cases of what you actually can do with these low level macros.
    – Marco
    Apr 6, 2013 at 13:44
  • yeah, I will follow your advice. Reading the ConTeXt codes is really a big challenge for me, but it is very interesting.
    – Lucas
    Apr 6, 2013 at 13:56

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.