DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:chem

This is an old revision of the document!


Chem Plugin

Compatible with DokuWiki

2009-12-25 or later, "Frusterick Manners"

plugin Format a molecular formula

Last updated on
2017-08-14
Provides
Syntax
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with chemistry, formula, science

This DokuWiki plugin formats a molecular formula easily.

Appearance C2H5O2-Na+
Without the plugin C<sub>2</sub>H<sub>5</sub>O<sub>2</sub><sup>-</sup>Na<sup>+</sup>
Using Chem plugin <chem>C2H5O2-Na+</chem>

The latest version supports to export Open Document format using ODT plugin.

Examples

C2H6

<chem>C2H6</chem>

Na2HPO4 12H2O

<chem>Na2HPO4 12H2O</chem>

C2H5O2-Na+

<chem>C2H5O2|-Na+</chem>    // | is a splitter.

Cl2H6N2Pt2+

<chem>Cl2H6N2Pt2+</chem>

Al2(SO4)3

<chem>Al2(SO4)3</chem>

another Version

The original plugin works very fine.

For those of you who have to write more chemical formulars and have some extra wishes like easier syntax, nuclid-number, and a nicer output in DokuWiki pages the following suggestion could help you.

Syntax:

92|235U3|2+

would appear as <html>23592<sub>32+</html>; the single numbers are optional so expressions like U2+, U2, 235U or 92|235U are recognized as well as all the brackets.

Unfortunately there are some limitations:

  • Due to many preg_matches the entering and leaving of DokuWiki editmenu takes quite long
  • :!: ODT-Support doesn't work - but that´s just due to a lack of regular expressions to get the formatting out. (May someone could give me a hand here)
  • :!: if you use ions and have multiple elements the shifting breaks as I just optimized it for one digit. (May someone could give me a hand here)
I'll work on it soon (in Apr, maybe ;-)iobataya 2010/04/04 22:23
I'd like to apply a new syntax for notation of isotopes in order to simplify either the DW syntax and the regular expressions.
  • Put on ^ before nucleons within a <chem> element. (→ superscript)
  • Put on _ before atomic number within a <chem> element. (→ subscript)
#EXAMPLE
^14_6C        (carbon-14)
^235_92U      (uranium-235)

What do you think ? — iobataya 2010/04/21 05:45

My server moved to new place. — iobataya 2010/12/06 22:50

Source code was moved to GitHub — iobataya 2013/01/20 15:39

SS 2015-12-13: Doesn't work all that well. A simple formula of calcium carbonate CaCO3 shows as CaCo3 (lower case oxygen)

plugin/chem.1503896919.txt.gz · Last modified: 2017-08-28 07:08 by LarsDW223

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki