Literate.jl icon indicating copy to clipboard operation
Literate.jl copied to clipboard

How to create jupyter's raw type of cells?

Open newptcai opened this issue 3 years ago • 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?

newptcai avatar Mar 03 '22 01:03 newptcai

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.

fredrikekre avatar Mar 03 '22 08:03 fredrikekre

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?

newptcai avatar Mar 03 '22 11:03 newptcai

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.

fredrikekre avatar Mar 03 '22 11:03 fredrikekre