1

I am typesetting a book and each chapter has its own title page. This is the code:

\documentclass[10pt]{book}
\usepackage[spanish, es-lcroman]{babel}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{extsizes}
\usepackage{longtable}
\usepackage{fixltx2e}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
%\usepackage{graphicx, lmodern}
\usepackage{fancyhdr}
\usepackage{wasysym}
\usepackage{translator}
\usepackage{array,booktabs,arydshln,xcolor}
\makeatletter
\def\@makechapterhead#1{%
\vspace*{250\p@}%
\noindent\hspace*{.1\linewidth}\smash{\rule[-2\textheight]{15pt}{3\textheight}}% Thick rule
\hspace{.02\linewidth}\smash{\rule[-2\textheight]{1pt}{3\textheight}}% Thin rule
\hspace{.1\linewidth}%
{\parbox[t]{\dimexpr.75\linewidth-7pt}{\raggedright
\ifnum \c@secnumdepth >\m@ne
    \normalfont\bfseries\fontsize{30\p@}{36\p@}\selectfont
    \@chapapp\space \scalebox{2}{\thechapter}
    \par\nobreak
    \vskip 30\p@
\fi
\interlinepenalty\@M
\fontsize{35\p@}{45\p@} \bfseries #1
}
}\thispagestyle{empty}\clearpage}
\def\@makeschapterhead#1{%
\vspace*{250\p@}%
\noindent\hspace*{.1\linewidth}\smash{\rule[-2\textheight]{15pt}{3\textheight}}% Thick rule
\hspace{.02\linewidth}\smash{\rule[-2\textheight]{1pt}{3\textheight}}% Thin rule
\hspace{.1\linewidth}%
{\parbox[t]{\dimexpr.75\linewidth-7pt}{\raggedright
\fontsize{35\p@}{45\p@} \bfseries #1
}
}\thispagestyle{empty}\clearpage}
\makeatother

In every chapter title page I get what I want, except for one in which the page number appears: enter image description here

I want to get rid of that page number but none of hat I have tried has worked so far.

\usepackage{titlesec}
\assignpagestyle{\chapter}{empty}

\usepackage{etoolbox}
\patchcmd{\chapter}{plain}{empty}{}{}

\makeatletter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                \thispagestyle{empty}% original style: plain
                \global\@topnum\z@

               \@afterindentfalse
                \secdef\@chapter\@schapter}
\makeatother

\renewcommand*\chapterpagestyle{empty}
  • 2
    you might try moving \thispagestyle{empty} to right after the initial \vspace*{250\p@}` within the make*chapterhead definitions. – barbara beeton Nov 25 '13 at 19:03
  • I changed the font size in the chapter head definition and the page number just disappeared. – Anthea Nov 25 '13 at 19:09
2

The problem is that the title is too long in that particular chapter, so the whole title page block gets moved to the next page, which is numbered. You can change your chapter macro so that the title is set in a box of a fixed height: write \parbox[t][height]... and include some \vspace at the end that can stretch or shrink:

Sample output

\documentclass[10pt]{book}
\usepackage[spanish, es-lcroman]{babel}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{extsizes}
\usepackage{longtable}
\usepackage{fixltx2e}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage{fancyhdr}
\usepackage{wasysym}
\usepackage{translator}
\usepackage{array,booktabs,arydshln,xcolor}

\makeatletter
\def\@makechapterhead#1{%
\vspace*{250\p@}%
\noindent\hspace*{.1\linewidth}\smash{\rule[-2\textheight]{15pt}{3\textheight}}% Thick rule
\hspace{.02\linewidth}\smash{\rule[-2\textheight]{1pt}{3\textheight}}% Thin rule
\hspace{.1\linewidth}%
{\parbox[t][10ex]{\dimexpr.75\linewidth-7pt}{\raggedright
\ifnum \c@secnumdepth >\m@ne
    \normalfont\bfseries\fontsize{30\p@}{36\p@}\selectfont
    \@chapapp\space \scalebox{2}{\thechapter}
    \par\nobreak
    \vskip 30\p@
\fi
\interlinepenalty\@M
\fontsize{35\p@}{45\p@} \bfseries #1\par
\vspace{0pt plus 1fill minus 1fill}
}
}\thispagestyle{empty}\clearpage}

\def\@makeschapterhead#1{%
\vspace*{250\p@}%
\noindent\hspace*{.1\linewidth}\smash{\rule[-2\textheight]{15pt}{3\textheight}}% Thick rule
\hspace{.02\linewidth}\smash{\rule[-2\textheight]{1pt}{3\textheight}}% Thin rule
\hspace{.1\linewidth}%
{\parbox[t][10ex]{\dimexpr.75\linewidth-7pt}{\raggedright
\fontsize{35\p@}{45\p@} \bfseries #1 \par
\vspace{0pt plus 1fill minus 1fill}
}
}\thispagestyle{empty}\clearpage}
\makeatother

\begin{document}
\chapter{Test}
Text
\chapter{Test}
Text
\chapter[test]{Test text test text test text test text test text test text
test text test text test text}
Text
\end{document}
| improve this answer | |

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.