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 create a new document class, similar to books, but with two columns and where new chapters always starts in a new page, printing the chapter name inside a box that should occupy two columns. How to do something like this?

share|improve this question
    
Note: using floats wouldn't work in this case, because I want the box in an specific position. –  Thiago Harry Nov 28 '11 at 23:02
    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Nov 29 '11 at 7:31
add comment

migrated from stackoverflow.com Nov 29 '11 at 5:48

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 4 down vote accepted

The titlesec package provides a good interface for sectioning commands:

enter image description here

\documentclass[twocolumn]{book}
\usepackage{lipsum}% for dummy text
\usepackage{titlesec}

\titleformat{\chapter}[frame]
  {\normalfont\huge\bfseries}{\thechapter.}{1.0em}{\Huge}
\titlespacing*{\chapter}{0pt}{-20pt}{10pt}

\begin{document}
\chapter{First Chapter Title}
\lipsum[1-5]
\end{document}
share|improve this answer
    
Yes, this is what I was looking for. With some changes in this sample code I got the effect I was looking for. Thanks. –  Thiago Harry Nov 29 '11 at 15:39
add comment

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.