Georg Brandl avatar Georg Brandl committed 085eefc

Fix #68: invalid latex output for images with height set.

Comments (0)

Files changed (4)

 Release 0.5.1 (in development)
 ==============================
 
-* Fix a bug when including images in sources in subdirectories.
+* Fix LaTeX writer output for images with specified height.
+
+* Fix wrong generated image path when including images in sources
+  in subdirectories.
 
 * Fix the JavaScript search when html_copy_source is off.
 
-* Fix a bug in autodoc when documenting classes with the option.
-  ``autoclass_content = "both"`` set.
+* Fix an indentation problem in autodoc when documenting classes
+  with the option ``autoclass_content = "both"`` set.
 
 * Don't crash on empty index entries, only emit a warning.
 

sphinx/latexwriter.py

                 include_graphics_options.append('width=%s' % w)
         if attrs.has_key('height'):
             h = self.latex_image_length(attrs['height'])
-            include_graphics_options.append('height=%s' % h)
+            if h:
+                include_graphics_options.append('height=%s' % h)
         if attrs.has_key('align'):
             align_prepost = {
                 # By default latex aligns the top of an image.

tests/root/images.txt

 
 .. an image with path name (relative to this directory!)
 .. image:: subdir/img.png
+   :height: 100
+   :width: 200
 
 .. an image with unspecified extension
 .. image:: img.*

tests/test_build.py

 
 ENV_WARNINGS = """\
 WARNING: %(root)s/images.txt:9: Image file not readable: foo.png
-WARNING: %(root)s/images.txt:21: Nonlocal image URI found: http://www.python.org/logo.png
+WARNING: %(root)s/images.txt:23: Nonlocal image URI found: http://www.python.org/logo.png
 WARNING: %(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8' used for reading included \
 file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option
 """
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.