Carbohydrates

Since a few weeks I’m working on a package using chemfig as a backend that allows a simple yet flexible input syntax for typesetting carbohydrates. My draft at this point allows the following:

\documentclass{scrartcl}
\usepackage{carbohydrates}
\begin{document}

\glucose[model=haworth,chain]\quad
\glucose[model=fischer,chain]\quad
\glucose[model=chair,ring]

\end{document
}

which gives:

cbh1

Now, this is quite nice so far. I have implemented all common aldoses, from trioses to hexoses, the models “fischer” (two versions), “haworth” (only pentoses and higher) and “chair” (only hexoses), possibilities for setting up the default appearance (when only using \glucose), and so on

Since I added them by using lines like the following ones

% predefined carbohydrates:
% aldohexoses:
\newaldose \allose   [hexose]{rrrr}
\newaldose \altrose  [hexose]{lrrr}
\newaldose \glucose  [hexose]{rlrr}
\newaldose \mannose  [hexose]{llrr
}

you see that I have want to have flexibility for adding more molecules as a user.

But I also still have a TODO list that I need to work on:

  • ring forms of L-saccharides
  • options for using colors for highlighting certain parts of a molecule
  • ketoses (only fructose?)
  • options for printing oxidized and reduced forms (?)

But before I proceed I’d like to have feedback on functionality of the package, usefulness (would you actually want to use the package?), missing features/other things for my TODO list (hopefully not too many).

If you want to contribute/give me feedback then you can get the package draft on its github page:

github.com/cgnieder/carbohydrates

There is currently no manual so you may need to figure out the options and commands yourself. But I’ve added the test file I used (test.tex) to the repository which might give you some hints.

You can contact me here in this blog using the comment form below. Better would be to use the issue tracker on the github site or emailing me at

contact@mychemistry.eu

.

2 Comments

  1. This would be a nice inclusion. I’d love to use it straight instead like now I’ve to code, make submol and so on. I don’t know if its possible but we use to have the cyclic structure of Glucose etc in the Fischer Projection. I hope you can find way to implement that too. By the way, I still couldn’t do it with chemfig too.

Leave a Reply

Your email address will not be published. Required fields are marked *