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





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.

enter image description here

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

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?

  • 1
    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
  • 1
    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
  • 1
    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.

Since strut comes from typesetting I am pretty sure it is possible to make it in ps, but can't say how. What you could try is to just replace the text with whatever that does not have letters with depth (e.g. g or j). But I doubt this will work since the positioning is already done in the ps file.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.