chrisjsewell / ipypublish

A workflow for creating and editing publication ready scientific reports and presentations, from one or more Jupyter Notebooks, without leaving the browser!
http://ipypublish.readthedocs.io
BSD 3-Clause "New" or "Revised" License
224 stars 37 forks source link

Caption placed above and below cell #130

Open Benfeitas opened 4 years ago

Benfeitas commented 4 years ago

I am specifying captions as suggested in the docs: In a markdown cell I write down the caption, and edit its medata to show

{
  "ipub": {
    "caption": "fig:mylabel"
  }
}

Then I specify the metadata of the figure cell as

{
  "ipub": {
    "figure": {
      "width": 0.6,
      "widefigure": false,
      "caption": "",
      "label": "fig:mylabel",
      "placement": "H",
      "height": 0.4
    }
  }
}

I then convert the nb to html through:

nbpublish -lb -f html_ipypublish_main mynb.ipynb --pdf-debug --clear-files

however the caption appears above and below the figure once rendered to html. Any way to solve this? edit: interestingly, this only seems to happen with figures and not with tables. edit2: specifying the caption only in the metadata of the figure cell still shows caption both above and below the cell.

chrisjsewell commented 4 years ago

Hey @Benfeitas thanks for the feedback. I'm pretty busy at the moment 😦 so I might not be able to get round to looking at this super quick. Have you tried not putting the "caption" key in the metadata of the figure cell (just the markdown one)?

Benfeitas commented 4 years ago

Hi @chrisjsewell , thanks for coming back to me. Yes, so removing the "caption" key from the figure cell, and having it only in the markdown cell, unfortunately doesn't change anything. Actually, it seems to be linked only with the metadata of the figure cell, and removing the "caption" key from the figure cell simply removes any labeling of the figure.