html - ipython notebook converting to pdf with indent when starting a new paragraph -
i don't want indent, looks ugly , not same in notebook. when converting html, looks in notebook, when converting pdf, new paragraph indent tab width.
no indent
annoying indent when converting pdf
this current nbconvert 4.2.0. doesn't appear using official api seems reasonable expect change between versions. i'll explain process can worked out future versions too.
by default pdfs rendered through latex using article.tplx
template. found in <site-packages>\nbconvert\templates\latex
directory. bit covers markdown rendering in base.tplx
.
so, create new template extends article.tplx
, copy bit out of base.tplx
covers markdown rendering. in 4.2.0 started line ((* block markdowncell scoped *))
. add in couple of commands jakob suggests above , use template render pdf notebook.
the template file like:
((= line inherits built in template want use. =)) ((* extends 'article.tplx' *)) % markdown mod. copied base.tplx. parindent & parskip added. ((* block markdowncell scoped *)) \setlength{\parindent}{0cm} \setlength{\parskip}{3mm} ((( cell.source | citation2latex | strip_files_prefix | markdown2latex ))) ((* endblock markdowncell *))
you use custom template command:
jupyter nbconvert my_notebook.ipynb --to pdf --template my_fixed_indent.tplx
Comments
Post a Comment