Re: Caching of graphics files
On Thu, Feb 12, 2026 at 05:16:45PM +, Michael Dean Pugh wrote: > This has been an issue for some time and I usually find a workaround, but > every time I have to remember how I did it. I have output from Mathematica > six identically sized .svg files which I want to put in a 2x3 table in LyX. > I insert the first graphic and then play with the size until it looks to be a > little less than 1/3 of the line width of the document. Armed with this > size, I then insert the other five graphs. These five are identically sized > but the first one is not--it is slightly too large. I've deleted it and > added it back. I deleted the files in the directory and regenerated them. I > even changed the name of the file. I deleted everything in the Cache > subdirectory. No go. I am 100% positive these plots are the same size, > having opened them in Inkscape to be certain. LyX must be caching something > somewhere, but I have no idea where. Does anyone know what is going on? 1) Can't you just set the exact size you want to see in the pdf input and set it the same for all figs in the table? You know about Graphics Groups feature, right? 2) Double check you claim that the files are really of the same size, I had similar problems when the svg file declared different margins etc. 3) Double check that you identified the right directory with cache. Does the cache regenerate when you relaunch lyx/pdf? Do you see new conversion happening? (If you really changed the filename this is not probably the problem). Pavel -- lyx-users mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-users
RE: Caching of graphics files
Mr. Obvious statements: 1) You are having trouble with the way svg's are being handled. 2) _One_ out of the _six_ is being handled different. 3) Same thing happens on any compile. My thought pattern is that something in your LyX file(s) is telling lyx to handle things that way. A) rename your .lyx file to something really new (i.e., ManThisTestHurts.lyx ) just to make sure you are not loading a 'same named' lyx file from some other directory without understanding that is happening. Then do a test compile of ManThisTestHurts.lyx . B) On Unix I would suggest using the following to gather a bit more information. grep -5 -i -e \.svg -e \.pdf -e "begin_inset Graphics" ManThisTestHurts.lyx I might go as far as exporting from lyx to latex and using the above grep on that latex file too. The options to grep are, -5=include 5 lines of context around any finds, -i=search case insensitive, -e=add another thing to search for IIRC the windows 'find' command can do something kind of like grep, but not nearly as easy. The point of the above is to see what lyx is being told to do. Also I expect that that output should be close to shareable without disclosing _too_ much content of your doc. Hopefully this adds clarity, but it is possible it will just dig us deeper in the "where does this hole end?". From: Michael Dean Pugh Sent: Friday, February 13, 2026 2:03 PM To: lyx-users Subject: Fw: Caching of graphics files I have spent the better part of two days now trying this and that. I do not want to retrace all of my steps here because it would be a long, time-consuming, and probably not-very-enlightening endeavor. This is what I am certain of: Every time I open this document in lyx and compile it, it creates a new temporary directory with a name similar to "lyx_tmpdir.jIaRmKTYJRBi" in the "...\AppData\Local\Temp" directory. It creates two sub directories called lyx_tmpbuf0 and lyx_tmpbuf1 and puts all relevant files (.aux, .bbl, etc) in the first of those. It also puts the six .svg files there along with the files that they are converted to before insertion in the final .tex document: one .pdf (the problem) and five .pngs. Now, I am absolutely certain that this is left over from when I first put that file in. I put it in as an .svg first. LyX threw a fit, so I re-output all six files as .pdfs from Mathematica and inserted the first as a .pdf. LyX still did not like it, but this time I was able to determine that it was the filename that LyX didn't like. I changed that and it worked. So, I thought, maybe it would have worked with the .svgs if I had used that filename structure. So I went back to the original plan and created six .svgs with new filenames. Put them in document-all six this time because by now I knew what size to use. Evidently, somewhere in here is where things went wrong. LyX converted that first file to a .pdf and the remaining five to .pngs. It is repeating this process every time I compile. If I find those files anywhere, I delete them, but to no avail: LyX just recreates them again on the next run. It is storing this conversion info somewhere, but I cannot find it. Under Tools->Preferences->File Handling->Converters, I have examined all of the SVG-> type converters. All of them have the Enable cache checkbox unchecked (I figure this is a path we do not need to investiate). I just need to know either (a) where LyX stores this info or (b) how to get LyX to forget it and start fresh. Either would work. _ From: Michael Dean Pugh mailto:[email protected]> > Sent: Thursday, February 12, 2026 12:38 PM To: lyx-users mailto:[email protected]> > Subject: Fw: Caching of graphics files Okay, here is something weird and definitely related. I regenerated the six files to a separate directory and inserted them in the LyX document as before. When I recompiled, the same thing happened. But in this new directory, .png files appeared for the five correctly sized plots with the same name as the .svg file. However, for the one oddball, a .pdf under the same name appeared instead of a .png. I know this is related to my earlier experiments. I just don't know how to start fresh. _ From: Michael Dean Pugh mailto:[email protected]> > Sent: Thursday, February 12, 2026 12:16 PM To: lyx-users mailto:[email protected]> > Subject: Caching of graphics files This has been an issue for some time and I usually find a workaround, but every time I have to remember how I did it. I have output from Mathematica six identically sized .svg files which I want to put in a 2x3 table in LyX. I insert the first graphic and then play with the size until it looks to be a little less than 1/3 of the line width of the document. Armed with this size, I then insert the other five graphs. These five are identically sized but the first one is not--it is slightly too large. I've deleted it and added it back. I deleted the
Re: Caching of graphics files
On my Macs LyX recognizes that I have rsvg-convert from https://en.wikipedia.org/wiki/Librsvg maybe that makes a difference? el On 2026/02/12 19:16, Michael Dean Pugh wrote: > This has been an issue for some time and I usually find a > workaround, but every time I have to remember how I did it. I have > output from Mathematica six identically sized .svg files which I > want to put in a 2x3 table in LyX. I insert the first graphic and > then play with the size until it looks to be a little less than 1/3 > of the line width of the document. Armed with this size, I then > insert the other five graphs. These five are identically sized but > the first one is not--it is slightly too large. I've deleted it and > added it back. I deleted the files in the directory and regenerated > them. I even changed the name of the file. I deleted everything in > the Cache subdirectory. No go. I am 100% positive these plots are > the same size, having opened them in Inkscape to be certain. LyX > must be caching something somewhere, but I have no idea where. Does > anyone know what is going on? > -- lyx-users mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-users
Re: Caching of graphics files
I can't answer your questions a and b because I don't rely on the LyX gui to generate PDFs. The reason I don't rely on the LyX gui is because back when I did, stuff like what you describe happened all the time. I'm not implying that these problems are intermittent or that your questions have no answer, I'm just saying they can get pretty complicated, which is why nobody has yet come up with an answer. What I do with all my books is use a generator script so *I* control where intermediate files go and *I* determine which files to delete and when. The following is one of my shellscripts to make a PDF: === #!/bin/sh ## tempfn=$1 cp -pf index_style.ist $tempfn.ist StyleFile=$tempfn.ist LyxCmd=lyx ### REMOVE ALL INTERMEDIATE FILES rm -f $tempfn.aux rm -f $tempfn.dvi rm -f $tempfn.ps rm -f $tempfn.pdf rm -f $tempfn.idx rm -f $tempfn.ilg rm -f $tempfn.ind rm -f $tempfn.log rm -f $tempfn.tex rm -f $tempfn.toc ### EXPORT TO LATEX AND COMPILE $LyxCmd --export latex $tempfn.lyx latex $tempfn.tex ### RUN makeindex TO CONSTRUCT INDEX INTERMEDIATE FILES if test -f $StyleFile; then makeindex -s $StyleFile $tempfn.idx else makeindex $tempfn.idx fi ### AT THIS POINT, MANUALLY INSPECT $tempfn.ilg FOR ERRORS. ### IF THERE ARE ERRORS, USE $tempfn.ilg AND $tempfn.ind TO ### TROUBLESHOOT THOSE ERRORS. DO NOT GO FARTHER UNTIL ### makeindex RUNS CLEANLY WITHOUT ERRORS. ### ONCE AGAIN COMPILE WITH LATEX TO INCORPORATE INDEXING FILES ### LATEX TWICE TO INCORPORATE ALL INDEX STUFF. ONCE IS NOT ENOUGH latex $tempfn.tex latex $tempfn.tex ### CHECK TO MAKE SURE THE PRECEDING COMPILE WORKED, ### IF NOT TROUBLESHOOT ### CONVERT TO PDF. CAREFUL, FOLLOWING LINE WRAPS IN EMAIL dvips -o $tempfn.ps $tempfn.dvi ps2pdf12 -dPDFSETTINGS=/prepress -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true $tempfn.ps ### VIEW THE RESULTS #xpdf $tempfn.pdf ## === The preceding is an older one: I use luatex and lualatex instead of latex these days, but you get the idea. I'm in charge of everything. With my methodology, the actual LyX/LaTeX compatible graphics files (pdf for instance), in their actual directories, are hard coded into the LyX file. All the graphical conversions, such as svg to pdf, are done in the shellscript, with the converted file going into the directory expected by the LyX file. This methodology takes a little work up front, but you're not constantly battling state issues, nor does everything go up in smoke with minor upgrades. By the way, I use one directory for each LyX file, for documents of any importance. This makes things much easier. If for some reason a given image or component must be used in several of my books, that's what hard links or symlinks are for. Windows and Mac must have something similar. My methodology isn't for everyone, but I find it a huge time saver. SteveT Steve Litt http://444domains.com Michael Dean Pugh said on Fri, 13 Feb 2026 19:02:42 + >I have spent the better part of two days now trying this and that. I >do not want to retrace all of my steps here because it would be a >long, time-consuming, and probably not-very-enlightening endeavor. >This is what I am certain of: Every time I open this document in lyx >and compile it, it creates a new temporary directory with a name >similar to "lyx_tmpdir.jIaRmKTYJRBi" in the "...\AppData\Local\Temp" >directory. It creates two sub directories called lyx_tmpbuf0 and >lyx_tmpbuf1 and puts all relevant files (.aux, .bbl, etc) in the first >of those. It also puts the six .svg files there along with the files >that they are converted to before insertion in the final .tex >document: one .pdf (the problem) and five .pngs. Now, I am absolutely >certain that this is left over from when I first put that file in. I >put it in as an .svg first. LyX threw a fit, so I re-output all six >files as .pdfs from Mathematica and inserted the first as a .pdf. LyX >still did not like it, but this time I was able to determine that it >was the filename that LyX didn't like. I changed that and it worked. >So, I thought, maybe it would have worked with the .svgs if I had used >that filename structure. So I went back to the original plan and >created six .svgs with new filenames. Put them in document—all six >this time because by now I knew what size to use. Evidently, >somewhere in here is where things went wrong. LyX converted that >first file to a .pdf and the remaining five to .pngs. It is repeating >this process every time I compile. If I find those files anywhere, I >delete them, but to no avail: LyX just recreates them again on the >next run. It is storing this conversion info somewhere, but I cannot >find it. Under Tools->Preferences->File Handling->Converters, I have >examined
Re: Caching of graphics files
Michael Dean Pugh said on Thu, 12 Feb 2026 17:16:45 + >This has been an issue for some time and I usually find a workaround, >but every time I have to remember how I did it. I have output from >Mathematica six identically sized .svg files which I want to put in a >2x3 table in LyX. I insert the first graphic and then play with the >size until it looks to be a little less than 1/3 of the line width of >the document. Armed with this size, I then insert the other five >graphs. These five are identically sized but the first one is not--it >is slightly too large. I've deleted it and added it back. I deleted >the files in the directory and regenerated them. I even changed the >name of the file. I deleted everything in the Cache subdirectory. No >go. I am 100% positive these plots are the same size, having opened >them in Inkscape to be certain. LyX must be caching something >somewhere, but I have no idea where. Does anyone know what is going >on? This is just an idea that popped into my head. SVG is pretty parsable. It's possible to make a Python program to: * Strip out the outer file information from each of the 6 Mathematica SVG files. * Put the first three in a group with lines between them. * Put the second three in a group with lines between them. * Put outer file information around the whole. I'm well aware that this is nothing like what you were asking about, but it's just a thought. SteveT Steve Litt http://444domains.com -- lyx-users mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-users
