Page Layouttitlesec creates "Unsynchronized" warning

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
bombcar
Posts: 22
Joined: Tue Oct 28, 2008 10:18 pm

titlesec creates "Unsynchronized" warning

Post by bombcar »

I have:

Code: Select all

\documentclass[b5paper]{book}
\usepackage{titlesec}
\titleformat{name=\section,page=odd}
	{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{name=\section,page=even}
	{\normalfont\Large\bfseries}{\thesection}{1em}{}
\begin{document}
\section{A Section}
\end{document}
This causes:

Code: Select all

LaTeX Warning: Unsynchronized `section' title on page 1.
but I cannot figure out why it is complaining. The only thing I can do to get rid of it is get rid of the page=even parts; but that's the whole point.

The side effect of this seems to be that it can throw the package out of whack; if I use a \section* command before a \section, it'll think it's on an even page on page 3!

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

titlesec creates "Unsynchronized" warning

Post by gmedina »

Hi bombcar,

the warning will disappear after a second compilation of the document. The warning message reminds the user that a second run is necessary, due to the asynchronous mechanism that TeX uses for building pages.

The titlesec documentation also mentions this:
documentation wrote:Since the page information is written to the aux file, at least two runs are necessary to get the desired result.
Regarding this:
bombcar wrote:...The side effect of this seems to be that it can throw the package out of whack; if I use a \section* command before a \section, it'll think it's on an even page on page 3!
Can you please post a minimal working example allowing us to reproduce the problem mentioned?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
bombcar
Posts: 22
Joined: Tue Oct 28, 2008 10:18 pm

titlesec creates "Unsynchronized" warning

Post by bombcar »

That must be what it was; I had

Code: Select all

pdflatex $*
pdflatex $*
makeindex -s ../songs.ist $*.idx
pdflatex $*
I moved the second call to after the third, which seems to work.

I'm not sure why I was calling it twice before makeindex.
Post Reply