2

I am currently writing a paper whose class settings are the following.

\documentclass[12pt, a4paper]{report}

Soon I will need to print it as a twoside document. When I add the twoside option the entire document is affected including the "cover page". If I am not mistaken the only easy way to make the document a two side one without affecting the cover page is by using the geometry package and then by adding \newgeometry{twoside} after the cover page. Unfortunately geometry package modify the margins of the document. I prefer the default ones for a4paper so I tried to change them by means of the following options.

\usepackage[a4paper, centering, total={5.4in, 8.18in}, twoside, bindingoffset=1cm]{geometry}

What are the precise dimensions of the margins for an a4paper, report document without geometry? I derived 5.4in, 8.18in approximately by trial and error but they are not correct.

EDIT

First picture no geometry package, a4paper. Second picture geometry package, a4paper.

No geometry Geometry

3
  • Welcome to TeX.SX! geometry package has the option pass use this as a first option while loading ... I think this is what you are looking for. This option tells geometry to not change the current geometry before use the rest of the options passed in the command (or the load of the package)
    – koleygr
    Commented Apr 2, 2021 at 1:11
  • 1
    Thank-you. I just tried pass option. Adding it in the preamble makes all the margins as the default ones which is great. Unfortunately adding twoside option doesn't work. If I add such option by means of newgeometry I get all the preamble options disabled and the margins are changed. I checked the package documentation pass option disable al geometry package with the exception of showframe and verbose
    – Nipper
    Commented Apr 2, 2021 at 10:52
  • if you don't want to change the layout you don't have to use geometry at all. If you are having an issue with laying out your title page, perhaps you should ask about that. Commented Apr 2, 2021 at 23:17

3 Answers 3

3

What are the precise dimensions of the margins for an a4paper, report document without geometry?

They are in columns two and three of the table for oneside and twoside. (the 62pt allocated to the margins are split in a different way). The code shows how to get this values.

w

But, more important, you also wanted to keep the original layout of the cover while changing the document to twoside. As you suggested it can be done with the package geometry, loaded with appropriate parameters for report oneside and then recover the twoside with \newgeometry.

Test to be done with the code provided:

(1) Use \documentclass[12pt,a4paper]{report} and comment both \usepackage[...]{geometry} and \newgeometry[...] (placed before \chapter).

You should get the values of the second column of the table (report oneside), both in "Geometry of the title page" and in "Geometry of the document".

(2) Now use \documentclass[12pt,a4paper, twoside]{report} keeping the two lines commented. You will get the values of the third column, report twoside, both for the cover and the rest of the document.

This is something undesirable because it changes the layout of the cover.

(3) Un-comment only \usepackage[...]{geometry}. You recover the values of oneside for everything. Fourth column of the table. One more step to go.

(4) Un-comment also \newgeometry[...] placed before \chapter. Now you will get the the values for report twoside in "Geometry of the document" (fifth column) while keeping the oneside values for "Geometry of the title page" (fourth column). The desired result.

This is the code

%\documentclass[12pt,a4paper]{report} % used to write the document 

\documentclass[12pt,a4paper,twoside]{report} % required to print the document

\usepackage[textwidth= 390.0pt,
textheight =592.0pt,
left= 103.27pt,  % 1in + 31pt
top= 92.27pt, % 1in + 20pt
marginparwidth= 85pt,
includemp,
includehead]{geometry} % reproduce report oneside layout

\title{Draft title of the report}
\author{Only one}

\begin{document}
    
\setlength{\parindent}{0pt} 

\textbf{\large Geometry of the title page}
\medskip

textwidth=  \the\textwidth

textheight= \the\textheight

oddsidemargin= \the\oddsidemargin

evensidemargin= \the\evensidemargin

topmargin= \the\topmargin

headheight= \the\headheight

headsep= \the\headsep

topskip= \the\topskip

footskip= \the\footskip

marginparwidth= \the\marginparwidth

marginparsep= \the\marginparsep
    
\maketitle

\newgeometry{twoside,  % recover report twoside layout
    textwidth= 390.0pt,
    textheight= 592.0pt,
    left= 82.27pt,  % 1in + 10pt
    top= 92.27pt, % 1in + 20pt
    marginparwidth= 85pt,
    includemp,
    includehead}    

\chapter{Measurements}

\textbf{\large Geometry of the document}
\medskip

\setlength{\parindent}{0pt} 

textwidth=  \the\textwidth
    
textheight= \the\textheight

oddsidemargin= \the\oddsidemargin

evensidemargin= \the\evensidemargin

topmargin= \the\topmargin

headheight= \the\headheight
 
headsep= \the\headsep

topskip= \the\topskip

footskip= \the\footskip

marginparwidth= \the\marginparwidth

marginparsep= \the\marginparsep

