Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm preparing a large document using the book class. I want my chapter, section, subsection, etc headings to appear either flushed left or right depending on whether they appear on an even or odd page, respectively. What I'm looking for is a way of doing this automatically, as the document is rather large and a minor addition/substraction of content could change the pages where many headings fall.

share|improve this question
    
Welcome to TeX.sx! –  Kurt Dec 4 '12 at 17:30

1 Answer 1

up vote 2 down vote accepted

The package titlesec provides \titleformat command with possible even/odd specification.

The package has many options and a full answer cannot be provided without your example of the desired output.. For the usage see the titlesec documentation

So just a short example (put into your preamble)

\usepackage{titlesec}
\titleformat{name=\section,page=even}{\filleft\Large\scshape}{\thesection}{.5em}{}
\titleformat{name=\section,page=odd}{\filright\Large\scshape}{\thesection}{.5em}{}

Notice that this requires two pases to stabilize.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.