@@ -367,7 +367,7 @@ def remove_coding(text):
367
367
TEMPLATE = """
368
368
{{ source_code }}
369
369
370
- {{ only_html }}
370
+ .. only:: html
371
371
372
372
{% if source_link or (html_show_formats and not multi_image) %}
373
373
(
@@ -403,27 +403,15 @@ def remove_coding(text):
403
403
{{ caption }}
404
404
{% endfor %}
405
405
406
- {{ only_latex }}
406
+ .. only:: not html
407
407
408
408
{% for img in images %}
409
- {% if 'pdf' in img.formats -%}
410
- .. figure:: {{ build_dir }}/{{ img.basename }}.pdf
409
+ .. figure:: {{ build_dir }}/{{ img.basename }}.*
411
410
{% for option in options -%}
412
411
{{ option }}
413
412
{% endfor %}
414
413
415
414
{{ caption }}
416
- {% endif -%}
417
- {% endfor %}
418
-
419
- {{ only_texinfo }}
420
-
421
- {% for img in images %}
422
- .. image:: {{ build_dir }}/{{ img.basename }}.png
423
- {% for option in options -%}
424
- {{ option }}
425
- {% endfor %}
426
-
427
415
{% endfor %}
428
416
429
417
"""
@@ -794,10 +782,6 @@ def run(arguments, content, options, state_machine, state, lineno):
794
782
':%s: %s' % (key , val ) for key , val in options .items ()
795
783
if key in ('alt' , 'height' , 'width' , 'scale' , 'align' , 'class' )]
796
784
797
- only_html = ".. only:: html"
798
- only_latex = ".. only:: latex"
799
- only_texinfo = ".. only:: texinfo"
800
-
801
785
# Not-None src_link signals the need for a source link in the generated
802
786
# html
803
787
if j == 0 and config .plot_html_show_source_link :
@@ -811,9 +795,6 @@ def run(arguments, content, options, state_machine, state, lineno):
811
795
build_dir = build_dir_link ,
812
796
source_link = src_link ,
813
797
multi_image = len (images ) > 1 ,
814
- only_html = only_html ,
815
- only_latex = only_latex ,
816
- only_texinfo = only_texinfo ,
817
798
options = opts ,
818
799
images = images ,
819
800
source_code = source_code ,
0 commit comments