我可以阻止 endfloat 改变 \leftmark 和 \rightmark 吗?

我可以阻止 endfloat 改变 \leftmark 和 \rightmark 吗?

我正在写一篇论文,每章末尾都有浮点数。endfloat让我在写作时将图表/表格保持在它们的第一个标注附近,这样顺序就正确了,但我不想使用可定制性较差的分段endfloat功能。我在某种程度上规避了它,但现在我的标题(配置为memoir)在浮点数和表格部分被弄乱了。

我怎样才能防止这种情况发生?

下面是一个显示我的问题的 MWE(第 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}

答案1

该包endfloat发出一个\markboth命令,但没有任何禁用它的选项。

加载后,您可以使用以下技巧将其删除endfloat

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

我们将其改为\markboth简单\@gobbletwo地吞噬掉原来的两个参数\markboth

这是你的第 3 页的顶部

在此处输入图片描述

更新

使用该软件包的 2.6 版本,补丁不再必要,只需使用简单的声明

\renewcommand{\efloatheading}[1]{}

将产生同样的效果。

相关内容