Page Layoutsection heading appears on every page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
xrismf
Posts: 5
Joined: Fri May 06, 2011 3:14 pm

section heading appears on every page

Post by xrismf »

Hello alltogether,

I have tried this example to get some nicer formatted headings for my document. Unfortunately now the header of the actual section is printed on top of every page, but I only want the header to appear at the actual beginning of the section. The relevant code is:

Code: Select all

Code, edit and compile here:
\documentclass[svgnames]{scrartcl}
...
\usepackage[automark]{scrpage2}
\usepackage{blindtext}
\usepackage{tikz}
\newcommand*\tikzhead[1]{%
\begin{tikzpicture}[remember picture,overlay]
\node[yshift=-2cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\draw[fill=LightSkyBlue] (0,0) rectangle
(\paperwidth,2cm);
\node[anchor=east,xshift=.9\paperwidth,rectangle,
rounded corners=15pt,inner sep=11pt,
fill=MidnightBlue]
{\color{white}#1};
\end{tikzpicture}
};
\end{tikzpicture}}
\clearscrheadings
\ihead{\tikzhead{\headmark}}
\pagestyle{scrheadings}
...
\begin{document}
...
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Can anybody help me?

Kind Regards

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: section heading appears on every page

Post by kaiserkarl13 »

Try \thispagestyle instead of \pagestyle and see if that does what you want.
xrismf
Posts: 5
Joined: Fri May 06, 2011 3:14 pm

Re: section heading appears on every page

Post by xrismf »

Well, got to put this on every page with a heading - but it works. So thank you very much :-)
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: section heading appears on every page

Post by kaiserkarl13 »

You could try redefining the \section command to include a \thispagestyle command.
Post Reply