![页眉中页面第一个字的节号](https://linux22.com/image/425001/%E9%A1%B5%E7%9C%89%E4%B8%AD%E9%A1%B5%E9%9D%A2%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E7%9A%84%E8%8A%82%E5%8F%B7.png)
我正在使用 fancyhead,我想在标题中包含该页面上第一个单词所属的部分编号:
\documentclass[leqno]{book}
\usepackage[utf8]{inputenc}
\usepackage{polski}
\usepackage{fancyhdr}
\usepackage{lipsum}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1}{} }
\pagestyle{fancy}
\fancyhead[LE]{\thepage}
\fancyhead[CE]{\thepart. \parttitle}
\fancyhead[RE]{[\thesubsection}
\fancyhead[LO]{\thesubsection]}
\fancyhead[CO]{\nouppercase{\rightmark}}
\fancyhead[RO]{\thepage}
\begin{document}
\setcounter{page}{5}
\setcounter{part}{1}
\setcounter{chapter}{3}
\setcounter{section}{4}
\section{first section}
\subsection{first subsection}
\lipsum[1]
\lipsum[1]
\lipsum[1]
\lipsum[1]\\
\\
that text comes from section 1 and should make header to [3.5.1
\subsection{second subsection}
that text comes from subsection 2 and changes header in the top right to [3.5.2 (supposed to be [3.5.1)
\end{document}