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:
[cce lang=”latex”]\documentclass{scrartcl}
\usepackage{carbohydrates}
\begin{document}
\glucose[model=haworth,chain]\quad
\glucose[model=fischer,chain]\quad
\glucose[model=chair,ring]
\end{document}[/cce]
which gives:
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 [cce inline=”true” lang=”latex”]\glucose[/cce]), and so on
Since I added them by using lines like the following ones
[cce lang=”latex”]% predefined carbohydrates:
% aldohexoses:
\newaldose \allose [hexose]{rrrr}
\newaldose \altrose [hexose]{lrrr}
\newaldose \glucose [hexose]{rlrr}
\newaldose \mannose [hexose]{llrr}[/cce]
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 (?)
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.
This seems very promising, I’ll try it. Thanks for sharing your work 🙂