Re: problem with graphics in beamerlyxexample1.lyx
BigG writes: > The patch is defunct, as the source has now moved on somewhat. According to the comments attached to the bug, the patch still works when using \IfFileExists instead of \pgfu...@iffileexists. Indeed, this patch: --- pgfcoreimage.code.tex.orig 2008-01-15 11:27:34.0 +0100 +++ pgfcoreimage.code.tex 2009-10-08 22:51:29.281129400 +0200 @@ -81,8 +81,11 @@ \def\...@findfile#1:#2+#3{% - \pgfu...@iffileexists{#3#1}% - {\xdef\...@filename{#3#1}}% + \edef\...@tempa{% +\def\noexpa...@tempa1\space{% + \xdef\noexpand\...@filename{1}}} + \IfFileExists{#3#1}% + {\...@tempa\expandafter\@tem...@filef@und}% {\def\...@mightbeempty{#2}% \ifx\...@mightbeempty\pgfutil@empty\else% \...@findfile#2+{#3}% works for me. -- Enrico
Re: Re: problem with graphics in beamerlyxexample1.lyx
Enrico Forestieri wrote: > BigG writes: >> I have LyX 1.6.4 installed in cygwin on W2K, and LyXWindows 1.6.4 on W2K on >> another box. When I >> use beamerlyxexample1.lyx, warnings about missing graphics are generated. > [...] >> The PDF generated is fine, but missing the four knight images, and the ICSI >> logo. This is what I >> would expect. However, the relevant image files are actually there in the >> same directory as >> beamerlyxexample1.lyx. For example, >> >> $ ls -w 80 /usr/local/share/lyx/examples/beam* >> /usr/local/share/lyx/examples/beamer-g4-mask.jpg* >> /usr/local/share/lyx/examples/beamer-g4.jpg* >> /usr/local/share/lyx/examples/beamer-icsi-logo.pdf* >> /usr/local/share/lyx/examples/beamer-knight1-mask.png* >> /usr/local/share/lyx/examples/beamer-knight1.png* >> /usr/local/share/lyx/examples/beamer-knight2-mask.png* >> /usr/local/share/lyx/examples/beamer-knight2.png* >> /usr/local/share/lyx/examples/beamer-knight3-mask.png* >> /usr/local/share/lyx/examples/beamer-knight3.png* >> /usr/local/share/lyx/examples/beamer-knight4-mask.png* >> /usr/local/share/lyx/examples/beamer-knight4.png* >> /usr/local/share/lyx/examples/beamerlyxexample1.lyx* >> >> Why can't pdflatex find them? > > This is a known pgf bug: > http://sourceforge.net/tracker/index.php?func=detail&aid=1336165&group_id=92412&atid=600660 > > A patch has been proposed, but it has not still been applied: > http://sourceforge.net/tracker/index.php?func=detail&aid=1447974&group_id=92412&atid=600662 > The patch is defunct, as the source has now moved on somewhat. I've monkeyed with pgfcoreimage.code.tex and produced the following replacement for p...@findfile: \def\...@findfile#1:#2+#3{% \...@findfile@inner#1:#2+{\in...@path#3} \ifx\...@filename\pgfutil@empty{ \...@findfile@inner#1:#2+{#3} } \fi } \def\...@findfile@inner#1:#2+#3{ \pgfu...@iffileexists{#3#1}% {\PackageInfo{pgf}{Found file #3#1\MessageBreak} \xdef\...@filename{#3#1}}% {\PackageInfo{pgf}{Failed to find #3#1\MessageBreak} \def\...@mightbeempty{#2}% \ifx\...@mightbeempty\pgfutil@empty\else% \...@findfile@inner#2+{#3}% \fi } } The idea is to do two searches; one with in...@path prepended, and one without. (This is necessary to find *all* the required files.) Unfortunately, as it stands it won't work. This is because in the TeX file which LyX produces, the input path is defined by the following line: \def\in...@path{{/usr/local/share/lyx/examples//}} The problem is caused by the double braces. By the time the full path string is passed to pgfu...@iffileexists, it looks like, for example, {/usr/local/share/lyx/examples}beamer-knight1.png The braces left behind invalidate the path. So I have two questions: a) is there a way in TeX to remove the outer pair of braces (I've tried all sorts of tactics, but being a relative newcomer to TeX, I've failed.) b) is there a good reason for the double braces to be there in the first place? (I'm sure there is, but I thought I'd better ask anyway. If I edit one pair away in the TeX file output by LyX, then my patch above seems to work fine.) Bill Gordon ://sneakemail.com
Re: problem with graphics in beamerlyxexample1.lyx
BigG wrote: I now have three machines with the following setups: Machine 1: W2K LyX 1.6.4 on cygwin(tetex) LyXWindows 1.6.4 MiKTeX 2.7 Machine 2: W2K LyXWindows 1.6.4 MiKTeX 2.7 Machine 3: XP LyXWindows 1.6.4 MiKTeX 2.7 so that's four installations of LyX. They all give basically the same result for beamerlyxexample1.lyx, which is as follows: File->Export->LaTeX (pdflatex) produces a TeX file which does not have the \def\input line. Running this through pdflatex produces the warnings above, and a PDF with no graphics. However, if the graphics files are put into the same directory as the TeX file, there are no warnings about missing graphics files, and the PDF file does have the appropriate graphics. This seems consistent with the lack of \def\input line. View->PDF (pdflatex) produces a TeX file which does have the \def\input line. In each of the four cases, the path appears to be correct (in the cygwin case, the two occurences of \string are not present, though). Running these through pdflatex produces the warnings above, and a PDF with no graphics in each of the four cases. Again, if the the graphics files are put into the same directory as the TeX file, there are no warnings about missing graphics files, and the PDF file does have the appropriate graphics. This would imply that the \def\input line is ignored for some reason. So a) your XP installation works, mine doesn't b) my \def\input lines appear to be OK, but are ignored or incorrectly interpreted by pdflatex c) my Export-ed files don't have the \def\input line (don't know if this is as expected or not). Any thoughts, anyone? Yep -- I think I screwed up. :-) Upon further review, I realize I'm missing some of the images (presumably the same ones) here. Most of the diagrams are intact because they're written in PGF rather than imported as image files. I thought the boxes that said "knight1" etc. were supposed to be boxes that said "knight1" etc.; I realize now they're placeholders for what I presume would be images of knights. I wondered why I wasn't afflicted by the bug Enrico cited. Turns out I am and didn't realize it. /Paul
Re: Re: Re: problem with graphics in beamerlyxexample1.lyx
> BigG writes: > > > > I have LyX 1.6.4 installed in cygwin on W2K, and LyXWindows 1.6.4 on W2K on > > another box. When I > > use beamerlyxexample1.lyx, warnings about missing graphics are generated. > [...] > > The PDF generated is fine, but missing the four knight images, and the ICSI > > logo. This is what I > > would expect. However, the relevant image files are actually there in the > > same directory as > > beamerlyxexample1.lyx. For example, > > > > $ ls -w 80 /usr/local/share/lyx/examples/beam* > > /usr/local/share/lyx/examples/beamer-g4-mask.jpg* > > /usr/local/share/lyx/examples/beamer-g4.jpg* > > /usr/local/share/lyx/examples/beamer-icsi-logo.pdf* > > /usr/local/share/lyx/examples/beamer-knight1-mask.png* > > /usr/local/share/lyx/examples/beamer-knight1.png* > > /usr/local/share/lyx/examples/beamer-knight2-mask.png* > > /usr/local/share/lyx/examples/beamer-knight2.png* > > /usr/local/share/lyx/examples/beamer-knight3-mask.png* > > /usr/local/share/lyx/examples/beamer-knight3.png* > > /usr/local/share/lyx/examples/beamer-knight4-mask.png* > > /usr/local/share/lyx/examples/beamer-knight4.png* > > /usr/local/share/lyx/examples/beamerlyxexample1.lyx* > > > > Why can't pdflatex find them? > > This is a known pgf bug: > http://sourceforge.net/tracker/index.php?func=detail&aid=1336165&group_id=92412&atid=600660 > > A patch has been proposed, but it has not still been applied: > http://sourceforge.net/tracker/index.php?func=detail&aid=1447974&group_id=92412&atid=600662 > > -- > Enrico Thanks for this Enrico - and thanks for the workaround for my other problem with tetex -- Bill Gordon
Re: Re: problem with graphics in beamerlyxexample1.lyx
Paul A. Rubin wrote: > BigG wrote: >> I have LyX 1.6.4 installed in cygwin on W2K, and LyXWindows 1.6.4 on >> W2K on another box. When I use beamerlyxexample1.lyx, warnings about >> missing graphics are generated. The following are >> examples: >> >> Package pgf Warning: File "beamer-icsi-logo" not found when defining >> image "ics >> i-logo". >> (pgf)Tried all extensions in ".pdf:.jpg:.jpeg:.png:" >> on input l >> ine 49. >> >> >> Package pgf Warning: Missing height for image "icsi-logo" in draft mode. >> (pgf)Using 1cm instead on input line 49. >> >> >> Package pgf Warning: File "beamer-knight1-mask" not found when >> defining mask "k >> night1-mask". >> (pgf)Tried all extensions in ".pdf:.jpg:.jpeg:.png:" >> on input l >> ine 169. >> >> >> Package pgf Warning: File "beamer-knight1" not found when defining >> image "knigh >> t1". >> (pgf)Tried all extensions in ".pdf:.jpg:.jpeg:.png:" >> on input l >> ine 169. >> >> The PDF generated is fine, but missing the four knight images, and the >> ICSI logo. This is what I >> would expect. However, the relevant image files are actually there in >> the same directory as >> beamerlyxexample1.lyx. For example, >> >> $ ls -w 80 /usr/local/share/lyx/examples/beam* >> /usr/local/share/lyx/examples/beamer-g4-mask.jpg* >> /usr/local/share/lyx/examples/beamer-g4.jpg* >> /usr/local/share/lyx/examples/beamer-icsi-logo.pdf* >> /usr/local/share/lyx/examples/beamer-knight1-mask.png* >> /usr/local/share/lyx/examples/beamer-knight1.png* >> /usr/local/share/lyx/examples/beamer-knight2-mask.png* >> /usr/local/share/lyx/examples/beamer-knight2.png* >> /usr/local/share/lyx/examples/beamer-knight3-mask.png* >> /usr/local/share/lyx/examples/beamer-knight3.png* >> /usr/local/share/lyx/examples/beamer-knight4-mask.png* >> /usr/local/share/lyx/examples/beamer-knight4.png* >> /usr/local/share/lyx/examples/beamerlyxexample1.lyx* >> >> Why can't pdflatex find them? >> >> Bill Gordon >> > > Works fine on Win XP here. Is this occurring when you try View->PDF > (pdflatex)? If so, here are a couple of things to try: > > 1. Try exporting a TeX file and running pdflatex against it manually. > > 2. Do View->PDF (pdflatex) and, while the PDF version is open, use a > DOS window to navigate to your temp directory. (Tools -> Preferences -> > Paths -> Temporary directory will point you to it if the location is not > obvious.) You should see beamerlyxexample1.tex sitting there. Open it > with any text viewer. About the third line should be a path command, > something like > > \def\in...@path{{\string"C:/Program > Files/LyX16/Resources/examples/\string"/}} > > (give or take). Check to make sure the path is correct. > > /Paul > > > > Thanks for responding Paul. I now have three machines with the following setups: Machine 1: W2K LyX 1.6.4 on cygwin(tetex) LyXWindows 1.6.4 MiKTeX 2.7 Machine 2: W2K LyXWindows 1.6.4 MiKTeX 2.7 Machine 3: XP LyXWindows 1.6.4 MiKTeX 2.7 so that's four installations of LyX. They all give basically the same result for beamerlyxexample1.lyx, which is as follows: File->Export->LaTeX (pdflatex) produces a TeX file which does not have the \def\input line. Running this through pdflatex produces the warnings above, and a PDF with no graphics. However, if the graphics files are put into the same directory as the TeX file, there are no warnings about missing graphics files, and the PDF file does have the appropriate graphics. This seems consistent with the lack of \def\input line. View->PDF (pdflatex) produces a TeX file which does have the \def\input line. In each of the four cases, the path appears to be correct (in the cygwin case, the two occurences of \string are not present, though). Running these through pdflatex produces the warnings above, and a PDF with no graphics in each of the four cases. Again, if the the graphics files are put into the same directory as the TeX file, there are no warnings about missing graphics files, and the PDF file does have the appropriate graphics. This would imply that the \def\input line is ignored for some reason. So a) your XP installation works, mine doesn't b) my \def\input lines appear to be OK, but are ignored or incorrectly interpreted by pdflatex c) my Export-ed files don't have the \def\input line (don't know if this is as expected or not). Any thoughts, anyone? Bill Gordon
Re: problem with graphics in beamerlyxexample1.lyx
BigG writes: > > I have LyX 1.6.4 installed in cygwin on W2K, and LyXWindows 1.6.4 on W2K on > another box. When I > use beamerlyxexample1.lyx, warnings about missing graphics are generated. [...] > The PDF generated is fine, but missing the four knight images, and the ICSI > logo. This is what I > would expect. However, the relevant image files are actually there in the > same directory as > beamerlyxexample1.lyx. For example, > > $ ls -w 80 /usr/local/share/lyx/examples/beam* > /usr/local/share/lyx/examples/beamer-g4-mask.jpg* > /usr/local/share/lyx/examples/beamer-g4.jpg* > /usr/local/share/lyx/examples/beamer-icsi-logo.pdf* > /usr/local/share/lyx/examples/beamer-knight1-mask.png* > /usr/local/share/lyx/examples/beamer-knight1.png* > /usr/local/share/lyx/examples/beamer-knight2-mask.png* > /usr/local/share/lyx/examples/beamer-knight2.png* > /usr/local/share/lyx/examples/beamer-knight3-mask.png* > /usr/local/share/lyx/examples/beamer-knight3.png* > /usr/local/share/lyx/examples/beamer-knight4-mask.png* > /usr/local/share/lyx/examples/beamer-knight4.png* > /usr/local/share/lyx/examples/beamerlyxexample1.lyx* > > Why can't pdflatex find them? This is a known pgf bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1336165&group_id=92412&atid=600660 A patch has been proposed, but it has not still been applied: http://sourceforge.net/tracker/index.php?func=detail&aid=1447974&group_id=92412&atid=600662 -- Enrico
Re: problem with graphics in beamerlyxexample1.lyx
BigG wrote: I have LyX 1.6.4 installed in cygwin on W2K, and LyXWindows 1.6.4 on W2K on another box. When I use beamerlyxexample1.lyx, warnings about missing graphics are generated. The following are examples: Package pgf Warning: File "beamer-icsi-logo" not found when defining image "ics i-logo". (pgf)Tried all extensions in ".pdf:.jpg:.jpeg:.png:" on input l ine 49. Package pgf Warning: Missing height for image "icsi-logo" in draft mode. (pgf)Using 1cm instead on input line 49. Package pgf Warning: File "beamer-knight1-mask" not found when defining mask "k night1-mask". (pgf)Tried all extensions in ".pdf:.jpg:.jpeg:.png:" on input l ine 169. Package pgf Warning: File "beamer-knight1" not found when defining image "knigh t1". (pgf)Tried all extensions in ".pdf:.jpg:.jpeg:.png:" on input l ine 169. The PDF generated is fine, but missing the four knight images, and the ICSI logo. This is what I would expect. However, the relevant image files are actually there in the same directory as beamerlyxexample1.lyx. For example, $ ls -w 80 /usr/local/share/lyx/examples/beam* /usr/local/share/lyx/examples/beamer-g4-mask.jpg* /usr/local/share/lyx/examples/beamer-g4.jpg* /usr/local/share/lyx/examples/beamer-icsi-logo.pdf* /usr/local/share/lyx/examples/beamer-knight1-mask.png* /usr/local/share/lyx/examples/beamer-knight1.png* /usr/local/share/lyx/examples/beamer-knight2-mask.png* /usr/local/share/lyx/examples/beamer-knight2.png* /usr/local/share/lyx/examples/beamer-knight3-mask.png* /usr/local/share/lyx/examples/beamer-knight3.png* /usr/local/share/lyx/examples/beamer-knight4-mask.png* /usr/local/share/lyx/examples/beamer-knight4.png* /usr/local/share/lyx/examples/beamerlyxexample1.lyx* Why can't pdflatex find them? Bill Gordon Works fine on Win XP here. Is this occurring when you try View->PDF (pdflatex)? If so, here are a couple of things to try: 1. Try exporting a TeX file and running pdflatex against it manually. 2. Do View->PDF (pdflatex) and, while the PDF version is open, use a DOS window to navigate to your temp directory. (Tools -> Preferences -> Paths -> Temporary directory will point you to it if the location is not obvious.) You should see beamerlyxexample1.tex sitting there. Open it with any text viewer. About the third line should be a path command, something like \def\in...@path{{\string"C:/Program Files/LyX16/Resources/examples/\string"/}} (give or take). Check to make sure the path is correct. /Paul