Extension talk:Math

Jump to navigation Jump to search

About this board

Previous discussions were archived for 2011–2014 and 2015–2016 on 2016-10-20.

What additional Software has to be installed

2
2A02:2028:C1C0:7B00:4028:FF6A:FAE5:F1C8 (talkcontribs)

I want to install a mediawiki (version >1.29 ) on a Linux system. Now, I'm not sure what kind of addition software I must install on my system; I'have really problems to understand the text on this page. Here are some questions I have:

do I have to install Texvc?

What is the relation between mathoid and Texvc?

What kind of software is already in the standard package und kind of additional services of the systems are used (which had to be installed by administrator before) the activation of the math extension?

Further I'm interested to install a mediawiki with a math-Extension (the same that is used by Wikipedia) in Synology NAS as Docker-Container. Are there already binaries of MediaWiki available which include the Math-Extension?


Nbrouard (talkcontribs)

I gave up with Texvc and mathoid. Instead our server are using Extension:SimpleMathJax . Simple and very efficient, but not from the Wikimedia Foundation. Nothing else to be installed but the extension.

Reply to "What additional Software has to be installed"
189.217.121.126 (talkcontribs)

esta extension a linstalarse muestra error en la base de datos exception de tipo grave MWexception y no se puede configurar asi que arreglenla o archiven la extension

Reply to "failed"

https://wikimedia.org/api/rest_v1/ returning code 0 and not 200

8
Nyet (talkcontribs)

Using mediawiki 1.31 and Math extension REL_31

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":)

If i change it to allow code 0:

