Hi,
I just used ``.. figure::`` with the latex2e writer for the first time and
faced the problem, that in the output of pdflatex my figures were placed at
the bottom of the page (like footnotes).
I don't know if this is a general problem or if it's due to my personal
LaTeX (i.e. MiKTeX) installation. Anyhow, I fixed this by redefining
visit_figure and depart_figure in (my local version of) latex2e.py:
def visit_figure(self, node):
self.body.append( '\\begin{figure}[h]\\begin{center}\n' )
def depart_figure(self, node):
self.body.append( '\\end{center}\\end{figure}\n' )
The important change here is ``[h]`` in visit_figure, which tells LaTeX to
place the figure *here*. I put in the *center* stuff only because I usually
want figures to be centered on the page. (I am not a LaTeX-expert but the
caption seems to be centered by default. Thus, if the *center* stuff is
missing, the figure is aligned left and the caption is centered.)
I would be happy if the developers, who are responsible for the latex2e
writer, [#]_ could review the figure-part of their code accordingly and
check-in a fix with a similar result.
Best regards,
Gunnar.
.. [#] Hi Engelbert, you are doing a great job here :-))
|