6

i am trying to set some text where the section header has a different margin and textwidth from the section text.

the screenshot shows a mockup of how i would like the final layout to look (including some of the section text layout usecases). section headers are in sans serif.

enter image description here

any advice on how best to implement this without resorting to tables? the easiest and cleanest thing would be to define separate geometry for section headers and section text? is this possible?

1 Answer 1

7

You can use the titlesec package to change the sectional unit formatting. A little example in which a \parbox was used to control the width of the text area reserved for the title and a negative length was used as the first argument of \titlespacing* to get the hanging title. The explicit option was used just to get explicit access to the titles:

\documentclass{article}
\usepackage[explicit]{titlesec}    
\usepackage{lipsum}    

\titleformat{\section}[block]
  {\normalfont\sffamily}
  {\thesection}{.5em}{\parbox[t]{3.7cm}{\centering\MakeUppercase{#1}}\filright}
\titlespacing*{\section}
  {-4pc}{2.5ex plus .1ex minus .2ex}{0.5pc}

\begin{document}

\section*{The Processional Experience}
\lipsum[2]

\end{document}

enter image description here

Of course, feel free to change the settings according to your needs.

3
  • i'll try this -- thank you for the very clear instructions
    – Vaughn Tan
    Jul 24, 2012 at 2:04
  • thanks for this. it eventually worked after a bunch of tweaks (there was other formatting i didn't know was needed at the time) -- i wouldn't have been able to do it without your chunk of working code though. much appreciated.
    – Vaughn Tan
    Jul 28, 2012 at 23:54
  • @VaughnTan You're welcome! I'm glad my example was useful. Jul 29, 2012 at 0:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .