単一ページで ohead を無効にする

単一ページで ohead を無効にする

セクションの最初のページ(最初のページのみ)の ohead を無効にしようとしています。いろいろ試してみましたが(\thispagestyle など)、どれもうまくいきません。

\documentclass[paper=a4,fontsize=12pt,parskip=half,bibliography=totoc,listof=totoc,headings=normal]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage[headsepline,plainheadsepline,footsepline,plainfootsepline]{scrlayer-scrpage} 
\pagestyle{scrheadings}
\automark{section}
\clearscrheadfoot 
\ihead{Mr. XY} 
\ohead{\headmark}
\ofoot[\pagemark]{\pagemark} 

\begin{document}

\section{first}
%here comes a lot of text...
%ein I don't want to have "first" in the header
\section{second}
%here comes a lot of text again...

\end{document}

誰かがその問題の解決策を教えてくれることを願っています。 ありがとうございます。

答え1

次の例では、およびplain.scrheadingsのオプション引数を使用して定義できるページ スタイル を使用します。\ihead\ohead

次に、セクション開始のあるページからヘッダー内のを削除するようにパッチを\section適用します。\thispagestyle{plain.scrheadings}\headmark

\documentclass[
  paper=a4,
  fontsize=12pt,
  parskip=half,
  bibliography=totoc,
  listof=totoc,
  headings=normal
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{lipsum}

\usepackage[
  headsepline, plainheadsepline,
  footsepline, plainfootsepline
]{scrlayer-scrpage} 
\pagestyle{scrheadings}
\automark{section}
\clearscrheadfoot 
\ihead[Mr. XY]{Mr. XY} 
\ohead[]{\headmark}
\ofoot[\pagemark]{\pagemark}

\let\orgsection\section
\def\section#1#{%
  \auxsection{#1}%
}
\def\auxsection#1#2{%
  \orgsection#1{#2}%
  \thispagestyle{plain.scrheadings}%
}

\begin{document}

\section{first}
\lipsum[2-12]
\section{second}
\lipsum

\end{document}

関連情報