全宽文本将所有边距固定的浮动文本移出页面右侧

全宽文本将所有边距固定的浮动文本移出页面右侧

我在用着marginfix使用修复侧注的定位在某些 Tufte 文档中,但每当页面包含全宽环境中的任何文本时,该页面上的所有边缘材料都会向右移动,因此虽然它相对于全宽文本“正确”定位,但它会溢出页面并远离所有常规宽度文本:

\documentclass[]{tufte-handout}
\usepackage{marginfix}
\begin{document}
This is text before some full width text. The footnote that goes with it is way over there.\footnote{This note goes with the text before the full width text.}
\begin{fullwidth}This is some full width text. Its presence on a page using \texttt{marginfix} pushes all notes to the right off the page.\end{fullwidth}
This is some other text, after the full width text, and its note is also way over there.\footnote{This note goes with the text after the full width text.}
\end{document}

有没有办法在使用时防止这种行为marginfix,也许通过修补 Tufte 或包装全宽环境?

答案1

诀窍是用来minipage重新定义fullwidth正确的宽度值

\documentclass[]{tufte-handout}

\makeatletter
\newlength{\fullwidthlength}
\AtBeginDocument{\setlength{\fullwidthlength}{\@tufte@fullwidth}}
\makeatother
\renewenvironment{fullwidth}{\noindent\begin{minipage}{\fullwidthlength}\strut}{\strut\end{minipage}}

\usepackage{marginfix}

\begin{document}
This is text before some full width text. The footnote that goes with it is way over there.\footnote{This note goes with the text before the full width text.}

\begin{fullwidth}This is some full width text. Its presence on a page using \texttt{marginfix} pushes all notes to the right off the page.\end{fullwidth}

This is some other text, after the full width text, and its note is also way over there.\footnote{This note goes with the text after the full width text.}

\end{document}

相关内容