I think that the technique you are using to change dimensions in the first page of chapters is error prone and not optimal. First, you do it manually, adding commands before and after each chapter heading. Second, it may be difficult to find a good point to place
\restoregeometry
, since this command inserts, in turn, a
\clearpage
command.
I've seen that you are using the sectsy package. Hence a simple approach is to directly redefine some commands, avoiding that package and solving your issue. Please copy the following code in a new file and name it as mysectsty.sty.
Code: Select all
% This is file mysectsty.sty
% Redefinition of several commands in book.cls related to chapter and
% section headings, as requested by user Arya in the LaTeX Community
% Forum. Code contributed by user Juanjo.
% See http://latex-community.org/forum/viewtopic.php?f=47&t=22734
\NeedsTeXFormat{LaTeX2e}[1998/06/01]
\ProvidesPackage{mysectsy}[2013/03/04, v 0.1]
\typeout{}
\typeout{Loading mysectsty...}
\typeout{}
\def\@makechapterhead#1{%
% \vspace*{50\p@}% <--- Original
\vspace*{\dimexpr 50\p@-0.5cm}% <--- New
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
% \huge\bfseries \@chapapp\space \thechapter %<--- Original
\centering\Large\scshape % <--- New
\@chapapp\space \thechapter % <--- New
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
% \Huge \bfseries #1\par\nobreak %<--- Original
\centering\Large\scshape #1\par\nobreak % <--- New
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
% \vspace*{50\p@}% <--- Original
\vspace*{\dimexpr 50\p@-0.5cm}% <--- New
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
% \Huge \bfseries #1\par\nobreak %<--- Original
\centering\Large\scshape #1\par\nobreak % <--- New
\vskip 40\p@
}}
% \newcommand\section{\@startsection {section}{1}{\z@}%<--- Original
\renewcommand\section{\@startsection {section}{1}{\z@}%<--- New
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
% {\normalfont\Large\bfseries}}%<--- Original
{\normalfont\large\bfseries}}% <--- New
\endinput
Put mysectsty.sty in the same folder as the main tex file. Now, in the preamble, replace
\usepackage{sectsty}
by
\usepackage{mysectsty}
and comment the following lines:
Code: Select all
\chapterfont{\centering\Large\mdseries\scshape}
\sectionfont{\large}
\subsectionfont{\large}
[By the way, the last line is superfluous, since subsections are written with "large" size by default].
Comment also any
\newgeometry
and
\restoregeometry
commands before and after each chapter heading. Compile and see if everything goes fine.
It seems that you are writing in Spanish. I would advise you to load the babel package with the spanish option. This avoids the need of redefining
\listtablename
and similar commands.