[PATCH] \includegraphics redefinition is broken in sphinx.sty

Leandro Lucarella avatarLeandro Lucarella created an issue

I noticed some problems when trying to include centered figures using raw latex for the figure but reST images (or images included using the graphviz extension), see http://groups.google.com/group/sphinx-dev/browse_thread/thread/2beb7aef4739f739/db445196c9e607bf for details.

I tracked down the problem and found out that is the sphinx.sty redefinition of the tex command \includegraphics:

% Redefine includgraphics for avoiding images larger than the screen size
% If the size is not specified.

    \ifdim \image@width>\linewidth%

If I comment that code in sphinx.sty, I get the expected results (the image centered in the figure). I don't know how useful is that redefinition, maybe it's doing more harm than good (maybe not, I barely know LaTeX =).

Attached is a pure-latex minimal example to reproduce the bug/solution, just run pdflatex test.tex (you need sphinx.sty and manual.cls) and see the results before and after commenting the offending code in sphinx.sty.

Comments (4)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.