RH2019: Chapter numbering, section references, and chapter name in header for PDF output

Contributor ,
Nov 08, 2019

Copy link to clipboard



I'm trying to create a pdf output that looks something like this:


I'm running into the following problems:

  • Chapter and section numbering in the body:
    I cannot get chapter numbering at all. I've tried a before: counter for <h1> in the pdf CSS but then all chapters are numbered '1' (one). I haven't even tried section numbering yet until that is resolved.
  • Applying an automatic <h1>, <h2>, <h3> etc. depending on the place in the TOC:
    All my topics (also the subsections have their own separate topics) start with <h1>. The generated TOC shows the correct indentation but the topics themselves stay at <h1> for each heading. I would have hoped this was generated automatically, but currently I fear my only option is to use one topic for every complete chapter, and apply the H1, H2 myself. Is that correct, or is there another way? 
  • If the chapter and section numbering can be resolved, would it be possibe to refer to them with a dynamically generated section number (see 12.3) in the body, or otherwise with a dynamically generated page number (see p. xx)?
  • Chapter name reference in the header: I have found a post for RH2015 that talks about a <<PD>> something which I suspect is a field. However, I cannot find anything about chapter names in the field dialog, just project-wide fields such as the project name, or otherwise the file title, but in that case using a separate TOC with numbered headings (as Peter suggests) wouldn't work (I think?); I would need to add the numbers to the file title which will probably make it show up in other places as well (would it?).


I could generate to Word to solve many of these problems, but then the numbered section references (see 12.3) would still need to be added manually afterwards, I think? Which is just not an option.

Any post scripting that could solve this, or any other solutions (or pointers to them) very much appreciated.

New UI, Single source layouts







Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Have something to add?

Join the conversation