This site will go down shortly. If you need any help, then please subscribe to The Persian TeX discussion mailing list
ask now - it's free

Most popular questions within the last 3 days

Most active Members
this month:
    +1 vote

    How can I use the psfrag package with the xepersian package in XeTeX?

    \setlatintextfont{Times New Roman}
        \psfrag{acb1}{ \tiny 1998}
        \psfrag{aeb1}{\tiny 1999}
        \psfrag{afb1}{\tiny 2000}
        \psfrag{ata}{\begin{tabular}{l} Cumulative Installed \\[-4pt] Wind Power (GW) \end{tabular}}
    \psfragfig[width=\textwidth]{Figure-Ch04-01.eps} %% Size: 12.7 x 5.7 cm
    \caption{Global cumulative installed wind power from 1997 to 2014 
    Uploaded File:
    asked by
    retagged by

    1 Answer

    0 votes
    Best answer

    Unfortunately, I could not run TeX on your provided minimal example since it complained about the control sequence \psfragfig being undefined with my version of the package psfrag (perhaps you are using an earlier version).

    I can reproduce the problem with the following minimal example taken from psfrag manual.

    \psfrag{\\tex[B][B]\{Plot of \$\\sin(t)\$ and \$\\cos(t)\$\}}{Plot of $\sin(t)$ and $\cos(t)$}
    \psfrag{\\tex[B][B]\{\$\\sin(t)\$, \$\\cos(t)\$\}}{$\sin(t)$, $\cos(t)$}

    where the image file example.eps can be downloaded from CTAN.

    Let's make two things clear

    • The issue has nothing to do with the xepersian package;
    • This is mainly a driver issue.

    If you run latex+dvips+ps2pdf, then you will get what you expect. To understand what is going on with XeTeX, try

    xelatex -no-pdf <filename.tex>

    and then

    xdvipdfmx <filename.xdv>

    If you do this, you should see a lot of warnings from xdvipdfmx.

    xdvipdfmx:warning: Unknown token "where"
    xdvipdfmx:warning: Interpreting PS code failed!!! Output might be broken!!!
    xdvipdfmx:warning: Interpreting special command ps: (ps:) failed.
    xdvipdfmx:warning: >> at page="1" position="(148.712, 459.953)" (in PDF)
    xdvipdfmx:warning: >> xxx "ps: /PSfrag where{pop(p1)[[0(Bl)1 0]](p2)[[1(Bl)1 0]](p3)[[2..."
    xdvipdfmx:warning: >> Reading special command stopped around >>{pop(p1)[[0(Bl)1 0]]

    This makes it clear that this is the driver issue. Having said that, you have few options

    • Remove all text labels from your eps file, convert it to PDF and use the package overpic to put labels on your image;

    • Use either package pstool or package auto-pst-pdf;

    • All other similar approaches.
    answered by (3.1k points)
    selected by