tag:blogger.com,1999:blog-9453241.post6737165208869679514..comments2024-01-22T23:57:51.851-07:00Comments on Phase Portrait: Bounding Boxes and EPS to PDF Conversion (in LaTeX)Ted Pavlichttp://www.blogger.com/profile/15297790411942050417noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-9453241.post-24321315566318048322016-03-12T13:42:40.041-07:002016-03-12T13:42:40.041-07:00I am using Powerdot and there seems to be no way t...I am using Powerdot and there seems to be no way to compile pdfs. I get a message like 'MiKTeX GPL Ghostscript<br /><br />9.05: Unrecoverable error, exit code 1<br /><br />MiKTeX GPL Ghostscript<br /><br />9.05: ERROR: A pdfmark destination page 17 points beyond the last page 16.<br /><br />Process exited normally'<br /><br />whatever I try.<br /><br />Therefore none of these controls on the bounding box seem to work for my case.<br /><br />I have a problem in that I have Tikz code to compile in my presentation which uses the \includegraphics of the graphicx package to input images in positions determined by the Tikz code. The picture files are EPS. The thing compiles fine, but the image in the resulting pdf has all the images turned on their side: It's like the bounding box acts as if in portrait, but I chose the option 'landscape'. Does anyone have any suggestions or indeed a solution to this?<br /><br /> Anonymoushttps://www.blogger.com/profile/05084471807353078499noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-22287188069585307942014-12-21T05:14:41.171-07:002014-12-21T05:14:41.171-07:00Hello.
Great post!
But I'd like to make some ...Hello.<br />Great post!<br /><br />But I'd like to make some adds. I have encountered a problem which succesfully was solved. Namely, none command was working for me. The system returned me an error:<br />"'gswin64c' is not recognized as an internal or external command, operable program or batch file."<br /><br />Here is an unswer: http://ghostscript.com/pipermail/gs-devel/2009-April/008314.html<br /><br /><b>Short</b>:<br />When Ghostscript is installed from the 'gs914w64.exe' it does not add the path to your PATH environment variable, nor does it add the 'lib' path.<br /><br />To use ps2pdf.bat or other lib scripts from a command prompt, right-<br />click on "My Computer", then click "Properties", then click the<br />"Advanced" tab and click on the "Environment Variables" near the<br />bottom and add the following to your 'Path' System variables:<br /><br />;C:\Program Files\gs\gs9.14\bin;C:\Program Files\gs\gs9.14\lib<br /><br />by selecting that variable and clicking on "Edit".Sobresalientehttps://www.blogger.com/profile/12827625686992701264noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-88297253224285970352010-03-24T13:39:09.916-07:002010-03-24T13:39:09.916-07:00Thanks for all the details. 3 yrs after the origin...Thanks for all the details. 3 yrs after the original post and it's still very helpful!Sarahnoreply@blogger.comtag:blogger.com,1999:blog-9453241.post-58262247447399821782008-04-30T15:20:00.000-07:002008-04-30T15:20:00.000-07:00Thanks for this. I have been looking for this for ...Thanks for this. I have been looking for this for a while.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9453241.post-14560934236932279982008-03-28T07:59:00.000-07:002008-03-28T07:59:00.000-07:00Thanks for the post. Here's a simple hack to fix ...Thanks for the post. Here's a simple hack to fix bounding boxes. I found that including latex in the Matlab figures simply places the BoundingBox declaration in an incorrect spot. The following perl script fixes the problem (and converts the files to pdf, using epstopdf), without generating any extra files.<BR/><BR/>---------------------<BR/>#!/usr/bin/perl<BR/># The script converts input a list of input eps files<BR/># to pdf files, using epstopdf.<BR/># It also fixes eps files of MATLAB figures, containing latex text.<BR/># Including LaTeX strings in figure labels causes some versions of MATLAB<BR/># to misplace the bounding box instructions in the eps files. <BR/><BR/>for $d (@ARGV){ # for every file in the input line<BR/> if (-s $d and $d=~/eps$/){ # check that it's non-empty and has an eps extension<BR/> print $d."\n"; # output the file name<BR/> # correct the bounding box problem with latex-containing Matlab plots<BR/> <BR/> @lines = `cat $d`; # read the file: HACK: will only work on *nix<BR/> @bbox = grep(/BoundingBox/, @lines); # Find the bounding box lines<BR/><BR/> # insert the bounding box where it belongs: <BR/> # right after the first line<BR/> $lines[1] =~ s#.*^#$bbox[0]#g; <BR/> <BR/> # write the corrected verions of the eps file<BR/> open F, ">$d";<BR/> print F @lines;<BR/> close F;<BR/><BR/> # create the pdf version<BR/> `epstopdf $d`;<BR/><BR/> }<BR/><BR/>}<BR/>-----------------------kirooshahttps://www.blogger.com/profile/17253804280081193383noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-84686731129106861332008-02-28T19:43:00.000-07:002008-02-28T19:43:00.000-07:00The gsopt switch of epstopdf only works with MikTe...The gsopt switch of epstopdf only works with MikTex epstopdf (written by Christian Schenk in C++). It doesn't work with TexLive since that is using a completely different epstopdf written by Sebastian Rahtz et al. in perl.<BR/><BR/>But, if you are using Texlive, it's very easy to modify the epstopdf function. first make a backup copy of epstopdf perl script. Then use vim to open the perl script and look for the the comment "### open output file". right below it, add -dPDFSETTINGS=/prepress or -dPDFSETTINGS=/printer to the arguments of gs, like <BR/> my $pipe = "$GS -q -dPDFSETTINGS=/prepress (leave other arguments intact)<BR/><BR/>and you are good to go.<BR/><BR/>you can check if the fonts are really embedded and subset by:<BR/><BR/>pdffonts myfile.pdfAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9453241.post-24706099277283836212008-02-25T11:59:00.000-07:002008-02-25T11:59:00.000-07:00To crop EPS, I use pdfcrop which is just a perl sc...To crop EPS, I use pdfcrop which is just a perl script like epstopdf.<BR/><BR/>In texlive, it's part of the texlive-extra-utils package.<BR/><BR/>-BenAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9453241.post-71415111816701670812007-09-20T09:53:00.000-07:002007-09-20T09:53:00.000-07:00One addition to Faraz' comment about the switch -s...One addition to Faraz' comment about the switch -shell-escape. You can run PdfTexify directly in WinEdt (without having to call PDFLatex), if in<BR/><BR/>Options>Execution Modes>PdfTexify<BR/><BR/>you add the switch<BR/><BR/>--tex-option=-shell-escapeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9453241.post-56361293134544639952007-09-13T07:47:00.000-07:002007-09-13T07:47:00.000-07:00I haven't tried this, but I hear from my officemat...I haven't tried this, but I hear from my officemate that this line will work well (where #1 is your EPS file):<BR/><BR/>ps2pdf -dPDFSETTINGS=/prepress -dEPSCrop #1<BR/><BR/>This line should embed fonts AND maintain bounding box AND should be supported across platforms (whereas the epstopdf command is very different on Windows).<BR/><BR/>Also consider using these font embedding options (perhaps INSTEAD of the prepress option):<BR/><BR/>-dPDFX=true<BR/><BR/>or<BR/><BR/>-dPDFSETTINGS=/printer<BR/><BR/>See the ps2pdf documentation for more details.Ted Pavlichttps://www.blogger.com/profile/15297790411942050417noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-20699288174638830612007-08-31T06:41:00.000-07:002007-08-31T06:41:00.000-07:00Thanks for the font embedding note!For font embedd...Thanks for the font embedding note!<BR/><BR/>For font embedding, also be sure that updmap.cfg is updated to download fonts. See <A HREF="http://www.daniel-lemire.com/blog/archives/2005/08/29/getting-pdflatex-to-embed-all-fonts/" REL="nofollow">Getting pdflatex to embed all fonts</A> (or <A HREF="http://users.rsise.anu.edu.au/~luke/embedded_fonts.html" REL="nofollow">pdf pdflatex embedded fonts</A>) for more details. <BR/><BR/>NOTE: It appears like font embedding is the default using gwTeX for OS X.Ted Pavlichttps://www.blogger.com/profile/15297790411942050417noreply@blogger.comtag:blogger.com,1999:blog-9453241.post-7966887267676546452007-08-19T11:19:00.000-07:002007-08-19T11:19:00.000-07:00Thanks a lot for this post.I have a couple of comm...Thanks a lot for this post.<BR/><BR/>I have a couple of comments:<BR/><BR/>>>Using the package epstopdf in latex:<BR/>-shell-escape switch is required. For those people who use WinEdt, they can set it at Options>Execution Modes>PDFLatex>Switches<BR/><BR/>if using PDFTexify, PDFLatex needs to be called at least once to convert the eps figures to pdf.<BR/><BR/>>>To have the fonts embedded and subset (IEEE requirement), use this rule:<BR/><BR/>\DeclareGraphicsRule{.eps}{pdf}{.pdf}{`epstopdf --gsopt=-dPDFSETTINGS=/prepress #1}<BR/><BR/>Basically the /prepress setting must be passed to gs. This is very useful and convenient for IEEE conferences.Anonymousnoreply@blogger.com