On 03/23/2018 05:40 PM, Marshall Feldman wrote:
I am writing a paper with using this structure (simplified for
explanation):
paper_root/master_document.lyx
paper_root/part1/part1.lyx
paper_root/part2/part2.lyx
paper_root/part3/part3.lyx
I have it set up so that, for example, I can work on part2.lyx and
compile it to view only the part2.pdf file.
Now say, I'm working on part2.lyx. If I put an image file in the same
directory, e.g.:
paper_root/part2/picture1.png
The compilation works fine. But if I create a top-level directory to
store my images, both to keep things organized to find files and to be
able to share/update pictures and have them in a different directory:
paper_root/images/picture1.png
When I try to insert the image in part2.lyx, Lyx just won't do it.
Nothing crashes, but the image never shows up in the document. In
fact, using the Insert > Graphics ... dialog, as soon as I browse to
../images/picture1.png and select the image, the Insert Graphics
window closes with nothing inserted in the document.
What am I doing wrong?
Secondary question:
I believe it was in his book on the ggplot2 package for R that Hadley
Wickham recommended putting this command in the LaTeX preamble:
\graphicspath{{../images/}{../graphs}}
But this totally screws things up for me when I put it in the preamble
in LyX. Any thoughts about this?
Thanks for your help.
It might help to know what version of LyX you are using, and what
operating system, just in case.
That said, parking images in a parallel directory has always worked for
me, and still does in 2.3.0. (I just checked.) You might try the
following. Start LyX from a terminal with the command "lyx -dbg
graphics". This will spew a ton of output, so you might want to capture
it to a file (perhaps by using the tee command, if you're on Linux).
Once LyX is open, load your document and make note of where you're at in
the terminal output. Now try the graphics insertion dialog, and see
whether the ensuing torrent of messages contains any errors. If you
can't find any problems, but are able to capture the output to a text
file, you might try posting it here.
I don't know anything about Wickham's suggestion. Someone else will have
to weigh in on that.
Paul