This extension contains functions for rendering and computing mathematical expressions.  Related Links: Extension Overview, DekiScript Overview, Extension Demos.

Assembly: mindtouch.deki.services
SID: http://services.mindtouch.com/deki/draft/2007/06/math
License: none

This service requires Deki Wiki 1.8.2 or later.

To enable this extension, follow these steps:

  1. Go to Service management in the Control Panel of your wiki.
  2. Under Add Service, click on Local, and select type Extension.
  3. Enter a description and the extension SID: http://services.mindtouch.com/deki/draft/2007/06/math
  4. Add any additional configuration settings that are required by the extension (see below).
  5. Click on add service.

Configuration:

Config Key Description
latex-path Path to latex application
dvips-path Path to dvips application
imagemagick-path Path to convert application

Microsoft Windows Setup
Install the following applications before using the Math service under Microsoft Windows XP and Windows Server 2003.

  1. Install MiKTeX
  2. Install ImageMagick
  3. Install Ghostscript
  4. Set 'latex-path' to point to latex.exe installed by MiKTex (e.g. C:\Program Files\MiKTeX 2.5\miktex\bin\latex.exe)
  5. Set 'dvips-path' to ponit to dvips.exe installed by MiKTex (e.g. C:\Program Files\MiKTeX 2.5\miktex\bin\dvips.exe)
  6. Set 'imagemagick-path' to convert.exe installed by ImageMagick (e.g. C:\Program Files\ImageMagick\convert.exe)

Debian Setup
Install the following before using the Math service under Debian Linux

  1. Execute:
    apt-get install tetex-extra gs-gpl imagemagick

  2. Set 'latex-path' to /usr/bin/latex
  3. Set 'dvips-path' to /usr/bin/dvips
  4. Set 'imagemagick-path' to /usr/bin/convert

Gentoo Setup
Install the following before using the Math service under Gentoo Linux

  1. Execute:
    emerge -a tetex ghostscript imagemagick

  2. Set 'latex-path' to /usr/bin/latex
  3. Set 'dvips-path' to /usr/bin/dvips
  4. Set 'imagemagick-path' to /usr/bin/convert

Functions:

  1. math.formula
  2. math.sheet

math.formula(formula : str) : uri

Render math formula.

Parameters:

Name Type Description
formula
str
Formula in Latex-AMS notation

Remarks:   Refer here for a math guide for Latex.

Samples:


Output

To embed a simple equation:

{{ math.formula("\\alpha^2+\\beta^2*\\gamma^3=1") }} 

./MathFormula1.JPG

To embed a more complicated equation:

{{ math.formula("\\Re{z} =\\frac{n\\pi \\dfrac{\\theta +\\psi}{2} } {\\left(\\dfrac{\\theta +\\psi}{2}\\right)^2 + \\left( \\dfrac{1}{2} \\log \\left\\lvert\\dfrac{B}{A}\\right\\rvert\\right)^2}") }}


./MathFormula2.JPG


math.sheet(sheet : uri, width : num, height : num) : xml

Embed an InstaCalc sheet.

Parameters:

Name Type Description
sheet
uri
URI to InstaCalc sheet.
width
num
Optional.  Width of sheet (default: 425)
height
num
Optional.  Height of sheet (default: 300)

Remarks:  Refer here for more information on InstaCalc.

Samples:


Output

To embed an InstaCalc sheet:

{{ math.sheet("http://instacalc.com/?d=&c=MTAwICogNTB8MioyICsgMy80fHxzYWxlcyA9IDMwMCBtaWxsaW9uICsgMTAlfDEwIGluY2hlcyB0byBjbXwxNTAgbGJzIGluIGtnfDUgTUIvc2VjIGluIEdCL2hvdXI&s=sssssss&v=0.9") }} 

./MathSheet1.JPG
Tag page

Files 1

FileSizeDateAttached by 
 short-math-guide.pdf
Latex AMS guide
531.67 kB06:48, 8 Aug 2007SteveBActions
Viewing 2 of 2 comments: view all
Hi there,

unlike other wikis that have Latex rendering, the deki syntax forces you to escape the \ operator each time, so a simple equation which in dokuwiki and normal latex would look like:

\alpha = \beta + \gamma

in dekiwiki you'd have to write:

\\alpha = \\beta + \\gamma

this is a major disadvantage since it's no longer possible to simply cut and paste formulas between latex documents and dekiwiki!

Is here a way that you could could fix the syntax to allow for "normal" latex to render properly without having to manually escape the \ characters?

Thanks,

YJ
Posted 19:52, 21 Apr 2008
YJ,
You can already do what you desire. Instead of using the {{ math.formula() }} syntax, use the "transformations" approach as shown in http://wiki.developer.mindtouch.com/MindTouch_Deki/FAQ/Page_Management/How_do_I...Use_the_Transformations%2f%2fTransform_Content_menu_item%3f:

1) Enter your raw latex markup (with no extra backslashes.)
2) Select the text, change the style to "formatted"
3) Open the transformations menu (the small gear button in the editor toolbar) and select "math.formula" edited 13:32, 3 Jul 2008
Posted 13:31, 3 Jul 2008
Viewing 2 of 2 comments: view all
You must login to post a comment.
Powered by MindTouch Deki v.8.08.1a