6

I can't find any previous thread about this, but I still have hope my intent doesn't prove to be impossible!

I'm writing an article where I start the "formal" part (TOC, etc.) with roman page numbering. For the main text part I switch to arabic numbers, starting from zero. No issue so far. Now, at the end of the document, I have a few "formal" sections left, resuming the roman numbering from before. Right now I do that manually with \setcounter{page}{5}. I thought there might be a way to do that with a variable like \newcommand{\x}{\thepage} on the last page before I switch to arabic page numbers, and then later use \setcounter{page}{\x}, but that gives me the following error: Missing number, treated as zero. \setcounter{page}{\x+1}.

Does anyone have an approach to that? Is that even possible?

Cheers

7
  • Have you tried \setcounter{page}{\numexpr\value{\x}+1\relax}?
    – Mico
    Jan 23, 2020 at 21:41
  • 2
    It is possible but don't do it. Such a numbering system is nonsense. How should a reader know where page v or ix is? Who ever invented this system (and it is not very old) has obviously no idea idea what page numbers are for. Jan 23, 2020 at 21:42
  • @Mico Thanks, just tried your example, still doesn't work...
    – fjungplan
    Jan 23, 2020 at 21:45
  • 1
    Please clarify, then, how you define \x. Do you run \newcommand\x{\thepage}, which would be bad, or \newcommand\x{\value{page}}?
    – Mico
    Jan 23, 2020 at 21:47
  • 2
    Well I simply rejected jobs asking me to implement this. Jan 23, 2020 at 21:51

2 Answers 2

6

This shows in the terminal

[1] [2] [1] [2] [3] [3] [4]

reflecting roman 1 2, arabic 1,2,3, roman 3,4

\documentclass[a5paper]{article}

\newcounter{savepage}

\begin{document}

\pagenumbering{roman}

zzzz \newpage zzz

\clearpage
\setcounter{savepage}{\value{page}}

\pagenumbering{arabic}

zzzz \newpage zzz

zzzz \newpage zzz

\clearpage

\pagenumbering{roman}
\setcounter{page}{\value{savepage}}


zzzz \newpage zzz


\end{document}
4
  • 2
    This seems to be a very confusing numbering system, it would be better to start again from one in the end matter and use Roman , I II,.. or alphabetic A,B, or prefix A1,A2, etc... Jan 23, 2020 at 21:49
  • 3
    It is madness -- and I suspect invented in Germany somewhere. The last two years it is wandering like a disease through german tex groups and it seems not to be possible to get rid of it again. If you tell people to drop it, they simply say "but it is required". Grr Jan 23, 2020 at 22:04
  • 1
    given the geographic location it is natural that: I blame @UlrikeFischer Jan 23, 2020 at 22:10
  • You're right, I'm based in Germany, and this is a University requirement, nothing I can just "reject". So the answers were really helpful with my problem, in contrary to comments telling me I shouldn't do it!
    – fjungplan
    Feb 7, 2020 at 2:10
8

This gives the expected result: three blank pages numbered with roman numbers, then three pages numbered with arabic numbers, and then a single blank page numbered "iv".

\documentclass{article}
\newcounter{x}
\newcommand{\blankpage}{\null\newpage}
\begin{document}
\pagenumbering{roman}
\blankpage\blankpage\blankpage
\setcounter{x}{\value{page}}
\pagenumbering{arabic}
\blankpage\blankpage\blankpage
\pagenumbering{roman}
\setcounter{page}{\value{x}}
\blankpage
\end{document}

Here's a screenshot of the bottom of the pages.

2
  • You are very nice user. Best regards. Can you put, please, if possible, a screenshot?
    – Sebastiano
    Jan 23, 2020 at 22:13
  • 1
    Thanks! Yes, I usually like to add screenshots, but I was not sure at first. I think what I added should show the essential.
    – Vincent
    Jan 23, 2020 at 23:21

You must log in to answer this question.

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