This question about Using an extension: Task filed

LatexModePlugin encounters errors while loading

LatexModePlugin does not work, even though I followed the installation instructions to a T. The InstalledPlugins page gives this error message:


Foswiki::Plugins::LatexModePlugin could not be loaded. Errors were: Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/---(\++)(!*)\s*(%SECLABEL{ <-- HERE .*?}%)?\s(.*?)\n/ at /var/www/foswiki/lib/Foswiki/Plugins/LatexModePlugin.pm line 138. at /var/www/foswiki/lib/Foswiki/Plugins/LatexModePlugin.pm line 138. require Foswiki/Plugins/LatexModePlugin.pm called at (eval 76) line 1 Foswiki::Plugin::BEGIN() called at /var/www/foswiki/lib/Foswiki/Plugins/LatexModePlugin.pm line 138 eval {...} called at /var/www/foswiki/lib/Foswiki/Plugins/LatexModePlugin.pm line 138 eval 'use Foswiki::Plugins::LatexModePlugin' called at /var/www/foswiki/lib/Foswiki/Plugin.pm line 107 Foswiki::Plugin::new("Foswiki::Plugin", Foswiki=HASH(0x556041521d30), "LatexModePlugin") called at /var/www/foswiki/lib/Foswiki/Plugins.pm line 194 Foswiki::Plugins::preload(Foswiki::Plugins=HASH(0x556041521ef8)) called at /var/www/foswiki/lib/Foswiki/Plugins.pm line 81 Foswiki::Plugins::new("Foswiki::Plugins", Foswiki=HASH(0x556041521d30)) called at /var/www/foswiki/lib/Foswiki.pm line 2120 Foswiki::new("Foswiki", undef, Foswiki::Request=HASH(0x55604258f688), HASH(0x55604251e3e0)) called at /var/www/foswiki/lib/Foswiki/UI.pm line 365 Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 421 eval {...} called at /usr/share/perl5/Error.pm line 413 Error::subs::try(CODE(0x556041166570), HASH(0x5560426bc9e0)) called at /var/www/foswiki/lib/Foswiki/UI.pm line 500 Foswiki::UI::_execute(Foswiki::Request=HASH(0x55604258f688), CODE(0x556041166660), "view", 1) called at /var/www/foswiki/lib/Foswiki/UI.pm line 326 Foswiki::UI::handleRequest(Foswiki::Request=HASH(0x55604258f688)) called at /var/www/foswiki/lib/Foswiki/Engine/CGI.pm line 100 Foswiki::Engine::CGI::run(Foswiki::Engine::CGI=HASH(0x556041de0e08)) called at /var/www/foswiki/bin/view line 30 Compilation failed in require at (eval 76) line 1. at (eval 76) line 1. Foswiki::Plugin::BEGIN() called at (eval 76) line 1 eval {...} called at (eval 76) line 1 eval 'use Foswiki::Plugins::LatexModePlugin' called at /var/www/foswiki/lib/Foswiki/Plugin.pm line 107 Foswiki::Plugin::new("Foswiki::Plugin", Foswiki=HASH(0x556041521d30), "LatexModePlugin") called at /var/www/foswiki/lib/Foswiki/Plugins.pm line 194 Foswiki::Plugins::preload(Foswiki::Plugins=HASH(0x556041521ef8)) called at /var/www/foswiki/lib/Foswiki/Plugins.pm line 81 Foswiki::Plugins::new("Foswiki::Plugins", Foswiki=HASH(0x556041521d30)) called at /var/www/foswiki/lib/Foswiki.pm line 2120 Foswiki::new("Foswiki", undef, Foswiki::Request=HASH(0x55604258f688), HASH(0x55604251e3e0)) called at /var/www/foswiki/lib/Foswiki/UI.pm line 365 Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 421 eval {...} called at /usr/share/perl5/Error.pm line 413 Error::subs::try(CODE(0x556041166570), HASH(0x5560426bc9e0)) called at /var/www/foswiki/lib/Foswiki/UI.pm line 500 Foswiki::UI::_execute(Foswiki::Request=HASH(0x55604258f688), CODE(0x556041166660), "view", 1) called at /var/www/foswiki/lib/Foswiki/UI.pm line 326 Foswiki::UI::handleRequest(Foswiki::Request=HASH(0x55604258f688)) called at /var/www/foswiki/lib/Foswiki/Engine/CGI.pm line 100 Foswiki::Engine::CGI::run(Foswiki::Engine::CGI=HASH(0x556041de0e08)) called at /var/www/foswiki/bin/view line 30 BEGIN failed--compilation aborted at (eval 76) line 1. at (eval 76) line 1. eval 'use Foswiki::Plugins::LatexModePlugin' called at /var/www/foswiki/lib/Foswiki/Plugin.pm line 107 Foswiki::Plugin::new("Foswiki::Plugin", Foswiki=HASH(0x556041521d30), "LatexModePlugin") called at /var/www/foswiki/lib/Foswiki/Plugins.pm line 194 Foswiki::Plugins::preload(Foswiki::Plugins=HASH(0x556041521ef8)) called at /var/www/foswiki/lib/Foswiki/Plugins.pm line 81 Foswiki::Plugins::new("Foswiki::Plugins", Foswiki=HASH(0x556041521d30)) called at /var/www/foswiki/lib/Foswiki.pm line 2120 Foswiki::new("Foswiki", undef, Foswiki::Request=HASH(0x55604258f688), HASH(0x55604251e3e0)) called at /var/www/foswiki/lib/Foswiki/UI.pm line 365 Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 421 eval {...} called at /usr/share/perl5/Error.pm line 413 Error::subs::try(CODE(0x556041166570), HASH(0x5560426bc9e0)) called at /var/www/foswiki/lib/Foswiki/UI.pm line 500 Foswiki::UI::_execute(Foswiki::Request=HASH(0x55604258f688), CODE(0x556041166660), "view", 1) called at /var/www/foswiki/lib/Foswiki/UI.pm line 326 Foswiki::UI::handleRequest(Foswiki::Request=HASH(0x55604258f688)) called at /var/www/foswiki/lib/Foswiki/Engine/CGI.pm line 100 Foswiki::Engine::CGI::run(Foswiki::Engine::CGI=HASH(0x556041de0e08)) called at /var/www/foswiki/bin/view line 30 ----

