4

I am programming a website on the subject of chemistry and for obvious reasons I also have to include structural and molecular formulas on that site. I want to have as few images as possible on the side and would therefore like to know how I can compile LaTeX code on my website, so I can show everything I could do in LaTeX itself. Thanks in advance.

Sam
  • 243
  • 5
  • 16
  • http://tex.stackexchange.com/questions/52722/can-you-make-chemical-structure-diagrams-in-latex Why not compiling images and then including them in a format you like? :) – MattAllegro Feb 18 '16 at 21:41
  • I want to be able to quickly change something, so it would be nice to have the code on our website. Additionally I'd like to style the code accordingly to the style of our website (font color etc). I could do this in pictures, but if we change something on the look of our page, we'd have to change every single picture... – Sam Feb 18 '16 at 22:19
  • Ok I got you. For what I know if you use - say - MathJax or similar, you may have limited capabilities in reproducing stuff from specific Latex packages. I'll search some more...you keep us up to date! – MattAllegro Feb 19 '16 at 06:25
  • 1
    I actually have MathJax installed, but as you said, this is linited to mathematical formulas. I can't integrate chemical packages :/ – Sam Feb 19 '16 at 09:15
  • 2
    At [Chemistry.SE](http://chemistry.stackexchange.com), we're using `mhchem` with MathJax to display reaction equations. – Klaus-Dieter Warzecha Feb 20 '16 at 08:08
  • Okay, thanks for the mhchem tip, that's pretty nice. But as Far as I see, I won't be able to draw organic molecules. Any ideas on that? – Sam Feb 21 '16 at 09:04
  • Do you have a WordPress blog? If yes you can use the [QuickLaTeX plugin](http://www.holoborodko.com/pavel/quicklatex/) and with it the full power of TeX Live (`chemfig`, `chemmacros`, `mhchem`, `chemformula`, …) – cgnieder Apr 12 '16 at 09:05

1 Answers1

3

As outlined in a previous comment, Chemistry.SE has enabled mhchem in MathJax to allow the rendering of simple formula and reaction equations. The MathJax documention actually gives some directions.

As far as structures of organic molecules are concerned, I'm usually draw them using BkChem and export them as the png images.

If I understand you correctly, you would like to avoid the images themselves and not just the act of drawing. Therefore, the idea to generate the drawings from a linear representation (InChi, SMILES) using openbabel will probably not convince you.

As a matter of fact, it is possible to create structure in LaTeX using chemfig and there have been requests to support this package in MathJax. However, it seems that so far, the strong dependance of chemfig on TikZ has prevented this.

Klaus-Dieter Warzecha
  • 2,265
  • 2
  • 27
  • 33