Rubber doesn't successfully convert graphics when subfile package is used

Bug #633661 reported by Andy Pascall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rubber
Confirmed
Wishlist
Unassigned

Bug Description

I generally keep my graphics in fig or svg files when I write LaTeX documents. I rely on Rubber to automatically convert those files to eps or pdf when I compile the document.

When using the "subfile" package with a document, Rubber does not successfully catch and convert the graphics included in the subfiles. See the attached file as a test case.

Revision history for this message
Andy Pascall (apascall) wrote :
Revision history for this message
Andy Pascall (apascall) wrote :

After digging through rubber's code, I found that this was more of a feature request for a "subfiles" module than a bug.

I spend a few hours trying to hack one together (with my limited python skills). I got it to work with my real use case, but not the test case I provided.

Here is how it works:
Subfiles is both a latex package and a latex class. It works a lot like the combine package which already has a rubber module, so I based the module on that one.

The main difference between combine and subfiles, is that the subfile document inherits its preamble from the master document. This means that when I compile the subfile, I can call "\includegraphics" as long as I have "\usepackage{graphics}" in the preamble of the master. However, rubber doesn't know that the graphics package was declared, so it doesn't load the graphics module.

To get around this, when the subfiles module detects that it is being called from within a subfile, it adds a dependency on the master document. This seems to work, but it will also process all of the other graphics in other subfiles, which might be a problem for master documents with a lot of subfiles.

It seems the solution would be to just look at the master's preamble (and not read the rest of the document) and load the relevant modules from this. However, I don't know how to implement this.

Attached is the start of my module. It works fine for my use case, but for the example I provided it crashes on the "del self.doc.hooks["end{document}"]" statement. If I remove that statement, then in my real use case, it will only process my first subfile statement. I can't figure out the difference between the real case and the test case.

Any help would be appreciated!

Changed in rubber:
status: New → Confirmed
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.