News for hackers. Stuff that matters.
Re:The new Jupyter Book by abhishekjha on Wednesday August 12, 2020 @08:35PM (#24138781)
>I've done this to directly generate branded PDF reports via latex.

Can you elaborate on this a little? Do you mean via Jupyter notebooks?

Re:The new Jupyter Book by setgree on Thursday August 13, 2020 @06:53AM (#24141949)
Here's an example where nbconverts a notebook and a template into a formatted tex file, and then a journal-ready PDF:

https://codeocean.com/capsule/9155944/tree/v1

The nbconvert syntax is

  jupyter nbconvert --exec --to latex --template ieee.tplx --output ../results/editorial.tex editorial.ipynb
and then `pdflatex` converts the tex file to a PDF
Re:The new Jupyter Book by heisenzombie on Wednesday August 12, 2020 @10:34PM (#24139398)
Yes, via Jupyter notebooks -- using the same machinery that gives the 'File > Export Notebook As...' functionality.

My method is roughly this:

1. Create a Python package that subclasses nbconvert.exporters.LatexExporter -- in the setup.py you register the class to 'nbconvert.exporters' in the 'entry_points' dict.

2. You can do general filtering/compiling by registering 'Exporter.filters'. The compile process can be modified by implementing a custom 'from_notebook_node()'

3. You can include a folder containing jinja template(s) in the package to implement whatever styling you want

4. I have some standard metadata that I pull from the notebook/cell metadata (using the standard Jupyter/lab frontend metadata sidebar) to define things like document titles, authors, etc.

5. Do the conversion like: jupyter nbconvert --to=myfancyexportformat notebook.ipynb

Re:The new Jupyter Book by carreau on Thursday August 13, 2020 @01:01AM (#24140092)
Wow someone use the features I wrote years ago ! <3 You might want to submit a blog post to Jupyter.org to show that this is possible and make it more known.
Re:The new Jupyter Book by heisenzombie on Thursday August 13, 2020 @04:20AM (#24141106)
That work you did those years ago made me a hero at work :) Thanks!
Re:The new Jupyter Book by carreau on Friday August 14, 2020 @12:10PM (#24159764)
Never had the opportunity to really document it, so thinks for finding it; I would have hoped for a much wider variety of exporter to be published. I'm still happy about the "pip install package" --to=qualname. I thin you can hardly make it simpler.