Smokes your problems, coughs fresh air.

Tag: latex

Installed MathJax-LaTeX WordPress plugin for blog.bigsmoke.us

Soon, I wish to document some statistical issues I’ve been running into lately due to the lack of understanding maintained by my recipe-level statistics training. Also, I’d like to document some of the things I did learn over the years, and, hopefully, the things I find out while working myself out of the modelling mountain that I currently find so difficult to mount. For this I will need to use some mathematical language, which is why I just installed the MathJaX-LaTeX WordPress plugin. MathJax-LaTeX uses the MathJax JavaScript library to support LaTeX and MathML math equations in WordPress without requiring the browser to have MathML support.

As for testing it, my knowledge (\(K()\)) of MathML (\(M\)) is pretty much nonexistant, while I’m quite comfortable with LaTeX (\(L\)) math exations, which is why I’m typing the LaTeX code “K(M) \ll K(L)” to generate the following simple equation:

\(K(M) \ll K(L)\)

eps2eps to the rescue when epstopdf complains of no bounding box

PDFLaTeX doesn’t like encapsulated postscript images. If you want to use .eps files with pdflatex, you can convert these files to PDF using Sebastian Rahtz’ epstopdf, and then remove all .eps file extensions from the image locations in your .tex source files. Then, the latex command will look for .eps file and the pdflatex command will look for .pdf, .jpg and .png files.

The other moment, I tried to do just this. But, epstopdf complained about the lack of a bounding box in one of my EPS files. Indeed, the conversion finished but generated a huge white background with the actual image somewhere in the lower left corner. From the man-page:

epstopdf transforms the Encapsulated PostScript file so that it is guaranteed to start at the 0,0 coordinate, and it sets a page size exactly corresponding to the BoundingBox. This means that when Ghostscript renders it, the result needs no cropping, and the PDF MediaBox is correct. The result is piped to Ghostscript and a PDF version written.

If the bounding box is not right, of course, you have problems…

Luckily, while tab-completing from eps to epstopdf, I noticed the eps2eps utility. I though: What if this utility happens to sanitize the EPS file a bit? A quick look at the man page and a test run later, my hope was confirmed: epstopdf would now generate a nice PDF file without complaining.

The epstopdf manual page could be amended to: If the bounding box is not right, you might want to try to run eps2eps first.

© 2022 BigSmoke

Theme by Anders NorenUp ↑