General ⇒ Reference to section name without \label
-
- Posts: 22
- Joined: Fri May 18, 2007 6:48 pm
Reference to section name without \label
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Reference to section name without \label
Best regards
Thorsten
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 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}