Discussion:
LyX and Inkscape
Martin Hoßbach
2011-09-22 09:49:59 UTC
Permalink
Hello

does anyone of you use Inkscape and the pdf-latex-format to create
images for your documents?

BTW: Same problem with gnuplot and the eps-latex-terminal... I
definitely want to use this format, because then I will have all text in
drawings and diagrams in the font used by the main document.

Inkscape creates two files: a pdf-file containing the drawing, and a
tex-file which adds all text to the drawing and also loads the pdf-file.
LyX seems to ignore the pdf file, since it is not referenced anywhere in
the LyX-File. As a result, I get an error: "foo.pdf cannot be found".

Trying to use \graphicspath to tell latex where to look for the pdf
doesn't help: I would have to add an absolute path to the pdf, which is
pointless if you work on two machines, one linux, one windows... Using a
relative path doesn't work, because LyX ignores the pdf-file and simply
doesn't copy it to the temp-folder.

Is there any way to tell LyX that the pdf-file exists and needs to be
copied to the temp-folder, so latex can find it?

Did I miss anything?

Thanks
Martin
Julio Rojas
2011-09-22 10:32:20 UTC
Permalink
Hi Martin. I use Inkscape all the time, but have not heard before of
this "pdf-latex-format".
Would you explain how to access it? I tried Save As but it is not there.

Thanks. Regards.
-------------------------------------------------
Julio Rojas
***@gmail.com


On Thu, Sep 22, 2011 at 11:49 AM, Martin Hoßbach <
Hello
does anyone of you use Inkscape and the pdf-latex-format to create images
for your documents?
BTW: Same problem with gnuplot and the eps-latex-terminal... I definitely
want to use this format, because then I will have all text in drawings and
diagrams in the font used by the main document.
Inkscape creates two files: a pdf-file containing the drawing, and a
tex-file which adds all text to the drawing and also loads the pdf-file. LyX
seems to ignore the pdf file, since it is not referenced anywhere in the
LyX-File. As a result, I get an error: "foo.pdf cannot be found".
Trying to use \graphicspath to tell latex where to look for the pdf doesn't
help: I would have to add an absolute path to the pdf, which is pointless if
you work on two machines, one linux, one windows... Using a relative path
doesn't work, because LyX ignores the pdf-file and simply doesn't copy it to
the temp-folder.
Is there any way to tell LyX that the pdf-file exists and needs to be
copied to the temp-folder, so latex can find it?
Did I miss anything?
Thanks
Martin
Mukhtar Ullah
2011-09-22 13:09:24 UTC
Permalink
Julio,

You find this option after you choose "save as pdf" and confirm your choice.
Later you will see a list of options one which is "PDF+LaTeX".

Regards,

Mukhtar
Julio Rojas
2011-09-22 13:28:29 UTC
Permalink
I just tested it and it works like a charm with LyX. Beautiful results! :D

Thanks to both of you.
-------------------------------------------------
Julio Rojas
***@gmail.com


On Thu, Sep 22, 2011 at 3:09 PM, Mukhtar Ullah <
Post by Mukhtar Ullah
Julio,
You find this option after you choose "save as pdf" and confirm your choice.
Later you will see a list of options one which is "PDF+LaTeX".
Regards,
Mukhtar
Neal Becker
2011-09-23 00:18:06 UTC
Permalink
Why wouldn't you just save as svg?
Post by Julio Rojas
I just tested it and it works like a charm with LyX. Beautiful results! :D
Thanks to both of you.
-------------------------------------------------
Julio Rojas
On Thu, Sep 22, 2011 at 3:09 PM, Mukhtar Ullah <
Post by Mukhtar Ullah
Julio,
You find this option after you choose "save as pdf" and confirm your choice.
Later you will see a list of options one which is "PDF+LaTeX".
Regards,
Mukhtar
Martin Hoßbach
2011-09-23 07:22:52 UTC
Permalink
Post by Neal Becker
Why wouldn't you just save as svg?
If we just talk about an illustration, I would save it as pdf and then
include the pdf. However, if the illustration contains anything in text,
then if I saved it as a pdf I would have the text in the font that
inkscape used. I believe that this looks ugly: Anything in the finished
document should be in the same font.

