On 7/2/13 11:44 PM, Julien Rioux wrote:
On Tue, Jul 2, 2013 at 2:50 PM, Michael Bach <[email protected]
<mailto:[email protected]>> wrote:

    Hi Julien,

    On 5/19/13 11:55 PM, Julien Rioux wrote:

        On 28/10/2012 6:01 AM, Michael Bach wrote:

            Ok, although I did not solve this in terms of LyX
            configuration: Just a
            quick notice for sake of completeness and in case someone is
            plagued by
            this issue and might be happy to find this.

            On 10/26/12 12:29 PM, Michael Bach wrote:

                Now when I try to compile the document, I see the line:
                === pstool: begin processing ===
                Error exporting to format
                
pdf2/Users/Shared/LyX/lyx-2.0.__4/src/support/Systemcall.cpp(__273):
                Systemcall: 'pdflatex -synctex=-1 -shell-escape
                  "skriptum.tex"'
                finished with exit code 1

                in the messages pane and get the error:
                I can't write on file `figures/EulerExplizit-pstool.__tex'.

                Now I assume that the external command from pstool is
                run inside the
                temporary LyX directory and it thus cannot find the
                figures/ folder to
                write the .tex file to...

            AFAIK, LyX does not copy the .eps and .tex psfrag files to
            the temporary
            directory, because it does not parse the ERT for the
            psfragfig macro. I
            decided to reference the files under figures/ directly with
            absolute
            paths to the source dir. This does work via "openout_any = a" in
            texmf.cnf but then compiling foreign documents does not feel
            secure
            anymore...

            I read the LyX "Customization" manual under 'Copier' for a
            better
            solution, but could not find a reference to the LyX
            temporary directory
            and have no clue how to best solve this in terms of LyX policy.

            Michael



        The way I use psfrag is to insert the .eps into LyX using the
        standard
        way from the Insert menu, and put the psfrag code in ERT in the LyX
        document. This way, LyX handles the copying of the .eps file
        correctly.
        You obviously need the correct \usepackage line added to your
        preamble
        in document settings.


    Thanks for your comment. I somehow missed your answer after all this
    time...


Well, it took me quite some time to answer in the first place...

    I get how you mentioned the inclusion of the .eps file - I remember
    trying that initially. I also assume you mean `\usepackage{pstool}'
    as correct preamble line(?). However, I do not know what you mean by
    'psfrag code'.


Actually, I just use \usepackage{psfrag} directly (\usepackage{pstool}
isn't necessary for pdf output via ps2pdf). The psfrag code that I refer
to is the content of the .tex file generated by matlabfrag alongside the
.eps file.

I read some more about the technologies and packages involved. I did not fully grasp the bare psfrag since I used the pstools psfragfig magic before, thanks for explanation.

I would be copy-pasting the content of the .tex file into an
ERT, but you could also input the .tex file via "Insert>File>Child Doc".

I tried this \input approach, placed before/after the graphics include but it did not work with pdflatex.

What this accomplishes corresponds to what is described at the beginning
of section 4.2 of the matlabfrag userguide.pdf manual. If you need to
use pdflatex, you'll need the \usepackage{pstool} instead, but then I
don't know how to help you!


I then tried to use the psfrag together with auto-pst-pdf to get to pdf, but pdftex process runs with 100% CPU for 10 minutes and then dies.

So I am back to pstool with absolute paths and an "openany_out=a pdflatex ..." command. This ERT approach is not as neat (e.g. no preview!) as the other figure handling in LyX, but at least it works.

Thanks for your thoughts on this!

Michael



Reply via email to