On Fri, Aug 7, 2009 at 9:52 AM, Daniel
Lohmann<daniel.lohm...@informatik.uni-erlangen.de> wrote:
> Hi,
> So here is what I want to achieve:
> I have some TikZ figures (which are actually stand-alone LaTeX-documents
> with the extension .tikz) that I want to embed (not the source, but the
> PDF/EPS via \includegraphics) into my LyX document in a way that (1) the
> LyX-Preview does work (2) PDF generation does work, and (3) the .tikz-file
> is opened in vim when I select "Edit externally..."
I am sorry if I am telling you something you already know, but...

It seems to me you are throwing away the value of TikZ by doing this.

Recall that one of the strengths of TikZ/pgf is that the fonts and
such in the figure will match the document. If you persist in keeping
the TikZ as stand alone latex documents, you are destroying that
possibility.  I don't think the document will ever compile because of
the duplicate preambles and such that the latex system encounters.

On the  other hand, if the TikZ file is just the TikZ figure, then I'd
be more optimistic.

But I don't think it is wise to convert the tikz to pdf and embed that
with includegraphics.
Rather, I think you just want to include the tikz code itself. You can
just use input on the TikZ figure itself. If you put that inside a LyX
floating graphic or a minipage, it "just works" in the final
processing. In Lyx, choose "Insert" "File" "Child Document" and then
choose your tikz text file.  As long as it is just the figure, it is
all good. I've just tested it, and it does work.

But you won't get an in-document preview in LyX without a  bit of
messing about.  I think that's where the other guy who refers you to
the Dia code has a good idea.  I've tried to figure that part out, but
no solution yet. We need a way to tell LyX to pass the Tikz figure
code straight through to LaTeX, but we also want an on-screen preview
of what that will be like.  But it is inherently impossible to get a
preview of what that will be like without compiling the whole
document.  A conundrum for me.

Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

Reply via email to