Page LayoutCreating header before creating the page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Fusel2000
Posts: 1
Joined: Wed Nov 17, 2010 9:37 pm

Creating header before creating the page

Post by Fusel2000 »

Hello,

I hope you'll understand my problem.

I have got a document with more than one sections on each page. Everytime when I start a new section I set an variable called \dvd on a certain word. In the header I want to have the value of \dvd at the start of the page.

My sourcecode looks like this:

Code: Select all

...
\newcommand{\dvd}{some stuff}
\usepackage{fancyheadings}
\fancyhf{}
\lhead{\dvd}
\rhead{\thepage}

\begin{document}
  \tableofcontents
  \newpage
  \renewcommand{\dvd}{some other stuff}
  \section{...}
...
  \renewcommand{\dvd}{some other stuff}
  \section{...}
...
  \renewcommand{\dvd}{some other stuff}
  \section{...}
...
\end{document}

My problem is, that in the header the value of \dvd at the end of the page occurs. But I want the value from the start of the page or the last value from the former page.

Can you help me? Sorry if my English is not perfect...

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Creating header before creating the page

Post by gmedina »

Hi,

maybe the mechanism provided by the mark-related commands of the titlesec package could be useful for you. Please refer to Section 5.4 "Marks" of the package documentation for further details.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply