The numbered distances are 20 mm using eso-pic, regardless if I say "40 mm"

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}

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

Tags:

Eso Pic