0

I am using \documentclass{article} to formulate an a4paper in twoside mode; Every thing is fine ... Well nearly, there is a small glitch somewhere in the standard LaTeX defaults between the page numbering function and the margin setup.

Here is a simplified version of the problem, initial pages are numbered with {roman} numerals; The main bulk of the document is then enumerated with {arabic} numerals.

Between the roman and the arabic numerals; The margin weight for the double page spread is shifting from outer to inner, or vice versa; The problem arises if the format change is made on an even page as it resets the count to an odd number.

\documentclass[a4paper, twoside]{article}

\begin{document}
\pagenumbering{gobble}
\title{Jabberwocky}
    \author{Lewis Carroll}
    \date{1871}
\maketitle

\newpage
\pagenumbering{roman}
\tableofcontents
\setcounter{tocdepth}{1}
This is an unfathomably long line of relative yet diminutive sense, such that
the totality of the page is spread with ink.

\newpage
\pagenumbering{arabic}
\section{Twas brillig}
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.

\section{Beware the Jabberwock}
"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!"

\section{He took his vorpal sword}
He took his vorpal sword in hand:
Long time the manxome foe he sought --
So rested he by the Tumtum tree,
And stood awhile in thought.

\section{And, as in uffish}
And, as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
And burbled as it came!

\newpage
\section{One, two! One, two!}
One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.

\section{And, has thou slain}
"And, has thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!'
He chortled in his joy.

\section{Twas brillig}
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe. 

\end{document}

And a screen shot of the pdf; Notice the difference in width of the juxtaposed margin between the title page and the content page i, and again between the content and page 1:

enter image description here

9
  • We don't need to see your preamble in its current form (as it contains a lot of packages that are irrelevant to the problem). Can you post a minimal working example (MWE) that replicates your problem? Click on the mentioned link and please read the post.
    – Werner
    Commented Apr 26, 2016 at 14:20
  • @Werner Thank you for the link. Here is a more concise rendition of the problem. Upon writing this it occurs to me that there is a number reset command, perhaps this would reset the margin too?
    – iain
    Commented Apr 26, 2016 at 15:20
  • 1
    It's perfectly normal: LaTeX decides that a page is right or left based on the value of the page counter; you have page “i” which is a right-hand page, followed by page “1”, which is again a right-hand page. You need \cleardoublepage (so as to create an empty page) when switching from Roman to Arabic numbers.
    – egreg
    Commented Apr 26, 2016 at 15:25
  • @egreg Thank you; This is not really solving the issue as my document starts with a title page that has pagenumbering{gobble}. Followed by an even number of roman numerated pages, and then the document starts. I think that using the \cleardoublepage will cause a problem in the double side print; thank you for your consideration.
    – iain
    Commented Apr 26, 2016 at 15:37
  • I suppose I could just skip that page in the pdf print, there must be a more elegant solution.
    – iain
    Commented Apr 26, 2016 at 15:40

2 Answers 2

0

By definition, \pagenumbering resets numbering to one.

Standard packages put odd numbers in recto pages and even in verso pages (recto = front and even = back for left-to-right languages).

You can sustitute \pagenumbering{arabic} with something like:

\renewcommand{\thepage}{\arabic{page}}

It renews command \thepage to arabic format without reseting page counter.

If you want to put an specific number from one page use:

\setcounter{page}{7} % sustitute 7 for the number you want.
7
  • This will work for now, thank you. It would be nice to reset the numerals to 1 without the margin jumping about though.
    – iain
    Commented Apr 26, 2016 at 16:19
  • Oh , firstly please let me apologize to you, it would seem that there is a bug in the stack exchange messaging protocol; I am unable to signal you from with this response due to some factor in-regard to your choice of screen name
    – iain
    Commented Apr 27, 2016 at 5:48
  • Darn, just missed the 5min editing limit - These text boxes are a pain when used to writing with vim, continuing on from the above ... Although your response has been useful to me in understanding why I can not achieve that which I wish to achieve, however; I am not currently using your solution. To my mind the issue at hand is not yet solved and is worthy of a little further explanation as to why; for the purpose of clarification before closing the thread.
    – iain
    Commented Apr 27, 2016 at 5:58
  • I am just wondering if there is not some tradition in book typesetting and binding that dictates that the first numbered page is always on the right hand side; my problem was caused by trying to start the numbering, with page one on the left; Mine is an article, with ordered subsections which take advantage graphically of the double spread, placing similar subjects together on opposing pages to make them easer to study; I think that TeX is my solution and that I need to learn more about the difference between TeX and LaTeX ...
    – iain
    Commented Apr 27, 2016 at 6:03
  • I think LaTeX is better solution because you have a lot of packages ready for use. In TeX you have to do everything by hand. I read the companion guide to the memoir package. ctan.org/tex-archive/info/memdesign?lang=en It gives a lot of information about typesetting practices.
    – Shosta
    Commented Apr 27, 2016 at 6:24
0

I have resolved my initial conundrum using a selection of the advice given in the comments and reply above; Perhaps this will help others to quickly resolve this leap in understanding that is quite necessary in avoiding teething problems when staring out with the LaTeX package.

As explained above the numbering system is inextricably linked to the double sided page printing layout; As such, this effects the placement of the left and right margins, if they are not of equal width and also the placement of margin notes when they are included. To resolve this issue there are various differing techniques, of which; The following has worked well for me.

First set the title page to \pagenumbering{gobble} and the page number to \setcounter{page}{0}; The prologue and contents section is then enumerated with roman numerals; Forced to finish upon an even numbered page, by way of the \cleardoublepage command. The actual content is numbered using indic numerals, by using the \pagenumbering{arabic} command; This gives the desired result. In essence; each segment must end upon an even number, before the page count is reset to one, if this is not done; The margins switch sides. In my screen capture example there is included an image, which achieves the same; Note that the \cleardoublepage command remains in the code but that it does not add a page when it is not required.

\documentclass[a4paper, twoside]{article}

\begin{document}
\pagenumbering{gobble}
\setcounter{page}{0}
\title{Jabberwocky}
    \author{Lewis Carroll}
    \date{1871}
\maketitle

\newpage
\pagenumbering{roman}
\tableofcontents
\setcounter{tocdepth}{1}
\cleardoublepage

\newpage
\pagenumbering{arabic}
\section{Twas brillig}
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.

\section{Beware the Jabberwock}
"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!"

\section{He took his vorpal sword}
He took his vorpal sword in hand:
Long time the manxome foe he sought --
So rested he by the Tumtum tree,
And stood awhile in thought.

\section{And, as in uffish}
And, as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
And burbled as it came!

\newpage
\section{One, two! One, two!}
One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.

\section{And, has thou slain}
"And, has thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!'
He chortled in his joy.

\section{Twas brillig}
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe. 

\end{document}

The finished result: (with image added)

enter image description here

If you require that the larger margin be placed upon the other side of each page; this can be achieved by omitting the \setcounter{page}{0} from the title page and including a \cleardoublepage, a dedication, or perhaps an image instead.

You must log in to answer this question.

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