So if I use this pdf+latex format, the text will be rendered by LaTeX,
at the positions specified by inkscape, but using the documents font.
Also, you can then use LaTeX-Commands in your illustration, for example
the math mode...

If anyone is interested: something similar can be done with gnuplot,
using the epslatex-terminal (then you just need to convert the eps-file
to pdf), and also with dia.

Martin
PhilipPirrip
2011-09-23 08:20:46 UTC
Permalink
Post by Martin Hoßbach
If anyone is interested: something similar can be done with gnuplot,
using the epslatex-terminal (then you just need to convert the eps-file
to pdf), and also with dia.
Martin, can you please tell me what exactly one should do in LyX with
those two files, a .pdf and a .tex?
Martin Hoßbach
2011-09-23 08:26:03 UTC
Permalink
Post by PhilipPirrip
Martin, can you please tell me what exactly one should do in LyX with
those two files, a .pdf and a .tex?
The files are used almost like a "normal image". Instead of inserting
the image (usually inside a float), you insert a child document, select
the .tex-file, and switch to "input" instead of "include". And then you
do what I was told before, so that LyX knows where the pdf-file can be
found... (--> TEXINPUTS)

Martin
--
Dipl.Inform. Martin Hoßbach
Research Assistant 'Cognitive Computing & Medical Imaging'

Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5 | 64283 Darmstadt | Germany
Tel +49 6151 155-585 | Fax +49 6151 155-480
***@igd.fraunhofer.de | www.igd.fraunhofer.de
Julio Rojas
2011-09-23 08:45:18 UTC
Permalink
Martin, I have generated one testing image with a black square and a
test formula. I can see the formula in the PDF. I thought the formula
was added at compilation time with the PDF_Tex file. Isn't it so?

Regards.
-------------------------------------------------
Julio Rojas
***@gmail.com



On Fri, Sep 23, 2011 at 10:26 AM, Martin Hoßbach
Post by PhilipPirrip
Martin, can you please tell me what exactly one should do in LyX with
those two files, a .pdf and a .tex?
The files are used almost like a "normal image". Instead of inserting the
image (usually inside a float), you insert a child document, select the
.tex-file, and switch to "input" instead of "include". And then you do what
I was told before, so that LyX knows where the pdf-file can be found... (-->
TEXINPUTS)
Martin
--
Dipl.Inform. Martin Hoßbach
Research Assistant 'Cognitive Computing & Medical Imaging'
Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany
Tel +49 6151 155-585  |  Fax +49 6151 155-480
Guenter Milde
2011-09-23 21:19:34 UTC
Permalink
Post by Martin Hoßbach
Post by PhilipPirrip
Martin, can you please tell me what exactly one should do in LyX with
those two files, a .pdf and a .tex?
The files are used almost like a "normal image". Instead of inserting
the image (usually inside a float), you insert a child document, select
the .tex-file, and switch to "input" instead of "include". And then you
do what I was told before, so that LyX knows where the pdf-file can be
found... (--> TEXINPUTS)
Wouldn't this be a candidate for an external inset?
Then we might even have a preview in LyX.

