fredrikekre/Literate.jl

How to create jupyter's raw type of cells?

newptcai opened this issue · 3 comments

In jupyter notebooks, you can create cells of raw type, where you can put whatever you want in it. I am using it to add some LaTeX code using this method, so I can control how a notebook looks like after turning it into PDF via LaTeX.

I wonder if there is a way to write LaTeX code directly a Literate.jl file and convert it to notebook raw cell?

That's not directly possible right now, since it looks like raw cells are a third cell type. Do you need to put "runtime" information there, or something static? You could probably inject it using a post process function in any case. For Literate.notebook that gives you the final notebook as a Dict, so you can do any and all modifications you need there.

Oh, I just need to inject some LaTeX code like \date{2022-03-03}. I will need them when I eventually convert notebooks to PDF. Can post process function do this?

Yes it can do anything you want, just write a function that takes a dict, and returns the modified dict and pass to Literate.notebook.