Open dabljues opened 4 years ago
So the report template uses the ipython style instead of the jupyter style at the top of the template. I'm not sure the history of that choice but you can easily change that by copying report.tplx
, changing line 4's style_ipython
to style_jupyter
, saving that as a new file (jupyter-report.tplx
) and referencing it as the template to use: --template=jupyter-report
. If there's difficulty finding the file you can do --TemplateExporter.template_file=/path/to/jupyter-report.tplx
.
In theory those templates look like they could have the style set via a config option, but I couldn't find how to set that. I suspect it was never fully implemented but I could be wrong.
@MSeal thank you, that fixed the code listings! I would like to ask another question. Cuz now the code listings are fine, but the output is just plain black on white and I guess I don't want that. I mean, on jupyter lab it's nicely coloured (e.g. red if it's an exception). Is there a way to somehow beautify it, or should I just stick with it?
@dabljues I'm fairly sure that we don't make any attempt to colour the output text. In theory, we could with a similar technique used for the code, but that would require some extra metadata for lexers that I don't know if we have.
@MSeal I don't think the cell style has a config option to change it. Only though the template.
As in the title, calling
ipython nbconvert --to pdf [...] --template report
removes the colored background from Python3 code cells. Going with a default template (soarticle
) works fine.ipython nbconvert --to pdf python_cheatsheet.ipynb --template report
article version: (
ipython nbconvert --to pdf python_cheatsheet.ipynb
)report version: (
ipython nbconvert --to pdf python_cheatsheet.ipynb --template report
)Is there any way to fix that?