As Seamus commented, most classes already start chapters on a new page. This requires using the \chapter
command.
However, if you use \section
commands, page breaks would not automatically happen, this is not very common for smaller sections. But you can define it, by this modification in your LyX document preamble:
\let\stdsection\section
\renewcommand*{\section}{\clearpage\stdsection}
The first line stores the original \section
command with a different name, then \section
is redefined to include a \clearpage
before. A good effect is, that \clearpage
forces figures and tables to be printed out before the next page is started, so they don't float into the next section. That's why I did not use just \newpage
.
However, I strongly recommend using a class with \chapter
commands, such as book
, report
, memoir
, scrbook
or scrreprt
. The last two are from the great KOMA-Script bundle.
The following code will remove the phrase "Appendix. " in front of "Bibliography" in the table of contents when using the LaTeX amsbook
class or the LyX document class book (AMS)
.
\usepackage{xstring}
\renewcommand{\tocappendix}[3]{%
\indentlabel{\IfStrEq{#3}{Bibliography}{}{#1}\@ifnotempty{#2}{ #2.\quad}}#3}
For LyX, this code can be inserted into the LaTeX Preamble ("Document > Settings...").
Background:
For typesetting the table of contents, the ".toc" file is used (it can be found in the "tmpdir" / "tmpbuf" directory of LyX). It contains lines like
\contentsline {chapter}{\tocappendix {Appendix}{A}{My First Appendix}}{3}
\contentsline {chapter}{\tocappendix {Appendix}{}{Bibliography}}{3}{appendix*.1}
Furthermore, the class file amsbook.cls
defines
\newcommand{\tocappendix}[3]{%
\indentlabel{#1\@ifnotempty{#2}{ #2}.\quad}#3}
By redefining the command \tocappendix
we can omit the printing of the first argument (e.g., "Appendix") if the third argument is "Bibliography". For string comparison, the xstring
package is used. Furthermore, the bracket }
in front of .\quad
was moved behind \quad
.
Best Answer
This probably should be a duplicate but I couldn't find it. I also don't have lyx installed but I imagine that the solution should be the same (so this is a latex solution). Apologies if lyx is honestly different.
The problem is that
\appendix
redefines how chapters are printed. It also resets the chapter counter. You have not said how the next chapter should be numbered but it seems reasonable to keep the same numbering which means that we need to save the current chapter number when\appendix
is called (I do this using\preto
from the etoolbox package) and then we need to restore the value of the chapter counter when we switch back to chapters.Below I define a
\resumechapters
command that does these things. Here is the output (with the page breaks suppressed):and here is the code: