I am trying to create a rectangle which covers the whole page using pstricks and XeLaTex; for example



This produces a cut-off rectangle with a4 width not landscape a0. If I change the document class option from landscape to portrait, it produces the rectangle correctly. However, in landscape mode it is missing the right side due to the image being cut-off at a4 width.

Doing a bit of a google, I found that the paper size needs to be set in the Ghostscript configuration file. So I used the command

kpsewhich -progname=dvipdfmx -format='other text files' dvipdfmx.cfg

to find the config file. Following advice online, I found the particular line:

D  "gs -q -dNOPAUSE -dBATCH -dEPSCrop -sPAPERSIZE=a0 -sDEVICE=pdfwrite  ..."

which shows that the paper size is being set to a0. Within the config file, there are some comments from the developers:

In 2014, we discovered that -sPAPERSIZE=a0 was needed to support pstricks under xetex; otherwise, images were cropped (see thread at http://tug.org/pipermail/xetex/2014-November/025664.html). Happily, it seems that using both -dEPSCROP and -sPAPERSIZE=a0 simultaneously works ok. So that's we do below.

However, in my case, the -sPAPERSIZE=a0 is not working. I tried editing the config file, changing from gs to rungs and this removed the rectangle entirely (there was also a comment from the developers in the config file, stating rungs is used as a wrapper). I also changed -sPAPERSIZE=a0 to -sDEFAULTPAPERSIZE=a0, which did nothing.

Any help is greatly appreciated as I am totally baffled.

For reference, I am running Ubuntu 18.04 and Texlive 2017.

Edit: I just found a line in the config file, which includes a different config file called: dvipdfmx-paper.cfg. Inside that file is a single line

p a4

Oooh I thought!! However, changing this line to p a0 did nothing.

1 Answer 1



\documentclass{a0poster}% has the same options as default


These values are written into the file a0header.ps which is later read by xdvipdfmx. But it has the wrong order for paperwidth/height.

You must log in to answer this question.

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