|
Cookbook /
MathtexSummary:Add markup to display and embed veral lines of mathematical formulas in wiki pages
Version:2008-10-11
Prerequisites:pmwiki 2.0 and later, latex and (dvipng or dvips+convert) installed on the server
Status:testing
Maintainer:felie
Categories: Markup
Questions answered by this recipe
DescriptionMathTex replace MimeTex for those who have latex installed on ther server. MathTex recipe permits several lines logical or mathematical demonstrations. Release NotesThis first version is for testing. Maybe it is possible to do more simple Markup for several lines, I don't know.
See AlsoInstallationThe homesite of MathTex is: http://www.forkosh.dreamhost.com/source_mathtex.html(approve links) GPL licenced written in C. As MimeTex, MathTex run in cgi for a simple usage, you can replace occurrences of mimtex by mathtex, after installation of the MathTex script in the cgi-bin directory. Edit the c code to set dvipng or dvips+convert locations. Compile the cgi by cc mathtex.c -o mathtex.cgi Customization to add newpackagesYou can add \usepackage{yourpackage} directly in the code after line 1023 and recompile the cgi Simply replace MimeTex for simple usagePut the mathtex.cgi in the cgi-bin directory of your server For those who have LaTex installed on their server! mv mimetex.cgi mimetex.old ln -s mathtex.cgi mimetex.cgi (a symbolic link is set to mathtex.cgi, calling mimetex is calling mathtex) Customisation to manage serveral line LaTeX scriptsI prepare a MathTex script from Pm MimeTex script. The idea of this script is simply to replace the Markup {$ latex $} by place the mathtex.php script into the cookbook directory in the local/config.php, add the line include_once('cookbook/mathtex.php');
set the values to the variables in the beginnine of the script (to run the cgi and to find the cache) Samplethe following code: the code use the fitch and xcolor package {$[=
\begin{fitch}
\fa Pp \to \neg\Diamond\neg{Pp} & A \\
\fa (p \to q) \to (\neg\Diamond q \to
\neg\Diamond p) & B \\
\fa \color{magenta} p \to \neg{P\neg{Fp}} & f \\
\fj \color{green} \neg{p} \color{red} \to P\neg{F{p}} & f' \\
\fa\fh \neg{p} \land \neg{Fp} & \\
\fa\fa \color{green} \neg{p} & 5,\land\\
\fa\fa \color{red} P\neg{Fp} & MP 6,4\\
\fa\fa \color{red} P\neg{Fp} \color{black} \to \color{blue} \neg\Diamond\neg{P\neg{Fp}} & A, p/P\neg{Fp} \\
\fa\fa \color{blue} \neg\Diamond\neg{P\neg{Fp}} & MP 7,8 \\
\fa\fa ( \color{magenta} p \to \neg{P\neg{Fp}} \color{black} ) \to
( \color{blue} \neg\Diamond\neg{P\neg{Fp}} \color{black} \to
\color{cyan} \neg\Diamond{p}) & B,
q/\neg{P\neg{Fp}}) \\
\fa\fa \color{blue} \neg\Diamond\neg{P\neg{Fp}} \color{black} \to
\color{cyan} \neg\Diamond{p} & MP
3,10 \\
\fa\fa \color{cyan} \neg\Diamond{p} & MP 9,11 \\
\fa \neg(\neg{p} \land \neg{Fp} \land\Diamond{p}) & 5,12 \\
\end{fitch}
=]$}
give: ![]() Contributorsfelie Comments |