[texhax] problem using titleref.sty and titlesec.sty together

Niall Mansfield texhax at uit.co.uk
Wed Mar 28 17:10:01 CEST 2012


When you latex or pdflatex the file below, the
	\titleref{sec-1}
evaluates to the chapter name where \label{sec-1} is
located, (i.e. "Dummy Chapter") instead of the section
name.  I believe this is wrong behaviour.

If you comment out the \usepackage{titlesec}, the reference
is correct (i.e. "First").

What's the best way to get round this?

  Thanks,
  Niall


----------

\documentclass{book}
\usepackage{titleref}
\usepackage{titlesec}
\begin{document}

\chapter{Dummy chapter}
\section{First}
\label{sec-1}
Foo bar.
\newpage
\section{Two}
The section before this is called
\titleref{sec-1}, on page \pageref{sec-1}

\end{document}


More information about the texhax mailing list