An automated workflow for scientific writing on Medium
How to upload Markdown files to Medium while maintaining tables, syntax highlighting, math typesetting, and footnotes.
Medium is an excellent platform for blogging and it has increasingly become a go-to source of knowledge on data science and other technical topics.
Unfortunately, though, the writing experience on Medium for scientific topics isn’t great: there’s no support for tables, code syntax highlighting, math typesetting, or footnotes — all pretty essential elements for many posts.
I’m not the first person to run into this issue, either. A few searches for keyword phrases like “medium math formula” demonstrate how widespread the issue really is:
- How to write mathematics on Medium, Writing Math (LaTeX) Formulas in Medium, and How to Embed Beautiful Math equations in Medium all describe multi-step workflows for including math typesetting. Essentially, you write your equations in other software, convert them to images, and then copy the images into your post.
- Undocumented Medium Formatting Tricks describes an even more convoluted process for including internally-linked footnotes: you have to inspect the HTML source of a post, copy
nameattributes, and then manually create each link.
- 5 Tips for Embedding Tables in Your Medium Posts and How to Share Beautiful Tables on your Medium Articles describe having to copy-and-paste tables into code blocks, include screenshots of your tables, or use third-party “embed” functionality.
While these are all useful articles in their own right, none of the proposed solutions were particularly appealing to me.
What if I want to write a typical Markdown post once and have it “just work” on Medium?
Well, now you can.
pb, an open-source CLI tool
pb is an open-source, command-line tool designed to facilitate a multi-platform, scientific publishing workflow.