What workflow would you suggest to support pdf and multi-language notebook output from the same source? Or at least from a source written in a common language, e.g. markdown or similar.
My previous experience with this dates back a number of years before notebooks were popular and only worked with R: I used knitr with a markdown source to produce html and pdf output. Fast forward to today: I'd like to be able to support Julia, Python, and R and, if at all possible, output Jupyter or Pluto notebooks! :upside_down:
Context: I'm writing up an intro course in econometrics where students would be free to choose one of several languages: the department head wants me to use R, the previous instructor wants me to use Python, and I personally would like to have Julia as an option too! In my vision, I would have a markdown source and would produce beamer slides Jupyter/Pluto notebooks, with some degree of multi-language support. The code for each language would most likely be in separate files that would be sourced from one or several master file.
Your suggestion? :grinning:
So the requirement is a tool which can take Julia, Python and R and generate Beamer PDFs?
Due to the multiple languages, my guess would be that copy and pasting would be the most reliable and quickest way to do it. Or use the Jupyter presentation mode but I don’t know whether it does PDF
Nbconvert might be able to do it
Thanks for the feedback! :grinning:
So the part where I convert markdown to beamer shouldn't be too hard. I have only tried it with R
code and knitr
, but I've seen lots of examples of that in Python
and Julia
, e.g. Weave.jl
. I was initially thinking of having a master file that would conditionally include the code: running it three times would generate the three sets of slides. Where I have no direct experience is converting from markdown to notebooks. I was under the impression that Nbconvert
uses the notebook as a source to produce markdown and other formats, rather than the other way around, or does it go both ways?
On second thoughts and seeing your comments, I guess it's probably not a good idea to try to go for a true multiple-language approach and would be easier to just copy-paste around three distinct source files... In this case I would write language-neutral slides to discuss theory and have an "appendix" with slides that contains the code for each language.
When it comes to Julia
I'm guessing that Weave.jl
is the package to convert markdown to slides and notebooks, right?
Patrick Toche said:
Thanks for the feedback! :grinning:
So the part where I convert markdown to beamer shouldn't be too hard. I have only tried it with
R
code andknitr
, but I've seen lots of examples of that inPython
andJulia
, e.g.Weave.jl
. I was initially thinking of having a master file that would conditionally include the code: running it three times would generate the three sets of slides. Where I have no direct experience is converting from markdown to notebooks. I was under the impression thatNbconvert
uses the notebook as a source to produce markdown and other formats, rather than the other way around, or does it go both ways?On second thoughts and seeing your comments, I guess it's probably not a good idea to try to go for a true multiple-language approach and would be easier to just copy-paste around three distinct source files... In this case I would write language-neutral slides to discuss theory and have an "appendix" with slides that contains the code for each language.
When it comes to
Julia
I'm guessing thatWeave.jl
is the package to convert markdown to slides and notebooks, right?
Perhaps NotebookToLaTeX.jl
might help in terms of converting the notebook to Latex (for Julia). Currently the package exports to article
and book
formats. But you could change the generated latex file.
Davi Sales Barreira said:
Patrick Toche said:
Thanks for the feedback! :grinning:
So the part where I convert markdown to beamer shouldn't be too hard. I have only tried it with
R
code andknitr
, but I've seen lots of examples of that inPython
andJulia
, e.g.Weave.jl
. I was initially thinking of having a master file that would conditionally include the code: running it three times would generate the three sets of slides. Where I have no direct experience is converting from markdown to notebooks. I was under the impression thatNbconvert
uses the notebook as a source to produce markdown and other formats, rather than the other way around, or does it go both ways?On second thoughts and seeing your comments, I guess it's probably not a good idea to try to go for a true multiple-language approach and would be easier to just copy-paste around three distinct source files... In this case I would write language-neutral slides to discuss theory and have an "appendix" with slides that contains the code for each language.
When it comes to
Julia
I'm guessing thatWeave.jl
is the package to convert markdown to slides and notebooks, right?Perhaps
NotebookToLaTeX.jl
might help in terms of converting the notebook to Latex (for Julia). Currently the package exports toarticle
andbook
formats. But you could change the generated latex file.
Actually, it might even work for the other languages too if you are using Jupyter Notebooks. I think the only thing you'd need to change would be the language listing, which is set to return Julia
. But you could easily change for the other languages. :D
Thanks Davi, I'll look into it! :-)
you're the author! :tada:
Yep! haha. Let me know if it helps, and perhaps I can try to work a slide template.
Last updated: Nov 06 2024 at 04:40 UTC