Koma スクリプト「srcbook」を使用して両面文書のヘッダーとフッターを変更する

Koma スクリプト「srcbook」を使用して両面文書のヘッダーとフッターを変更する

私は論文を書いています。KOMA クラスを使用していますscrbookが、文書のスタイルを変更する際に行き詰まってしまいました。

まず、ヘッダーとフッターに問題があります。必要な形式は、偶数ページと奇数ページでそれぞれ次のようになります。

右側に章名、右側に偶数ページのページ番号を表示したい

左側にセクション名、左側に奇数ページのページ番号を表示したい

私の文書の前文は次の通りです

\documentclass[twoside,12pt,headsepline,chapterprefix=true]{scrbook} 
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{slashed}
\usepackage{mathtools}
\usepackage{scrlayer-scrpage}
\usepackage{biblatex}
\usepackage{csquotes}
\usepackage{hyperref}
\pagestyle{scrheadings}
\automark{chapter}
\automark*[section]{}

しかし、これは次のような形式になります ここに画像の説明を入力してください ここに画像の説明を入力してください

章とセクションの名前が目的の場所の反対側に表示され、ページ番号もフッターに表示されることに注意してください。私が探している形式を取得する方法を誰か知っていますか? また、「第 2 章」を削除し、ヘッダーに章の名前だけを表示したいです。

2 番目に、両面印刷形式を使用しているため、各章の後に空白ページがあります。タイトル ページ、謝辞、概要、目次の後に空白ページを残したいのですが、ドキュメントの残りの部分には空白ページを残したくありません。これは可能ですか?

編集: これは私の現在のドキュメントと同じ形式のものを提供するコードです

\documentclass[twoside,12pt,headsepline,chapterprefix=true]{scrbook} 
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{slashed}
\usepackage{mathtools}
\usepackage{scrlayer-scrpage}
\usepackage{lipsum}
\pagestyle{scrheadings}
\automark{chapter}
\automark*[section]{}
\begin{document}
\frontmatter
\tableofcontents
\chapter{Acknowledgements}
\lipsum[1-3]
\chapter{Abstract}
\lipsum[4-5]
\mainmatter
\chapter{ Cha 2}
\lipsum[6-15]
\section{section 1}
\lipsum[16-22]
\end{document}

答え1

ページ番号がplainページの外側のヘッダー(章ページなど)にも表示される必要がある場合は、次のように使用できます。

\clearpairofpagestyles
\ohead*{\pagemark}
\ihead{\headmark}

ページヘッダーから章番号を削除するには、

\renewcommand*\chaptermarkformat{}

メインの空白ページを削除するには、パッチを適用し\mainmatterて KOMA スクリプト オプションを設定しますopen=any

\usepackage{xpatch}
\xapptocmd{\mainmatter}{\KOMAoptions{open=any}}{}{\PatchFailed}

例:

\documentclass[
  %twoside,% default
  12pt,headsepline,chapterprefix=true
]{scrbook} 
\usepackage{lipsum}% only for dummy text
%\usepackage[utf8]{inputenc}% only needed for outdated TeX distributions
\usepackage{graphicx}
%\usepackage{amsmath}
\usepackage{slashed}
\usepackage{mathtools}% loads amsmath
\usepackage{scrlayer-scrpage}% sets page style scrheadings automatically
%\pagestyle{scrheadings}
\automark[section]{chapter}
\renewcommand*\chaptermarkformat{}% removes chapter number from page header

\clearpairofpagestyles
\ohead*{\pagemark}
\ihead{\headmark}

\usepackage{xpatch}
\xapptocmd{\mainmatter}{\KOMAoptions{open=any}}{}{\PatchFailed}

\begin{document}
\frontmatter
\tableofcontents
\chapter{Acknowledgements}
\lipsum[1-3]
\chapter{Abstract}
\lipsum[4-5]
\mainmatter
\chapter{Cha 1}
\lipsum[6-15]
\section{section 1}
\lipsum[16-22]
\chapter{Foo}
\lipsum[23-50]
\end{document}

ここに画像の説明を入力してください

短くしたことに注意してください

\automark{chapter}
\automark*[section]{}

\automark[section]{chapter}

でも、もしかしたら

\automark[chapter]{chapter}
\automark*[section]{}

関連情報