3 ms·
Currently finishing up my own PhD thesis. My approach to the same problem is quite different. I write my thesis in Org mode. Exporting to HTML is pretty painles
by V1ndaar 4y ago
Currently finishing up my own PhD thesis. My approach to the same problem is quite different. I write my thesis in Org mode. Exporting to HTML is pretty painless. Been doing the same for years for my notes. PDF export via LaTeX & HTML export. LaTeX and PDFs fail pretty hard when including source code (some literate programming in Org). That was my initial motivation behind also producing HTML.
The final thesis that I will hand in is of course a regular PDF (well, a print based on that). But the HTML version can contain lots more stuff that doesn't fit (and belong) into the actual paper thesis, e.g. code snippets to generate plots etc. (optional export of Org subsections). By publishing the git repository of the thesis, linking all code and data + a bit of work -> full reproducible thesis.
- hoosieree 4y agoHeh, I also write papers in org and am currently writing my dissertation in org. Source code is always a pain to export for PDF, especially when switching from 1 to 2 column layout depending on the publication. My blog is written in org too, but I post-process to make it fit in with the rest of my static site. At some point maybe I'll get enough free time to swap out my makefile setup for org-publish, but if it ain't broke... To anyone who'll listen I advocate for org-mode as a better alternative to Jupyter notebooks, Markdown, and LaTeX. It's in some ways the antithesis to "do one thing well". If you try to do N things well while adhering to the unix philosophy you end up learning N different tools. But org-mode is one tool that does N things well, and some of the things you learn doing thing N transfer to thing N+1, so you get economies of scale.
- taink 4y agoHow do you plot graphs with org? I've been trying to use it for that purpose but I can't wrap my head around how to do it without some tikz incantation I don't really understand. I've seen gnuplot mentioned here and there but the setup seems pretty involved. I'm looking for a way to plot simple numeric data signals in time series, which are pretty trivial in jupyter notebooks.
- V1ndaar 4y agoWell, personally as I write almost all my code in Nim and am the developer of ggplotnim [0], I simply write a source code snippet with some short Nim code, generate a plot and dump the filename into the Org file. If I had more time and wanted something more convenient and magical, I would probably write a elisp function that takes X Y (Z) columns and generates a plot from those using a simple Nim program in the back that receives the data, generates the plot and returns it somehow. Haven't given this much thought though. [0]: https://github.com/Vindaar/ggplotnim https://github.com/Vindaar/ggplotnim
- hoosieree 4y agoI mostly use matplotlib+seaborn in a python code block, and tell matplotlib to write pdf output. Then I'll include the pdf with a link. Here's a sketch: # first run this code block: #+begin_src python # some code to generate a plot at images/plot.pdf #+end_src # then put the image where you want it: #+CAPTION: Some plot or other #+NAME: fig:asdfhjkl #+ATTR_LATEX: :width 0.7\textwidth [[file:./images/plot.pdf]] You can put some incantation on the top of your .org file to make it run all the code blocks before exporting, but I usually just run them manually if I need to make a change to a figure. Here's a full example from one of my papers. You can see I made quite a few revisions with all the commented-out lines. Note the :results none :exports none arguments to the org-babel code block, which makes the code itself invisible in the resulting paper. #+begin_src python :results none :exports none import matplotlib.pyplot as plt import seaborn as sns def get_loss(filename): loss = [] with open(filename) as f: for line in f: loss.append(float(line.split(' = ')[-1])) return loss data = {} # data['NLP (P=0.1)'] = get_loss( '../sample-programs/loss-epochs-nlp-0.1-30.txt') # data['NLP (P=0.2)'] = get_loss( '../sample-programs/loss-epochs-nlp-0.2-30.txt') # data['NLP (P=0.4)'] = get_loss( '../sample-programs/loss-epochs-nlp-0.4-30.txt') # data['NLP (P=0.8)'] = get_loss( '../sample-programs/loss-epochs-nlp-0.8-30.txt') data['NLP (P=0.1)'] = get_loss( '../sample-programs/loss-epochs-both-0.1-30.txt') data['NLP (P=0.2)'] = get_loss( '../sample-programs/loss-epochs-both-0.2-30.txt') data['NLP (P=0.4)'] = get_loss( '../sample-programs/loss-epochs-both-0.4-30.txt') # data['NLP (P=0.8)'] = get_loss( '../sample-programs/loss-epochs-both-0.8-30.txt') data['Plain'] = get_loss( '../sample-programs/loss-epochs-30.txt') sns.lineplot(data=data, palette='deep') # TODO add plots for combined Plain+NLP at other probabilities plt.xlabel('Epoch') plt.ylabel('Loss') plt.legend() filename = 'images/loss-plot.pdf' plt.savefig(filename) return filename #+end_src #+CAPTION: Training loss for data augmentation #+LABEL: fig:loss #+ATTR_LATEX: :width 0.5\textwidth #+RESULTS: fig:loss [[file:./images/loss-plot.pdf]]
- janeway 4y agoIMO, the pdf version should contain the exact information that any other format might contain. Which version is the thesis and is everything contained. Anything else is just for your own interest. But your approach sounds great. Good luck!