# XeLaTeX bottom margin overflow when using Bookdown

I'm having the following problem:

In page two, the paragraph starting with "To reduce the risk" starts outside of the "text" body height. After some search, I found a similar report in TeX Stack Exchange, see Figure or longtabu/longtable causes bottom margin overflow - TeX - LaTeX Stack Exchange.

In the .tex generated by bookdown, I have

\begin{figure}

{\centering \includegraphics[width=1\linewidth]{./img/overfitting}

}

\caption{Illustration of overfitting. Squares represent points, green line represents hyperplane, and colours represent classes. Training data in the top row and testing data in the botton row. (a) Initial configuration of the problem: three and four wrong prediction in training and testing data, respectively. (b) Configuration at the end of first iteration: four and two wrong prediction in training and testing data, respectively. (c) Configuration at the end of second iteration: one and one wrong prediction in training and testing data, respectively. (d) Final configuration with occurrence of overfitting: zero and four wrong prediction in training and testing data, respectively.}\label{fig:overfitting}
\end{figure}

\begin{longtable}[]{@{}lrr@{}}
\caption{\label{tab:hkjc-fractures-location}Location and number of fractures (in racing and in training) in Thoroughbred racehorses at the Hong Kong Jockey Club from 1 July 2004 to 30 June 2011 sorted based on total number of fracture events. Source:~{[}@sunFractureIncidenceRates2016; @sunNoncatastrophicCatastrophicFractures2019{]}.}\tabularnewline
\toprule
Location & No.~fracture events in racing & No.~fracture events in training \\
\midrule


which confirm that the issue is caused by longtable and float on the same page.

How can I disable longtable?

You don't tell us how you create the table.
If you use knitr::kable you can specify the argument longtable=FALSE .

2 Likes

I'm using

read_csv("./file.csv") %>% knitr::kable(
"pipe",
booktabs = TRUE,
caption = 'Some text'
)


because I need some text in the CSV file that need to be processed by Pandoc.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.