In my thesis, I would like to have
- each figure and table on its own page at the end of each chapter (easy with
endfloat
) - The first figure of each chapter begins its own section that goes into the ToC, but no section title appears in the actual document.
- same as the previous point, but with tables
- the page header for the figure and table sections reflects the change
Either I end the document with \processdelayedfloats
and:
- the header correctly changes with the Tables section, but Tables stays in the header into the Figures section
- the ToC shows neither Tables nor Figures.
Or I uncomment the last few lines and:
- the Tables header continues into the new section for 1 page, then changes to the new section
- the ToC gets updated, but the page numbers for Figures and Tables are both the first non-float page.
hyperref
links the Figures and Tables ToC entries to neither the page listed nor the first table/figure.
For as awesome the idea of the endfloat
package is, it seems to be poorly implemented in my opinion. Any help in this problem (as well as understanding how this package works) would be appreciated.
MWE:
\documentclass[oneside]{memoir}
\usepackage[nolists,nomarkers,noheads,tablesfirst]{endfloat}
%%%%%%%%%%%%% stop endfloat from marking both headers %%%%%%%%%%%%%
\usepackage{etoolbox}
\makeatletter
\patchcmd{\efloat@process}{\markboth}{\@gobbletwo}{}{}
\makeatother
\AtBeginTables{\addcontentsline{toc}{section}{Tables}\markright{Tables}}
\AtBeginFigures{\markright{Figures} \addcontentsline{toc}{section}{Figures}}
\usepackage{lipsum}
\makepagestyle{mainMatter}
\makeoddfoot{mainMatter}{}{\thepage}{}
\makeoddhead{mainMatter}{\leftmark}{}{\rightmark}
\makeheadrule{mainMatter}{\linewidth}{\normalrulethickness}
\makepsmarks{mainMatter}{%
\nouppercaseheads
\createmark{section}{right}{nonumber}{}{. \ }
\createmark{chapter}{left}{shownumber}{Chapter }{: \ }}
\usepackage{hyperref}
\begin{document}
\tableofcontents*
\pagestyle{mainMatter}
\chapter{My Chapter}
\section{My Section}
\lipsum[1]
\begin{figure}
\centering
\fbox{{\HUGE a figure}}
\caption{A Figure placed here}\label{fig:a fig}
\end{figure}
\lipsum[1]
\begin{table}
\centering
\caption{Cool table}
\begin{tabular}{lc}
A & 100 \\
B & 41 \\
C & 17 \\
X?! & 0 \\
\end{tabular}
\label{tab:my table 1}
\end{table}
\begin{figure}
\centering
\fbox{{\HUGE another figure}}
\caption{A Figure placed here}\label{fig:a fig 2}
\end{figure}
\begin{table}
\centering
\caption{boring table}
\begin{tabular}{c|c}
A & B \\
\end{tabular}
\label{tab:my table 2}
\end{table}
\lipsum[1]
\processdelayedfloats
\section{Frustrated}
Note that if you uncomment the line below, suddenly the ToC gets updated (incorrectly) and the next page has a new header.
\lipsum[1-8]
\end{document}