I would like to calculate the the ratio between two lengths in order to automatically get the scale for a map included using the mercatormap package. For instance, I want the map to show 1km in the horizontal direction and be \textwidth
wide, this means that the scale argument I have to provide would be something like 100000cm / \textwidth
.
I found this solution:
\documentclass{minimal}
\usepackage{graphicx}
\begin{document}
\makeatletter
\Gscale@div\tmp {100cm}{\textwidth}
{\textbackslash}textwidth = \the\textwidth
100cm / {\textbackslash}textwidth = \tmp
\Gscale@div\tmp {100000cm}{\textwidth} % Causes: ! Dimension too large. <to be read again> [...]
% I can't work with sizes bigger than about 19 feet.
100000cm / {\textbackslash}textwidth = \tmp
\end{document}
which apparently does not work for large dimensions. Given that 1pt
is about 28.4cm
the first ratio is calculated correctly, the second one on the other hand raises the error on the comment above. Got the same error using \pgfmathparse
as well.
Is there a way to get around this "about 19 feet" limitation?