Tldr
This page has notes about using Emacs for teaching in a university setting. I teach some computer science classes at UC Davis, these notes are informed by that experience. For now these are brief notes describing my setup and customizations that Iāve made.
Emacs
- My base Emacs is installed on MacOS using brew, I use the railwaycat emacs-mac package.
Spacemacs
- I started using the Spacemacs distro in Fall 2023, the same time that I started using Emacs
- Iām still using Spacemacs in Fall 2024.
- Iām not a huge fan of the package management
- I like the keybindings (I came to Emacs from Neovim and VSCode with Vim plugin)
Image-dired
- I just found out about image-dired.
- This is useful for browsing through figures and diagrams that Iāve saved.
- ImageMagick must be installed.
- This issue and solution applied.
(setq image-dired-cmd-create-thumbnail-program "/usr/local/bin/convert") ;; set the absolute path to the ImageMagick convert command
(setq image-dired-queue-active-limit 8) ;; set the number of images image-dired will attempt to convert at a time
(setq image-dired-debug t) ;; Display debugging messages
Org Mode
- I use Org Mode
- I use
org-tree-slide
- In the long term, I would like have one org buffer for each lecture
- I use
org-ref
for citations, recently triedcitar
- org-ref-export with citeproc t refproc t
Math Equations
- I use
org-latex-preview
. - I have some custom functions to automatically resize the preview images.
- I am not sure yet how to make one equation (of many on the same slide) larger than the rest.
Styling
- I copy-paste the same snippet of Local Variables that use face-remap-add-relative to adjust fonts and sizes for org faces.
Working with Images
- I make use of org-download-clipboard and org-download-screenshot to add images
- I can open images from the main Org buffer in a new buffer by moving point to the image and doing
RET
- However, the new buffer that pops open is usually small.
- I have
image-auto-resize
set tot
, this makes the image fit the window size. But the image doesnāt grow when I increase the size of the window. - Resizing and doing
M-x image-transform-fit-to-window
fixes the above problem. This is bound tos w
in my setup. Iād like to hook this ontoevil-window-set-width
so it happens automatically.
Alternating between PDFs and Org content
- For me, Org is the top-level structure, and I can detour to and return from PDFs by linking to them in the org buffer.
Publishing lecture notes
- I tried
ox-hugo
but had a hard time with setup, probably just wasnāt patient enough to understand the config. - I have a custom function that exports an org buffer to a markdown file plus images. I choose the markdown file path and images directory interactively on each export. Not the most efficient, but works ok for the time being.
Stability
- I have noticed intermittent stability issues with Emacs.
emacs-mac
is MUCH more responsive and MUCH less prone to crashing than mainline emacs on MacOS.- In some cases, I have noticed that
savehist-mode
seems to be the culprit.- Lag occurs at regular intervals
The approach from this page resulted in the following:
3692:(setq mu4e~headers-search-hist
3850:(setq mu4e--search-hist
18839:(setq command-history
131498:(setq eww-prompt-history
132242:(setq consult--find-history
From here it seems that mu4e--search-hist
and command-history
both result in large writes to the savehist
cache.
Other notes on stability:
Other text-based presentation frameworks
There are a variety of text-based presentation frameworks:
- For several classes in the 23-24 year, I mostly used Polylux for Typst
- Thereās Beamer for LaTeX, havenāt used it extensively
- Thereās also Reveal.js for HTML/JS (or Markdown ā HTML/JS)
- This year (24-25), Iāve experimented with org-tree-slide for Emacs Org-Mode
Notice that these all follow the (presentation framework) for (markup language) template.
Decision criteria include:
- what markup language do you want to write in?
- what markup language does the LLM want to write in?
Typst, being a new language, has worse LLM performance (circa Spring 2024, may have improved since). But it is equally powerful to LaTeX with superior syntax, builtins, and documentation in comparison to LaTeX (my opinion). Org-tree-slide is great, but might only make sense if you are already in the Emacs/Org ecosystem. Reveal was my first text-based presentation framework, maybe the easiest to get started in.