# Text Export in EPS for use with psfrag in Latex

## Recommended Posts

Hallo everyone,

I started using Affinity Designer yesterday and I am really impressed how powerfull the software is while being so easy to use at the same time!

However, when I wanted to export my first graphic to EPS in ordner to embed it in a Latex project, I realized that psfrag is not able to replace the text in the exported graphic because the text is exported as a graphic object rather than a true text object.

Am I missing an export option or is Affinity Designer really not able to export true text in an EPS file? Why is text not being exported the way it is described in the PostScript Technology Center, e.g. like in this documentation?

Best regards

Tobi

##### Share on other sites

Any thoughts on this? Will the EPS export support native text in the future? This is very important for me, otherwise I have to stick to CorelDraw.

##### Share on other sites

I rarely leave text live in a graphic file meant to be placed into something else. I figure if the graphic is right, then it doesn't need to be live text...

AD doesn't have the capability to do this as far as I recall. But then again, while I don't know your work-flow and the reason behind leaving the text live, why not then add the text in whatever it is you are using?

##### Share on other sites

This is because I use AD for scientific purposes where I use text for anotations. This can be greek letters, short formulas etc. which can be set much more easily in latex. Moreover, I want to have the text in the same size and font type as the main text. This is why I only use short label texts in the graphics which I replace with psfrag in latex.

##### Share on other sites

But doesn't PSfrag also rely upon a tag in the EPS file for the change to happen? How does this work then with CD? I've never used LaTeX much less the PSfrag package so I am genuinely curious.

Sorry I don't have an answer to the issue and it looks like if CD works for this, then basically either you would need to continue using CD in the main, or design all but the labels in AD, export and bring into CD to finish up the text.

##### Share on other sites

So my workflow is, e.g. when I want to have a text in the graphic with the greek letter "sigma", in the graphic I create a text field with "L01" (or any other usually short text) and in latex I use the command "\psfrag{L01}[cc][cc]{$\sigma$}", then latex replaces L01 with the greek letter for sigma. But this of course requires the "L01" in the EPS file to be exported as text, as psfrag searched for this label in the EPS and in my example replaces the graphic's text. When the text is exported as a graphic object with paths psfrag of course cannot find it in the EPS.

I think it would be a simple-to-implement yet powerfull feature to have an option in the export dialog which lets the user choose between "text as text" or "text as paths".

##### Share on other sites
To demonstrate how easy it would be to export text as text, see the following example. I have exported an EPS file with AD where I placed a text with "L01". AD exports the code you see below unter "% L01". I simply added the code under "% L02", so the relevant part of the EPS looks like this:

% L01
288.541 485.116 m
288.541 485.116 289.707 485.116 289.707 485.116 c
289.707 485.116 289.707 477.534 289.707 477.534 c
289.707 477.534 294.067 477.534 294.067 477.534 c
294.067 477.534 294.067 476.509 294.067 476.509 c
294.067 476.509 288.541 476.509 288.541 476.509 c
288.541 476.509 288.541 485.116 288.541 485.116 c
closepath
/DeviceRGB setcolorspace
0 0 0 setcolor
fill
299.902 483.558 m
300.277 482.866 300.465 481.919 300.465 480.716 c
300.465 479.575 300.295 478.632 299.955 477.886 c
299.463 476.815 298.658 476.28 297.541 476.28 c
296.533 476.28 295.783 476.718 295.291 477.593 c
294.881 478.323 294.676 479.304 294.676 480.534 c
294.676 481.487 294.799 482.306 295.045 482.989 c
295.506 484.263 296.34 484.899 297.547 484.899 c
298.633 484.899 299.418 484.452 299.902 483.558 c
closepath
298.842 477.968 m
299.166 478.452 299.328 479.355 299.328 480.675 c
299.328 481.628 299.211 482.412 298.977 483.027 c
298.742 483.643 298.287 483.95 297.611 483.95 c
296.99 483.95 296.536 483.658 296.249 483.074 c
295.962 482.49 295.818 481.63 295.818 480.493 c
295.818 479.638 295.91 478.95 296.094 478.431 c
296.375 477.638 296.856 477.241 297.535 477.241 c
298.082 477.241 298.518 477.483 298.842 477.968 c
closepath
/DeviceRGB setcolorspace
0 0 0 setcolor
fill
302.123 482.45 m
302.123 482.45 302.123 483.259 302.123 483.259 c
302.885 483.333 303.416 483.457 303.717 483.631 c
304.018 483.805 304.242 484.216 304.391 484.864 c
304.391 484.864 305.223 484.864 305.223 484.864 c
305.223 484.864 305.223 476.509 305.223 476.509 c
305.223 476.509 304.098 476.509 304.098 476.509 c
304.098 476.509 304.098 482.45 304.098 482.45 c
304.098 482.45 302.123 482.45 302.123 482.45 c
closepath
/DeviceRGB setcolorspace
0 0 0 setcolor

fill

% L02

/Helvetica findfont
12 scalefont setfont
288 480 moveto
(L02) show

Now in latex I use the following code to replace L01 with $\alpha$ and L02 with $\beta$:

\begin{figure}[tb]

\centering
\footnotesize
\psfrag{L01}[cc][cc]{$\alpha$}
\psfrag{L02}[cc][cc]{$\beta$}
\includegraphics[width=1.0\linewidth,keepaspectratio]{figures/mygraphic.eps}
\caption{My graphic}
\end{figure}

Of course, L01 cannot be replaced by psfrag, L02 does!

##### Share on other sites

That's all pretty cool. Thanks for explaining. It is a good and clear use case that demonstrates why Serif should (re)consider using live text in an EPS export.

The only way I think it could even work out of AD would be to export as a PDF and convert the PDF with a PDF to EPS conversion/converter as the text would remain live then.

Mike

##### Share on other sites

Thank you Mike, that was a really good hint! I tried Acrobat Pro, pdftops, ghostscript ... all with no luck because text was always rastered in the EPS, but Inkscape finally did the trick! At least this is a workaround until hopefully a "text as text" option is available in AD.

##### Share on other sites

I would love to have this feature as well! Typesetting equations etc. is highly appreciated by the scientific community. Is there any feature request yet?

##### Share on other sites

I too would really like this feature. Affinity Designer makes very nice human-readable EPS files (much better than the competition), but forcing all text to be converted to paths is inefficient and undesirable in some cases. An option to "export text as text" vs "export text as paths" for EPS files would be greatly appreciated!

##### Share on other sites

To give this topic some more weight, I would like to see this feature, too!

## Create an account

Register a new account