Feature Request #167

Latex plugin for Redmine

Added by Trond Lossius about 10 years ago. Updated over 9 years ago.

Status:ClosedStart date:2009-06-07
Priority:NormalDue date:
Assignee:Trond Lossius% Done:

100%

Category:-Estimated time:16.00 hours
Target version:-
Branch:

Description

From Nils: Could we install this latex-plug in for the redmine wikis? It would be the easiest way to include mathematical equations in the wikis

formatter.rb Magnifier - Modified formatter.rb file (7.7 KB) Trond Lossius, 2009-08-23 08:33 pm

History

#1 Updated by Trond Lossius about 10 years ago

I have installed and tested the plugin on my own computer. I got problems due to the name of the plugin that involves a hyphen. This has been reported to the plugin developer, and I'll check back later to see if he respons to it.

#2 Updated by Yoann Rousseau almost 10 years ago

Trond Lossius wrote:

I got problems due to the name of the plugin that involves a hyphen.

I have downloaded and tested this plugin too. I also got problems with the name, but I managed to solve it. When I have installed this plugin, I renamed it with the following name : redmine-wiki_latex_plugin
The error was something like this :

 [...] plugin wiki_latex_plugin does not exist [...] 

It concerned the following file :
 $(REDMINE_ROOT)/vendor/plugins/redmine-wiki_latex_plugin/app/views/wiki_latex/macro_inline.html.erb

Line 3, we can see the following code :
<%= stylesheet_link_tag "wiki_latex.css", :plugin => "wiki_latex_plugin", :media => :all %>

The solution was to replace
:plugin => "wiki_latex_plugin"

with
:plugin => "redmine-wiki_latex_plugin"

After this modification, the plugin was recognized.
It is possible that while using the plugin, some formulas aren't interpreted, typically those involving braces. To solve this problem, look at this : http://www.redmine.org/issues/3061

#3 Updated by Trond Lossius almost 10 years ago

Thanks a lot, Yoann.

This definitively got me further. I have the plugin installed on the server, and I have the required latex, dvips, and convert (from ImageMagick) installed as well.

Furthermore I have altered

$(REDMINE_ROOT)/vendor/plugins/redmine-wiki_latex_plugin/app/views/wiki_latex/macro_inline.html.erb

as supposed to. I have also modified

$(REDMINE_ROOT)/lib/redmine/wiki_formatting/textile/formatter.rb

as discussed here. Finally I have migrated the production database and restarted the application.

I don't get any error messages any longer, but I still have the same issues that you had the other day: I don't obtain the desired result. Instead the formula is simply printed without being interpreted.

The redmine site that I'm currently testing this with is:

http://redmine.spatdif.org

Would you be kind to take a look at the formatter.rb file to see if I might have mistyped anything?

Thanks!

Trond

#4 Updated by Trond Lossius over 9 years ago

Test:

{{latex($\sum_i c_i$)}}

#5 Updated by Trond Lossius over 9 years ago

Test 2

{{latex($\sum_i c_i$)}}

#6 Updated by Trond Lossius over 9 years ago

Test 3 - multiline equation:

{{latex(
\begin{equation}
\sum_{i=1}^k c_i
\end{equation}
)}}

#7 Updated by Trond Lossius over 9 years ago

  • Status changed from New to Closed
  • % Done changed from 40 to 100

Update - Latex now works:

{{latex(
\begin{equation}
\sum_{i=1}^k c_i
\end{equation}
)}}

Also available in: Atom PDF