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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using \@startsection in pdflatex to define the formatting of the subsection headings. I would like their width to be limited to 4in, and centered. I can change the third item {\z@} to indent the left hand side, but it doesn't center. Is there another way of doing this?

share|improve this question
have a look at format-title-section-number-flush-left-and-title-centered/49320#49320; it's not exactly the same, but it's pretty close – cmhughes Jul 4 '12 at 1:30
What about the subsection number? – egreg Jul 4 '12 at 6:31

Using the titlesec package you can do this as follows, by first calculating the necessary margins:



minus .1ex}{}

Sample output

This uses the default hang style with the label hanging to the left of the title. Use \titleformat{\subsection}[block]{...} to move the label in, so the first line as a whole is centered, or [display] to have the label on the line above.

share|improve this answer

Your Answer


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.