我希望页码位于外页边框上,略低于中心,当前章节标题位于底部,但逆时针旋转 90 度(即向左),使其也贴在页面外边框上,即
+--------------+--------------+
| | |
| | |
| | |
| | |
| | |
|p | p| p = page number
| | |
|C | C| CT = chapter title, rotated
|T | T| 90 degrees counter-clockwise
+--------------+--------------+
果然我可以用tikz-pgf就像上面提到的那样这里(由于这种情况,我已经在使用 tikz),通过
\node [anchor=west] at ([yshift=-0.5cm] current page.west){\pagemark}
并同样使用它来旋转章节标题,但有没有更好的方法,也许也尊重pagestyle
,例如通过定义pagemargin
类似于pageheader
?
答案1
scrlayer-scrpage
以下是使用包定义新页面样式的建议:
\documentclass[
%oneside
]{scrbook}
\usepackage[top=30mm,bottom=30mm,inner=25mm,outer=35mm]{geometry}
\usepackage{blindtext}
\usepackage{rotating}
\usepackage{scrlayer-scrpage}
\automark[chapter]{chapter}
% new font element for the text in outermargin
\newkomafont{outermargin}{\scshape\Large}
% declare new layers for the outermargin
\DeclareNewLayer[
foreground,
outermargin,
oddpage,
contents={\rotatebox{90}{\parbox[b][\layerwidth][b]{\layerheight}{%
\hspace*{.5cm}\parbox[b]{.35\layerheight}{\usekomafont{outermargin}\headmark}%
\vspace*{.5cm}}}}
]{ChapterInOutermargin.odd}
\DeclareNewLayer[
clone=ChapterInOutermargin.odd,
evenpage,
contents={\rotatebox{90}{\parbox[t][\layerwidth][t]{\layerheight}{%
\vspace*{.5cm}%
\hspace*{.5cm}\parbox[t]{.35\layerheight}{\usekomafont{outermargin}\headmark}}}}
]{ChapterInOutermargin.even}
\DeclareNewLayer[
clone=ChapterInOutermargin.odd,
contents={\parbox{\layerwidth}{\vspace*{.55\layerheight}%
\hfill\usekomafont{outermargin}\pagemark\hspace*{.5cm}}}
]{PagenumberInOutermargin.odd}
\DeclareNewLayer[
clone=ChapterInOutermargin.even,
contents={\parbox{\layerwidth}{\vspace*{.55\layerheight}%
\hspace*{.5cm}\usekomafont{outermargin}\pagemark\hfill}}
]{PagenumberInOutermargin.even}
% declare new page styles using the new layers
\DeclarePageStyleByLayers{outermargin}{%
ChapterInOutermargin.odd,ChapterInOutermargin.even,%
PagenumberInOutermargin.odd,PagenumberInOutermargin.even}
\DeclarePageStyleByLayers{plain.outermargin}{%
PagenumberInOutermargin.odd,PagenumberInOutermargin.even}
% if page style plain should be an alias for plain.outermargin
\RedeclarePageStyleAlias{plain}{plain.outermargin}
% use the new page style
\pagestyle{outermargin}
% if chapter pages should use page style outermargin instead plain
\renewcommand*{\chapterpagestyle}{outermargin}
\begin{document}
\tableofcontents
\blinddocument
\end{document}