\bigskip
\begin{tabular}{lcccc}
    \hline
                   &   report 1s   &   report 2s   & geometry \& 2s & +newgeometry \& 2s \\
                   & cover + pages & cover + pages & cover + pages  &     only pages     \\ \hline
    textwidth      &    390.0pt    &    390.0pt    &    390.0pt     &      390.0pt       \\
    textheight     &    592.0pt    &    592.0pt    &    592.0pt     &      592.0pt       \\
    oddsidemargin  &    31.0pt     &    10.0pt     &     31.0pt     &       10.0pt       \\
    evensidemargin &    31.0pt     &    52.0pt     &    31.97pt     &      52.97pt       \\
    topmargin      &    20.0pt     &    20.0pt     &     20.0pt     &       20.0pt       \\
    headheight     &    12.0pt     &    12.0pt     &     12.0pt     &       12.0pt       \\
    headsep        &    25.0pt     &    25.0pt     &     25.0pt     &       25.0pt       \\
    topskip        &    12.0pt     &    12.0pt     &     12.0pt     &       12.0pt       \\
    footskip       &    30.0pt     &    30.0pt     &     30.0pt     &       30.0pt       \\
    marginparwidth &    85.0pt     &    85.0pt     &     85.0pt     &       85.0pt       \\
    marginparsep   &    10.0pt     &    10.0pt     &     10.0pt     &       10.0pt       \\ \hline
\end{tabular}
    
\end{document}
2

I have answered this before somewhere but I couldn't find the duplicate so ...

The two options are doing very different things.

Classically TeX has no concept of paper size or margin, it just sets the size of the text block and the margins are the difference between that and whatever size paper you print on.

There is a nominal offset of 1in from the top left corner but that was typically adjusted in the dvi driver rather than in TeX, and there are no TeX primitives corresponding to the right margin at all.

Most dvi drivers (and tex variants with a built in back end such as pdftex and luatex) have a way of specifying the media size that can be used to set the page dimensions in PDF.

At the time LaTeX2e was designed pdflatex was very new and almost all tex use was via classic dvi tex with a multitude of dvi drivers so by default latex makes no assumptions about the back end in use.

So a4paper option in the standard classes sets a text block suitable for A4, and sets the latex \paperwidth and \paperheight dimension registers to the size of A4. But it does not set any dvi driver \special nor the pdflatex primitives \pdfpagewidth and \pdfpageheight to actually force the PDF to be A4. The PDF page dimension will be set typically by an installation default when you installed texlive, which might be US Letter size.

Packages such as geometry, graphicx, hyperref which do determine the back end system in use all normalize the settings so that \pdfpagewidth, \pdfpageheight or equivalent specials or luatex primitives are set based on the values of \paperwidth and \paperheight, thus forcing the dimension of the PDF page to match the latex specified paper size. So even if you use no options at all, the margins, espically the implicit right and bottom margins, may change.

4
  • Thank-you for the detailed explanation. Still I do not understand how to set the margins to be approximately equal to the default ones I get when setting a4paper and be able to apply twoside option.
    – Nipper
    Commented Apr 2, 2021 at 23:00
  • @Nipper as I tried to say, you haven't given enough information about what margins you expect, as they depend on your physical paper size, that you haven't stated, nor is it clear what margins you want with twoside: changing the margins to be assymetric is the main effect of twoside so you would not expect them to be the same as oneside. you asked about a4 dimensions in inches which is obviously possible but more natural to use metric units Commented Apr 2, 2021 at 23:11
  • Sorry maybe I wasn't clear enough. I do not need the page dimensions (paperwidth or paperheight) associated to the a4paper option. I need the the dimensions of the left and right, top and bottom margins associated to a4paper when geometry is not used. When geometry is used the left and right margins are thinner. Moreover, the top margin appears to be smaller than the bottom one resulting in the the whole text to be moved upward.
    – Nipper
    Commented Apr 2, 2021 at 23:43
  • @Nipper tex has no right or bottom margin, that is just the white space left over when you place the text block offset by the left margin on the physical page. geometry lets you specify left and right but that is just syntax sugar so it does the calculations for you. If you over specify and specify total page size and the width of the text block and the left and right margins it has to ignore some of the values. So the "right margin" depends on the physical size of the paper or (by default) your side default pdf page size or (once you specify geometry or graphicx) the width of \pdfpagewidth Commented Apr 3, 2021 at 7:30
1

You can use the layouts package to report the current page layout values (and also see what happens if you change them). You can use the changepage package's adjustwidth environment to temporarily alter the current left and right margins. Here is an example.

% marginsprob.tex  SE 591067
\documentclass[12pt, a4paper]{report}
\usepackage{layouts}
\usepackage{changepage}
\usepackage{lipsum}

\begin{document}

% The current page layout lengths
\begin{figure}
\currentpage
\pagedesign
\caption{This page layout values}
\end{figure}

% The general page layout length commands
\begin{figure}
\pagediagram
\caption{Page layout parameters}
\end{figure}
\clearpage

\lipsum[1]

\begin{adjustwidth}{-1cm}{1cm}
 \textbf{Adjusted} \lipsum[2]
\end{adjustwidth}

\lipsum[3]

\end{document}

enter image description here

I suggest you use layouts to find what the dimensions of a4paper and a4paper,twoside are. Then use \documentclass[12pt,a4paper,twoside]{report} but use adjustwidth environment for the first title page followed by a move to the remainder of the document.

1
  • Thank-you all for the answers. Now it is clear that "margins" are indirectly derived by defining the body area dimensions namely \textwidth and \textheight. I did not know the layout package before. Now I managed to set everything properly.
    – Nipper
    Commented Apr 6, 2021 at 22:55

You must log in to answer this question.

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