0

For some reason my "Languages" chapter is not appearing properly: it's as if parts of it were not respecting my page layout (see A on the screen-capture).

Also, and it's probably related, there's now a blank page right after "Chapter 1" when "chapter 2" should instead appear there (see B on the screen-capture).

Any help would be appreciated. Thank you.

enter image description here

% PREAMBLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[a4paper,oneside,centered]{book}
\special{papersize=210mm,297mm}
\usepackage[top=3cm, bottom=3.2cm, left=2.5cm, right=2.5cm]{geometry}

\usepackage[english]{babel}
\usepackage{newpxtext} % Font for document instead of obsolete Palatino
\usepackage{tocloft} % Customization of TOC LOF LOT
\usepackage[table,xcdraw]{xcolor} % For shading in tables
\usepackage{pdfcolmk}
\usepackage{multirow}
\usepackage{textcomp}
\usepackage{ltablex}
\usepackage{nicefrac} % to write fractions
\usepackage{attrib} % For source of quotations
\usepackage{lettrine} % For NewThought formatting
\usepackage{array} % To define width of columns in long table
\usepackage{booktabs} % Nicer spacing in columns
\usepackage{siunitx} % To write Celsius, etc.
\usepackage{enumitem} % To create item lists
\usepackage{caption} % To change way captions are labelled
\usepackage{scrextend}
\usepackage{threeparttable} % For table notes + To allow footnote material to stay with the tabular environment
\usepackage{etoolbox} % To make table footnote font smaller
\usepackage{threeparttablex}
\appto\TPTnoteSettings{\footnotesize}

% Creating Index
\usepackage{imakeidx}
\makeindex
%\indexsetup{othercode=\small}
%\makeindex[columns=3,title=Index,intoc,options={-s indexstyle.ist}]
%\usepackage{showidx} %To print all index entries in right margin to proofread entries

\usepackage{blindtext}
%\usepackage{showframe}

% Styling Chapter appearance
\usepackage[T1]{fontenc}
\usepackage{titlesec, color}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}
{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}

\usepackage{hyperref} % Hyperlinks

\usepackage[toc]{glossaries}
\makeglossaries

%%%%%TEST_ZONE%%%%%%

\newglossaryentry{naiive}
{
    name=na\"{\i}ve,
    description={is a French loanword (adjective, form of naïf)
        indicating having or showing a lack of experience,
        understanding or sophistication}
}

%%%%%TEST_ZONE%%%%%%

%Table of Content depth
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{5}
\setlength{\parindent}{15pt}

%Hyperlinks for TOC
\makeatletter
\hypersetup{
    colorlinks,
    citecolor=blue,
    filecolor=blue,
    linkcolor=blue,
    urlcolor=blue
}

\begin{document}

    %\layout    

    % FRONTMATTER STARTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \frontmatter

    \title{The Book of Wonders}
    \maketitle

    \tableofcontents
    \clearpage

    \listoftables
    \clearpage

    \thispagestyle{plain} % To not have "List of Tables appear" at the top of the "Preface" page
    \section*{Preface}
    \blindtext
    \clearpage

    \thispagestyle{plain} % To not have "List of Tables appear" at the top of the "Preface" page
    \section*{Introduction}
    \blindtext
    \clearpage

    % MAINMATTER STARTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \mainmatter

    \chapter{The Story}

    \section{Data}

    \index{Plants}
    \index{star}
    \index{Mu}
    \index{Sinis}
    \index{Ball}

    \chapter{Languages}

    \section{Pronunciation}

    \section{Scripts}

    \subsection{Tina}

    \subsubsection{Consonants}

    \subsubsection{Vowels}

    \subsubsection{Numerals}

    \subsubsection{Special Symbols}

    \subsection{Anna}

    \subsubsection{Consonants}

    \subsubsection{Vowel Diacritics}

    \subsubsection{Diphthongal Diacritics}

    \subsubsection{Numerals}

    \subsubsection{Special Symbols}

    \subsubsection{Common Determinatives}

    \subsection{Herbert}

    \subsubsection{Consonants}

    \subsubsection{Vowel Diacritics}

    \subsubsection{Consonants}

    \subsubsection{Vowels}

    \subsubsection{Numerals}

    \subsubsection{Special Symbols}

    \subsection{Jennifer}

    \subsubsection{Consonants}

    \subsubsection{Vowel Diacritics}

    \subsubsection{Special Symbols}

    \subsection{Mike}

    \subsubsection{Consonants}

    \subsubsection{Vowel Diacritics}

    \subsubsection{Special Symbols}

    \subsection{Script Samples}

    \backmatter

    \printglossaries
    \printindex

\end{document}
Bernard
  • 271,350

1 Answers1

1

Ok, I'll give it a try:

All sectioning commands do not allow a page break right after them to prevent them from standing alone. Once you add text to the corresponding section, a page break will automatically be after the text.

So, adding arbitrary text, or and an \mbox{} as David suggested would solve your problem.


For the background I did some research myself, and will do my best to explain based on the \section command:

The \section command for the book class is defined as

\newcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large\bfseries}}

Therein the \@startsection command is actually a low level TeX command:

\def\@startsection#1#2#3#4#5#6{%
  \if@noskipsec \leavevmode \fi
  \par
  \@tempskipa #4\relax
  \@afterindenttrue
  \ifdim \@tempskipa <\z@
    \@tempskipa -\@tempskipa \@afterindentfalse
  \fi
  \if@nobreak
    \everypar{}%
  \else
    \addpenalty\@secpenalty\addvspace\@tempskipa
  \fi
  \@ifstar
    {\@ssect{#3}{#4}{#5}{#6}}%
    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}

Here we have a \if@nobreak \everypar{}, which delays a \nobreak command until text has been added, to prevent this text from being separated from the sectioning command (source). Once (La)TeX comes upon the text, the \nobreak is inserted.

Now, to my believe, the original \nobreak is inserted by an \@xsect command, defined in latex.ltx

\def\@xsect#1{%
  \@tempskipa #1\relax
  \ifdim \@tempskipa>\z@
    \par \nobreak
    \vskip \@tempskipa
    \@afterheading
  \else
    \@nobreakfalse
    \global\@noskipsectrue
    \everypar{%
      \if@noskipsec
        \global\@noskipsecfalse
       {\setbox\z@\lastbox}%
        \clubpenalty\@M
        \begingroup \@svsechd \endgroup
        \unskip
        \@tempskipa #1\relax
        \hskip -\@tempskipa
      \else
        \clubpenalty \@clubpenalty
        \everypar{}%
      \fi}%
  \fi
  \ignorespaces}

which again is called by the \@sect macro used in ever @startsection

\def\@sect#1#2#3#4#5#6[#7]#8{%
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
  \fi
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #6{%
        \@hangfrom{\hskip #3\relax\@svsec}%
          \interlinepenalty \@M #8\@@par}%
    \endgroup
    \csname #1mark\endcsname{#7}%
    \addcontentsline{toc}{#1}{%
      \ifnum #2>\c@secnumdepth \else
        \protect\numberline{\csname the#1\endcsname}%
      \fi
      #7}%
  \else
    \def\@svsechd{%
      #6{\hskip #3\relax
      \@svsec #8}%
      \csname #1mark\endcsname{#7}%
      \addcontentsline{toc}{#1}{%
        \ifnum #2>\c@secnumdepth \else
          \protect\numberline{\csname the#1\endcsname}%
        \fi
        #7}}%
  \fi
  \@xsect{#5}}
Timm
  • 803