# How to eliminate over-specification in h and v warning in Geometry package?

I use a memoir class template as the basis for my own thesis. It includes the geometry package. This produces a warning but do not appear to impact on the compiling of a pdf. I use pdfLaTeX.

Here is a MWE

\documentclass[11pt, a4paper, oneside, oldfontcommands]{memoir}
\usepackage[a4paper]{geometry}
% PDF VIEW
\geometry{total={210mm,297mm}, left=25mm,right=25mm, bindingoffset=0mm, top=25mm,bottom=25mm}
% PRINT
%\geometry{total={210mm,297mm},left=20mm,right=20mm,
%bindingoffset=10mm, top=25mm,bottom=25mm}

\begin{document}
hello there
\end{document}


The errors I get are;

Package geometry Warning: Over-specification in h'-direction.width' (597.50787pt) is ignored. Package geometry Warning: Over-specification in v'-direction.height' (845.04684pt) is ignored.

I read some of the package documentation but can't seem to see what is going on here.

Can someone tell me what this warning is about and how to eliminate it if possible.

Edit 1: I see from some of the answers that there is some debate as if geometry package is needed at all. I am using a template that is not from my Department(just one I found on the web) as I am in the Humanities and no-one in the department uses LaTeX. I am editing it to meet my university’s style-guide, so it is not essential for me to use the package if not needed. In relation to the margins this is what my university guidelines say;

text must be left justified with a left-hand margin of 4 cm and may be right justified. An easily-readable layout and double-sided printing are recommended for the body text.

A4 Paper size is required and although my MWE didn't have it (my bad) double sided printing is recommended (as above).

• memoir has its very own mechanism of setting the type area. You should use it. – Johannes_B Nov 7 '14 at 20:08
• You are giving the option a4paper (globally and to geometry) and later adding this information once again using absolute values. Once should be anough. – Johannes_B Nov 7 '14 at 20:08

You're probably misunderstanding what total= is for: it specifies the width and height of the text block, not the paper size. The paper size is already specified by the global option a4paper (you don't need to pass it to geometry if it's already in the \documentclass options).

Thus you have specified a text width of 210mm, but also left and right margins of 25mm, which are contradictory with the stated paper size (210mm). The last options specified win, so you get a text width of 210 – 50 = 160 millimeters. The same for the height.

A nonstandard paper size can be specified with papersize={<width>,<height>} or with separate paperwidth=<width> and paperheight=<height> options. But a4paper is enough in your case.

When the paper size is known (and it should better be), just specifying the margins is enough:

\usepackage{geometry}
\geometry{
a4paper,% redundant if already in \documentclass
left=25mm,
right=25mm,
top=25mm,
bottom=25mm,
heightrounded,% better use it
}


The last option ensures the height is adjusted so that an integer number of lines are accommodated in the text block.

Note, however, that memoir has its own methods for setting the page parameters.

Since you are using memoir you should use its facilities to layout your page. I am not very familiar with this class but the documentation seems extremely helpful so I'd suggest looking through it. A rather selective reading suggests the following:

\documentclass[11pt, a4paper, oneside, oldfontcommands]{memoir}
\setlrmarginsandblock{25mm}{25mm}{*}
\setulmarginsandblock{25mm}{25mm}{*}
\checkandfixthelayout
\usepackage{kantlipsum}
\begin{document}
\kant[1-5]
\end{document}


Of course, these margins are not terribly attractive but I'm guessing that you are required to use them.

• I accepted @egreg answer because I think it answers the question as asked orginally, but would like to say that I'll probably use your solution. Thanks and +1. – gman Nov 9 '14 at 15:58
• @gman That might be so. I added this partly as a supplement, as much as anything else. Thanks for letting me know it was helpful. – cfr Nov 9 '14 at 16:22

This is due because geometry calculates on his own the missing dimensions for your document. It complains when you specify too many parameters, thus resulting in an
Over-specification warning.

This code should work fine:

\documentclass[11pt,oneside,oldfontcommands]{memoir}
\usepackage[a4paper,left=25mm,top=25mm,textwidth=160mm,textheight=249.7mm]{geometry}

\begin{document}
hello there
\end{document}


As shown in the example, I prefer this syntax rather than using \geometry because of its compactness, but either formula should generate the same result.

• What is the point of specifying the width and height of the text block? Why not let geometry calculate it? In any case, you ought not use the package with memoir at all. – cfr Nov 7 '14 at 21:37
• @cfr the page is divided both horizontally and vertically in 3 spaces. For instance horizontally you have "left" margin, "right" margin and "textwidth"; given two of them, the third results by subtracting the known dimensions from "paperwidth". – RicoRally Nov 7 '14 at 21:42
• It just seems easier to specify the margins and calculate the dimensions of the text block to me. But, each to their own. More importantly, geometry should not be used here anyway. – cfr Nov 7 '14 at 21:46
• having fixed textwidth comes useful when manually setting twoside documents. – RicoRally Nov 7 '14 at 21:50
• But this is one-sided. Anyway, as I say, that's a matter of preference. But geometry shouldn't be used here. That's not. – cfr Nov 7 '14 at 22:00