[texhax] How to put the chapter into report title

Uwe Lueck uwe.lueck at web.de
Wed Oct 6 08:39:47 CEST 2010


"Alan T Litchfield" <alan at alphabyte.co.nz>,  06.10.2010 01:46:35
> Do not tell me what you think I should have. I know what I want. What  
> I want to know is how to get there. If that is not possible then fine,  
> I can live with that.
[...]
> Sorry, but your response is increasingly offensive.

Sorry, it was after midnight here. Next morning:

"Alan T Litchfield" <[alan at alphabyte.co.nz]>, 15.09.2010 21:55:24:
> I am using the report class with pdfLaTeX to generate chapter proofs  
> (that's because the whole thing uses report and I want easy  
> consistency).
>
> The preamble looks pretty much the same as the header file for the  
> whole document. For the whole document all the chapters are linked  
> using \include{..} and for this chapter proof the content references  
> only one chapter to include at a time.
>
> What I want to achieve is to put the contents of \chapter{...} into  
> \title{...} so when I run \maketitle the chapter title appears as the  
> report title,along the lines of:
>
> Chapter proof
> The name of the chapter
>
> I am using \maketitle to capture the date of the proof.
>
> How can I use the chapter title as the report title?

main file:

    \usepackage{nameref} % unless you load hyperref
    \title{Report\\[1ex]Chapter proof\\\nameref{ch:X}}
    \author{Alan T. Litchfield}
    \begin{document}
    \maketitle

included file:

    \chapter{...}\label{ch:X}

I really tested the \nameref thing, not having found an explicit statement on how to use \nameref. 

You may get errors in the first or second run, then just try again, third run should be fine. 

HTH really -- Uwe.


More information about the texhax mailing list