雙頁浮動:dpfloat 覆蓋垂直對齊?

雙頁浮動:dpfloat 覆蓋垂直對齊?

對於雙頁花車(即應該在整個跨頁上一起出現的成對花車),dpfloat定期推薦該包,並且它對我來說也非常有效。

然而,我決定覆蓋 LaTeX 預設的浮動垂直對齊方式(即居中),而是指定每個整頁浮動,無論其高度如何,都與文字區域的頂行對齊 - 即,我刪除整頁浮動上方的所有空白,並將所有剩餘空白放在其下方。

我用@fptop這個。

從理論上講,這樣做的好處之一是雙頁浮動的兩半,即使它們的高度不同,至少仍然會對齊它們的頂部邊框,從而提供更令人愉悅的效果美學上的結果。

dpfloat事實並非如此。該包似乎以某種方式覆蓋了使用@fptop.浮動再次垂直居中。最糟糕的影響之一是雙頁浮動,它由同一圖像的兩半組成(即相同的高度!),因此只有一個公共標題,放置在右側。由於標題和圖像被放置在一個盒子內,然後居中,因此兩個圖像完全未對齊,這在您最需要的情況下違背了該包的目的:將屬於在一起的東西放在一起。

當然,我查看了 dpfloat.sty,但無法找到導致問題的原因。有任何想法嗎?

在此輸入影像描述

\documentclass[DIV=9,twoside=true]{scrartcl}
\usepackage{blindtext,dpfloat}

%make sure figure starts at text area's top
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother

\begin{document}
\Blindtext

\begin{figure}[p]
\rule{.5\textwidth}{.5\textheight}
\caption{A usual full-page float that's not part of a pair}
\end{figure}%

\Blindtext

\begin{figure}[p]
\begin{leftfullpage}
\rule{.5\textwidth}{.5\textheight}
\end{leftfullpage}
\end{figure}%

\begin{figure}[p]
\begin{fullpage}
\rule{.5\textwidth}{.5\textheight}
\caption{Right half of a double-page float pair with common caption.}
\end{fullpage}
\end{figure}%

\Blindtext

\Blindtext
\end{document} 

答案1

包強制浮動為全高,因此添加的填充乳膠永遠不會大於 0pt,您需要影響內容放入包的全高框的方式(\vss從頂部移除)

\documentclass[DIV=9,twoside=true]{scrartcl}
\usepackage{blindtext,dpfloat}

%make sure figure starts at text area's top
\makeatletter
\setlength{\@fptop}{0pt}
\def\endfullpage{\egroup\dp\@@wholepage\z@
   \vbox to\textheight{\unvbox\@@wholepage\vss}}

\def\endleftfullpage{\egroup\dp\@@wholepage\z@
   \vbox to\textheight{\unvbox\@@wholepage\vss}\global\@LPtrue}
\makeatother

\begin{document}
\Blindtext

\begin{figure}[p]
\rule{.5\textwidth}{.5\textheight}
\caption{A usual full-page float that's not part of a pair}
\end{figure}%

\Blindtext

\begin{figure}[p]
\begin{leftfullpage}
\rule{.5\textwidth}{.5\textheight}
\end{leftfullpage}
\end{figure}%

\begin{figure}[p]
\begin{fullpage}
\rule{.5\textwidth}{.5\textheight}
\caption{Right half of a double-page float pair with common caption.}
\end{fullpage}
\end{figure}%

\Blindtext

\Blindtext
\end{document} 

相關內容