1

I am using Ipython Notebook and I would like to save the notebook as pdf. When a notebook contains html figures in markdown mode I cannot export them

In example:

<img src='http://draftingmanuals.tpub.com/14262/img/14262_140_2.jpg'>

represents the following:

enter image description here

However, when I download the notebook as PDF via LaTeX (pdf) the result is without the figure:

enter image description here

Is this a bug or can I avoid this somehow?

blaz
  • 4,108
  • 7
  • 29
  • 54

1 Answers1

2

This is not really a bug, but a known limitation. Actually there are two issues in your example:

  1. the raw html <img> tag gets stripped when the markdown cells are converted by pandoc to latex (see pandoc docu).
  2. you link to a remote image, which is (currently) not downloaded prior to the conversion.

Thus, it is a bit tricky to get what you desire. The first issue may be overcome by means of a custom filter and custom template. For the second, you may need a custom preprocessor.

Alternatively, you could use python with urllib (e.g. Downloading a picture via urllib and python) and matplotlib to display this image. Such embedded images are converted fine.

Community
  • 1
  • 1
Jakob
  • 19,815
  • 6
  • 75
  • 94