Dokuwiki for science

Tabinclude プラグイン


{{tabinclude>start,*/chem_plugin,/pubmed_plugin|Plugin for PubMed}}

  • Symplus Wiki
  • Chem plugin
  • Plugin for PubMed

Chem plugin

This DokuWiki plugin formats a molecular formula by using 'chem' tag.


Appearance DokuWiki code memo
C2H6 <chem>C2H6</chem>
Na2HPO4 12H2O <chem>Na2HPO4 12H2O</chem>
Al2(SO4)3 <chem>Al2(SO4)3</chem> Using brackets
C2H5O2-Na+ <chem>C2H5O2|-Na+</chem> Inserted a pipe before a formal charge.
Cl2H6N2Pt2+ <chem>Cl2H6N2Pt2+</chem> Formal charge number before +/-.
[(C6H4)2]412+ <chem>[(C6H4)2]4|12+</chem> Using several combinations

Usage of seperation between atom-numbers and charge-numbers

Appearance code memo
SO42- <chem>SO4|2-</chem> Correctly formated
SO42- <chem>SO42-</chem> Needs a pipe between 4 and 2.
SO4 2- <chem>SO4 2-</chem> Undesired white space


You can install by using 'Manager Plugins' in Admin tools. Download URL is available at


  • 2013-01-20 Source code was moved to GitHub.
  • 2008-09-29 Supported the Open document format export using ODT plugin.
  • 2008-03-21 Seperator implementation and bracket support


Kibi's bug-fix

(Kibi posted bug-fix and made some extension for isotope expression in the previous system of DW. Since a 'discussion plugin' is not deployed in this current DW, I pasted his/her comment here. Thanks, Kibi — i.obataya 2009/11/11 19:17)

I've made some improvements to your plugin: now it can handle not only charge number of ion, but oxidation state: N-3, N-1, N0, N+1, N+3, H2+1S+6O3-2S-2

Fixed error with “+” in equation: 2H2 + O2 ⇒ 2H2O

Fixed error with alternative formulas like Anion2Cation3

Added support of isotope numbers: 238U, 2239Pu

All you need is replace function getChemFormat with that:

  function getChemFormat($raw){
    $pattern = array("/([A-Za-z\]\)]+)(0)/", "/[\|]?([0-9]*)[\^]/", "/([^ ][\]\)]?)[\|]?(([\-\+][0-9]*)|([0-9]*[\-\+]))/", "/([A-Z]|[a-z]|\)|\])([1-9][0-9]*)/");
    $replace = array("\${1}<sup>\${2}</sup>", "<sup>\${1}</sup>", "\${1}<sup>\${2}</sup>","\${1}<sub>\${2}</sub>");
    return preg_replace($pattern,$replace,$raw);

The examples ahead would be like this:

  • oxidation state: N-3, N-1, N0, N+1, N+3, H2+1S+6O3-2S-2
  • “+” in equation: 2H2 + O2 ⇒ 2H2O
  • alternative formulas like Anion2Cation3
  • isotope numbers: 238U, 2239Pu



{{tabinclude>page1,page2,page3, ...}}


最初のページが読み込み時に表示されます。読み込み時に表示されるページを指定したい場合は、「*」(アスタリスク)をページ名の前に付けます。 次の例ではpage2が表示されます。




{{tabinclude>page1|Top page,page2|Second page,page3,..}}


このタブコントロールは、jQueryを使用していますが、jQuery tab UIは使用していません。文字色や背景色はテンプレートで指定されたものに準拠するようになっています。テンプレートの配色は、lib/tpl/(テンプレート)/style.iniで指定されています。たとえば、この中の色を変えれば、テンプレート全体の色が変わり、タブコントロールの色も同様に変わります。タブコントロールだけ個別にスタイルを変えたい場合は、lib/plugins/tabinclude/style.cssを変更します。


  • dokuwiki/default
  • monobook
  • arctic
  • arctic-mbo
  • roundbox
  • vector

dokuwikiテンプレート使用時 roundboxテンプレート使用時

Installation & setting

You can install this plugin with standard method in Admin→Manage Plugins. If you want to install manually, rename extracted zip folder to 'tabinclude' to place in lib/plugins/ directory.


  • 2013-02-05
    • Tab control become independent on jQuery UI.
    • Rewritten script.js converting from tw-sack to jQuery.
    • CSS is compliant to each templates' color.
    • localized to Japanese
  • 2013-01-27
    • Supported only recent version using jQuery UI. (Angua, Adolla Belle)
  • 2008-10-13
    • Vulnerability for XSS was fixed.
    • ODT export has been supported.


<float icon(compass)>