Günter
Liviu Andronic
2011-09-23 21:54:21 UTC
Permalink
Post by Guenter Milde
Wouldn't this be a candidate for an external inset?
Then we might even have a preview in LyX.
Yes, I also thought that this may improve users' welfare.
Liviu
Julien Rioux
2011-09-23 23:19:41 UTC
Permalink
Post by Guenter Milde
Post by Martin Hoßbach
Post by PhilipPirrip
Martin, can you please tell me what exactly one should do in LyX with
those two files, a .pdf and a .tex?
The files are used almost like a "normal image". Instead of inserting
the image (usually inside a float), you insert a child document, select
the .tex-file, and switch to "input" instead of "include". And then you
do what I was told before, so that LyX knows where the pdf-file can be
found... (--> TEXINPUTS)
Wouldn't this be a candidate for an external inset?
Then we might even have a preview in LyX.
Günter
See this bug report: http://www.lyx.org/trac/ticket/7510
Basically, I was thinking the same as you, but was curious how people
are using the format today even without a patch to LyX.
--
Julien
Mukhtar Ullah
2011-09-22 13:06:43 UTC
Permalink
Post by Martin Hoßbach
Is there any way to tell LyX that the pdf-file exists and needs to be
copied to the temp-folder, so latex can find it?
Martin,
I had a similar problem and have to thank the latest version LyX 2.0.1 for
solving the issue. This problem occurs when your figure (both .pdf_tex and .pdf)
in a directory (most commonly a subdirectory). To cut it short, let us assume
that the two files are in a subdirectory ./figures (I would recommend to always
use one such name for the directory for the reason to follow). Go to
Tools->Preferences->Paths->TEXTINPUTS prefix: by default the current document
directory is included (the dot .). Add the subdirectory path by appending
;./figures (the semicolon ; is to separate the two paths). I believe this should
solve such issues in he future except in the case that your subdirectoery has a
different name (e.g. ./img) in which case also append ;./img.

Regards,

Mukhtar
Martin Hoßbach
2011-09-22 13:35:13 UTC
Permalink
I will have to try this later today at home, since here at work I only
have a windows pc, and the windows version of 2.0.1 seems not to be
available yet...

Thanks anyway.

Martin
Post by Mukhtar Ullah
Post by Martin Hoßbach
Is there any way to tell LyX that the pdf-file exists and needs to be
copied to the temp-folder, so latex can find it?
Martin,
I had a similar problem and have to thank the latest version LyX 2.0.1 for
solving the issue. This problem occurs when your figure (both .pdf_tex and .pdf)
in a directory (most commonly a subdirectory). To cut it short, let us assume
that the two files are in a subdirectory ./figures (I would recommend to always
use one such name for the directory for the reason to follow). Go to
Tools->Preferences->Paths->TEXTINPUTS prefix: by default the current document
directory is included (the dot .). Add the subdirectory path by appending
;./figures (the semicolon ; is to separate the two paths). I believe this should
solve such issues in he future except in the case that your subdirectoery has a
different name (e.g. ./img) in which case also append ;./img.
Regards,
Mukhtar
--
Dipl.Inform. Martin Hoßbach
Research Assistant 'Cognitive Computing & Medical Imaging'

Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5 | 64283 Darmstadt | Germany
Tel +49 6151 155-585 | Fax +49 6151 155-480
***@igd.fraunhofer.de | www.igd.fraunhofer.de
Liviu Andronic
2011-09-22 13:39:18 UTC
Permalink
On Thu, Sep 22, 2011 at 3:35 PM, Martin Hoßbach
I will have to try this later today at home, since here at work I only have
a windows pc, and the windows version of 2.0.1 seems not to be available
yet...
It is, but using Uwe's unofficial installer [1].
Liviu

