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:
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
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:
.
\documentclass{scrartcl}
\usepackage{carbohydrates}
\begin{document}
\glucose[model=haworth,chain]\quad
\glucose[model=fischer,chain]\quad
\glucose[model=chair,ring]
\end{document}
\usepackage{carbohydrates}
\begin{document}
\glucose[model=haworth,chain]\quad
\glucose[model=fischer,chain]\quad
\glucose[model=chair,ring]
\end{document}

\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}
% aldohexoses:
\newaldose \allose [hexose]{rrrr}
\newaldose \altrose [hexose]{lrrr}
\newaldose \glucose [hexose]{rlrr}
\newaldose \mannose [hexose]{llrr}
- 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 (?)
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
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 🙂