Open
Description
Here's a sample code block and some result-block headers to create a figure:
#+name: plot_test
#+BEGIN_SRC jupyter-python :file junk.png :exports both :display image/png
import numpy as np
import matplotlib.pyplot as plt
plt.plot([1,2,3], [4,5,2])
#+END_SRC
#+name: sample_plot
#+caption: A sample plot
#+results: plot_test
When I execute the code block, the figure displays very nicely in my org
buffer, but when I export it to PDF (via LaTeX), although the graph shows up, it has no caption or figure number.
The problem seems to be that the resultant figure is enclosed in a :RESULTS: drawer. Here's the full results block after executing the code block:
#+name: sample_plot
#+caption: A sample plot
#+ATTR_LATEX: :float t :placement [htbp]
#+results: plot_test
:RESULTS:
[[file:junk.png]]
:END:
If I manually delete :RESULTS:
and :END:
, the figure exports with the desired caption.
What's the simplest way to get this to work as desired without manually deleting the :RESULTS:
drawer delimiters?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels