# Papersize in latex [closed]

I am using Windows 8, Texmaker 4.5 and Miktex 2.9.

When compiling Latex, Dvi2ps and ps2pdf, I have a problem of papersize. My miktex option is A4 Paper. When compiling, the dvi and ps files are a4, but the pdf is letter. I use the option ps2pdf -sPAPERSIZE#a4 %.ps %.pdf which does not change anything.

When compiling pdflatex I do have a4 paper.

Could you help me get a A4 paper when using ps2pdf ?

Thank you

• Confused by this... Are you setting paper size in your LaTeX code? for example, the package geometry can do that. – Ryan Dec 20 '16 at 18:55
• You should use -sPAPERSIZE=a4. – Werner Dec 20 '16 at 19:03
• @Werner: not for a Windows user – user2478 Dec 20 '16 at 19:06
• I am using the package geometry, and setting the paper size in obvious places : \documentclass[a4paper,10pt]{article} – MJii Dec 20 '16 at 19:23
• I'm voting to close this question as off-topic because because it is solved by comments. – Zarko Feb 20 '17 at 19:23

\documentclass{article}
\usepackage[dvips,a4paper]{geometry}
\begin{document}
foo
\end{document}


has a4 in the pdf:

voss@shania:~\$ pdfinfo zz.pdf
Title:          zz.dvi
Producer:       GPL Ghostscript 9.18
CreationDate:   Tue Dec 20 20:02:50 2016
ModDate:        Tue Dec 20 20:02:50 2016
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          1
Encrypted:      no
Page size:      595 x 842 pts (A4)
Page rot:       0
File size:      3846 bytes
Optimized:      no

dvips -t unknown filename.dvi

• try dvips -t unknown filename.dvi and then ps2pdf filename.ps – user2478 Dec 20 '16 at 19:39
• Look at the .ps file, line 9 or so. You should have DocumentPaperSizes: a4. B.t.w., you should update MiKTeX: present version of MiKTeX GPL Ghostscript is 9.19. – Bernard Dec 20 '16 at 19:47