# Trouble with latex and dvips with an FSTTCS documentclass

Following from my other question Which DVI viewer on linux?, now that I can easily view DVI files I came to the conclusion that the unusual document class I used for my document defines some non-standard margins and/or page size. This clashes with my compilation chain latex --> dvips --> ps2pdf (I'm using PSTricks): the dvi file looks formatted fine, but dvips isn't able to get the page size right and the margins look shifted.

The class file I'm using is located here (in the submission format section of the FSTTCS conference page there is also a zip file with a readme and examples). You can see my problem by compiling this minimal example:

\documentclass{fsttcs}
\begin{document}
\title{My document}
\runningtitle{My document}
\runningauthors{A, B, C}
\author{A, B, C}
\affiliation{XYZ}
\section{Sect. 1}
This is the section 1 of the test file.
This is the section 1 of the test file.
This is the section 1 of the test file.
\newpage
\section{Sect. 2}
This is the section 2 of the test file.
This is the section 2 of the test file.
This is the section 2 of the test file.
\newpage
\section{Sect. 3}
This is the section 3 of the test file.
This is the section 3 of the test file.
This is the section 3 of the test file.
\end{document}


With a simple pdflatex test.tex everything looks ok, but when I run latex test.tex && dvips test.dvi && ps2pdf test.ps, the page slightly changes its proportions and the page contents are shifted. I tried passing specifying all formats supported by dvips (letter, legal, ledger, a4, a3) with the dvips -t <size>, but none of them works correctly.

I'm sure pdflatex gives the correct output because it is the same as the precompiled pdf included in the example zip file, but I can't use it because of PSTricks and I'm unable to specify the correct format to dvips. What should I do, please?

-
It's quite obscure why the class sets letterpaper but then calls crop with the a4 option. However, you get identical results by adding the option a4paper or letterpaper to \documentclass. The provided example uses ISO A4 paper. –  egreg May 7 '12 at 8:45
@egreg: hi, thanks for passing by. I think it may have something to do with the page numbers: the body with the contents is always centered, but the page numbers appears to its right and its left side (see my example compiled wit pdflatex). Unfortunately both the options you suggest lead to results different from the correct one. –  Riccardo May 7 '12 at 8:53
it is possible to use pdflatex when using PSTricks- see these questions http://tex.stackexchange.com/search?q=pdflatex+pstricks for details –  cmhughes May 7 '12 at 8:58
dvi2pdf directly works OK for me. –  Harish Kumar May 7 '12 at 9:59

I get the same result as the examples provided by stating explicitly that we want A4 paper:

\documentclass{fsttcs}
\usepackage{ifpdf}
\ifpdf\else
\AtBeginDvi{\special{papersize=21cm,29.7cm}}
\fi
\begin{document}


However the class is badly written, as it uses geometry but sets \paperwidth and \paperheight in incompatible ways. It's not clear what page dimensions they would like: the class issues letterpaper, but then also uses the a4 option to crop and defines even different sizes afterwards.

-
That's great, it works like a charm... thanks a lot! –  Riccardo May 7 '12 at 9:18