Basically ps2pdf -dEPSCrop
doesn't crop to the full extent specified and stops at some mysterious point. I'm trying to trim the white space on the left of the image but -dEPSCrop
stops short irrespective of the value I give to the lower left bounding box coordinate of the pspicture environment variable.
Please find a not-so-MWE at: http://pastebin.com/MYAJtLUu
Here's the file stripped of all but the \uput
's:
\documentclass[english,landscape,a4paper]{slides}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{babel}
\usepackage{pst-eps}
\usepackage{pstricks}
\usepackage{multido}
\usepackage{pst-node}
\usepackage{pst-math}
\usepackage{pstricks-add}
\begin{document}
\begin{TeXtoEPS}
\begin{pspicture}(2,-2.966)(12.064,0)
\psset{linejoin=1}
\newcommand{\verysmall}{\fontsize{9}{9pt}\selectfont}
\verysmall
\uput{0.2mm}[180](2.349,-1.66){$s$}
\uput{1mm}[225](2.522,-2.043){$c$}
\uput{1mm}[-110](4.067,-.9){$b$}
\uput{0.25mm}[-45](8.405,-2.671){$a$}
\uput{0mm}[0](11.808,-1.66){$t$}
\uput{1mm}[100](4.799,-1.199){$d$}
\uput{0.5mm}[90](8.653,-2.597){$e$}
\end{pspicture}
\end{TeXtoEPS}
\end{document}
I'm trying to create cropped PDF images from pstricks graphics. My workflow is as follows:
latex NoSoMWE.tex
dvips -E NoSoMWE.dvi
ps2pdf -dEPSCrop NoSoMWE.ps NoSoMWE.pdf
Lately however, ps2pdf -dEPSCrop
no longer works when the pstricks file makes use of the \uput
directive. Cropping however works when all \uput
's are removed from the not-so-MWE. Cropping does not work if at most one \uput
directive is used.
Please advise, thanks.
Best Answer
If your objective is
then the remaining paragraphs might be useful for you.
In this answer, I assume you are a Windows user. If it is not the case, you have to adapt the given MS-DOS batch files (also known as make file in other OS).
I will use the following image in this answer, name it
hen.jpg
.I will divide into 2 cases based on whether or not an input file, that is used to produce a standalone PDF output, imports images. If you don't import images in the input file, that is used to produce a standalone PDF output, then the division is not important but you should choose the faster one!
Case 1
This compilation is much much faster than the compilation that will be discussed in Case 2. However, you cannot use this work flow if your input file imports any image of type PDF, PNG and/or JPG. If you only import EPS images or you don't import any image, you should choose this work flow because the compilation is much much much faster!
Create a batch file, name it
DevLa.bat
, to compile an input file that is used to produce a standalone PDF output.For simplicity, you can save it in the same directory in which the input file exists. If you want to reuse this batch for other project, then you need to setup PATH environment variable.
The following MWE
withoutimage.tex
(which does not import images) can be compiled withDevLa.bat
by invoking
And you will get a tight PDF output as follows.
Case 2
This compilation is much much slower than the compilation discussed in Case 1. However, you can use this work flow if your input file imports any image of type PDF, PNG, JPG and/or EPS. If you only import EPS images or you don't import any image, you should choose the work flow in Case 1 because its compilation is much much much faster!
Create a batch file, name it
DevXe.bat
, to compile an input file that is used to produce a standalone PDF output.For simplicity, you can save it in the same directory in which the input file exists. If you want to reuse this batch for other project, then you need to setup PATH environment variable.
The following MWE
withimage.tex
(which does import a JPG image) can be compiled withDevXe.bat
And you will get a tight PDF output as follows.
Importing the stadalone PDF outputs
After getting the standalone PDF outputs, you can import them from within your main input file as follows.
And it can be compiled using either
xelatex
orpdflatex
.And the result is as follows.