1

i have just bought the new macbook air M2. I've tried to compile a file i had before and i had the message "!Dimension too large error". I don't understand why it doesn't work anymore. here is the code :

\documentclass[10pt,a4paper,french]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{fourier}
\usepackage{xspace}
\usepackage[scaled=0.875]{helvet}
\renewcommand{\ttdefault}{lmtt}
\usepackage{amsmath,amssymb,amstext,makeidx}
\usepackage{fancybox}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\usepackage{pifont}
\usepackage[euler]{textgreek}
\usepackage{textcomp,enumitem}
\usepackage[table,dvips]{xcolor}
\usepackage{graphicx}
\usepackage{pst-plot,pst-tree,pst-func,pstricks-add}

\usepackage[left=3.5cm, right=3.5cm, top=1.9cm, bottom=2.4cm]{geometry}

\begin{document}

\psset{xunit=1cm,yunit=0.0005cm} \begin{pspicture}(-1,-1000)(10.5,24000) \multido{\n=0.0000+0.3333}{32}{\pslinelinestyle=dashed,linewidth=0.2pt(\n,23000)} \multido{\n=0+1000}{24}{\pslinelinestyle=dashed,linewidth=0.2pt(10.5,\n)} \psaxes[linewidth=1.25pt,Dy=2000]{->}(0,0)(0,0)(10.5,23000) \uputr{Nombre de mégots}\uputd{Rang de l'année} \uputd{$x$} \uputl{$y$} \psdotsdotstyle=+,linecolor=red,dotscale=2(1,17384)(2,14817)(3,12569)(4,10721)(5,9142)(6,8458)(7,7673)(8,6691) \end{pspicture} \end{center} \end{document}

Thanks for your help

user187802
  • 16,850
  • 1
    I get the error on TeXlive 2021 on Linux as well, so the problem is not specific to M2 macs. (To be more specific, I get that error with latex and xelatex, and a different error with pdflatex or lualatex; what are you using?) – frabjous Sep 30 '22 at 23:08
  • 1
    i'm using LaTex dvips ps2pdf – sebastien hanot Oct 01 '22 at 16:26

2 Answers2

1

The error originated from the y-axis scaling. In this example, the scale was changed by 1000 factor and a matching label was added.

z

Using lualatex and PSTricks v3.13 <2022/01/09>. Also works with xelatex.

\documentclass{article}

\usepackage{pst-plot}

\begin{document}

\psset{xunit=1cm,yunit=0.0005cm} \begin{pspicture}(-1,-1000)(10.5,24000) \multido{\n=0.0000+0.3333}{32}{\pslinelinestyle=dashed,linewidth=0.2pt(\n,23000)} \multido{\n=0+1000}{24}{\pslinelinestyle=dashed,linewidth=0.2pt(10.5,\n)} \psaxes[linewidth=1.25pt, Dy=2, dy=1cm, ylabelFactor=\cdot10^3]{->}(0,0)(10.5,23500)% changed <<<<<<<<<<<<<< \uputr{Nombre de mégots} \uputd{Rang de l'année} \uputd{$x$} \uputl{$y$} \psdotsdotstyle=+,linecolor=red,dotscale=2(1,17384)(2,14817)(3,12569)(4,10721)(5,9142)(6,8458)(7,7673)(8,6691) \end{pspicture}

\end{document}

On my system the error that appeared when using Dy=2000 and the upper y-limit was more than around 18500.

! Dimension too large.

(I can't work with sizes larger than about 19ft.)

See ! Dimension too large

Now a secondary effect appeared: the y-ticks suffered a progressive displacement. So it's probably a bug. Or as the manual warns,

multido.tex increments the labels using rudimentary fixed points arithmetic....

but why will the ticks be affected?

Simon Dispa
  • 39,141
0

Divide all y values by 1000 and then use yLabelFactor:

\documentclass{article}
\usepackage{pst-plot}
\begin{document}

\psset{yunit=0.5cm} \begin{pspicture}(-1,-1)(10.5,24) \multido{\r=0.0000+0.3333}{32}{\pslinelinestyle=dashed,linewidth=0.2pt(\r,23)} \multido{\n=0+1}{24}{\pslinelinestyle=dashed,linewidth=0.2pt(10.5,\n)} \psaxes[linewidth=1.25pt,Dy=2,ylabelFactor=\cdot10^3]{->}(0,0)(0,0)(10.5,23) \uputr{Nombre de mégots}\uputd{Rang de l'année} \uputd{$x$} \uputl{$y$} \psdots[dotstyle=+,linecolor=red,linewidth=2pt,dotscale=2]% (0,20)(1,17.384)(2,14.817)(3,12.569)(4,10.721)(5,9.142)(6,8.458)(7,7.673)(8,6.691) \end{pspicture}

\end{document}

enter image description here

user187802
  • 16,850