Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am working on a thesis with floats at the end of each chapter. endfloat lets me keep the figs/tables near their first callouts while writing so the order is correct, but I don't want to use the poorly-customizable sectioning endfloat provides. I circumvented it to some extent, but now my headers, configured with memoir, are messed up at the Floats and Tables sections.

How can I prevent this from happening?

Here's a MWE showing my problem (headers go bad at page 3):

\documentclass[12pt,letterpaper,oneside]{memoir}
%%%%%%%%%%%%  FLOATS AND TABLES  %%%%%%%%%%%%
\usepackage[nolists,nomarkers,noheads,figuresfirst]{endfloat}
    \AtBeginTables{\section{Tables}\vfill}
    \AtBeginFigures{\section{Figures}\vfill}
    \AtBeginDelayedFloats{}
    \renewcommand{\efloatseparator}{\vfill\clearpage}
    \setfloatlocations{table}{p}
    \setfloatlocations{figure}{p}
%\usepackage{booktabs}

%%%%%%%%%%%%  FORMAT HEADERS  %%%%%%%%%%%%
\makepagestyle{endfloatTakeover}
\makeoddfoot{endfloatTakeover}{}{\thepage}{}
\makeoddhead{endfloatTakeover}{\leftmark}{}{\rightmark}
\makeheadrule{endfloatTakeover}{\linewidth}{\normalrulethickness}
\makepsmarks{endfloatTakeover}{%
\nouppercaseheads
\createmark{section}{right}{nonumber}{}{. \ }
\createmark{chapter}{left}{shownumber}{Chapter }{: \ }}
\pagestyle{endfloatTakeover}

%%%%%%%%%%%%  MWE TEXT  %%%%%%%%%%%%
\usepackage{lipsum}

\begin{document}
\chapter{Intro}
\section{First Intro Section}
\lipsum[1] See~\fref{fig1}.

\begin{figure}[h]
\centering
FIGURE 1
\caption{Vivamus vehicula dolor laoreet neque imperdiet consequat} \label{fig1}
\end{figure}

\lipsum[2]

\section{Second Intro Section}
\lipsum[3]
 See~\fref{fig2}.

\begin{figure}
\centering
FIGURE 2
\caption{Vivamus vehicula dolor laoreet neque imperdiet consequat} \label{fig2}
\end{figure}

\lipsum[4]
See~\tref{tab:tab1}

\begin{table}[h]
  \centering
    \begin{tabular}{c}
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. \\
    Morbi in turpis faucibus, sollicitudin sem eu, condimentum nibh. \\
    Quisque pharetra nunc volutpat purus venenatis, ut cursus purus consectetur. \\
    Fusce suscipit massa eu libero blandit, a facilisis risus pharetra. \\
    \end{tabular}
  \caption{ia nostra, per inceptos himenaeos. }
    \label{tab:tab1}
\end{table}

\clearpage
\processdelayedfloats

\end{document}
share|improve this question
    
The example doesn't compile because \end{figure} must start at column 1. –  egreg Jun 17 '13 at 19:26
    
that's odd, it compiles for me. I will edit it so other people can use it without errors. –  DocBuckets Jun 17 '13 at 21:25

1 Answer 1

up vote 5 down vote accepted

The package endfloat issues a \markboth command without any option for disabling it.

You can remove it with the following trick after loading endfloat:

\usepackage{etoolbox}
\makeatletter
\patchcmd{\efloat@process}{\markboth}{\@gobbletwo}{}{}
\makeatother

We change \markboth into \@gobbletwo which simply gobbles the two arguments originally for \markboth.

Here's the top of your page 3

enter image description here

share|improve this answer
    
Awesome. I will have to keep this in mind if there are other packages with problematic commands in them. –  DocBuckets Jun 17 '13 at 21:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.