nbconvert icon indicating copy to clipboard operation
nbconvert copied to clipboard

Bullet list not getting properly generated in PDF

Open zHaytam opened this issue 7 years ago • 5 comments

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!

zHaytam avatar Nov 18 '18 21:11 zHaytam

Trying adding an empty line before the list like:

Some text here:

 - Item 1.
 - Item 2.
 - Item 3.

t-makaro avatar Nov 19 '18 00:11 t-makaro

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

ert485 avatar Feb 04 '20 02:02 ert485

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.

t-vi avatar Mar 08 '21 20:03 t-vi

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

kraktus avatar Sep 14 '23 12:09 kraktus

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

douglas-raillard-arm avatar Sep 05 '24 10:09 douglas-raillard-arm