[1] https://developer.berlios.de/project/showfiles.php?group_id=5117&release_id=18767
Thanks anyway.
Martin
Post by Mukhtar Ullah
Post by Martin Hoßbach
Is there any way to tell LyX that the pdf-file exists and needs to be
copied to the temp-folder, so latex can find it?
Martin,
I had a similar problem and have to thank the latest version LyX 2.0.1 for
solving the issue. This problem occurs when your figure (both .pdf_tex and .pdf)
in a directory (most commonly a subdirectory). To cut it short, let us assume
that the two files are in a subdirectory ./figures (I would recommend to always
use one such name for the directory for the reason to follow). Go to
Tools->Preferences->Paths->TEXTINPUTS prefix: by default the current document
directory is included (the dot .). Add the subdirectory path by appending
;./figures (the semicolon ; is to separate the two paths). I believe this should
solve such issues in he future except in the case that your subdirectoery has a
different name (e.g. ./img) in which case also append ;./img.
Regards,
Mukhtar
--
Dipl.Inform. Martin Hoßbach
Research Assistant 'Cognitive Computing & Medical Imaging'
Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany
Tel +49 6151 155-585  |  Fax +49 6151 155-480
--
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
Mukhtar Ullah
2011-09-22 13:58:18 UTC
Permalink
Post by Liviu Andronic
It is, but using Uwe's unofficial installer [1].
Liviu
[1]
https://developer.berlios.de/project/showfiles.php?group_id=5117&release_id=18767
I am also on windows and using Uwe's unofficial installer. I don't see any
difference in the two installers except that the unofficial installer changes
your MiKTeX package repository path during installation which I change back
because I have a local repository.

Mukhtar
Julien Rioux
2011-09-22 16:25:10 UTC
Permalink
Post by Mukhtar Ullah
Post by Martin Hoßbach
Is there any way to tell LyX that the pdf-file exists and needs to be
copied to the temp-folder, so latex can find it?
Martin,
I had a similar problem and have to thank the latest version LyX 2.0.1 for
solving the issue. This problem occurs when your figure (both .pdf_tex and .pdf)
in a directory (most commonly a subdirectory). To cut it short, let us assume
that the two files are in a subdirectory ./figures (I would recommend to always
use one such name for the directory for the reason to follow). Go to
Tools->Preferences->Paths->TEXTINPUTS prefix: by default the current document
directory is included (the dot .). Add the subdirectory path by appending
;./figures (the semicolon ; is to separate the two paths). I believe this should
solve such issues in he future except in the case that your subdirectoery has a
different name (e.g. ./img) in which case also append ;./img.
Regards,
Mukhtar
So, besides setting the TEXINPUTS, how do you include the image in your
document? Using \input or an external template?
--
Julien
Mukhtar Ullah
2011-09-23 08:50:08 UTC
Permalink
Post by Julien Rioux
So, besides setting the TEXINPUTS, how do you include the image in your
document? Using \input or an external template?
I am using the \input command in ERT. You may try \input via child document as
Martin suggested.

Mukhtar
Csikos Bela
2011-09-23 16:58:40 UTC
Permalink
So, besides setting the TEXINPUTS, how do you include the image in your >
document? Using \input or an external template?>
I am using the \input command in ERT. You may try \input via child documen=
t >as Martin suggested.

Hello:

I became interested in this one too.
However no matter whether I set the TEXINPUTS prefix or leave it as is
I always get error message:

!pdfTeX error: pdflatex (file ./inkscape.pdf): reading image file fail

I have linux, lyx-2.0.1 and texlive 2010-34.1.

What can be the problem?

Thanks,

bcsikos
Csikos Bela
2011-09-23 17:34:15 UTC
Permalink
Post by Csikos Bela
I became interested in this one too.
However no matter whether I set the TEXINPUTS prefix or leave it as is
I always get error message:>
!pdfTeX error: pdflatex (file ./inkscape.pdf): reading image file fail
I have linux, lyx-2.0.1 and texlive 2010-34.1.
What can be the problem?
I found what was the problem. The lyx file name and the pdf to be inserted
had the same file name (inkscape-try).

bcsikos
Sergey
2014-09-18 12:24:05 UTC
Permalink
Go to Tools->Preferences->Paths->TEXTINPUTS prefix: by default the current
document directory is included (the dot .). Add the subdirectory path by
appending
;./figures (the semicolon ; is to separate the two paths). I believe this should
solve such issues in he future except in the case that your subdirectoery has a
different name (e.g. ./img) in which case also append ;./img.
Regards,
Mukhtar
This method works for me.
Thanks Mukhtar!

Continue reading on narkive:
Loading...