I'm using document class book to make a series of books that contain translations of Buddhist scripture (suttas). Each sutta heading has three elements:
- an acronym (MN 1)
- a translated title (The Root of All Things)
- a root title (Mūlapariyāyasutta)
We are converting to LaTeX from HTML, where these are expressed as follows:
<h2>
<span class='acronym'>MN 1</span>
<span class='translated-title'>The Root of All Things</span>
<span class='root-title'>Mūlapariyāyasutta</span>
</h2>
I want to preserve a similar structure in LaTeX, so that we can assign three independent parts to each heading, and flexibly use them in the three places that a heading gets used: the section heading, ToC, and page header/footer. In each place we want to be able to style them.
Perhaps the markup might look something like this:
\chapter{MN 1}{The Root of All Things}{Mūlapariyāyasutta}
Or perhaps more explicitly:
\chapter{\acronym MN 1}{\translatedtitle The Root of All Things}{\roottitle Mūlapariyāyasutta}
Then we might create a section heading like this:
MN 1
The Root of All Things
Mūlariyāyasutta
And a ToC entry like this:
- MN 1: The Root of All Things — Mūlapariyāyasutta
And a page header/footer like this:
The Root of All Things | *Mūlapariyāyasutta*
|
|
MN 1 | MN 1
Here is an MWE (that doesn't actually work) for the header/footer:
\documentclass{book}
\usepackage{fancyhdr}
\fancyhead[LE]{\translatedtitle}
\fancyhead[RO]{\roottitle}
\fancyfoot[LE,RO]{\acronym}
I'm struggling to imagine what an MWE would look like for chapter headings and ToC, so this is all I've got ATM! I've looked in various places such as titlesec
and I can't find anything like this. I'm not looking for exact details on how to style these complex headings, but rather an approach that would make them available for styling and reuse.
Is there a package that handles such cases? Any help would be appreciated.
Some added nuances:
- the headings should be unnumbered, we supply fixed IDs instead.
- because this will apply in multiple volumes with different hierarchies and structures, it should work on different levels such as
\chapter
,\section
,\subsection
. - the document will also include "regular" headings (also unnumbered) for Introductions and the like.
\chapter[foo]{bar}
will show "foo" in ToC, headers, references withnameref
, etc., but will print "bar" in the title of tex.