Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-29 19:04:02

backspaces
Member
From: Santa Fe, NM
Registered: 2004-09-10
Posts: 15
Website

[request] Equation Editor

I’d like to be able to easily include equations in Textpattern., either LaTeX syntax or MathML .. or anything else for that matter! There is a Wordpress Equation Plugin that would likely be OK .. although I suspect it’d be a huge install.

The WordPress site has a FAQ

There are other simpler systems that would be just fine too, that eventually rely on MathML, a semi-standard now adays. This Javascript ASCII Math package might be much better.

Is there a solution already that I don’t know about? I couldn’t find anything with the search feature of the forum.

TIA

— Owen

Offline

#2 2007-08-28 16:51:03

policleto
Member
From: Pisa, Italy
Registered: 2007-08-28
Posts: 24

Re: [request] Equation Editor

Maybe a LateXrender filter would be less difficult to obtain. But I have not enough knowledge with PHP.
Someone out there that can give an hand to realize this little project?

Thank you in advance.

Offline

#3 2008-04-20 03:44:30

nuit
New Member
Registered: 2008-04-20
Posts: 4

Re: [request] Equation Editor

Yeah, there is a solution…i was bothered to by this problem and so i wrote a little hack….i’m not quite sure how to bring it to a plugin, so…..it works great :D

Latex in Textpattern

it is written in german, but it’s pretty simple….add these two methods: latex and fLatex to the class in classTextile.php
and
$text = $this->latex($text);
to the graf-method….it should work by then :D by using: $$formula$$ or <latex>formula</latex> or <math>formula</math>

Last edited by nuit (2008-04-20 03:45:05)

Offline

#4 2008-04-20 17:44:02

policleto
Member
From: Pisa, Italy
Registered: 2007-08-28
Posts: 24

Re: [request] Equation Editor

thank you! I will give a try!

Offline

#5 2008-04-23 00:45:38

alex9142
Member
Registered: 2008-03-17
Posts: 45

Re: [request] Equation Editor

Hi!

Sorry, but I didn´t understood where the graf-method is (or what it is).

Offline

#6 2008-04-23 00:50:13

alex9142
Member
Registered: 2008-03-17
Posts: 45

Re: [request] Equation Editor

Is this the place where we need to addd it?

function graf($text) { // handle normal paragraph text if (!$this->lite) { $text = $this->noTextile($text); $text = $this->code($text); }

$text = $this->getRefs($text); $text = $this->links($text); if (!$this->noimage) $text = $this->image($text);

if (!$this->lite) { $text = $this->table($text); $text = $this->lists($text); }

$text = $this->span($text); $text = $this->footnoteRef($text); $text = $this->glyphs($text); return rtrim($text, “\n”); }

Offline

#7 2008-04-23 01:01:34

alex9142
Member
Registered: 2008-03-17
Posts: 45

Re: [request] Equation Editor

One more question: where do we need to add the code? Above the line $text = $this->code($text); ?
I don’t understand german :

nun kommt noch eine kleine Zeile dazu in der graf-Methode:

$text = $this->latex($text);

Diese Zeile gleich nach dieser

$text = $this->code($text);

Offline

#8 2008-04-23 01:10:56

alex9142
Member
Registered: 2008-03-17
Posts: 45

Re: [request] Equation Editor

I tried to use the latex as explained above, but the article returns a error message:

You must stay in inline math mode.

what does it mean?

Offline

#9 2008-04-23 18:10:05

nuit
New Member
Registered: 2008-04-20
Posts: 4

Re: [request] Equation Editor

Sorry…
Yeah that’s the right place….
You can add it before or after the line….i wrote: “after the line” but….theres no problem in using it before

i understand the lite variable now…you can turn it on or of in comments….sooo..if you want latex in comments as well….and don’t turn on the lite thing…you should put outside the if(!$this->lite) {…} thing :D.
were in this one is not important…i would say, at the beginning, because of, later on it’s parsing through, and the tags are not in a shelf

to the inline math mode:
I think….it’s just for math….so it is not possible to write real latex into the latex tags….i bit missunderstanding…..if somebody writes a parser, it should work, but it just uses the wordpress.com parser to parse the Latex-Math.
sooo…you can use latex-formulas but not all latex stuff ^^ (why do you need it anyway, textile is doing that stuff :D)
if you are using math…just show the formula which is not working

Last edited by nuit (2008-04-23 18:11:13)

Offline

#10 2008-04-23 22:23:12

alex9142
Member
Registered: 2008-03-17
Posts: 45

Re: [request] Equation Editor

Hi Nuit!

Thank you for your reply! Latex is already running in my website: www.mosapyr.com

I copied the “alt” tag that is shown in the images in this blog: http://moonsword.info/latex-in-textpattern
and now I understand how it works !
Now I am trying to find out how to write logic expressions using this ( that sentences with a mirrored E ).

Offline

#11 2008-04-23 22:30:50

nuit
New Member
Registered: 2008-04-20
Posts: 4

Re: [request] Equation Editor

probably this link helps: ->hier

Offline

#12 2008-04-23 22:35:34

alex9142
Member
Registered: 2008-03-17
Posts: 45

Re: [request] Equation Editor

Hi!

I will check it out right now!

Thank you!

Offline

Board footer

Powered by FluxBB