Annotating lecture slides with an iPad and Sidecar, live and in recordings

I like to design my lectures around slides that can be annotated. When teaching standard organic chemistry courses, I leave lots of blank spaces (e.g., for mechanisms). This provides a bunch of advantages: it makes the students draw structures, which I think is important; it controls the pace of the lecture; and it substantially shortens lecture prep time by cutting down on all the ChemDraw.

Miami has installed smartboards in most of our lecture halls at this point, but I’ve never used them. I’m a bit too uncompromising as a Mac/Keynote user (this should work with PowerPoint too), and I’d much rather use an iPad. For years I used the Doceri app. This worked pretty well through many iterations of lecture classes, but I was never completely satisfied with Doceri; it does its job, but there were small nagging problems. For example, it has poor Apple Pencil support (at least as of a few years ago), and I never loved the way it would freeze the screen when you wanted to write something.

I spent a few years teaching mostly lab classes and put this sort of stuff aside. This spring, I was back to teaching second-semester sophomore organic chemistry and it seemed like a good time to revisit my options. I came up with a good working solution, then the COVID-19 outbreak hit and I had to move everything online. Fortunately, the same method works well for recording lectures and posting them to YouTube.

Continue reading

A personal article resolver in Python

A while back, I wrote a little post on my fondness for the Chemistry Reference Resolver. It is a wonderful tool for quickly accessing journal articles in a not-so-hyperlinked world, especially when used via an app launcher like Alfred. However, I would occasionally run into a journal that it didn’t connect to. I’m also often looking for little scripting projects, so I decided to put together a Python program that would replicate (some of) its behavior and could be run locally.

Continue reading

An improved filter for handling schemes, charts, and graphs in pandoc

About a year and a half ago, I wrote a series of pandoc filters designed to facilitate writing chemistry in pandoc. Specifically, I was looking to solve a few problems:

  • Not surprisingly, there is no native support for alternate figure types (schemes, charts, etc.) in pandoc.
  • Pandoc takes advantage of LaTeX’s native captioning. This has the side effect of adding labels (“Figure X”) to captions in LaTeX/pdf output, but not in other formats (e.g., html, Word). I always found this mildly irritating since the same markdown is rendered differently in different formats.
  • Pandoc doesn’t have native cross-referencing support (although I suspect that will change down the road).
  • Pandoc doesn’t natively support the “wordwrap” LaTeX package, so text does not flow around figures in LaTeX/pdf output. In principle, I don’t have a problem with this, but if you’re writing with a hard page limit it’s a huge problem.

The cross-referencing issue is a big one, and not surprisingly there are excellent filters already available that provide this functionality (e.g., pandoc-fignos, pandoc-numbering). However, for the specific combination of problems faced by a chemist trying to write reasonable looking chemistry, I didn’t find solutions that exactly met my needs.

Continue reading

Modular, simple vector diagrams of glassware

Recently, I was working on an exam for a lab course, and wanted to ask a few questions about basic reaction setups. I had a harder time putting together simple figures than I would have expected. ChemDraw has some half-decent options but they’re useless if you need something they don’t already have and, let’s face it, those 3D flasks with the little logos are just trying to hard. After a few frustrating hours, I gave up, and decided that it wouldn’t be so hard to throw together the basics on my own.

Continue reading

Alfred and the Chemistry Reference Resolver

We live in a strange time. Working at a small/medium-sized university, I can access almost any scientific article published in the 20th century without leaving my office chair. In principle, each of these articles is interconnected to the rest of the literature through unique citations, and yet the state of linking between these many documents is terrible. Even the most recently published articles tend to be shamefully isolated.

Continue reading

Visualizing molecular isosurfaces (MOs, etc.) in Blender

For all that I like using Blender as a tool to visualize molecular structures, there are obvious tradeoffs when using general-purpose software instead of something customized for chemistry. One of those tradeoffs is that there’s no obvious way to import various kinds of computational chemistry data.

For me, this is most often molecular orbitals, which we occasionally want to show in manuscripts. So, I started to think a bit about how to render isosurfaces in combination with imported geometries. I briefly considered trying to write something that processes cube files (from Gaussian), but quickly gave up. Instead, I’ve found that Jmol does the job wonderfully, and with minimal fuss.

Continue reading

Wrapping figures in pandoc pdfs

In general, I like to write my pandoc documents as close to the canonical format as possible and let LaTeX deal with positioning figures. It works pretty well, and it’s infinitely more straightforward than doing it in Word. However, LaTeX doesn’t natively wrap text around figures, and sometimes you really need to maximize the use of space. In pure LaTeX, this can be done with the wrapfig package. In pandoc, this package can be used through a template, but it’s a little tricky if you don’t want every figure treated the same way.

Continue reading

Automatically numbering figures, schemes, and charts in pandoc

Chemists may be unique in the number of different types of floats we use when writing. At a minimum Figures, Schemes, and Tables, and often Charts. Keeping track of all of these when writing can be a nuisance. I tend to write a lot and then revise heavily, especially when working on proposals. Inevitably the numbering gets screwed up after deleting or moving things around.

Continue reading

Pandoc filters for chemistry

One of the great things about pandoc is that it is very extensible through the use of filters. The best example of this is pandoc-citeproc, which is how references are processed in the native pandoc syntax. However, there are many other filters available, and they are fairly easy to write if you’re passingly familiar with any one of a number of different programming languages (although Haskell—pandoc’s native language—and Python appear to be most common).

As a chemist, this sort of extensibility is both tremendously useful and sometimes very necessary. There are, I’ve realized, some real idiosyncrasies to our writing (for example, our insistence on having at least two and sometimes three different categories of figures that are numbered separately). In LaTeX, these are taken care of with different packages, like mhchem. I like to use LaTeX for Supporting Info files and these sorts of packages are very useful. In pandoc, a lot of similar functionality can be added through short filters that are applied when the files are processed.

Continue reading