ConTeXt:防止標題和圖像之間分頁

ConTeXt:防止標題和圖像之間分頁

使用 ConteXt,如何防止標題和圖像或文字 + 圖像之間出現分頁?例如,給定:

 \section{With a Chart}
 \placefigure[here] {}{\externalfigure[Chart.pdf]}

 % or

 \section{With a Chart}
 \placefigure[right] {}{\externalfigure[Chart.pdf][width=5cm]}
 Hello, world ...

上述序列通常會導致章節標題之間出現分頁符號。

我注意到有一對有關的問題,但沒有具體的內容 - 我認為這是一個微不足道的情況,可能比我在其他問題中看到的更直接的答案。

答案1

第一個標題圖分割可以透過force在位置參數中使用來修復。至於第二個,我沒有找到解決方案,而且我認為沒有一個簡單的解決方案,因為包裝的數字與段落的構建方式相當混亂,並且與之互動並不容易。

\starttext

\input knuth
\input knuth
\input knuth
\input knuth

\startsection[title={With a Chart}]

  \startplacefigure[location={force,here}]
    \externalfigure[Chart.pdf]
  \stopplacefigure

  \input knuth
  \input knuth
  \input knuth

\stopsection

\startsection[title={With a Chart}]

  \startplacefigure[location={force,right}]
    \externalfigure[Chart.pdf][width=5cm]
  \stopplacefigure

  Hello, world ...

\stopsection

\stoptext

在此輸入影像描述

相關內容