Wrent / dokuwiki-plugin-latexit

Repository of DokuWiki plugin latexit, which allows to export multiple DokuWiki pages in single LaTeX file.
3 stars 8 forks source link

duplicate component from mathjax plugin #19

Open Klap-in opened 9 years ago

Klap-in commented 9 years ago

Your syntax component for mathjax https://github.com/Wrent/dokuwiki-plugin-latexit/blob/master/syntax/mathjax.php looks like a duplicate of https://github.com/liffiton/dokuwiki-plugin-mathjax/blob/master/syntax/protecttex.php

Currently I use the https://www.dokuwiki.org/plugin:latex plugin, but not the mathjax plugin. However, the syntax_plugin_latexit_mathjax still tries to handle the latex instruction.

My suggestion: Can you move your changes in syntax_plugin_latexit_mathjax to the mathjax plugin please? That solves the duplicate code and the plugin conflict between latex and the not-installed mathjax plugin. Thanks.

Klap-in commented 9 years ago

Hi Adam,

I implemented in the mathjax plugin the latex mode. Also I moved your replacements to the mathjax plugin, however it aren't no official latex syntaxes.

Do you have real usecases of this replacements? or is it just a gimmick? Thanks for response. Gerrit

Wrent commented 9 years ago

I am actually not really sure if I implemented it myself, because I didn't want to push into other plugin or whether it was necessary for some other reason.

I will try to look at it ASAP, test it and I'll let you know. If everything will work with the new mathjax, it could probably be removed.

Klap-in commented 9 years ago

To be clear, I mean with 'replacements' this piece of code:

        $match = str_replace('<=>', '\Leftrightarrow', $match);
        $match = str_replace('<->', '\leftrightarrow', $match);
        $match = str_replace('->', '\rightarrow', $match);
        $match = str_replace('<-', '\leftarrow', $match);
        $match = str_replace('=>', '\Rightarrow', $match);
        $match = str_replace('<=', '\Leftarrow', $match);
        $match = str_replace('...', '\ldots', $match);
        $match = str_replace('−', '-', $match);

I have moved these replacements to the mathjax plugin.

I'm refactoring LaTeXit a bit to let handle mathjax all itself, and I'm rewriting Zotero plugin as well. I will share my changes soon, so please wait before you change things as well...

Klap-in commented 9 years ago

A start of my mods are now available: Not really tested, work in progress: https://github.com/Klap-in/dokuwiki-plugin-latexit/commit/6cb7c802d334993ae52f7040de5a64e81c9bc2f6

Wrent commented 9 years ago

To the "replacements": actually you were right, it was just a gimmick specifical for my use-case. In the original document with mathjax the user was using "to be replaced" expressions a lot and that's why, I put this in. Probably it should be removed.