6

Using the very simple example:

\documentclass[a0paper,landscape,final]{a0poster}
\usepackage[texcoord,grid,gridunit=mm,gridcolor=gray!40,subgridcolor=green!40]{eso-pic}
\begin{document}
.
\end{document}

I want a numbered step size in the grid of 40 mm, but I get one of 20 mm.

Figure illustrating the numbered grid step size I get

What is it that I am doing wrong?


Update:

When adding

\gridSetup
  [mm]  % gridunit name
  {1mm} % gridunit
  {1}   % gridlabel factor
  {10}  % grid delta
  {40}  % grid Delta
  {1}   % gap

to the example code above,

I get two interesting phenomena:

(1) The "green" steps change to 10 mm in the horisontal direction, but not in the vertical.

Figure illustrating what describes as "Phenomena (1)"

(2) At the middle of the document, the vertical lines have run out since they are too densly spaced.

Figure illustrating what describes as "Phenomena (2)"

  • 1
    You've changed the colours, but you've not changed the dimensions. What did you expect? – cfr Jul 25 '18 at 0:23
  • I thought dimensions was the "!40" part. I could not find information in manuals, so I used examples online. – Lars Abrahamsson Jul 25 '18 at 9:37
  • 2
    You mean in gridcolor=gray!40,subgridcolor=green!40? Note that the key names are gridcolor and subgridcolor, as the names indicate they are for setting the colour of the grid. The ! syntax is from xcolor, and is for colour mixing. In general you can do <colour1>!<percentage>!<colur2> to mix two colours. If just one colour is specified, as in gray!40, white is used as the second colour. Hence, gray!40 mixes 40% gray and 60% white. More complicated expressions are also possible, if of interest see section 2.3.2 in the xcolor manual. – Torbjørn T. Jul 25 '18 at 11:20
3

Werners answer is correct. But there seems to be a bug in eso-pic. Some code necessary to set up the grid properly is only executed once while loading the package. It should probably be in \AtBeginDocument. I added it here to make \gridSetup work as expected.

\documentclass[a4paper,landscape,final]{article}
\usepackage[texcoord,grid,gridunit=mm,gridcolor=gray!40,subgridcolor=green!40]{eso-pic}
\gridSetup[mm]{1mm}{1}{5}{40}{1}

\makeatletter
\AtBeginDocument{%
  % code from eso-pic, executed during load, but needed to properly
  % setting up the grid
  \ifESO@texcoord
    \def\ESO@yoffsetI{\z@}\def\ESO@yoffsetII{-\paperheight}%
    \edef\ESO@griddeltaY{-\ESO@griddelta}\edef\ESO@gridDeltaY{-\ESO@gridDelta}%
  \else
    \def\ESO@yoffsetI{-\paperheight}\def\ESO@yoffsetII{\z@}%
    \edef\ESO@griddeltaY{\ESO@griddelta}\edef\ESO@gridDeltaY{\ESO@gridDelta}%
  \fi
}
\makeatother

\begin{document}
.
\end{document}

enter image description here

  • Great! Cool! I've learnt a lot from you all! – Lars Abrahamsson Jul 27 '18 at 11:56
5

When you choose mm as the gridunit, it has a default setup:

\gridSetup
  [mm]  % gridunit name
  {1mm} % gridunit
  {1}   % gridlabel factor
  {5}   % grid delta
  {20}  % grid Delta
  {1}   % gap

Here 20 (or the grid Delta) sets the jump between major grid lines. You can change this to suit your needs:

enter image description here

\documentclass{article}

\usepackage[texcoord,grid,gridunit=mm,gridcolor=gray!40,subgridcolor=green!40]{eso-pic}
\gridSetup
  [mm]  % gridunit name
  {1mm} % gridunit
  {1}   % gridlabel factor
  {5}   % grid delta
  {40}  % grid Delta
  {1}   % gap

\begin{document}  

.

\end{document}
  • Cool. Two follow-up questions: (1) Why is the screen shot you provided scaled differently in the horisontal and vertical axes? (2) What does the "{5}" mean here? The green steps in horisontal direction are 5 mm and in the vertical direction they are 10 mm. – Lars Abrahamsson Jul 25 '18 at 10:44
  • I updated the original questions with what happens using the "\gridSetup". Partly related to my follow-up question actually. – Lars Abrahamsson Jul 25 '18 at 10:56
  • @LarsAbrahamsson: You can vary the combinations of gridlabelfactor and gridDelta. For example, try 2 and 20. – Werner Jul 25 '18 at 15:27
  • Werner: Thanks. The gridlabelfactor is simply a scaling, makes the document seems a different size than it actually is. – Lars Abrahamsson Jul 25 '18 at 15:33
  • Werner: grid delta is the increments without numbers (green in the example). grid Delta on the other hand is the increments with numbers (gray in the example). – Lars Abrahamsson Jul 25 '18 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.