Skip to content

matplotlib.sphinxext.plot_directive.py issue with ..image:: directive option passing for latex output.  #2928

@sanguineturtle

Description

@sanguineturtle

Issue:
plot_directive.py is not including possible ..image:: directive options (i.e. scale or align) when outputting to latex.

My Local Fix:
A partial fix is detailed below but it has one issue in that it will only parse one option through opts dictionary.

Details of Change:

{{ only_latex }}

   {% for img in images %}
       .. image:: {{ build_dir }}/{{ img.basename }}.pdf
   {% endfor %}

was updated to:

{{ only_latex }}

{% for img in images %}
       .. image:: {{ build_dir }}/{{ img.basename }}.pdf
      {%- for option in options %}
      {{ option }}
      {% endfor %}
{% endfor %}

Know Issue:
[1] Currently cannot specify more than one option as the parser introduces new lines in between each option when constructing the .. image:: directive environment. I don't see how opts works?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions