GNOME Bugzilla – Bug 314777
export text layers to latex style eps (postscript)
Last modified: 2008-01-15 12:59:32 UTC
The GIMP can export to eps, but any text in the exported image is drawn and is not in the resulting eps file as text, which makes it difficult to use the eps file in latex and have latex render the image. gnuplot has a pslatex terminal type that does it very well, and outputs a .tex file that has the eps inside it, and does the text stuff with latex. It looks like it shouldn't be too hard to implement in the gimp. This is what it looks like, for example: % GNUPLOT: LaTeX picture with Postscript \begingroup% \makeatletter% \newcommand{\GNUPLOTspecial}{% \@sanitize\catcode`\%=14\relax\special}% \setlength{\unitlength}{0.1bp}% \begin{picture}(3600,2160)(0,0)% {\GNUPLOTspecial{" (**start of eps**) %!PS-Adobe-2.0 EPSF-2.0 %%Title: cylinder.tex %%Creator: gnuplot 4.0 patchlevel 0 %%CreationDate: Fri Aug 26 22:07:44 2005 %%DocumentFonts: %%BoundingBox: 0 0 360 216 %%Orientation: Landscape %%EndComments (**more eps stuff**) 1.000 UP stroke grestore end showpage (**end of eps - start of tex to place the text**) }}% \put(522,1608){\makebox(0,0){$y$ axis}}% \put(397,1403){\makebox(0,0)[r]{$2$}}% \put(397,1266){\makebox(0,0)[r]{$1$}}% \put(397,1130){\makebox(0,0)[r]{$0$}}% \put(397,994){\makebox(0,0)[r]{$-1$}}% \put(397,857){\makebox(0,0)[r]{$-2$}}% \put(3014,493){\makebox(0,0){$z$ axis}}% \put(3120,744){\makebox(0,0){$7$}}% \put(2986,686){\makebox(0,0){$6$}}% \put(2853,627){\makebox(0,0){$5$}}% \put(2719,569){\makebox(0,0){$4$}}% \put(2586,510){\makebox(0,0){$3$}}% \put(2452,452){\makebox(0,0){$2$}}% \put(2319,393){\makebox(0,0){$1$}}% etc. -=- (** indicates stuff snipped by me **) -=- It would seem that it would not be too difficult for the gimp to export to a .tex file in that manner, using the text layer for \put stuff with the location of the text specified by where it is in the text layer of the gimp file. It would make the gimp a lot more useful to me, currently I am having to manually do that and it is a real PITA - it would be *really nice* if the gimp could do it for me. From what gnuplot does, it doesn't look that difficult. No need to use pstricks or any other latex package either in order to use it - it just works (you do have to go from dvi to pd before going to pdf, but that's the case with any eps image in a latex document)
"which makes it difficult to use the eps file in latex and have latex render the image" in above should have read which makes it difficult to use the eps file in latex and have latex render the text
For the plug-in, the text layer is just a layer like any other layer. It has no chance to get the information about the text. That API would first have to be added. This is definitely not as simple as you put it. Also, export to PDF would be a lot more interesting than export to Postscript.
I'm going to resolve this as WONTFIX, in part because it has been unconfirmed for over a year, and in part because I don't think we want to do this. There is no possibility of making the result that LaTeX produces look exactly like the text that GIMP shows -- even making it similar would be very tricky. On the other hand, if somebody wants to write an external plugin to do this, that should become possible as soon as there is a text layer api, which hopefully will get into the next GIMP release. I understand the wish -- it would make life easier for me as well -- but it doesn't belong in the main distribution, where it would confuse unsophisticated users and produce a lot of bug reports.