Sphinx placement to latex

I am trying to use Sphinx to create latex and HTML tutorials, but I am having problems placing shapes in latex. In Sphinx, my numbers look like this:

.. figure:: _images/somepicture.png
    :figwidth: 100 %
    :width: 100 %
    :align: center

    some caption

So, when it is written in HTML, the numbers cover the entire width of the page. It works great.

The problem arises in latex, where a typical figure in latex is written as:

\begin{figure}[htbp]
\centering

\includegraphics[width=1.000\linewidth]{reset.png}
\end{figure}

The problem is choosing the placement [htbp]. Since the images are \ linewidth in length, they are very large and end on the next page, and often often the text and numbers in the document are not saved in the output pdf file. I want to change [htbp] to [H].

conf.py "figure_align", , . http://sphinx.readthedocs.org/en/latest/config.html#options-for-latex-output

conf.py, :

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble':'',

#Figure placement within LaTeX paper NOT WORKING
'figure_align': 'H'

}

: , ?

+4
2

Pull, : https://bitbucket.org/birkenfeld/sphinx/pull-request/227/latex-allow-alternative-float-options-for/diff

, "figure_align" . .

, sphinx ( ), , 0.5 , , . 1.2.2, "figure_align" .

, sphinx, .

0

conf.py , , "H".

()

'figure_align': 'H',

sphinx-doc 1.4.6.

'figure_align' , 'htbp (, , , ). , , " , . , "H", , . Sphinx-doc latex_element.

+1

Source: https://habr.com/ru/post/1545071/


All Articles