summaryrefslogtreecommitdiffstats
path: root/2021/talks/babel.md
blob: cd28d54b529eb1171b0fc07382205e7e80d69343 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[[!meta title="Babel for academics"]]
[[!meta copyright="Copyright © 2021 Asilata Bapat"]]
[[!inline pages="internal(2021/info/babel-nav)" raw="yes"]]

<!-- You can manually edit this file to update the abstract, add links, etc. --->

# Babel for academics
Asilata Bapat

[[!taglink CategoryOrgMode]]

[[!inline pages="internal(2021/info/babel-schedule)" raw="yes"]]

Plain org-mode is already an extremely powerful and
customisable tool for task and time management, note-taking, calendar
and agenda management, and much more. Babel takes org a step further
by letting you write, evaluate, and export code in different languages
from within a single file. In this talk, I will highlight some
features of babel that I find exciting and extremely useful,
particularly for an academic workflow.

Getting started with babel can be intimidating, but it's hard to stop
using it once you start. As an academic, I typically don't manage
large coding projects. My primary purpose is writing lecture notes,
assignments, and papers, and managing related admin. Typically, I want
to try and automate the boring portions of my workflow without extra
overhead. I also tend to find various tasks easier in some programming
languages and harder in others, and prefer to mix and match languages
as the task dictates. Babel makes this process seamless.

A basic use case is writing a document in org-mode and exporting it to
LaTeX or HTML. Org-mode even lets you write multiple documents in a
single org file, which can be convenient. Babel lets you add all sorts
of enhancements to the same file. For example, suppose we have a
single org document with all the problem sets for a course. Within
this single file, we could now:

-   draw pictures in ditaa, graphviz, or python instead of LaTeX,
-   use python to do complex calculations and then output the result as LaTeX,
-   define skeletons to quickly draw up assignment templates,
-   toggle exporting of assignments with or without solutions based on tags,
-   locally change export settings or run a post-export hook,
-   automatically export to LaTeX after saving,
-   tangle code blocks from some or all of the languages to external files.

I will try to showcase features of babel that academics could find
helpful, by presenting some ways in which I have tried to use babel. I
would also like to be inspired by other people's babel workflows!

# Links
- Course webpage: <https://asilata.github.io/ggm/2021/>
- Code: <https://github.com/asilata/emacsconf2021>
- Code (gitlab mirror): <https://gitlab.com/asilata/emacsconf2021>

# Discussion

IRC nick: asilata

Pad:

-   Q1: The talk was amazing thanks! I show the img inline in the Org
    file with org-toggle-inline-images, maybe useful to others too.
    -   A: Thanks! I do that if I want to look at previews, too, but
        sometimes it slows down my document. Any tips for that?
-   Q2: I always tried to use Tikz for showing diagrams in Org Mode
    documents, but dot code blocks definitively make drawing graphics
    easier! Thanks for sharing!
    -   Remark by Karl: In my personal workflows, I love the abstraction
        layer of <https://plantuml.com/>

From BBB:

- Don't have a question, just to say inspiring to see how you use org-mode + babel. Thx!
- Ha, a question, is your setup online somewhere?
- Asilata Bapat: <https://github.com/asilata/emacsconf2021>
- thanks so much for the presentation and sharing the details of your workflow
- I particularly appreciated your "causal use" of skel :D

IRC:

- the export-setup block is a great use case for orgstrap :)
  - asilata: I was just thinking that after the orgstrap presentation :)
- Man I was just wondering how to write LateX in Emacs this is incredible.
- I really liked the resulting LaTeX output file -- looked gorgeous :)
- Yeah seriously. I am pleasantly surprised. I think I'll have to switch over to using Emacs and LateX
- Theme: zenburn
- wait ... does elisp support unicode lambda like racket?
  - I mean... you can make it, but not out of the box.
    - asilata: I think it's just an org prettification
      - prettify-symbols-mode
- do you use latex preview in the org buffer too?
  - asilata: no, I usually don't, I find it slows down my system a bit.
- some very nice examples of wicked-cool org stuff there :)
- I also use python to generate latex from babel so that I don't mess things up

From [YouTube](https://www.youtube.com/watch?v=1Ooi4KAd2FM&feature=em-comments): 

- Cool talk! I suggest to export your diagrams to some vector format (PDF, SVG, etc.) if you (as you say) embed it in LaTeX/PDF later. Otherwise, you can see blur on a large enough scale. 


Links:

-   <https://asilata.github.io/ggm/2021/>
-   <https://github.com/asilata/emacsconf2021/>

# Speaker information
- Name pronunciation: /ˈəsɪʟət̪ɑ ˈbɑpəʈ/  UH-si-luh-tah BAH-putt
- Pronouns: she/her
- Homepage: <https://asilata.github.io>
- Email: <mailto:asilata.bapat@anu.edu.au>

[[!inline pages="internal(2021/captions/babel)" raw="yes"]]

[[!inline pages="internal(2021/info/babel-nav)" raw="yes"]]