@@ -357,7 +357,7 @@ def remove_coding(text):
357
357
TEMPLATE = """
358
358
{{ source_code }}
359
359
360
- {{ only_html }}
360
+ .. only:: html
361
361
362
362
{% if source_link or (html_show_formats and not multi_image) %}
363
363
(
@@ -393,27 +393,15 @@ def remove_coding(text):
393
393
{{ caption }}
394
394
{% endfor %}
395
395
396
- {{ only_latex }}
396
+ .. only:: not html
397
397
398
398
{% for img in images %}
399
- {% if 'pdf' in img.formats -%}
400
- .. figure:: {{ build_dir }}/{{ img.basename }}.pdf
399
+ .. figure:: {{ build_dir }}/{{ img.basename }}.*
401
400
{% for option in options -%}
402
401
{{ option }}
403
402
{% endfor %}
404
403
405
404
{{ caption }}
406
- {% endif -%}
407
- {% endfor %}
408
-
409
- {{ only_texinfo }}
410
-
411
- {% for img in images %}
412
- .. image:: {{ build_dir }}/{{ img.basename }}.png
413
- {% for option in options -%}
414
- {{ option }}
415
- {% endfor %}
416
-
417
405
{% endfor %}
418
406
419
407
"""
@@ -813,10 +801,6 @@ def run(arguments, content, options, state_machine, state, lineno):
813
801
':%s: %s' % (key , val ) for key , val in six .iteritems (options )
814
802
if key in ('alt' , 'height' , 'width' , 'scale' , 'align' , 'class' )]
815
803
816
- only_html = ".. only:: html"
817
- only_latex = ".. only:: latex"
818
- only_texinfo = ".. only:: texinfo"
819
-
820
804
# Not-None src_link signals the need for a source link in the generated
821
805
# html
822
806
if j == 0 and config .plot_html_show_source_link :
@@ -830,9 +814,6 @@ def run(arguments, content, options, state_machine, state, lineno):
830
814
build_dir = build_dir_link ,
831
815
source_link = src_link ,
832
816
multi_image = len (images ) > 1 ,
833
- only_html = only_html ,
834
- only_latex = only_latex ,
835
- only_texinfo = only_texinfo ,
836
817
options = opts ,
837
818
images = images ,
838
819
source_code = source_code ,
0 commit comments