如何修改车头线(KOMA)的位置(居中/左对齐)

如何修改车头线(KOMA)的位置(居中/左对齐)

考虑一下这个 MWE

\documentclass{scrbook}
\usepackage{scrlayer-scrpage}% sets page style scrheadings 
\newlength\ratio
\setlength{\ratio}{2cm}
\usepackage[  % page layout modifications
  paper=a4paper,  %  - use A4 paper size
  foot=1.5\ratio,
  bindingoffset=.5\ratio,  %  - binding correction
  inner=\ratio,  %  - total body: left margin (odd pages)
  top=1.5\ratio,  %  - total body: top margin
  outer=2\ratio,  %  - total body: right margin (odd pages)
  bottom=2.5\ratio,  %  - total body: bottom margin
  marginparwidth=2\ratio,  %  - width for side note
  marginparsep=.25\ratio,  %  - space between notes and body text (content)
  % showframe,
]{geometry}

\AddToLayerPageStyleOptions{scrheadings}{%
  oninit=\KOMAoptions{%
    headsepline=.5pt:\textwidth+2\ratio,
    footsepline=.5pt:\ratio%
  }
}
\KOMAoptions{%
  headwidth={\textwidth+\ratio},%
  footwidth={\textwidth+\ratio}%
}
\usepackage{blindtext}% dummy text
\begin{document}
\blinddocument
\end{document}

结果是

现状

不过我希望有头线不是居中但向内边界演变,footsepline 应该只从外边界进入。此图经过修改并显示了所需的结果:

地位要求者

答案1

首先:我看不出有任何理由激活选项footsepline,而只有在初始化headsepline页面样式时才激活。scrheadings

要将头部分隔线与头部外边距对齐,可以使用选项olines。但这不足以将脚部分隔线移入边距。为此,您必须将页脚延伸到纸张边缘,或者您可以将分隔线层移向外边距:

\documentclass{scrbook}
\usepackage{scrlayer-scrpage}% sets page style scrheadings 
\newlength\ratio
\setlength{\ratio}{2cm}
\usepackage[  % page layout modifications
  paper=a4paper,  %  - use A4 paper size
  foot=1.5\ratio,
  bindingoffset=.5\ratio,  %  - binding correction
  inner=\ratio,  %  - total body: left margin (odd pages)
  top=1.5\ratio,  %  - total body: top margin
  outer=2\ratio,  %  - total body: right margin (odd pages)
  bottom=2.5\ratio,  %  - total body: bottom margin
  marginparwidth=2\ratio,  %  - width for side note
  marginparsep=.25\ratio,  %  - space between notes and body text (content)
  %showframe,
]{geometry}

\KOMAoptions{%
  headwidth={\textwidth+\ratio},%
  footwidth={\textwidth+\ratio},%
  headsepline=.5pt:\textwidth+2.5\ratio,% extended by bindigoffset
  footsepline=.5pt:2\ratio,% extended corresponding to your image
  olines,
}
\ModifyLayer[addhoffset=\ifodd\value{page}\else -\fi 1.5\ratio]{scrheadings.foot.above.line}
\usepackage{blindtext}% dummy text
\begin{document}
\Blinddocument
\end{document}

左页和右页

相关内容