ConTeXt の特定のセクションの前に新しいページを配置しないようにする

ConTeXt の特定のセクションの前に新しいページを配置しないようにする

各セクションに空白ページを配置できるようにしました。

\setuphead[section][page=yes]

特定のセクションの後に空白ページを挿入しないようにしたい:

例えば。

\section{Section 1}%starts a new page after
bla...
\section{Section 2}% I need this section does not start a new page
bla...

答え1

別のオプションとしては、新しいセクション コマンドを定義することが考えられます。

\setuphead[section][page=yes]

\definehead[sectionnopage][section][page=no]

\starttext
Some text here.
\section[title=Section 1]
bla...
\sectionnopage[title=Section 2]
bla...
\stoptext

答え2

セクションの周りのグループで使用することもできます\disablepagebreaksが、これに副作用があるかどうかはわかりません。

\setuphead[section][page=yes]

\starttext

\section{Section 1}
bla...

{\disablepagebreaks\section{Section 2}}
bla...

\stoptext

に対応するものはないようです\disablepagebreaks。 定義することは可能ですが、これはサポートされておらず、予期しない方法で機能しなくなる可能性があることに注意してください。

\unprotect
\let\normal_page_breaks_process\page_breaks_process
\unexpanded\def\enablepagebreaks%
    {\let\page_breaks_process\normal_page_breaks_process}
\protect

\setuphead[section][page=yes]

\starttext

\section{Section 1}
bla...

\disablepagebreaks
\section{Section 2}
\enablepagebreaks
bla...

\stoptext

関連情報