1

I'm using this format for my chapters

\usepackage{xcolor}
\usepackage{pstcol}
\makeatletter
\def\LigneVerticale{\vrule height 1.5cm depth 0.9cm\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\GrosCarreAvecUnChiffres#1{{%
  \color{white}%
  \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
  %\rlap{\hbox to 1cm{\hss\mbox{\color{black}#1}\hss}}%
  %\vrule height 0pt width 1cm depth 0pt}}
  \hspace{-0.65cm}
  }}
\def\@makechapterhead#1{
    \vspace*{-20pt}
    \hbox{%
    \huge\bfseries
    \LignesVerticales
    \hspace{-0.62cm}%
    \GrosCarreAvecUnChiffre{\thechapter}
    \hspace{0.2cm}\hbox{#1}%
    }\par\vskip 0.5cm}
    \def\@makeschapterhead#1{
         \vspace*{-20pt}
    \hbox{%
    \huge\bfseries
    \LignesVerticales
    \hspace{-0.62cm}%
    \GrosCarreAvecUnChiffres{\thechapter}
    \hspace{0.2cm}\hbox{#1}%
    }\par\vskip 0.5cm}
\makeatother

The contents is always on a new page, but i would like to have it under the title on the first page. Anyone knows how to make it?

  • I suspect something like \let\cleardoublepage\relax etc. just before \tableofcontents – user31729 Oct 14 '14 at 15:13
  • @ChristianHupfer Answer? :-p – Johannes_B Feb 11 '15 at 22:42
  • @ChristianHupfer or something else? – Johannes_B May 9 '16 at 8:03
  • @Johannes_B: I'll think about it later on – user31729 May 9 '16 at 10:59
  • 4
    Possible duplicate of ToC on the title page in a report – GiuTeX Sep 2 '17 at 10:46
3

This is a guess only (since no MWE was given): Using the book class and patching \tableofcontents and \@maketitle slightly to remove the \newpage or \cleardoublepage usage.

\documentclass[notitlepage]{book}

\usepackage{xcolor}
\usepackage{pstricks}
\usepackage{xpatch}
\usepackage{auto-pst-pdf}

\makeatletter
\AtBeginDocument{%
\xpretocmd{\tableofcontents}{%
  \begingroup\let\cleardoublepage\relax
}{}{}

\xapptocmd{\tableofcontents}{%
  \endgroup%
}{}{}

\xpatchcmd{\@maketitle}{\newpage\null}{}{}{}
}
\makeatother

\title{Theory of Brontosaurs}
\author{Ann Elk}
\date{\today}

\makeatletter
\def\LigneVerticale{\vrule height 1.5cm depth 0.9cm\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\GrosCarreAvecUnChiffres#1{{%
  \color{white}%
  \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
  %\rlap{\hbox to 1cm{\hss\mbox{\color{black}#1}\hss}}%
  %\vrule height 0pt width 1cm depth 0pt}}
  \hspace{-0.65cm}
  }}
\def\@makechapterhead#1{
    \vspace*{-20pt}
    \hbox{%
    \huge\bfseries
    \LignesVerticales
    \hspace{-0.62cm}%
    \GrosCarreAvecUnChiffre{\thechapter}
    \hspace{0.2cm}\hbox{#1}%
    }\par\vskip 0.5cm}
    \def\@makeschapterhead#1{
         \vspace*{-20pt}
    \hbox{%
    \huge\bfseries
    \LignesVerticales
    \hspace{-0.62cm}%
    \GrosCarreAvecUnChiffres{\thechapter}
    \hspace{0.2cm}\hbox{#1}%
    }\par\vskip 0.5cm}
\makeatother



\begin{document}
\maketitle
\tableofcontents


\chapter{First chapter}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.