3

I'm trying to make my title page count as "Page 1" in my PDF, but I have the restriction that (I think) I can only make a change to the preamble section of my .tex file.

My scenario is that I'm using sphinx-doc (with Read the Docs) to generate a PDF of our project's documentation, so I (think?) I can only make changes in the sphinx conf.py file which go into the LaTeX preable. (In other words, I don't have access to the generated .tex file before it's processed into a PDF.)

In our case, our users are reading this PDF on their devices, so I want the page numbers in the PDF to "match" the actual page count numbers of the document and the TOC.

I have figured out how to switch the numbering to arabic, but the problem is everything is off by 1. A page linked in the TOC as "Page 13" is actually Page 14 of the PDF.

I assume this is because the title page isn't being counted as a number?

I looked at other answers (here and here), but it seems that those require inline changes to the .tex file which I'm not able to do?

So I wonder if I can do this from the preamble?

Here's what I'm adding into my preamble via the sphinx config so far:

    \renewcommand\thesection{\hspace*{-0.5em}}
    \renewcommand\thesubsection{\hspace*{-0.5em}}
    \usepackage{bera}
    \usepackage[defaultsans]{lato}
    \usepackage{inconsolata}
    \usepackage{ragged2e}
    \AtBeginDocument{\raggedright}
    \setcounter{tocdepth}{1}
    \pagenumbering{arabic}

Thanks! Brian

1 Answer 1

2

A rather radical way is to inject \renewcommand\pagenumbering[1]{} in the preamble of the generated LaTeX file. You do this via the 'preamble' key (check the docs).

It worked for me in my testing (for document of the 'manual' type, i.e. using report class).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .