# What is the name of the variable containing the current chapter title?

Consider a chapter in a french book defined by:

\chapter{Blablabla}


It will generate the output:

Chapitre I : Blablabla

Then, we have the following variables:

• \chaptername corresponds to Chapitre
• \thechapter corresponds to I

Question: what is the variable containing the chapter title Blablabla?

• Strictly speaking, these are macros, not variables. But, in any event, this depends on the document class in use, so please provide a minimal working example. May 4, 2015 at 1:49
• @PaulGessler In the standard classes, there is no such macro, is there? \leftmark includes the name of the chapter but it also includes the other parts of the mark. Or am I overlooking something?
– cfr
May 4, 2015 at 1:51
• @cfr You didn't miss anything :-) But it can be given a name if need be.
– user11232
May 4, 2015 at 1:52
• @Vincent You really should look at titleps and titlesec as Bernard suggested.
– cfr
May 4, 2015 at 2:03
• What about \@title{}? May 4, 2015 at 5:45

# Document classes

The standard classes report and book and the KOMA-Script classes scrreprt and scrbook do not store the chapter title in macros.

Class memoir uses three internal macros for the chapter title and its variations for the table of contents and the header lines:

\chapter[title in table of contents][title in header line]{title in body}


Then the internal macros contain:

\f@rtoc -> title in table of contents
\f@rhdr -> title in header line
\f@rbdy -> title in body


# Packages

There are packages, which support to reference chapter titles.

• Package nameref:

\chapter[title in table of contents]{title in body}
\label{chap:label}


Then \nameref{chap:label} yields "title in table of contents". The name is stored in the internal macro \@currentlabelname (until it is overwritten by the next title).

• Package titleref:

\chapter[title in table of contents]{title in body}
\label{chap:label}


Then \titleref{chap:label} gives "title in table of contents". The name is stored in the internal macro \TR@currentTitle (until overwritten).

• Package zref-titleref:

\chapter[title in table of contents]{title in body}
\zlabel{chap:label}% \zref@label or \zlabel with package zref-user


Then "title in table of contents" is stored by \zref@titleref@setcurrent in property title in macro \zref@titleref@current.

• What is the name of the file with the manual of zref-titleref? May 4, 2015 at 12:49
• @KeksDose zref is the main project. May 4, 2015 at 12:49

There seems to be a terrible lack of modularity and compositionality in all this. Here's my situation: I am formatting a book, which has the chapter title without the chapter number as the heading on odd-numbered pages. (This is, incidentally, a very common feature in book designs: I had a quick look at books on my bookshelf and lots of them do this). One would think that it would be handy tohave a) a variable containing the chapter number, and b) a variable containing the text of the chapter name without the chapter number. And one would also think that any formatting could be applied to these variables after they had been defined, and that one would have a clear distinction of levels between the definitions of the data (i.e. chapter number, chapter name) and the formatting applied to them in a particular design. I may be missing the obvious, but is there a simple way of doing this, using the LaTeX standard classes?

• Welcome to the TeX - LaTeX Stack Exchange. This should be a new question or comment, not an answer. Dec 6, 2021 at 12:49
• If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review Dec 6, 2021 at 13:12