Graphics, Figures & TablesHow to add "Page" to "Chapter 1" like toc & lof

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Michael_590
Posts: 51
Joined: Wed Aug 06, 2014 6:59 pm

How to add "Page" to "Chapter 1" like toc & lof

Post by Michael_590 »

How can I add the word "Page" to chapter 1. In chapter 1, what I have are links to items with page numbers (at the far right).

And, I'd like to add the word "Page" at the start of chapter 1 above the column of page numbers. (I've already added the word to the table of contents and listoffigurs.)

Thanks,

Code: Select all

\documentclass{book}
    \usepackage{caption}
    \usepackage{graphicx}
    \begin{document}
    \tableofcontents
    \addtocontents{toc}{~\hfill\textbf{Page}\par}
    \listoffigures
    \addtocontents{lof}{~\hfill\textbf{Page}\par}
    \chapter{One}
    Pretend Link1 to: Story 1                      20
    Pretend Link2 to: Story 2                      29
    Pretend Link3 to: Story 3                      35
    Pretend Link4 to: Story 4                      38
    \chapter{Go tell it on the mountain}
    \bigbreak
    \chapter{Darned if I know }
     This is the third chapter in the story.
    \begin{minipage}{\linewidth}
            \begin{center}
                    \includegraphics[width=\textwidth]{example-image}
                    \captionof{figure}{this is my caption}
            \end{center}
    \end{minipage}
    \chapter{Happy New Year}
     This is the fourth chapter in the story.
    \begin{minipage}{\linewidth}
            \begin{center}
                    \includegraphics[width=\textwidth]{example-image}
                    \captionof{figure}{this is my caption}
            \end{center}
    \end{minipage}
    \chapter{Five}
     This is the fifth chapter in the story.
    \begin{minipage}{\linewidth}
            \begin{center}
                    \includegraphics[width=\textwidth]{example-image}
                    \captionof{figure}{this is my caption}
            \end{center}
    \end{minipage}
    \end{document}
Last edited by Michael_590 on Fri Sep 26, 2014 5:42 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: How to add "Page" to "Chapter 1" like toc & lof

Post by Johannes_B »

Hi Michael, please klick on »open in writelatex« just above the code you posted.

Right now, i can't figure out the structure of your document. If a story has the level of a section, then a chapter of that story can't logically be on the same level.

Please try to explain what you have in mind. There might be a very clean solution.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Michael_590
Posts: 51
Joined: Wed Aug 06, 2014 6:59 pm

How to add "Page" to "Chapter 1" like toc & lof

Post by Michael_590 »

Johannes_B wrote:Please try to explain what you have in mind. There might be a very clean solution.
I have, slightly, edited the code in my first post.

What I want to do is I have serveral links to sections in chapter 5. These links have page numbers associated with them. (My actual LaTex was created by Doxygen, so the links will always have accurat page numbers.) What I want to do is put the word "Page" above this column of page numbers.

I want to simulate what I have done with the word "Page" for the table of contents and list of figures.

Thanks,
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to add "Page" to "Chapter 1" like toc & lof

Post by Johannes_B »

Michael, i beg you, try to give me some information. And please
compile your own minimal examples and make sure thy show the
problem at hand.
Doxygen might generate the LaTeX code, but LaTeX itselve is in
charge of setting hyperlinks and also page numbers.

To this day, you refused to give any information on your
workflow. You are changing auto-generated code, which is never a
good idea because all the changes will be lost with the next
Doxygen run.

To be honest, if you don't invest time in explaining yourself, i
wonder why i invest time answering.

Code: Select all

\documentclass{book}
\begin{document}
\chapter{One}
\hfill\textbf{Page}\par
Pretend Link1 to: Story 1                      20\par
Pretend Link2 to: Story 2                      29\par
Pretend Link3 to: Story 3                      35\par
Pretend Link4 to: Story 4                      38\par
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Michael_590
Posts: 51
Joined: Wed Aug 06, 2014 6:59 pm

Re: How to add "Page" to "Chapter 1" like toc & lof

Post by Michael_590 »

Deleted
Last edited by Michael_590 on Fri Oct 31, 2014 7:44 pm, edited 1 time in total.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: How to add "Page" to "Chapter 1" like toc & lof

Post by Johannes_B »

Can you give us at least a bit feedback on how or if our hints and advice were useful?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Michael_590
Posts: 51
Joined: Wed Aug 06, 2014 6:59 pm

Re: How to add "Page" to "Chapter 1" like toc & lof

Post by Michael_590 »

Deleted
Post Reply