![删除章节开头的标题行(上下文)](https://linux22.com/image/426725/%E5%88%A0%E9%99%A4%E7%AB%A0%E8%8A%82%E5%BC%80%E5%A4%B4%E7%9A%84%E6%A0%87%E9%A2%98%E8%A1%8C%EF%BC%88%E4%B8%8A%E4%B8%8B%E6%96%87%EF%BC%89.png)
我想删除仅标题行, 和仅适用于章节开头,但保留章节标题。我知道这不常见。有没有什么方法可以自动完成?
\setupheader
[text]
[before={\startframed[frame=off,bottomframe=on,framecolor=blue,]},
after={\stopframed},
]
\setupheadertexts[Text left][Text right]
\starttext
%\setupheader
% [text]
% [before=,
% after=,
% ]
\chapter{asdf}
\page
%\setupheader
% [text]
% [before={\startframed[frame=off,bottomframe=on,framecolor=blue,]},
% after={\stopframed},
% ]
\section{asdf}
\stoptext
答案1
肮脏的伎俩利用子页码:
%For testing only
%\setuppapersize[A6]
\setupsubpagenumber[way=bychapter,state=start]
\startsetups zza
\doifelse{\the\numexpr\subpageno\relax}{1}{\startframed[frame=off]}{\startframed[frame=off,bottomframe=on,framecolor=blue,]}
\stopsetups
\setupheader
[text]
[before=\setup{zza},
after=\stopframed,
]
\setupheadertexts[Text left][Text right]
\starttext
\chapter{Dari balgeun bam...}
\dorecurse{3}{\samplefile{knuth}}
\chapter{Siltago malhae...}
\dorecurse{3}{\samplefile{tufte}}
\stoptext