GeneralReference to section name without \label

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
sombrancelha
Posts: 22
Joined: Fri May 18, 2007 6:48 pm

Reference to section name without \label

Post by sombrancelha »

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
Last edited by sombrancelha on Mon Jun 15, 2009 11:24 pm, edited 2 times in total.

Recommended reading 2024:

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

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

Post by localghost »

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
sombrancelha
Posts: 22
Joined: Fri May 18, 2007 6:48 pm

Reference to section name without \label

Post by sombrancelha »

I am using revtex4 class.

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}
Post Reply