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 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?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
    
i'll try this -- thank you for the very clear instructions –  Vaughn Tan Jul 24 '12 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 '12 at 23:54
    
@VaughnTan You're welcome! I'm glad my example was useful. –  Gonzalo Medina Jul 29 '12 at 0:14

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.