1

I need to draw a big diagram in PStricks, using XeLaTeX. To be readable, I want to draw it on a large page, which dimensions I manually set. Here's a MWE :

\documentclass[11pt]{article}
\usepackage{pst-all}

% set page dimensions
\paperwidth  = 30cm
\paperheight = 30cm
% use geometry pass option to pass dimensions to output driver (XeLaTeX)
\usepackage[pass]{geometry}

\begin{document}

% pstricks figure
\psset{unit = 1cm}
\begin{pspicture}(25,1)
   \psline(0,0)(25,0)
\end{pspicture}

\end{document}

This draws a horizontal line, but it is definitely not 25cm. It is somehow blocked by a standard A4 margin. I tried setting negative margins in geometry, without success.

Thanks!!

2 Answers 2

1

It doesn't seem to work with xelatex, for some reason. However, compiling with pdflatex and loading auto-pst-pdf, this code works fine:

\documentclass[x11names, 11pt, border=5pt]{standalone}
\usepackage{pst-all}
\usepackage{auto-pst-pdf} %
\usepackage[paperwidth=30cm, paperheight=30cm, margin = 25mm, nomarginpar,  showframe]{geometry}

\begin{document}

% pstricks figure
\psset{unit = 1cm, linecolor=Tomato3, linewidth=1.5pt}
\noindent\begin{pspicture}(0,-1)(25,1)
   \psline(0,0)(25,0)
\end{pspicture}

\end{document} 

enter image description here

1

No problem with xelatex. However, you should set page margins vis package geometry:

\documentclass[11pt]{article}
\usepackage{pstricks}
\usepackage[paperwidth=30cm,paperheight=30cm,margin=0cm]{geometry}
\begin{document}
    \noindent
    \psline[arrowscale=5]{<->}(0,\dimexpr\baselineskip-1pt)(30cm,\dimexpr-30cm+\baselineskip)

\newpage\noindent
\begin{pspicture}(30,30)
\psline[arrowscale=5]{<->}(30cm,30cm)
\end{pspicture} 
\end{document}

enter image description here

You must log in to answer this question.

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