[Tex/LaTex] How to get part name in LaTeX

fancyhdrheader-footerparts

Actually I am using the fancyhdr package, and trying to put the current part name in the right header.

I know that \rightmark and \leftmark are used to represent the current section and chapter heading respectively, but I can not find anything similar to represent the part name.

Best Answer

That would depend on what type of "part" you are refering to, \chaptername, \sectionname, \thepage, \thesection, \thechapter, etc... See this link for details.

EDIT: In light of your comment, this thread seems to be discussing a solution (note: there is a typo, it must be \renewcommand{\part}..., i.e. a backslash must be added):

For using the parts, you can do the following:

\let\Oldpart\part
\newcommand{\parttitle}{}
\renewcommand{part}[1]{\Oldpart{#1}\renewcommand{\parttitle}{#1}}

and then use \parttitle in the header.

Another alternative is to use the titlesec package which provides commands like \partmark that you can use.