From: <mi...@us...> - 2013-09-02 15:44:17
|
Revision: 7718 http://sourceforge.net/p/docutils/code/7718 Author: milde Date: 2013-09-02 15:44:15 +0000 (Mon, 02 Sep 2013) Log Message: ----------- Fix [ 239 ] Latex writer glues paragraphs with figure floats. Modified Paths: -------------- trunk/docutils/HISTORY.txt trunk/docutils/docutils/writers/latex2e/__init__.py trunk/docutils/test/functional/expected/standalone_rst_latex.tex trunk/docutils/test/functional/expected/standalone_rst_xetex.tex Modified: trunk/docutils/HISTORY.txt =================================================================== --- trunk/docutils/HISTORY.txt 2013-08-21 22:01:21 UTC (rev 7717) +++ trunk/docutils/HISTORY.txt 2013-09-02 15:44:15 UTC (rev 7718) @@ -16,6 +16,10 @@ Changes Since 0.11 ================== +* docutils/writers/latex2e/__init__.py + + - Fix [ 239 ] Latex writer glues paragraphs with figure floats. + * docutils/writers/odf_odt/__init__.py - Apply patch by Jakub Wilk to fix bug [ 100 ]. Modified: trunk/docutils/docutils/writers/latex2e/__init__.py =================================================================== --- trunk/docutils/docutils/writers/latex2e/__init__.py 2013-08-21 22:01:21 UTC (rev 7717) +++ trunk/docutils/docutils/writers/latex2e/__init__.py 2013-09-02 15:44:15 UTC (rev 7718) @@ -2138,9 +2138,9 @@ # The LaTeX "figure" environment always uses the full textwidth, # so "outer alignment" is ignored. Just write a comment. # TODO: use the wrapfigure environment? - self.out.append('\\begin{figure} %% align = "%s"\n' % alignment) + self.out.append('\n\\begin{figure} %% align = "%s"\n' % alignment) else: - self.out.append('\\begin{figure}\n') + self.out.append('\n\\begin{figure}\n') if node.get('ids'): self.out += self.ids_to_labels(node) + ['\n'] Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex =================================================================== --- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2013-08-21 22:01:21 UTC (rev 7717) +++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2013-09-02 15:44:15 UTC (rev 7718) @@ -938,6 +938,7 @@ A \emph{figure} is an image with a caption and/or a legend. With page-based output media, figures might float to a different position if this helps the page layout. + \begin{figure} \noindent\makebox[\textwidth][c]{\includegraphics[width=258bp]{../../../docs/user/rst/images/title.png}} \caption{Plaintext markup syntax and parser system.} @@ -970,6 +971,7 @@ \end{figure} A left-aligned figure: + \begin{figure} % align = "left" \noindent\makebox[\textwidth][c]{\includegraphics[width=40px]{../../../docs/user/rst/images/biohazard.png}} \caption{This is the caption.} @@ -986,6 +988,7 @@ rendering software used. A centered figure: + \begin{figure} \noindent\makebox[\textwidth][c]{\includegraphics[width=40px]{../../../docs/user/rst/images/biohazard.png}} \caption{This is the caption.} @@ -1002,6 +1005,7 @@ rendering software used. A right-aligned figure: + \begin{figure} % align = "right" \noindent\makebox[\textwidth][c]{\includegraphics[width=40px]{../../../docs/user/rst/images/biohazard.png}} \caption{This is the caption.} @@ -2381,6 +2385,7 @@ \hline \end{longtable} \label{table-label} + \begin{figure} \phantomsection\label{figure-label} \noindent\makebox[\textwidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}} Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex =================================================================== --- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2013-08-21 22:01:21 UTC (rev 7717) +++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2013-09-02 15:44:15 UTC (rev 7718) @@ -937,6 +937,7 @@ A \emph{figure} is an image with a caption and/or a legend. With page-based output media, figures might float to a different position if this helps the page layout. + \begin{figure} \noindent\makebox[\textwidth][c]{\includegraphics[width=258bp]{../../../docs/user/rst/images/title.png}} \caption{Plaintext markup syntax and parser system.} @@ -969,6 +970,7 @@ \end{figure} A left-aligned figure: + \begin{figure} % align = "left" \noindent\makebox[\textwidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}} \caption{This is the caption.} @@ -985,6 +987,7 @@ rendering software used. A centered figure: + \begin{figure} \noindent\makebox[\textwidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}} \caption{This is the caption.} @@ -1001,6 +1004,7 @@ rendering software used. A right-aligned figure: + \begin{figure} % align = "right" \noindent\makebox[\textwidth][c]{\includegraphics[width=40\pdfpxdimen]{../../../docs/user/rst/images/biohazard.png}} \caption{This is the caption.} @@ -2149,6 +2153,7 @@ \hline \end{longtable} \label{table-label} + \begin{figure} \phantomsection\label{figure-label} \noindent\makebox[\textwidth][c]{\includegraphics{../../../docs/user/rst/images/biohazard.png}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |