LyX and Jupyter notebooks (request for comments)

José Matos jaomatos at gmail.com
Fri Jul 12 22:29:51 UTC 2024


Hi,
  this is a topic that I have heard here several times.

I have been playing with Jupyter a lot for the last years to the point
where I am using meta-data and customized templates prettify the pdf
generated from the jupyter notebooks (using koma-script and a toc, for
example).

Before working on this for LyX I would like to ask you what is your use
case and what would like to see in LyX to support Jupyter notebooks.


Essentially there are two main choices:

* use the Jupyter notebook and treat it like an external file;
* work as some sort of frontend to a jupyter server.


The reason why I am asking this feedback is because I saw several ways
to work that user have to deal with it. Example of options are:

* execute the notebook before importing it;
* exclude markup and just import code cells;
* import everything;
* blah, blah (read it as etc).

Given this preamble/rationale what would you like to see?


By the way since this is the development mailing list this is a
technical analysis of the possible implementations:

The first approach is to use templates to customize the output.
FWIW such as it is I am able to get just the document body surrounded
by a \begin{document} and \end{document}.
I have suppressed completely several blocks: document class; preamble;
maketitle, ...

If I am unable to get rid of the document environment it I will bring
python to fix this. :-D

The next step is to import the latex into lyx.


The other options is to program this directly into Python since
nbconvert is a Python package. :-)


A third more remote approach is to add a LyX backend, just as there are
the html and latex, to nbconvert. In a sense this is similar to write a
layout files with lots of inclusions of inclusions.


Best regards and thanks for all the fish... sorry feedback. :-D

-- 
José Abílio


More information about the lyx-devel mailing list