Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have an input file as follows.

% Test.tex
\documentclass{article}
\usepackage{pstricks}
\psset
{
 linewidth=0.01
}

\newcommand\All{0.1}
\newcommand\Left{-\All}
\newcommand\Right{\All}
\newcommand\Bottom{-\All}
\newcommand\Top{\All}

\newlength\AllPadding\setlength{\AllPadding}{0mm}
\newlength\LeftPadding\setlength{\LeftPadding}{\AllPadding}
\newlength\RightPadding\setlength{\RightPadding}{\AllPadding}
\newlength\BottomPadding\setlength{\BottomPadding}{\AllPadding}
\newlength\TopPadding\setlength{\TopPadding}{\AllPadding}


\topmargin=\dimexpr\TopPadding-72.27pt\relax
\oddsidemargin=\dimexpr\LeftPadding-72.27pt\relax
\paperwidth=\dimexpr\Right\psxunit-\Left\psxunit+\RightPadding+\LeftPadding\relax
\paperheight=\dimexpr\Top\psyunit-\Bottom\psyunit+\TopPadding+\BottomPadding\relax

\special{papersize=\the\paperwidth,\the\paperheight}


\headheight=0pt
\headsep=0pt
\parindent=0pt
\topskip=0pt
\pagestyle{empty}

\pagecolor{yellow}
\begin{document}
\pspicture(\Left,\Bottom)(\Right,\Top)
\psframe(\Left,\Bottom)(\Right,\Top)
\endpspicture
\end{document}

It is compiled with the following batch file.

rem Automate.bat takes an input file name without extension.
latex %1
dvips %1
gswin32c -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%1.pdf %1.ps
pdftops -eps %1.pdf

I got a result as follows.

enter image description here

Notice that there are excessive strips outside the black frame due to rounding errors in calculating paper size. Depending on the given settings, the excessive strips may appear on the left, right, top, and bottom. Even though the excessive strips will not be noticeable by naked eyes, I want to remove them as far as there is a way to do so.

How to express my length calculation to get rid of the excessive strips?

share|improve this question
1  
run it with xelatex and everything will be fine. –  Herbert Jul 26 '11 at 20:39
    
+1 but XeLaTeX renders very slowly. I cannot use it for animating PSTricks diagrams. It takes too much time, even though for a simple series of object changes. –  xport Jul 27 '11 at 0:05

1 Answer 1

up vote 1 down vote accepted

dvips -D10000 %1 and gswin32c ... -r10000 ... will use more precision in your conversions. There will still be rounding error.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.