sje30 / catam-julia

CATAM material in Julia
http://sje30.github.io/catam-julia
MIT License
21 stars 8 forks source link

Format for case studies #5

Closed jmbyrne closed 3 years ago

jmbyrne commented 3 years ago

Here are some options for formats that case studies can be written in;

Pluto

Whether we choose between them on a case (study) by case (study) basis or pick one or two to use for everything I don't know. We should probably also create quick templates/style guides for those that we will use for consistency

sje30 commented 3 years ago

Have you seen the following:

  1. https://github.com/JunoLab/Weave.jl
  2. https://jupytext.readthedocs.io/en/latest/

Weave allows you to mix Julia code and markdown, and export to various formats (including pdf via latex).

Jupytext is what I've used recently to convert raw .jl files to Jupyter notebooks, which are then convertd to pdf. So, this relies on the notebook technology really.

Both are non-interactive.

jmbyrne commented 3 years ago

These look promising, particularly Weave. They do have the limitation that is inevitable for notebook-style formats where the inherent meaningfulness of code means that I can't use incomplete code in the case study. For example, a long function may be useful to split up into several sections to explain them more in detail, but then the code won't function because you can't split a block of code over multiple blocks in the notebook.

jmbyrne commented 3 years ago

I should have an example of this written by this afternoon for a short case study that I'm writing up in Google Docs at the moment. For this case study at least, Google Docs seems to work well, although we'll probably have to discuss this later with more complicated case studies and with Valentin next week

jmbyrne commented 3 years ago

A case study is up now. I have got outputs in HTML and PDF style, we'll have to decide which of those is best

jmbyrne commented 3 years ago

Contrary to what I said on Friday, I thought I'd give Pluto another go since I realised it might not be as problematic as I once thought. image Here is some Julia code in Pluto in three different forms

If we decide that either of the first two options would be usable in case studies then that fixes my major gripe with using Pluto, and so I would suggest that we go with it for all case studies unless further problems crop up

jmbyrne commented 3 years ago

The latest case study that I've put up is Modelling infectious diseases. It is written in Pluto entirely, with the incomplete code problem solved by using blocks of the form

md"""
```julia
<julia-code>
```
"""

This form leaves code in clearly distinct blocks but keeps syntax formatting. In my opinion this leaves the only major problem with Pluto as the bad PDF output, but since we're using HTML output (which is good), then I think Pluto should be usable as standard.

sje30 commented 3 years ago

super. pdf is not important, as long as the HTML looks good (which this does).

sje30 commented 3 years ago

Shall we close this now, and stick to Pluto for the rest of the summer?

@jmb280cam @valentin-imbach

jmbyrne commented 3 years ago

I'm happy to

valentin-imbach commented 3 years ago

Yes, that works for me as well

On 3 Aug 2021, at 22:07, jmb280cam @.***> wrote:

 I'm happy to

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.