# Text got misaligned after psfrag replacement took place in .eps

I need to translate to translate texts in eps files. For this i use psfrag package like this:

\documentclass[12pt]{article}
\usepackage{psfrag}
\usepackage[dvips]{graphicx,color}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[ukrainian]{babel}
\thispagestyle{empty}

\begin{document}

\begin{figure}
\psfrag{valid}[][][0.8]{справжній}
\psfrag{match}[][][0.8]{збіг}
...
\includegraphics{rk-figure.eps}
\end{figure}

\end{document}


But after replacement some words are misaligned. Here you can see that word молодший is a bit higher than старший. Can i use some LaTeX command to avoid this.

Investigation has shown that the porblem comes from how latex aligns original, english, characters. In this example it is g in high-order.

So, i would like to put \strut inside eps file to make all baseline aligned the same. But i can't do like this:

1 -99.5 -100 @w
268 1685 :M
(\strut{}high-order)S


Is there another option? Maybe there is a known letter which has biggest depth, which i can put in the beginning of each label in eps file?

• Can you update with a minimal working example, MWE. That is a compilable example starting with \documentclass and ending with \end{document}. We also need the eps file. – StefanH Mar 25 '17 at 15:26
• It looks like it has something to do with the fifth letter (the one before sha, which I am afraid is the only Cyrillic letter I know). But that is just a wild guess. A quick fix could be to use \raisebox. – StefanH Mar 25 '17 at 15:30
• @StefanH but this will raise д (de) – Yola Mar 25 '17 at 15:34
• You can use a negative raise, like \raisebox{-3pt}{ABC} – StefanH Mar 25 '17 at 15:39
• @StefanH Thank you, i see, you mean to raise whole word. But i have lots of figures and i could change font in future, i would like to have general solution. – Yola Mar 25 '17 at 15:43

It is difficult to help without a MWE, but I would recommend putting a \strut in all your replacement texts to align text boxes.
• Sorry, do you mean like this \psfrag{valid}[][][0.8]{\strut{}справжній}? This doesn't help:( I can add a picture, with strut actually drawn to see it more clearly. – Yola Mar 25 '17 at 16:32
• Sorry, i found the source of the error, the problem is in orignal, english, letters, in this case it was g in high-order. I will post an answer soon. Thanks a lot! – Yola Mar 25 '17 at 16:48
The \strut is a (La)TeX command specifying a distance of height 0.7\baselineskip and depth 0.3\baselineskip. Postscript (ps) is a different language and hence does not understand this.
for the cases where you have a depth of the letter I would try to find it, starting with 0.3\baselineskip and raising with this value. If you have the same font in all ps-files you only have to find this value once.