Text FormattingWrap chapter heading?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
wcapio
Posts: 6
Joined: Wed Aug 04, 2010 7:25 pm

Wrap chapter heading?

Post by wcapio »

Hi folks

I'm in trouble here. I want to use the following chapter style, but as my chapter titles are too long, they fall off the table? Could anyone help me with this... I am close to deadline. Thanks in advance

Code: Select all

\usepackage{pstricks}
\makeatletter
\def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax}
\def\LignesVerticales{%
  \let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
\def\GrosCarreAvecUnChiffre#1{%
  \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
  \rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%
  \vrule height 0pt width 1cm depth 0pt}

\def\@makechapterhead#1{\hbox{%
\huge 
    \LignesVerticales
    \hspace{-0.5cm}%
    \GrosCarreAvecUnChiffre{\thechapter}
    \hspace{0.2cm}\hbox{#1}%
}\par\vskip 2cm}
\def\@makeschapterhead#1{\hbox{%
    \huge 
    \LignesVerticales
    %\hspace{0.5cm}%
    \hbox{#1}%
}\par\vskip 2cm}
Last edited by wcapio on Tue Aug 10, 2010 4:15 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Wrap chapter heading?

Post by Stefan Kottwitz »

You could use \parbox instead of \hbox in your definition, like

Code: Select all

\def\@makechapterhead#1{\hbox{%
\huge
    \LignesVerticales
    \hspace{-0.5cm}%
    \GrosCarreAvecUnChiffre{\thechapter}
    \hspace{0.2cm}\parbox{.9\textwidth}{#1}%
}\par\vskip 2cm}
Choose an appropriate length instead of .9\textwidth. The same applies to \@makeschapterhead.

Stefan
LaTeX.org admin
wcapio
Posts: 6
Joined: Wed Aug 04, 2010 7:25 pm

Re: Wrap chapter heading?

Post by wcapio »

Owe you bigtime!!
Thanks a lot!
Post Reply