Hi,
I'm trying to put the section name at the header. The only way I found to reference to the section's name was with the nameref package (and similar ones), which require you to use \label.
But I'm looking for a way to show the current section name.
Thanks
General ⇒ Reference to section name without \label
-
- Posts: 22
- Joined: Fri May 18, 2007 6:48 pm
Reference to section name without \label
Last edited by sombrancelha on Mon Jun 15, 2009 11:24 pm, edited 2 times in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Reference to section name without \label
Your approach goes into the wrong direction. For standard classes take a close look at packages like fancyhdr or titlesec. Other document classes like those from the KOMA Script bundle or memoir have built-in features which are described in the very comprehensive manuals. If you run into trouble, feel free to ask.
Best regards
Thorsten
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 22
- Joined: Fri May 18, 2007 6:48 pm
Reference to section name without \label
I am using revtex4 class.
I succeeded with the following code:
I succeeded with the following code:
Code: Select all
\documentclass{revtex4}
\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{\leftmark}
\begin{document}
\section*{Section Name}
\markboth{Section Name}{}
...
\end{document}