General ⇒ \ref in headings
\ref in headings
Any ideas?
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
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
\ref in headings
when I use \ref inside a section title, then it's working fine inside the headings of a report document, the reference is resolved.
You could give us a minimal working example, that shows the problem, then we could provide specific help.
Stefan
\ref in headings
\ref in headings
Code: Select all
\documentclass[12pt,twosided]{report}\usepackage{hyperref}\usepackage{theorem}\newtheorem{thm}{Theorem}\begin{document}\pagestyle{headings}\chapter{Example Reference \ref{foo}}\begin{thm}\label{foo}Theorem....\end{thm}fill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill textfill text fill text fill text fill text fill text fill text fill text fill text
\ref in headings
Code: Select all
\documentclass{report}\usepackage[english]{babel}\usepackage{blindtext}\begin{document}\tableofcontents\pagestyle{headings}%the optional argument will be used in the Table of Contents and in the headings\chapter[First chapter]{First chapter referencing section~\ref{sec:secone}}\Blindtext\Blindtext\section{First section}\label{sec:secone}\end{document}
Remark: the blindtext package was loaded only to automatically generate some text.
Re: \ref in headings
Re: \ref in headings
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: \ref in headings
you may use uppercase labels like FOO, and it will work, because the headings use uppercase.
Test it or check the warnings in your logfile concerning undefined references, they are printed in uppercase.
If you had checked the log, you would have seen another warning, the option twosided is undefined, it must be twoside.
Stefan
Re: \ref in headings
@gmedina: Yeah, I don't really care if the heading has a hyperlink, I just want it to have the correct number for the ref.