jupyter / nbconvert

Jupyter Notebook Conversion
https://nbconvert.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.74k stars 569 forks source link

Bullet list not getting properly generated in PDF #917

Open zHaytam opened 5 years ago

zHaytam commented 5 years ago

Hello,

My jupyter notebook contains a markdown with a bullet list:

Some text here:
 - Item 1.
 - Item 2.
 - Item 3.

When I generate the PDF using jupyter-nbconvert jn.ipynb --to pdf, the result is:

Some text here: - Item 1. - Item 2. - Item 3.

Is there are way for nbconvert to correctly generate a nice bullet list? Thank you!

t-makaro commented 5 years ago

Trying adding an empty line before the list like:

Some text here:

 - Item 1.
 - Item 2.
 - Item 3.
ert485 commented 4 years ago

I experienced this as well. Adding the empty line made it format better.

It also affects the > in markdown, and even with this fix: now it's on its own line, but is the same as any paragraph (markdown has a grey bar on the indent).

Its possible that's an inherent difference in normal markdown and latex's style, but any difference in the appearance (vs directly dowload as html->print to pdf) is undesirable to some degree

t-vi commented 3 years ago

This isn't PDF-specific. I'm using nbsphinx and it seems like the conversion to HTML (though rst?) has the same effect. Similarly it seems that the Python markdown package doesn't like lists starting without an empty line before. So it seems that there is a discrepancy between "Jupyter Markdown" and expectations of other tools.

kraktus commented 1 year ago

Note that this is an issue with pandoc, created an issue: https://github.com/jgm/pandoc/issues/9079

douglas-raillard-arm commented 2 months ago

I also experienced that on HTML output. It seems that pandoc has a setting to recognize bullet lists without a preceding blank line, maybe nbconvert should make use of it ? https://github.com/jgm/pandoc/issues/9079#issuecomment-1719850251

EDIT: Tested with that extension and it fixes the issue, I'll spin a PR next week