![]() ![]() (raw LaTeX is ignored in these other formats). ![]() This works just fine if you’re only interested in output to pdf/LaTeX, but it’s a terrible approach because it means you could never translate the document to Word, html, etc. In LaTeX, the mhchem package allows one to simple write \ce”). These are both very awkward to type, and more importantly they just look terrible and are hard to read. For example, butanol comes out like this: CH~3~CH~2~CH~2~CH~2~OH, and sulfate is SO~4~^2-^. The basic issue is this: pandoc’s support of sub/superscripts means that writing chemistry is very possible, but the raw markdown can look a bit awkward. ![]() I’ve put this up as a Github repo, although there’s not a whole lot to it. Here’s the first one: pandoc-chem-struct. ![]() In the next few posts, I’ll outline a few examples of short little filters I’ve recently put together to smooth the path for writing chemistry in pandoc. In pandoc, a lot of similar functionality can be added through short filters that are applied when the files are processed. I like to use LaTeX for Supporting Info files and these sorts of packages are very useful. In LaTeX, these are taken care of with different packages, like mhchem. 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). 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).Īs a chemist, this sort of extensibility is both tremendously useful and sometimes very necessary. The best example of this is pandoc-citeproc, which is how references are processed in the native pandoc syntax. One of the great things about pandoc is that it is very extensible through the use of filters. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |