Re: lyx preview and bounding box
On Wed, Nov 14, 2012 at 10:25 PM, Stephen Buonopane sbuon...@bucknell.edu wrote: I am trying to debug a problem with the use of the clip to bounding box feature on pdf files. LyX seems to extract a different value of the bounding box then the media box that is defined in the pdf file. For example… Media Box = 0 0 612 792 LyX gets 0 0 481 628 If you then try to clip to some smaller value, the on screen lyx preview and the pdf output do not match (they show different parts of the image) making it impossible to crop correctly with just the lyx screen alone. My understanding is that on screen preview uses png files? What code does LyX use to do the file conversion? I checked the debug graphics output and I see a series of strings like /var/folders/t7/5jlv9y4m8xlf0r0059bn09v8gn/T/lyx_tmpdir.L59595/gconvert0.M59595.pdf which goes from pdf - ps - eps -png I wanted to take a look at the actual png file that lyx is using for on screen display, but the above file does not seem to exist on my computer…I have things like …t7/5jlv9y4m8xlf0r0059bn09v8gn/T/lyx_tmpdir.L59595/lyx_tmpbuf1 My instinct is it might have something to do with an assumption of 72dpi vs 92dpi, since the ratio of the media boxes 481/612 is about the same as 72/92. And some googling suggested that png files make some assumption about dpi. I am using Mac OSX 10.7.5 and LyX 2.0.4. This is a new problem that has cropped up since I switched to 10.7 and LyX2.0.4. (But I did both at the same time, so not sure what the root cause is) If anyone wants to give it a try, attached is the file. Try changing from y=0 to y=300 for example. It was generated with Print to PDF from excel, but I get the same problem from other sources as well (but it seems not from all pdf files). This works fine for me on Ubuntu (meaning my pdf output is the same as my LyX output). Attached is the .lyx file. If you want more output to analyze, use '-dbg graphics'. From what I understand, converted graphics are usually stored in your user-dir/cache folder, but I'm not sure if LyX uses a converter in this situation. I think Qt handles the pdf directly. Scott I would be happy to help provide more details, but I don't have the programming skill to actually fix the code. LyX is amazing and I have been using it for 15 years now! Wow! Steve BoundingBox.lyx Description: Binary data
Re: lyx preview and bounding box
On Nov 15, 2012, at 7:18 AM, Scott Kostyshak wrote: On Wed, Nov 14, 2012 at 10:25 PM, Stephen Buonopane sbuon...@bucknell.edu wrote: I am trying to debug a problem with the use of the clip to bounding box feature on pdf files. LyX seems to extract a different value of the bounding box then the media box that is defined in the pdf file. For example… Media Box = 0 0 612 792 LyX gets 0 0 481 628 If you then try to clip to some smaller value, the on screen lyx preview and the pdf output do not match (they show different parts of the image) making it impossible to crop correctly with just the lyx screen alone. My understanding is that on screen preview uses png files? What code does LyX use to do the file conversion? I checked the debug graphics output and I see a series of strings like /var/folders/t7/5jlv9y4m8xlf0r0059bn09v8gn/T/lyx_tmpdir.L59595/gconvert0.M59595.pdf which goes from pdf - ps - eps -png I wanted to take a look at the actual png file that lyx is using for on screen display, but the above file does not seem to exist on my computer…I have things like …t7/5jlv9y4m8xlf0r0059bn09v8gn/T/lyx_tmpdir.L59595/lyx_tmpbuf1 My instinct is it might have something to do with an assumption of 72dpi vs 92dpi, since the ratio of the media boxes 481/612 is about the same as 72/92. And some googling suggested that png files make some assumption about dpi. I am using Mac OSX 10.7.5 and LyX 2.0.4. This is a new problem that has cropped up since I switched to 10.7 and LyX2.0.4. (But I did both at the same time, so not sure what the root cause is) If anyone wants to give it a try, attached is the file. Try changing from y=0 to y=300 for example. It was generated with Print to PDF from excel, but I get the same problem from other sources as well (but it seems not from all pdf files). This works fine for me on Ubuntu (meaning my pdf output is the same as my LyX output). Attached is the .lyx file. If you want more output to analyze, use '-dbg graphics'. From what I understand, converted graphics are usually stored in your user-dir/cache folder, but I'm not sure if LyX uses a converter in this situation. I think Qt handles the pdf directly. Scott Thanks, Scott As I suspected this may be a Mac specific issue. Can any Mac developers tell me how LyX (or Qt?) displays the onscreen graphics and where the files are stored. In /var/lyx_tmpdir./lyx_tmpbuf#/* I see other temporary files like the actual latex code and even math preview png graphics, but for inserted graphics I see only the original pdf file. So maybe Qt is doing the cropping independent of Lyx? In any case, somehow LyX is getting the wrong bounding box from an external converter. Is it just ImageMagick convert doing the conversion? Steve
Re: Error with syctex=-1 and lib/doc/Additional.lyx
I figured it out. I'm running Fedora 16 which out of the box comes with a very outdated TeX and LaTeX installation (circa 2005 or so). Updated to TeXLive 2012 with the instructions on this page: http://fedoraproject.org/wiki/Features/TeXLive#TeX_Live_2012_2 Now it all works. On Mon, Nov 12, 2012 at 11:48 PM, Kayvan Sylvan kayvansyl...@gmail.comwrote: When trying to view (pdflatex, or ps2pdf) the output of lib/doc/Additional.lyx, I get the following error: ! Undefined control sequence. l.11 \synctex =-1 The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.
Re: lyx preview and bounding box
On Wed, Nov 14, 2012 at 10:25 PM, Stephen Buonopanewrote: > I am trying to debug a problem with the use of the "clip to bounding box" > feature on pdf files. > LyX seems to extract a different value of the bounding box then the media box > that is defined in the pdf file. > > For example… > Media Box = 0 0 612 792 > LyX gets 0 0 481 628 > > If you then try to clip to some smaller value, the on screen lyx preview and > the pdf output do not match (they show different parts of the image) making > it impossible to crop correctly with just the lyx screen alone. > > My understanding is that on screen preview uses png files? > What code does LyX use to do the file conversion? > > I checked the debug graphics output and I see a series of strings like > "/var/folders/t7/5jlv9y4m8xlf0r0059bn09v8gn/T/lyx_tmpdir.L59595/gconvert0.M59595.pdf" > which goes from pdf -> ps -> eps ->png > > I wanted to take a look at the actual png file that lyx is using for on > screen display, but the above file does not seem to exist on my computer…I > have things like > "…t7/5jlv9y4m8xlf0r0059bn09v8gn/T/lyx_tmpdir.L59595/lyx_tmpbuf1" > > My instinct is it might have something to do with an assumption of 72dpi vs > 92dpi, since the ratio of the media boxes 481/612 is about the same as 72/92. > And some googling suggested that png files make some assumption about dpi. > > I am using Mac OSX 10.7.5 and LyX 2.0.4. This is a new problem that has > cropped up since I switched to 10.7 and LyX2.0.4. (But I did both at the same > time, so not sure what the root cause is) > > If anyone wants to give it a try, attached is the file. Try changing from y=0 > to y=300 for example. > It was generated with Print to PDF from excel, but I get the same problem > from other sources as well (but it seems not from all pdf files). This works fine for me on Ubuntu (meaning my pdf output is the same as my LyX output). Attached is the .lyx file. If you want more output to analyze, use '-dbg graphics'. From what I understand, converted graphics are usually stored in your user-dir/cache folder, but I'm not sure if LyX uses a converter in this situation. I think Qt handles the pdf directly. Scott > > I would be happy to help provide more details, but I don't have the > programming skill to actually fix the code. > > LyX is amazing and I have been using it for 15 years now! Wow! > > Steve > BoundingBox.lyx Description: Binary data
Re: lyx preview and bounding box
On Nov 15, 2012, at 7:18 AM, Scott Kostyshak wrote: > On Wed, Nov 14, 2012 at 10:25 PM, Stephen Buonopane >wrote: >> I am trying to debug a problem with the use of the "clip to bounding box" >> feature on pdf files. >> LyX seems to extract a different value of the bounding box then the media >> box that is defined in the pdf file. >> >> For example… >> Media Box = 0 0 612 792 >> LyX gets 0 0 481 628 >> >> If you then try to clip to some smaller value, the on screen lyx preview and >> the pdf output do not match (they show different parts of the image) making >> it impossible to crop correctly with just the lyx screen alone. >> >> My understanding is that on screen preview uses png files? >> What code does LyX use to do the file conversion? >> >> I checked the debug graphics output and I see a series of strings like >> "/var/folders/t7/5jlv9y4m8xlf0r0059bn09v8gn/T/lyx_tmpdir.L59595/gconvert0.M59595.pdf" >> which goes from pdf -> ps -> eps ->png >> >> I wanted to take a look at the actual png file that lyx is using for on >> screen display, but the above file does not seem to exist on my computer…I >> have things like >> "…t7/5jlv9y4m8xlf0r0059bn09v8gn/T/lyx_tmpdir.L59595/lyx_tmpbuf1" >> >> My instinct is it might have something to do with an assumption of 72dpi vs >> 92dpi, since the ratio of the media boxes 481/612 is about the same as >> 72/92. And some googling suggested that png files make some assumption about >> dpi. >> >> I am using Mac OSX 10.7.5 and LyX 2.0.4. This is a new problem that has >> cropped up since I switched to 10.7 and LyX2.0.4. (But I did both at the >> same time, so not sure what the root cause is) >> >> If anyone wants to give it a try, attached is the file. Try changing from >> y=0 to y=300 for example. >> It was generated with Print to PDF from excel, but I get the same problem >> from other sources as well (but it seems not from all pdf files). > > This works fine for me on Ubuntu (meaning my pdf output is the same as > my LyX output). Attached is the .lyx file. > > If you want more output to analyze, use '-dbg graphics'. From what I > understand, converted graphics are usually stored in your > user-dir/cache folder, but I'm not sure if LyX uses a converter in > this situation. I think Qt handles the pdf directly. > > Scott Thanks, Scott As I suspected this may be a Mac specific issue. Can any Mac developers tell me how LyX (or Qt?) displays the onscreen graphics and where the files are stored. In /var/lyx_tmpdir./lyx_tmpbuf#/* I see other temporary files like the actual latex code and even math preview png graphics, but for inserted graphics I see only the original pdf file. So maybe Qt is doing the cropping independent of Lyx? In any case, somehow LyX is getting the wrong bounding box from an external converter. Is it just ImageMagick convert doing the conversion? Steve
Re: Error with syctex=-1 and lib/doc/Additional.lyx
I figured it out. I'm running Fedora 16 which out of the box comes with a very outdated TeX and LaTeX installation (circa 2005 or so). Updated to TeXLive 2012 with the instructions on this page: http://fedoraproject.org/wiki/Features/TeXLive#TeX_Live_2012_2 Now it all works. On Mon, Nov 12, 2012 at 11:48 PM, Kayvan Sylvanwrote: > When trying to view (pdflatex, or ps2pdf) the output of > lib/doc/Additional.lyx, I get the following error: > > ! Undefined control sequence. > l.11 \synctex > =-1 > The control sequence at the end of the top line > of your error message was never \def'ed. If you have > misspelled it (e.g., `\hobx'), type `I' and the correct > spelling (e.g., `I\hbox'). Otherwise just continue, > and I'll forget about whatever was undefined. > > >