Feature Request #167

Latex plugin for Redmine

Added by Trond Lossius over 2 years ago. Updated almost 2 years ago.

Status:Closed Start date:2009-06-07
Priority:Normal Due date:
Assignee:Trond Lossius % Done:

100%

Category:- Spent time: 14.00 hours
Target version:- Estimated time:16.00 hours
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 - Modified formatter.rb file (7.7 kB) Trond Lossius, 08/23/2009 08:33 pm

History

Updated by Trond Lossius over 2 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.

Updated by Yoann Rousseau over 2 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

Updated by Trond Lossius over 2 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

Updated by Trond Lossius almost 2 years ago

Test:

$\sum_i c_i$

Updated by Trond Lossius almost 2 years ago

Test 2

$\sum_i c_i$

Updated by Trond Lossius almost 2 years ago

Test 3 - multiline equation:

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

Updated by Trond Lossius almost 2 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