mboratko / redmine_latex_mathjax

A plugin to enable mathjax on redmine
24 stars 29 forks source link

Support for Redmine 3.x? #15

Closed rauchrob closed 9 years ago

rauchrob commented 9 years ago

If the current code also works for Redmine 3.x, it should be documented. If not, support should be added.

rauchrob commented 9 years ago

I have just setup a Redmine development instance using the 3.0-stable branch and installed your plugin as described. It shows up under Administration -> Plugins and I can see MathJax related stanzas in the Generated HTML, but it is not rendered at all.

rauchrob commented 9 years ago

I now see that some formulas get rendered, though. For example, a wiki page containing $sum_{i=1}$ works, but $a^2$ does not work. Apparently, the circumflex gets translated by Redmine to a <sup>...</sup> tag, which breaks the MathJax rendering.

jwalkerbg commented 9 years ago

Hi, you may want to try my cloning https://github.com/jwalkerbg/redmine_latex_mathjax I tried to resolve some conflicts with other plugins and was partially successful in this work. Also, I am neither Ruby nor Ruby on Rails programmer, so I can not garantee that I have not introduced new errors.

rauchrob commented 9 years ago

@jwalkerbg I have tested your fork, having the same problems as described above. I'm not a Rails guy either, but it seems you tried to tidy up things a bit, which is a good idea, imho.

mboratko commented 9 years ago

Are you sure that $a^2$ doesn't work on it's own? I would have thought, reading the Redmine Text Formatting page, that another circumflex would have to appear later in the page, and then the text which is enclosed within the two circumflexes would get wrapped in a tag.

In any event, this is an issue of Redmine's Text Formatting competing with commands which are used by MathJax. You can probably avoid this by escaping the circumflex (i.e. wrap anything containing the circumflex in a tag), switching to a text format which has less overlap with characters you will use for MathJax (try markdown, perhaps), or turning off Text Formatting entirely.

This isn't something that can be fixed within this plugin, because essentially there's nothing to fix - if someone wanted to use the support for superscript within Textile, they need to be able to do that, so properly escaping is the right way to avoid the conflict.

rauchrob commented 9 years ago

@process91 Yes, I am sure that $a^2$ does not work. Switching to Markdown does not solve the Problem, either. However, after reading your comment I tried $a\^2$ and it worked perfectly. Maybe this should be documented somewhere.

mboratko commented 9 years ago

Thanks for testing that, I will add this information to the Readme.

rauchrob commented 9 years ago

Another Workaround: Use textile text formatting...

mboratko commented 9 years ago

I thought textile was default on Redmine?

On Wed, Jul 22, 2015 at 10:34 AM, Robert Rauch notifications@github.com wrote:

Another Workaround: Use textile text formatting...

— Reply to this email directly or view it on GitHub https://github.com/process91/redmine_latex_mathjax/issues/15#issuecomment-123742955 .

rauchrob commented 9 years ago

Yes, it is. But as a fan of Markdown, I immediately switched to Markdown when it was available.

mboratko commented 9 years ago

Ah, I see. I've added a line to the FAQ of this plugin in any event, hopefully that will make it clear.

On Wed, Jul 22, 2015 at 10:37 AM, Robert Rauch notifications@github.com wrote:

Yes, it is. But as a fan of Markdown, I immediately switched to Markdown when it was available.

— Reply to this email directly or view it on GitHub https://github.com/process91/redmine_latex_mathjax/issues/15#issuecomment-123743584 .

nicolasaunai commented 7 years ago

is there any news regarding this issue? We still have this "bug" which prevents us to copy/paste directly latex documents into redmine without much work.

mboratko commented 7 years ago

Are you talking about the bug which occurs when you are using Markdown instead of Textile? As far as I know, creating a true fix for this is not possible at the plugin level, one would have to add additional functionality directly to Redmine. The reason is that Markdown is processed server-side, while MathJax (by default) is processed client-side.

The only workaround is to use the plugin as a macro, as described in #23. I realize that this means you can't copy and paste LaTeX directly, however I know of no way of fixing this without patching Redmine itself to either add the possibility for plugins to override the markup parser or simply adding native MathJax support to Redmine itself.