I don't even know where to begin. Everything seems like it's working fine.

-- HunterBuchanan - 08 Mar 2019

While this is an easy bug to fix, maybe you want to try MathModePlugin in the meantime in case you only need mathematics.

The fix to the plugin itself is to insert a backslash in front of the opening curly bracket. So

m/---(\++)(!*)\s*(%SECLABEL{...

becomes

m/---(\++)(!*)\s*(%SECLABEL\{...

This basically is caused by newer perl versions that now warn about incompatible regular expressions.

-- MichaelDaum - 09 Mar 2019

Thank you very much, MichaelDaum! I can't tell you how helpful that was. I didn't understand quite what the error message was pointing out, and of course I have practically zero familiarity with Perl.

In the end, I had to add about 5-6 backslashes to the plugin code in order to escape those opening curly brackets, and then it took me another few minutes to figure out it was pointing to the wrong path for the Latex binary.

The research lab who's setting up the Wiki really wants full Latex support, so I'm glad I could hack this together for them. Thank you again, you're a lifesaver!

-- HunterBuchanan - 11 Mar 2019

Bug report filed at Tasks.Item14827

-- MichaelDaum - 11 Mar 2019
 

QuestionForm edit

Subject Using an extension
Extension LatexModePlugin
Version Foswiki 2.1.6
Status Task filed
Related Topics Tasks.Item14827
Topic revision: r4 - 11 Mar 2019, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy