Page LayoutDifferent front page layout for each chapter

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

Different front page layout for each chapter

Post by snowfrog »

Hi,

I'm trying to get a different layout for each chapter title page in my thesis. Basically, I have a different background picture on each title page and I need to move the title of the chapter each time depending on the picture.

I have

Code: Select all

\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \@chapteralignment \reset@font
    \ifnum \c@secnumdepth >\m@ne
      \huge\bfseries \color{red} \@chapapp{} \thechapter 
      \par
      \vskip 20\p@
    \fi
    \Huge \bfseries #1\par
    \nobreak
     \vskip 40\p@
  }}
to define how the title of the chapter should look like in my class definition file.

I saw in an article that to change how the title look I could put something like this in the preamble

Code: Select all

\renewcommand{\@makechapterhead}[1]{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \hrule                                        % horizontal line
    \vspace{5pt}%                                 % add vertical space
    \ifnum \c@secnumdepth >\m@ne
        \huge\scshape \@chapapp\space \thechapter % Chapter number
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \Huge \scshape #1\par                         % chapter title
    \vspace{5pt}%                                 % add vertical space
    \hrule                                        % horizontal rule
    \nobreak
    \vskip 40\p@
  }}
but when I try I get the error message

Code: Select all

! Undefined control sequence.
<argument> 50\p 
                @
l.7   \vspace*{50\p@}
                     %
Besides, even if it worked it would not allow me to have different layout for each chapter I guess.

Does anybody know how I could do this?
Thank you.

Recommended reading 2024:

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

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

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Different front page layout for each chapter

Post by frabjous »

If I were you, I'd use the titlesec package, which allows you to use \titleformat{\chapter}... and \titlespacing{\chapter}... commands to change this stuff on the fly. Read its documentation for more info.
snowfrog
Posts: 38
Joined: Wed Jan 06, 2010 8:11 pm

Different front page layout for each chapter

Post by snowfrog »

I'd use the titlesec package
Thanks for the advise. titlesec works a treat and does exactly what I need!
Post Reply