mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Allow alternative float options for figure. See #1. no-pep8
This commit is contained in:
parent
74c7a52eca
commit
d82590927f
@ -1099,6 +1099,12 @@ These options influence LaTeX output.
|
||||
"Rejne". You can also set this to ``''`` to disable fncychap.
|
||||
``'preamble'``
|
||||
Additional preamble content, default empty.
|
||||
``'figure_align'``
|
||||
Latex figure float alignment, default 'htbp' (here, top, bottom, page).
|
||||
Whenever an image doesn't fit into the current page, it wil be
|
||||
'floated' into the next page but may be preceeded by any other text.
|
||||
If you don't like this behavior, use 'H' which will disable floating
|
||||
and position figures strictly in the order they appear in the source.
|
||||
``'footer'``
|
||||
Additional footer content (before the indices), default empty.
|
||||
|
||||
|
@ -236,6 +236,9 @@ latex_elements = {
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
|
@ -164,6 +164,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
'footer': '',
|
||||
'printindex': '\\printindex',
|
||||
'transition': '\n\n\\bigskip\\hrule{}\\bigskip\n\n',
|
||||
'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# sphinx specific document classes
|
||||
@ -1005,7 +1006,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
# TODO non vertical space for other alignments.
|
||||
align = '\\begin{flush%s}' % node.attributes['align']
|
||||
align_end = '\\end{flush%s}' % node.attributes['align']
|
||||
self.body.append('\\begin{figure}[htbp]%s\n' % align)
|
||||
self.body.append('\\begin{figure}[%s]%s\n' % (
|
||||
self.elements['figure_align'], align))
|
||||
if any(isinstance(child, nodes.caption) for child in node):
|
||||
self.body.append('\\capstart\n')
|
||||
self.context.append(ids + align_end + '\\end{figure}\n')
|
||||
|
Loading…
Reference in New Issue
Block a user