2

I'm creating custom graph paper, and my code is

\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{tikz}
\usepackage{background}
\usetikzlibrary{positioning}
\usepackage{geometry}

\geometry{
    a4paper,
    total={170mm,257mm},
    left=10mm,
    right=10mm,
    top=10mm,
}

\SetBgContents%
{   \begin{tikzpicture}[remember picture, overlay]
    \draw [line width=0.3pt,color=gray,step=0.5cm] (current page.south 
    west) grid (current page.north east);
    \end{tikzpicture}
}
\SetBgScale{1}
\SetBgAngle{0}

\thispagestyle{empty}

\begin{document}

\begin{flushright}
\begin{tikzpicture}
\node[draw, double, rounded corners, scale=2, text height=25pt, 
anchor=north west, align=center] (15,0) {Name: 
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ \\ Date: \_\_\_\_\_\_\_\_\_\_\_};
\end{tikzpicture}
\end{flushright}

\end{document}

Which works, except it gives two errors:

Package geometry Warning: Over-specification in h'-direction.width' (483.69684pt) is ignored.

and

Package geometry Warning: Over-specification in v'-direction.height' (731.23582pt) is ignored.

I'm not really sure what is causing this, or how to fix it. Could someone explain?

I looked at this question, but I didn't really understand the explanation given.

1 Answer 1

2

There are several problems:

You call a first time geometry with option margin=25mm, then load it again and specify left=10mm, right=10mm, top=10mm. This contradicts the previous option, since margin=25mm means

left=25mm, right=25mm, top=25mm, bottom=25mm.

Furthermore, you specify height and width. But width is what remains from paper width after you've substracted left + right. Actually, you have no choice, and this specification will be ignored.

2
  • I think so. total= is the same as body+ optionally margins if I remember well?
    – Bernard
    Aug 13, 2016 at 0:11
  • okay. I also deleted the [margin=25mm] specification, as it was not necessary. It now works perfectly.
    – auden
    Aug 13, 2016 at 0:12

You must log in to answer this question.

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