diff --git a/MathRestbaseInterface.php b/MathRestbaseInterface.php
 index 2dc5d45..5355177 100644
 --- a/MathRestbaseInterface.php
 +++ b/MathRestbaseInterface.php
 @@ -364,7 +364,7 @@ class MathRestbaseInterface {
          */
         public function evaluateRestbaseCheckResponse( $response ) {
                 $json = json_decode( $response['body'] );
 -               if ( $response['code'] === 200 ) {
 +               if ( $response['code'] === 200 || $response['code'] === 0) {
                         $headers = $response['headers'];
                         $this->hash = $headers['x-resource-location'];
                         $this->success = $json->success;
 
 

I get

Failed to parse (Conversion error. Server ("https://wikimedia.org/api/rest_") reported: "Cannot get mml. Server problem.")

Is the RESTBase server down?

Jdforrester (WMF) (talkcontribs)

Is the RESTBase server down?

No, but maybe the Mathoid service is?

87.123.120.67 (talkcontribs)

My Math extension have been failing with the same error since a few days.

38.140.29.18 (talkcontribs)

I've had this problem too. After some debugging, it appears that PHP's curl was refusing the SSL certificate of https://wikimedia.org/api/rest_ . I downloaded a cacert.pem file and pointed edited the php.ini to point to under under variable curl.cainfo and openssl.cafile. This fixed my problem.

[curl]

curl.cainfo = "C:\PHP7\cacert.pem"

[openssl]

openssl.cafile="C:\PHP7\cacert.pem"

J Ra Rose (talkcontribs)

Since today I have the same issue. Where did you download the cacert.pem file?

2001:B68:16:80:921B:EFF:FE13:C9A2 (talkcontribs)

We have the same issue as OP. Adding certificates to php.ini did not help.

2001:B68:16:80:921B:EFF:FE13:C9A2 (talkcontribs)

Our problems started after a system update. The issue is probably caused by changes in other packages.


2001:B68:16:80:921B:EFF:FE13:C9A2 (talkcontribs)
Reply to "https://wikimedia.org/api/rest_v1/ returning code 0 and not 200"

Math extension return a fatal exception of type "Wikimedia\Rdbms\DBQueryError

1
Gdwikimeca (talkcontribs)

Hello,

I have install the math extension (on mediawiki 1.31) but when i try to add a <math> balise in a page, i have this screen :

MediaWiki internal error.

Original exception: [W-I969TjGCIAAAU3aBUAAAAe] 2018-11-19 04:37:00: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"

Exception caught inside exception handler.

Set $wgShowExceptionDetails = true; and $wgShowDBErrorBacktrace = true; at the bottom of LocalSettings.php to show detailed debugging information.

When i try to add $wgShowExceptionDetails = true; and $wgShowDBErrorBacktrace = true; at the bottom of LocalSettings.php, i have a blank page at the same place.

What can i do ?

URL of my wiki : www.wikimeca.org/wikimeca_1_31/

Reply to "Math extension return a fatal exception of type "Wikimedia\Rdbms\DBQueryError"
Fokebox (talkcontribs)

Hi everyone. I use Math extension and besically everything is fine. But I have found out small bug when I see formulas at IPad Safari browser - it doesn't display cyrillic symbols when I put them throgh \text{киррилица}

Physikerwelt (talkcontribs)

Lets test here:

Physikerwelt (talkcontribs)

Do you have installed the native MathMl extension? Otherwise you will get a [svg image](https://wikimedia.org/api/rest_v1/media/math/render/svg/e80f165a0d58c6514c476f7e46ac8c9e8a544e3d) with inline text

 1 <svg xmlns:xlink="http://www.w3.org/1999/xlink" width="12.75ex" height="3.343ex" style="vertical-align: -1.171ex;" viewBox="0 -934.9 5489.6 1439.2" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" aria-labelledby="MathJax-SVG-1-Title">
 2 <title id="MathJax-SVG-1-Title">{\displaystyle {\text{киррилица}}}</title>
 3 <defs aria-hidden="true"></defs>
 4 <g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true">
 5 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">к</text>
 6 <g transform="translate(609,0)">
 7 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">и</text>
 8 </g>
 9 <g transform="translate(1219,0)">
10 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">р</text>
11 </g>
12 <g transform="translate(1829,0)">
13 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">р</text>
14 </g>
15 <g transform="translate(2439,0)">
16 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">и</text>
17 </g>
18 <g transform="translate(3049,0)">
19 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">л</text>
20 </g>
21 <g transform="translate(3659,0)">
22 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">и</text>
23 </g>
24 <g transform="translate(4269,0)">
25 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">ц</text>
26 </g>
27 <g transform="translate(4879,0)">
28 <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">а</text>
29 </g>
30 </g>
31 </svg>

It depends on the fonts installed on your iPad what you actually see? @Pkra What do you think: Should we try to convert all text elements to paths or leave that to the browser?

Fokebox (talkcontribs)

<chem>m_\text{теор}(CH3COOC2H5) = n(CH3COOC2H5)\cdot M(CH3COOC2H5) = 0,5\text{моль} \cdot 88 \text{г/моль} = 44 \text{г}</chem>

https://wikireshebnik.ru/index.php/%D0%9F%D0%B0%D1%80%D0%B0%D0%B3%D1%80%D0%B0%D1%84_7_-_%D0%A5%D0%B8%D0%BC%D0%B8%D1%8F._10_%D0%BA%D0%BB%D0%B0%D1%81%D1%81._%D0%9A%D1%83%D0%B7%D0%BD%D0%B5%D1%86%D0%BE%D0%B2%D0%B0_%D0%9D.%D0%95.#.D0.9F.D0.BE.D0.BB.D1.83.D1.87.D0.B5.D0.BD.D0.B8.D0.B5_.D1.8D.D1.84.D0.B8.D1.80.D0.B0_.D0.BF.D1.80.D0.B8_.D0.BD.D0.B0.D0.B3.D1.80.D0.B5.D0.B2.D0.B0.D0.BD.D0.B8.D0.B8_.D1.83.D0.BA.D1.81.D1.83.D1.81.D0.BD.D0.BE.D0.B9_.D0.BA.D0.B8.D1.81.D0.BB.D0.BE.D1.82.D1.8B_.D0.B8_.D1.8D.D1.82.D0.B8.D0.BB.D0.BE.D0.B2.D0.BE.D0.B3.D0.BE_.D1.81.D0.BF.D0.B8.D1.80.D1.82.D0.B0

So there isn’t russian text included to the formula on ipad ... on desktop it is fine!

Reply to "Bug at Math extension"

Math extension cannot connect to Restbase.

9
Tunglinwu (talkcontribs)

解析失敗 (MathML 使用 SVG 或 PNG 備用 (建議用於現代瀏覽器與輔助工具):從伺服器 "http://api.formulasearchengine.com/v1/" 收到無效的回應 ("Math extension cannot connect to Restbase.")。)

http://api.formulasearchengine.com/v1/ is error so many times.

Libattery (talkcontribs)
Libattery (talkcontribs)
193.10.97.111 (talkcontribs)
193.10.97.111 (talkcontribs)

This extension seems dead.

Plasma g (talkcontribs)

I was having the same problem, but by changing a line in LocalSettings.php to

$wgMathFullRestbaseURL= 'https://en.wikipedia.org/api/rest_';

and running "php update.php", the problem went away. So I think the above statement "This extension seems dead" is not the definitive word.

Ciencia Al Poder (talkcontribs)

Pointing $wgMathFullRestbaseURL to wikipedia doesn't seem to work since MediaWiki 1.30

193.147.143.68 (talkcontribs)

It works for me with MediaWiki 1.30 and LAMP on Ubuntu 18.04 machine

Ciencia Al Poder (talkcontribs)

I later discovered it doesn't work when you have RestBase installed and configured for Visual Editor. Otherwise it should work.

Reply to "Math extension cannot connect to Restbase."
Prh47bridge (talkcontribs)

Proceeding with this very slowly as time allows!

When Mathoid is running I try to test it using:

curl -d 'q=E=mc^2' localhost:10044

as per the manual. Instead of the expected result I get:

{"status":500,"type":"internal_error","title":"TypeError","detail":"Cannot read property 'semantic' of undefined","method":"POST","uri":"/","success":false,"log":"Cannot read property 'semantic' of undefined","error":""}

My log shows:

{"name":"mathoid","hostname":"ns3299566.ip-5-135-154.eu","pid":1442,"level":50,"message":"500: internal_error","stack":"TypeError: Cannot read property 'semantic' of undefined\n    at srePostProcessor (/usr/lib/node_modules/mathoid/lib/math.js:118:16)\n    at BBPromise.then.then (/usr/lib/node_modules/mathoid/lib/math.js:299:20)\n    at tryCatcher (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/promise.js:512:31)\n    at Promise._settlePromise (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/promise.js:569:18)\n    at Promise._settlePromise0 (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/promise.js:614:10)\n    at Promise._settlePromises (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/promise.js:693:18)\n    at Async._drainQueue (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/async.js:133:16)\n    at Async._drainQueues (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/async.js:143:10)\n    at Immediate.Async.drainQueues (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/async.js:17:14)\n    at runCallback (timers.js:789:20)\n    at tryOnImmediate (timers.js:751:5)\n    at processImmediate [as _immediateCallback] (timers.js:722:5)","status":500,"type":"internal_error","detail":"Cannot read property 'semantic' of undefined","levelPath":"error/500","request_id":"06e8ae51-0c1c-11e8-a75a-adde2b46ba51","request":{"url":"/","headers":{"user-agent":"curl/7.47.0","content-length":"8","content-type":"application/x-www-form-urlencoded","x-request-id":"06e8ae51-0c1c-11e8-a75a-adde2b46ba51"},"method":"POST","params":{"0":"/"},"query":{},"remoteAddress":"127.0.0.1","remotePort":53513},"msg":"500: internal_error","time":"2018-02-07T15:31:55.216Z","v":0}

As previously, nodejs version is 8.9.4.

Any ideas?

Reply to "Mathoid failing"
Prh47bridge (talkcontribs)

I'm currently getting the following error:

{"name":"mathoid","hostname":"ns3299566.ip-5-135-154.eu","pid":23337,"level":60,"err":{"message":"Cannot read property 'displayMessages' of undefined","name":"TypeError","stack":"TypeError: Cannot read property 'displayMessages' of undefined\n    at Object.exports.config (/usr/lib/node_modules/mathoid/node_modules/mathoid-mathjax-node/lib/main.js:864:14)\n    at initApp (/usr/lib/node_modules/mathoid/app.js:149:11)\n    at module.exports (/usr/lib/node_modules/mathoid/app.js:254:12)\n    at _requireModule.then (/usr/lib/node_modules/mathoid/node_modules/service-runner/lib/worker.js:165:80)\n    at tryCatcher (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/promise.js:512:31)\n    at Promise._settlePromise (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/promise.js:569:18)\n    at Promise._settlePromiseCtx (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/promise.js:606:10)\n    at Async._drainQueue (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/async.js:138:12)\n    at Async._drainQueues (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/async.js:143:10)\n    at Immediate.Async.drainQueues (/usr/lib/node_modules/mathoid/node_modules/bluebird/js/release/async.js:17:14)\n    at runCallback (timers.js:789:20)\n    at tryOnImmediate (timers.js:751:5)\n    at processImmediate [as _immediateCallback] (timers.js:722:5)","levelPath":"fatal/service-runner/worker"},"msg":"Cannot read property 'displayMessages' of undefined","time":"2018-01-16T10:44:55.156Z","v":0}

Nodejs version is 8.9.4

Any ideas?

137.82.12.118 (talkcontribs)

I added the following to my config, under mathoid conf section. It seems that the default mj_config is not populated for some reason.

mj_config:

extensions: "TeX/color,TeX/mediawiki-texvc,TeX/mhchem"

Prh47bridge (talkcontribs)

That worked. Thanks. Now to figure out how to set it up as a service and whatever else I need to do to get it running properly!

Reply to "Trying to get Mathoid to run"
Kaganer (talkcontribs)

These is needed?

Reply to "Extension:Math/newFeatures and listed subpages"

Help with Math extension error /index.php/Special:MathStatus Error from line 415 of /var/www/html/includes/libs/MultiHttpClient.php: Call to undefined function curl_multi_init()

1
120.29.36.246 (talkcontribs)

I am not clear what i need in Localsettings.php. I have texvc working as I run the test as per the read me with

texvc /home/wiki/tmp /home/wiki/math "y=x+2" iso-8859-1 "rgb 1.0 1.0 1.0"

(although not wit exact path as above) and that produce the png file as expected

LocalSettings.php

$wgShowExceptionDetails = true;

wfLoadExtension( 'Math' );

$wgDefaultUserOptions['math'] = 'mathml';

$wgMathFullRestbaseURL= 'https://api.formulasearchengine.com/';

Reply to "Help with Math extension error /index.php/Special:MathStatus Error from line 415 of /var/www/html/includes/libs/MultiHttpClient.php: Call to undefined function curl_multi_init()"