I'm having a problem when compiling this rmarkdown file to pdf in RStudio. This problems is that, in the pdf file, the pdf compiler doesn't create a new page when the text reaches the bottom (about 1/2-way through) and appears to continue to write the remaining text onto an invisible extended page, like it doesn't know that page size or margins. If I take the .tex file from rmarkdown and load it into TeXworks, the pdf version has the same problem. I've used R markdown for several years and have never seen this, though this is the first time I've had all Headers (#, ##, ###) in the file. Adding 'normal' text under one of the headers does not help. Here're are the file contents. Sorry it's so long but it has to be long to display the problem. Any help is welcome.

```
---
title: "Class 3670 Book Outline"
author: "Professor"
date: "`r Sys.Date()`"
output:
pdf_document:
fig_caption: yes
keep_tex: yes
number_sections: no
toc: yes
toc_depth: 3
---
# Energy Transfer
## Thermal Equilibrium
### Thermal equilibrium and the Laws of Thermodynamics
### Non-equilibrium Thermodynamics and the Transport of Energy
### Temperature in Living Systems
### Temperature in the Environment
### Temperature Scales
## Modes of Heat Transfer
### Conductive heat transfer
### Convective heat transfer
### Radiative heat transfer
## Governing Equation and Boundary Conditions of Heat Transfer
### Governing equation for heat transfer derived
### General boundary conditions
### Bioheat transfer equation for mammalian tissue
### Governing equation derived in cylindrical coordinates
### Governing equations in various coordinate systems
### Solution techniques: Analytical vs. Numerical
### Problem formulations: an algorithm to solve transport problems
### Problem solving: A general approach
## Conduction heat transfer - Steady State
### Steady state heat conduction in a slab
### Steady state heat conduction in a cylinder
### Geometry effect: slab, cylinder, and sphere
### Steady state heat conduction in a slab with internal heat generation
### Steady state heat transfer from extended surfaces: Fins
## Conduction heat transfer - Unsteady state
### Transient heat transfer with no internal resistance
### Biot number: deciding when to ignore the internal resistance
### Transient heat transfer with internal resistance
### Transient heat transfer in a finite geometry - multidimensional problems
### Semi-infinite region
## Convection Heat Transfer
### Governing equation for convection
### Temperature profiles and boundary layers over a surface
### Laminar and turbulent flows
### Convective heat transfer coefficient defined
### Significant parameters in convective heat transfer
### Convective heat transfer coefficient calculations
### Orders of magnitude for heat transfer coefficient values
## Heat Transfer with Change of Phase
### Freezing and thawing
### Freezing of pure water
### Freezing of solutions and biomaterials
### Temperature profiles and freezing time
### Evaporation
## Radiative Heat Transfer
### The electromagnetic spectrum
### Reflection, absorption, and transmission of waves at a surface
### Thermal Radiation from an ideal (black) body
### Fraction of energy emitted
### Thermal radiation from a real body: emissivity
### Solar, atmospheric, and earth surface radiation
### Radiative exchange between bodies
```