使用包 scrlayer-scrpage 在标题中添加章节和段落名称

使用包 scrlayer-scrpage 在标题中添加章节和段落名称

我怎样才能获取笔记本(单页模式)页眉左侧位置的当前章节名称和中间位置的当前段落名称?

谢谢你的回答。

答案1

我担心你会因为这个标题的决定而遇到麻烦……

\documentclass[oneside]{scrbook}
\usepackage{lipsum}% only for dummy text
\usepackage[autooneside=false]{scrlayer-scrpage}
\automark[paragraph]{section}
\clearpairofpagestyles
\ihead{\leftmark}
\chead{\rightbotmark}
\cfoot*{\pagemark}
\renewcommand{\chapterpagestyle}{scrheadings}
\begin{document}
\chapter{A chapter}
\section{Section One}
\paragraph{A Paragraph in Section One}
\lipsum[1]
\section{Section Two}
\paragraph{A Paragraph in Section Two}
\lipsum[2]
\paragraph{Another Paragraph in Section Two}
\lipsum[3-5]
\end{document}

在此处输入图片描述

相关内容