Extension talk:Math/Archive 2016 to 2024/Flow export
This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
![]() | This page is an archive. Do not edit the contents of this page. Please direct any additional comments to the current talk page. |
Is Math working on CentOS 7?
I installed everything and get the error: Failed to parse (PNG conversion failed; check for correct installation of latex, dvips, gs, and convert) As per http://shukra.cedt.iisc.ernet.in/edwiki/Manual:Enable_TeX/problems#Error_:_Failed_to_parse_.28PNG_conversion_failed.3B_check_for_correct_installation_of_latex.2C_dvips.2C_gs.2C_and_convert.29 I check that all commands are available and they are. But texvc is not working from command line since the tmp and final file are not created. Is there a texvc log file somewhere to troubleshoot? 181.64.3.16 (talk) 02:31, 2 November 2016 (UTC)
- What i do is texvc tmp math "y=x+2" in terminal. The log file was in tmp i think. 80.147.66.181 (talk) 13:34, 19 January 2017 (UTC)
Error using Math Extension
I've been having a ton of trouble using the Math extension.
Special:MathStatus yields Internal error
[dff8cc5f986b85186244f9eb] /mediawiki/Special:MathStatus MWException from line 213 of /Applications/mediawiki/apps/mediawiki/htdocs/extensions/Math/MathRestbaseInterface.php: Math extension can not find Restbase URL. Please specify $wgMathFullRestbaseURL. 160.39.20.102 (talk) 17:39, 9 December 2016 (UTC)
- I too cannot get it to work. Centos on linux. I'm getting an internal error. I have installed it several times. No luck. No one answering me. Dehilster (talk) 17:45, 30 December 2016 (UTC)
- I'm getting an error too:
- [WPYKsU1ooVIAAEHCJnkAAAAG] /Special:MathStatus MWException from line 104 of /home/petters1/public_html/w/extensions/Math/MathRestbaseInterface.php: TeX input is invalid.
- Backtrace:
- #0 /home/petters1/public_html/w/extensions/Math/MathRestbaseInterface.php(395): MathRestbaseInterface->calculateHash()
- #1 /home/petters1/public_html/w/extensions/Math/MathRestbaseInterface.php(95): MathRestbaseInterface->getContentRequest(string)
- #2 /home/petters1/public_html/w/extensions/Math/MathRestbaseInterface.php(224): MathRestbaseInterface->getContent(string)
- #3 /home/petters1/public_html/w/extensions/Math/MathRenderer.php(657): MathRestbaseInterface->getSvg()
- #4 /home/petters1/public_html/w/extensions/Math/MathMathML.php(357): MathRenderer->getSvg()
- #5 /home/petters1/public_html/w/extensions/Math/MathMathML.php(398): MathMathML->correctSvgStyle(NULL)
- #6 /home/petters1/public_html/w/extensions/Math/MathMathML.php(466): MathMathML->getFallbackImage()
- #7 /home/petters1/public_html/w/extensions/Math/SpecialMathStatus.php(70): MathMathML->getHtmlOutput()
- #8 /home/petters1/public_html/w/extensions/Math/SpecialMathStatus.php(52): SpecialMathStatus->testSpecialCaseText()
- #9 /home/petters1/public_html/w/extensions/Math/SpecialMathStatus.php(42): SpecialMathStatus->runMathMLTest(string)
- #10 /home/petters1/public_html/w/includes/specialpage/SpecialPage.php(522): SpecialMathStatus->execute(NULL)
- #11 /home/petters1/public_html/w/includes/specialpage/SpecialPageFactory.php(577): SpecialPage->run(NULL)
- #12 /home/petters1/public_html/w/includes/MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
- #13 /home/petters1/public_html/w/includes/MediaWiki.php(851): MediaWiki->performRequest()
- #14 /home/petters1/public_html/w/includes/MediaWiki.php(512): MediaWiki->main()
- #15 /home/petters1/public_html/w/index.php(43): MediaWiki->run()
- #16 {main} 145.118.85.180 (talk) 12:48, 18 April 2017 (UTC)
- Here is provided a workaround:
Work with img_auth.php?
Does Math work with img_auth.php work properly? I get an access denied error. 80.147.66.181 (talk) 13:31, 19 January 2017 (UTC)
Bugs in mobile smartphone
I noticed that someone has an issue about this bug() which shows the math equation small even the mobile smartphone is zoomed in. Is there a way to fix this problem? --Jerrykim306 (talk) 07:41, 31 January 2017 (UTC)
api.formulasearchengine.com returns 404
Yesterday I noticed that the api.formulasearchengine.com is not reachable anymore. Instead it returns a HTTP 404 error.
Contact failed due to another 404 error in loading some background files which enables the contact formular.
Does anybody know about a fallback or alternative API? Hakatangadol (talk) 23:08, 2 February 2017 (UTC)
- There was a problem with the HTTPS version of the site. I have fixed that, it should work again now. In addition I'm currently working on the documentation how that server was set up, so that people can setup their own rendering instance if they whish. Extension:Math/Restbase Physikerwelt (talk) 18:56, 6 February 2017 (UTC)
Restbase dependency
I do not understand at all the role of restbase. Do I need to install RestBase to use the math extension with mathml? I just want to render some <math> using api.formulasearchengine.com but I keep having the error "Math extension cannot connect to Restbase." Aguarino ch 77 (talk) 13:04, 19 April 2017 (UTC)
- formulasearch doesn't seem to have a valid certificate, I switched it to http and it started working. Prod (talk) 15:36, 21 April 2017 (UTC)
- This isn't clear to me either. I'm able to get Mathoid running, but I'm wondering if it's required to additionally run restbase. Jamesmontalvo3 (talk) 04:58, 27 April 2017 (UTC)
how to point to a local mathoid?
I receive the error:
« Math extension cannot connect to Restbase. »
because the url called is:
http://localhost:10042/v1/media/math/check/tex (which gives 404)
although this example works fine :
curl -d 'q=E=mc^2' http://localhost:10042/
My LocalSettings.php :
wfLoadExtension( 'Math' ); $wgDefaultUserOptions['math'] = 'mathml'; $wgMathValidModes[] = 'mathml'; $wgMathMathMLUrl = 'http://localhost:10042/'; $wgMathFullRestbaseURL = 'http://localhost:10042/';
What should I set to make it call directly http://localhost:10042/ or make mathoid listen to the correct path?
Thanks! Plyd (talk) 19:38, 14 May 2017 (UTC)
- Now you should install restbase to work with local mathoid.
- I found way to work. But I don't fully understand the source, so you can try on your own risk.
- https://phabricator.wikimedia.org/T154394#3356579 Libattery (talk) 05:32, 20 June 2017 (UTC)
Math extension cannot connect to Restbase.
解析失敗 (MathML 使用 SVG 或 PNG 備用 (建議用於現代瀏覽器與輔助工具):從伺服器 "http://api.formulasearchengine.com/v1/" 收到無效的回應 ("Math extension cannot connect to Restbase.")。)
http://api.formulasearchengine.com/v1/ is error so many times. Tunglinwu (talk) 07:36, 15 May 2017 (UTC)
- http://api.formulasearchengine.com/v1/ seems don't work. also to me.
- i got error messege like this.
- Math extension cannot connect to Restbase. Libattery (talk) 06:39, 16 May 2017 (UTC)
- I'm using en.wikipedia rest api now.
- https://en.wikipedia.org/api/rest_v1/
$wgMathFullRestbaseURL= 'https://en.wikipedia.org/api/rest_';
Libattery (talk) 06:55, 17 June 2017 (UTC)- We almost always get this error, for example https://www.heurekaslu.se/wiki/Climate_Model. Sometimes it works so there is no error in the formulas. Have tried each of the following
- $wgMathFullRestbaseURL= 'https://en.wikipedia.org/api/rest_';
- $wgMathFullRestbaseURL= 'http://api.formulasearchengine.com/v1/'; and
- $wgMathFullRestbaseURL= 'https://api.formulasearchengine.com/v1/'; and 193.10.97.111 (talk) 11:03, 6 December 2017 (UTC)
- This extension seems dead. 193.10.97.111 (talk) 10:11, 13 December 2017 (UTC)
- 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. Plasma g (talk) 00:59, 14 February 2018 (UTC)
- Pointing $wgMathFullRestbaseURL to wikipedia doesn't seem to work since MediaWiki 1.30 Ciencia Al Poder (talk) 22:16, 18 February 2018 (UTC)
- It works for me with MediaWiki 1.30 and LAMP on Ubuntu 18.04 machine 193.147.143.68 (talk) 14:34, 21 May 2018 (UTC)
- I later discovered it doesn't work when you have RestBase installed and configured for Visual Editor. Otherwise it should work. Ciencia Al Poder (talk) 16:23, 21 May 2018 (UTC)
- Has anyone had this problem again recently because it's suddenly occurred on my wiki? I tried the alternate Restbase Urls but nothing has worked. 2A02:C7D:8A41:1E00:45F7:8FB3:DA76:93EE (talk) 22:48, 11 May 2019 (UTC)
- We also observed following Math/LaTex rendering to PNG issue while upgraded from MediaWiki 1.30.0 to MediaWiki 1.31.1. But, it's not the issue in earlier version (1.30.0)
- (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://en.wikipedia.org/api/rest_v1/":): {\displaystyle \sigma_1^\prime} and 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://en.wikipedia.org/api/rest_v1/":): Sanjay (talk) 13:57, 27 May 2019 (UTC)
- Looks like a problem with wikipedia servers... Ciencia Al Poder (talk) 16:45, 28 May 2019 (UTC)
- We were not using Mathoid Server as a service in earlier MediaWiki v1.30.0. hence the Math/LaTex rendering to PNG was just working fine with LaTex/DVI libs.
- but, when we upgraded to this MediaWiki v 1.31.1, the above issue is occurred in the same server environment.
- Hence, could you let know how we can bypass the Mathoid Server dependency in this LTS version(MediaWiki 1.31.1) and still we can make Math render working as it's working in MediaWiki 1.30.0 ? Sanjay (talk) 08:55, 3 June 2019 (UTC)
- If you do not install mathoid (and RESTBase), you may use wikipedia's RESTBase, which is what it's using now by default. However, you must ensure PHP is able to connect to wikipedia, which is probably blocked by one of your firewalls or SELinux and that's the error message you're getting Ciencia Al Poder (talk) 09:20, 3 June 2019 (UTC)
- There is security restrictions to connect from our corporate network to the internet. so I unable to test wiki's Restbase
- Hence, I have install for the 'methoid' webservice in our local RHEL7 server. I have opted for the dev-config available in the Mathoid package. Now the daemon is running with following pid. But, I see the listening server IP indicates 0.0.0.0:10044
- {"name":"mathoid","hostname":"domainname.com","pid":23788,"level":30,"levelPath":"info","msg":"Worker 23788 listening on 0.0.0.0:10044","time":"2019-06-06T11:21:19.871Z","v":0}
- Could you let know how can we get the appropriate IP that need to configure with below parameters for Math in LocalSettings.php ? I have already checked with 'domainname:port' is still not working for following configuration in LocalSettings.php
- wfLoadExtension( 'Math' );
- $wgDefaultUserOptions['math'] = 'mathml';
- $wgMathMathMLUrl = 'https://domainname.com:10044/'; Sanjay (talk) 11:49, 6 June 2019 (UTC)
- I think you also need RESTBase, or at least this is how I have configured (what would be the purpose of RESTBase, after all?). Then $wgMathMathMLUrl points to RESTBase, and you enable the math endpoint in RESTBase to point to mathoid daemon. Ciencia Al Poder (talk) 19:34, 6 June 2019 (UTC)
- Actually RESTBase server implementation along with Mathoid server is required only when you are running such a Huge WIKI.
- But for small enterprise wiki with limited memory to render math formulae, we need to install/setup/configure the Mathoid server for WIKI locally in the RHEL7 server followed with below steps.
- ** First Install Mathoid server pre-requisites packages dependency in RHEL7 server.
- # yum update -y [required when need to update latest packages available in the server]
- # yum install -y epel-release
- # yum install -y gcc-c++ nodejs npm mocha librsvg2-devel pkgconfig git
- # yum groupinstall -y 'Development Tools'
- ** Second, Install Mathoid server in the desired server location.
- # cd /var/data/wiki/
- # git clone https://github.com/wikimedia/mathoid/
- # chown -R apache:wikiadm mathoid
- # cd mathoid
- # chmod 775 server.js cli.js
- ** Third, Run the Mathoid server and test
- # npm install
- # npm test
- ** Fourth, Add below lines under LocalSettings.php to map mathoid server with mediawiki
- $wgMathoidCli = ['/var/data/wiki/mathoid/cli.js', '-c', '/var/data/wiki/mathoid/config.yaml'];
- # Below lines required to add in LocalSettings.php to Opt Mathoid server test-config as dependency
- [Note. Ensure you already got installed below Math extension compatible with the MediaWiki version]
- wfLoadExtension( 'Math' );
- $wgMathValidModes[] = 'mathml';
- $wgDefaultUserOptions['math'] = 'mathml';
- $wgMathMathMLUrl = 'http://12.23.34.45:10044/';
- ** Fifth, Change below line is the api interface for MediaWiki in Mathoid server config.yaml
- uri: https://Template:Domain/api.php
- Restart HTTPD server : # systemctl restart httpd
- You are all DONE !
- The math formula should render to desired formats in .png !
Sanjay (talk) 10:58, 14 June 2019 (UTC)
- Any ideas? Same problem here. 38.124.157.153 (talk) 22:20, 31 May 2019 (UTC)
- Can anyone provide a simple php_curl request that Math could make to wiki's Restbase, in order to test whether this is a problem of the code or a problem of the web host?
- Thank you! 128.12.92.43 (talk) 15:44, 3 June 2019 (UTC)
- I tried connecting to both the Wikimedia and Wikipedia Restbases with the same problem (MediaWiki 1.32). The issue in my case was with how the MediaWiki core handles HTTP responses. I haven't seen anyone else mention it, so here's my other comment on the issue with two hacks. Johanngan (talk) 03:33, 2 July 2019 (UTC)
- I used one of Johanngan's hacks above and it works!
- See that thread I will post some more details 123.51.111.134 (talk) 02:19, 25 July 2019 (UTC)
- This suddenly started happening on my MediaWiki1.28 install. Johanngan's second hack worked perfectly. Many thanks! 80.6.112.58 (talk) 15:40, 26 January 2020 (UTC)
Is texvc required or not?
We have installed MediaWiki 1.29.1 (and php 7.1.9) on a Windows 2016 server. The math extension does not work, are you supposed to install Texvc if TeX formulas are used? Treesys (talk) 15:33, 22 September 2017 (UTC)
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()
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/'; 120.29.36.246 (talk) 03:13, 2 December 2017 (UTC)
Extension:Math/newFeatures and listed subpages
These is needed? Kaganer (talk) 15:08, 28 December 2017 (UTC)
Trying to get Mathoid to run
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? Prh47bridge (talk) 15:56, 17 January 2018 (UTC)
- 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" 137.82.12.118 (talk) 22:53, 18 January 2018 (UTC)
- 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! Prh47bridge (talk) 13:50, 19 January 2018 (UTC)
Mathoid failing
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? Prh47bridge (talk) 15:39, 7 February 2018 (UTC)
Bug at Math extension
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{киррилица} Fokebox (talk) 06:25, 29 August 2018 (UTC)
- Lets test here: Physikerwelt (talk) 13:46, 4 September 2018 (UTC)
- 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 textIt 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? Physikerwelt (talk) 13:52, 4 September 2018 (UTC)
<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"> <title id="MathJax-SVG-1-Title">{\displaystyle {\text{киррилица}}}</title> <defs aria-hidden="true"></defs> <g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)" aria-hidden="true"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">к</text> <g transform="translate(609,0)"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">и</text> </g> <g transform="translate(1219,0)"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">р</text> </g> <g transform="translate(1829,0)"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">р</text> </g> <g transform="translate(2439,0)"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">и</text> </g> <g transform="translate(3049,0)"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">л</text> </g> <g transform="translate(3659,0)"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">и</text> </g> <g transform="translate(4269,0)"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">ц</text> </g> <g transform="translate(4879,0)"> <text font-family="monospace" stroke="none" transform="scale(71.759) matrix(1 0 0 -1 0 0)">а</text> </g> </g> </svg>
- <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! Fokebox (talk) 03:48, 6 September 2018 (UTC)
https://wikimedia.org/api/rest_v1/ returning code 0 and not 200
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? Nyet (talk) 01:38, 8 November 2018 (UTC)
No, but maybe the Mathoid service is? Jdforrester (WMF) (talk) 16:47, 8 November 2018 (UTC)Is the RESTBase server down?
- My Math extension have been failing with the same error since a few days. 87.123.120.67 (talk) 19:19, 13 November 2018 (UTC)
- 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" 38.140.29.18 (talk) 22:14, 16 November 2018 (UTC)
- Since today I have the same issue. Where did you download the cacert.pem file? J Ra Rose (talk) 19:35, 21 November 2018 (UTC)
- We have the same issue as OP. Adding certificates to php.ini did not help. 2001:B68:16:80:921B:EFF:FE13:C9A2 (talk) 13:22, 5 December 2018 (UTC)
- 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 (talk) 13:27, 5 December 2018 (UTC)- I have resolved the problem by installing mathoid locally and interfacing it over CLI interface:
- Extension:Math#Mathoid's CLI interface 2001:B68:16:80:921B:EFF:FE13:C9A2 (talk) 14:58, 5 December 2018 (UTC)
- I had the same issues as OP on MediaWiki 1.32. The HTTP responses were coming back just fine (rendered math and everything); the problem was coming from the MultiHttpClient in the core. It parses the HTTP response code from the header with a regex match that's hard coded to look for HTTP/1.x, when in fact my server was receiving an HTTP/2 response. The code 0 was a default that was never overwritten thanks to the failed match.
- I found two workarounds that resolved the issue for me.
- Change all the checks in MathRestbaseInterface.php to accept a code 0 response.
- Go against Do_not_hack_MediaWiki_core and modify the regex in MultiHttpClient to properly match the HTTP/2 response code.
- I'm pretty sure I only modified one line of code. Here's what I did:
- Locate the file
MultiHttpClient.php
. It should be on the path:<Your MediaWiki root directory>/includes/libs/MultiHttpClient.php
. - Search for the line of code that uses
preg_match()
, in thegetCurlHandle
method. For me it was on line 390 (MW 1.33), line 392 (MW 1.32). - Change the argument from
"/^(HTTP\/1\.[01]) (\d{3}) (.*)/"
to"/^(HTTP\/[12](?:\.[01])?) (\d{3}) (.*)/"
- Just to be clear, here's the diff:
diff MultiHttpClient_orig.php MultiHttpClient.php 392c392 < if ( preg_match( "/^(HTTP\/1\.[01]) (\d{3}) (.*)/", $header, $matches ) ) { --- > if ( preg_match( "/^(HTTP\/[12](?:\.[01])?) (\d{3}) (.*)/", $header, $matches ) ) {
- Just to be clear, here's the diff:
- I ended up going with the second option. It seems like an overhaul of the MultiHttpClient is in the works with T202352, so maybe this issue will resolve itself in future releases. Johanngan (talk) 03:17, 2 July 2019 (UTC)
- Could you describe in a bit more detail what you did to MultiHttpClient? I might go by your second solution as well. British Potato (talk) 20:09, 11 July 2019 (UTC)
- I used the Johangan's hack:
- Change all the checks in MathRestbaseInterface.php to accept a code 0 response."
- and it worked.
- When I have created a patch file to use in our docker container, I'll post it as a gist here... 123.51.111.134 (talk) 02:19, 25 July 2019 (UTC)
- I did what Johangan recommended as well. Here's my rough patch, which "works".
- Dloewenherz2 (talk) 00:25, 10 August 2019 (UTC)
--- MathRestbaseInterface.php 2019-08-09 19:10:54.000000000 -0500 +++ MathRestbaseInterface.php 2019-08-09 19:23:45.000000000 -0500 @@ -8,6 +8,8 @@ use MediaWiki\Logger\LoggerFactory; +const WikiMediaServersReturnInvalidErrorCodes = true; + class MathRestbaseInterface { private $hash = false; private $tex; @@ -382,7 +384,7 @@ */ public function evaluateRestbaseCheckResponse( $response ) { $json = json_decode( $response['body'] ); - if ( $response['code'] === 200 ) { + if ( $response['code'] === 200 || WikiMediaServersReturnInvalidErrorCodes ) { $headers = $response['headers']; $this->hash = $headers['x-resource-location']; $this->success = $json->success; @@ -439,7 +441,7 @@ * @throws MWException */ private function evaluateContentResponse( $type, array $response, array $request ) { - if ( $response['code'] === 200 ) { + if ( $response['code'] === 200 || WikiMediaServersReturnInvalidErrorCodes ) { if ( array_key_exists( 'x-mathoid-style', $response['headers'] ) ) { $this->mathoidStyle = $response['headers']['x-mathoid-style']; } @@ -474,3 +476,4 @@ throw new MWException( "Cannot get $type. $detail" ); } } +
- I am facing the same issue. The problem seems to be some temporary issue with server. I have implemented retry three times, in case of a failure:
- --- a/src/MathRestbaseInterface.php
- +++ b/src/MathRestbaseInterface.php
@@ -172,22 +172,34 @@ class MathRestbaseInterface {
/** @var MathRestbaseInterface $first */
$first = $rbis[0];
$multiHttpClient = $first->getMultiHttpClient();
- + self::batchEvaluateWithRetry( $rbis, $multiHttpClient );
- + self::batchGetMathML( $rbis, $multiHttpClient );
- + }
- +
- + private static function batchEvaluateWithRetry ( array $rbis, MultiHttpClient $multiHttpClient, $retries = 0 ) {
foreach ( $rbis as $rbi ) {
/** @var MathRestbaseInterface $rbi */
$requests[] = $rbi->getCheckRequest();
}
$results = $multiHttpClient->runMulti( $requests );
- + $failedRbis = [];
$i = 0;
foreach ( $results as $requestResponse ) {
/** @var MathRestbaseInterface $rbi */
$rbi = $rbis[$i++];
try {
$response = $requestResponse[ 'response' ];
- - $rbi->evaluateRestbaseCheckResponse( $response );
- + $res = $rbi->evaluateRestbaseCheckResponse( $response );
- + if (!$res) {
- + $failedRbis[] = $rbi;
- + }
} catch ( Exception $e ) {
}
}
- - self::batchGetMathML( $rbis, $multiHttpClient );
- +
- + if (count($failedRbis) > 0 && $retries < 3) {
- + self::batchEvaluateWithRetry( $failedRbis, $multiHttpClient, $retries + 1 );
- + }
}
private function getMultiHttpClient() {
117.251.174.113 (talk) 06:56, 28 November 2024 (UTC)
Math extension return a fatal exception of type "Wikimedia\Rdbms\DBQueryError
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/ Gdwikimeca (talk) 08:03, 19 November 2018 (UTC)
- Try to run <code>update.php</code>.
- Ref: https://lists.wikimedia.org/pipermail/mediawiki-l/2018-March/047266.html S0ring (talk) 12:23, 26 April 2019 (UTC)
failed
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 189.217.121.126 (talk) 01:33, 30 December 2018 (UTC)
What additional Software has to be installed
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?
2A02:2028:C1C0:7B00:4028:FF6A:FAE5:F1C8 (talk) 10:45, 16 March 2019 (UTC)
How to use chinese letters within a formula?
<math display="block"><mtext>鸡</mtext></math>
<math><mtext>{鸡} 鸡 "Chinese letters"</mtext></math>
These attempts failed with:
Failed to parse (syntax error): {\displaystyle <mtext>鸡</mtext>}
Failed to parse (syntax error): <mtext>{鸡} 鸡 "Chinese letters"</mtext>
Is there any other way to add chinese letters within a formula? S0ring (talk) 12:28, 26 April 2019 (UTC)
- You can write , however depending your device the appearance might be broken or not as good as normal text. Debenben (talk) 13:28, 26 April 2019 (UTC)
- Thanks for the suggestion, I am looking for an elegant solution, but yours won't work either:
- <math>鸡</math>
- Failed to parse (lexing error): 鸡 S0ring (talk) 14:27, 26 April 2019 (UTC)
- You have to write it inside \text or \mbox like <math>\text{鸡}</math>: . If you want to help making it look better, you could test the inline svg proposal here phab:T195861 and share your experience or push for alternative rendering solutions. Debenben (talk) 15:15, 26 April 2019 (UTC)
- Thanks again! It works in MathML render mode, but fails in PNG images render mode... (just toggle in Preferences -> Math) with the error:
- Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): \text{鸡}
- All packages are installed, the diagnostics passed (Manual:$wgUseTeX#Diagnostics) and other formulas correctly shown. S0ring (talk) 15:52, 27 April 2019 (UTC)
- This kind of Unicode rendering issue was reported before in bug 798 some Latin letters are still not supported, including those that include multiple diacritics (as well as letters from other languages i.e. chinese).
- For ex. this is working:
- <math>\text{àáâãäåæçčďèéěêëìíîïňñòóôõöřšťøùúůûüýÿžß}</math>
- and this not working:
- <math>\text{²°µ´}</math>
- One workaround is to switch the rendering mode from PNG to MathML:
- <math forcemathmode="mathml">\text{²³°´µ}</math>
- Is this a known problem? S0ring (talk) 21:28, 30 April 2019 (UTC)
- There are a lot of rendering issues with the current setup, but you must be referring to texvc, which is not used in mediawiki anymore and I have not seen anybody offering to maintain it.
- If you are using mediawiki on your own wiki, you can just use Mathjax and the problems are gone, Mathml unfortunately only works with firefox. Debenben (talk) 12:30, 1 May 2019 (UTC)
- Thank you for this clarification, I didn't find any note that texvc isn't supported anymore.
- For Mathjax I found two MW extensions: Extension:SimpleMathJax and Extension:MathJax (which is in Beta release status). Do I have to replace Extension:Math with an Mathjax extension (which one from above do you recommend?) or to force Extension:Math to use Mathjax as the only rendering option (from Extension:Math#MathJax results it is deprecated)? S0ring (talk) 11:36, 2 May 2019 (UTC)
- I am not familiar with the MathJax extension. You can use the SimpleMathJax extension or no extension at all. The SimpleMathJax extension is only a few lines of javascript. You could add something like https://de.wikipedia.org/wiki/Benutzer:Debenben/MathJax.js to the page MediaWiki:Common.js in your wiki if you want $ $ and other LaTeX delimiters like math.stackexchange or scholarpedia use, otherwise just customize it according to the MathJax documentation http://docs.mathjax.org/en/latest/ Debenben (talk) 16:29, 2 May 2019 (UTC)
- After I saved your script to my Common.js it had no effect, no rendering occured. With the SimpleMathJax extension enabled and the HTML text from https://codepen.io/pkra/pen/pgOyaw (1) everything looks fine, except the first two formulas:
- $$ f(u_1) = f(u_0) + hf'(u_0)+{h^2\over 2!}f(u_0) + \cdots + {h^{n+1}\over (n+1)!}f^{(n+1)}(u_0) + o(h^{n+1}). $$
- $$ f(u) = f'(u) = f(u) = \cdots = f^{(n)}(u) = 0;\quad f^{(n+1)}(u) \ne 0. $$
- (1) Note. I had to add $wgSmjInlineMath = [ ["$","$"] ]; to LocalSettings.php, as well as to remove from the HTML text the whitespaces before any $$. S0ring (talk) 17:32, 6 May 2019 (UTC)
Forcing MathML output
How can a user force the extension to serve MathML (that is, <math …>…</math>
) instead of <img>s? En.Wikipedian documentation at w:Help:Displaying_a_formula #Native_MathML is quite confusing. Incnis Mrsi (talk) 19:04, 24 June 2019 (UTC)
- I'm pretty sure that as an editor one can't make it do that for other people. That would break the reader experience for the 99% of readers whose device won't render MathML. It's the same way that we don't let editors force the output to have an autoplaying video, even if they really want to; it'd be an anti-user feature. Jdforrester (WMF) (talk) 22:13, 25 June 2019 (UTC)
- I feel that Jdforrester_(WMF) missed my point, or I ignore something important myself. The question is not about overriding intended behaviour by planting hacks to wiki code – were it, I’d ask another way, such as “which code can force the extension to switch to MathML?”. The question is about control of the extension by its end user. Incnis Mrsi (talk) 16:13, 28 June 2019 (UTC)
- What do you mean by "end user"? System administrator? Page editor? Reader? Jdforrester (WMF) (talk) 19:19, 28 June 2019 (UTC)
- Who ultimately consumes a wiki page? Reader, of course. Sysadmins definitely don’t fall under the “end” user class unless we discuss tools intended for system administration. Incnis Mrsi (talk) 14:07, 29 June 2019 (UTC)
getID3() v1.9.18 vs. v1.9
Attempting to install 'Math-REL1_33-183fd5c.tar.gz' on our server:
- MediaWiki 1.33.0
- PHP 7.2.19-0ubuntu0.18.04.1 (apache2handler)
- MySQL 5.7.26-0ubuntu0.18.04.1
The tar file is extracted to '../extensions/Math'.
Running 'update.php' produces the following error.
cd ./wiki/maintenance
sudo php update.php
# Error.
james-heinrich/getid3: 1.9.18 installed, ^1.9 required.
Error: your composer.lock file is not up to date. Run "composer update --no-dev" to install newer dependencies
Is this an error? The 'getid3 v1.9.18' library was installed for the TimedMediaHandler extension. The following is from 'Special:Version' under "Installed Libraries":
james-heinrich/getid3 1.9.18 GPL-1.0-or-later, LGPL-3.0-only and MPL-2.0 PHP script that extracts useful information from popular multimedia file formats
Is there a work around for this? Or, does 'getID3()' need to be rolled back to v1.9?
Thanks for any help. Huck (discuss • contribs) 15:22, 3 December 2019 (UTC)
Math error
Hi
I have the following configuration in LocalSettings.php:
wfLoadExtension( 'Math' );
$wgMathValidModes[] = 'mathml';
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathFullRestbaseURL = 'https://en.wikipedia.org/api/rest_v1/';
However, formula do not render correctly.
For example, this code: <math><20</math>
displays:
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 "/mathoid/local/v1/":): {\displaystyle <20}
What is causing the error and how to resolve it? Thanks! Hwgen22 (talk) 14:47, 3 April 2020 (UTC)
- not rendering correctly for me either with the default settings.
- Test Rendering the input "x^2+\text{a sample Text}" succeeded.
- Test Comparing to the reference rendering succeeded.
- Test Rendering of a+b in plain MathML mode succeeded.
- Test Checking the presence of '+' in the MathML output succeeded.
- Test Comparing the generated SVG with the reference failed.
- Test Checking if MathML input is supported succeeded.
- Test Rendering Presentation MathML sample failed.
- Test Checking if the link to SVG image is correct failed.
- Backend tests for rendering mode MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools) completed.
- doestn seem to be anyone maintaining this project atm though. 203.220.96.59 (talk) 20:35, 20 April 2020 (UTC)
Is there a way that I can change or add things into the tex-header?
For example, define new commands that are available for the entire wiki? 206.72.65.117 (talk) 23:42, 14 April 2020 (UTC)
Math extension error
Hello! I am new to mediawiki and have inherited an environment that is currently running a mediawiki server. I was asked to get the Math extension installed for my users, and I believe I have done so correctly. However, my user is seeing an error displayed on the page, showing the following:
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("$3") from server "$2":): {\displaystyle \nabla \cdot E = \rho/\epsilon_0 }
I have seen similar articles referring to this error, but they seem to be showing a RESTbase issue. I can provide additional information if needed, I thank you all for your time Angryitguy (talk) 16:57, 23 April 2020 (UTC)
Math extension stopped working
RESOLVED | |
After upgrading to MW 1.35 all works now |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hello,
I had following settings and all worked fine:wfLoadExtension( 'Math' ); // Set MathML as default rendering option $wgDefaultUserOptions['math'] = 'mathml'; $wgMathFullRestbaseURL = 'https://en.wikipedia.org/api/rest_'; $wgMathMathMLUrl = 'https://mathoid-beta.wmflabs.org/';But today I have noticed that extension does not work anymore showing mistake: Math extension cannot connect to Restbase
What had happened and how can I fix it? Fokebox (talk) 09:50, 25 August 2020 (UTC)
- Experiencing the same issue on MW 1.3.0 after upgrading to PHP 7.4.3. Upgrading MW to 1.3.5 resolved the issue. BBUCommander (talk) 09:09, 14 November 2020 (UTC)
- After upgrading to MW 1.35 all works now Fokebox (talk) 22:32, 15 November 2020 (UTC)
== Raw Failed to parse (syntax error): {\displaystyle tag in visual editor edit and math formula editor == I followed every step but raw <nowiki><Math> tag shows in visual editor edit and math formula editor.</nowiki> It's fine in view mode. [[Special:Contributions/175.116.180.216|175.116.180.216]] ([[User talk:175.116.180.216|talk]]) 08:09, 28 September 2020 (UTC) :I tried to build Mathoid Server myself, but it seems to have failed. :It is a bit slow when used with the following content, but it is working. :Please let me know if there is a fast wgMathMathMLUrl in Asia. :// Set MathML as default rendering option :$wgDefaultUserOptions['math'] = 'mathml'; :$wgMathFullRestbaseURL = '<nowiki>https://en.wikipedia.org/api/rest_'</nowiki>; :$wgMathMathMLUrl = '<nowiki>https://mathoid-beta.wmflabs.org/'</nowiki>; [[Special:Contributions/175.116.180.216|175.116.180.216]] ([[User talk:175.116.180.216|talk]]) 01:55, 29 September 2020 (UTC) == I cannot see the math formula while editing in visualEditor == {{Flow summary|https://github.com/fred-wang/webextension-native-mathml/pull/15 (merged and released)}} After you close the math editor, you cannot see the math formula you have create so in editing mode you do not see that there is a math code there (but you can see it is if you change to the code view). This makes editing it afterwars quite dificult. [[User:Amglez|Amglez]] ([[User talk:Amglez|talk]]) 17:39, 14 November 2020 (UTC) :Do you happen to use the [https://addons.mozilla.org/en-US/firefox/addon/native-mathml/ Native MathML Firefox extension]? VisualEditor has become incompatible with it a few months(?) ago. Probably VisualEditor needs to be fixed, but as a workaround you can disable the extension while editing formulæ in VE. [[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 13:49, 16 November 2020 (UTC) :Thank you very much for your answer. I disabled the extension and everything works again. [[User:Amglez|Amglez]] ([[User talk:Amglez|talk]]) 17:04, 16 November 2020 (UTC) :{{reply to|Amglez}} The fix has been released, so now you can re-enable the extension and it will work correctly while editing in VisualEditor. [[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 08:49, 21 December 2020 (UTC) == Math only displayed as raw tags == Hello! I am on a brand new installation of MW and I cannot seem to get the Math extension to function properly. No matter what I do, <nowiki><math>E=mc^2}
</nowiki> is just displayed as the raw input, <math>E=mc^2</math>
(not with this computer code markup of course). Does anyone have an idea what I can try?
Versions are as such:
MediaWiki | 1.35.0 |
PHP | 7.4.3 (apache2handler) |
MariaDB | 10.3.25-MariaDB-0ubuntu0.20.04.1 |
ICU | 66.1 |
Lua | 5.1.5 |
and I have installed Math version 3.0.0 (b5a8f57) 12:52, 13 July 2020 (as seen in the Special:Version page).
I followed the installation instructions, including $wgDefaultUserOptions['math'] = 'mathml'
, running the update procedure, and setting
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathFullRestbaseURL = 'https://en.wikipedia.org/api/rest_';
$wgMathMathMLUrl = 'https://mathoid-beta.wmflabs.org/';
On the special page MathStatus I get the following output:
This page displays information about the enabled math rendering modes.
The following rendering modes are enabled:
PNG images
LaTeX source (for text browsers)
MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools)
Running backend tests for rendering mode MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools).
Test Rendering the input "x^2+\text{a sample Text}" succeeded.
Test Comparing to the reference rendering succeeded.
Test Rendering of a+b in plain MathML mode succeeded.
Test Checking the presence of '+' in the MathML output succeeded.
Test Comparing the generated SVG with the reference failed.
Test Checking if MathML input is supported succeeded.
Test Rendering Presentation MathML sample succeeded.
Test Checking if the link to SVG image is correct succeeded.
Backend tests for rendering mode MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools) completed. 131.180.32.48 (talk) 11:52, 18 November 2020 (UTC)
- Well, feel free to delete this. For some reason my text was enclosed in nowiki tags by default. I do not know why; maybe me not understanding the visual editor. The test that fails is still an open question to me but maybe of lesser importance (Test Comparing the generated SVG with the reference failed.) 131.180.32.48 (talk) 11:58, 18 November 2020 (UTC)
- The visual editor works with WYSIWYG text, not with wikitext, so in order to accurately represent what you see (the raw wikicode), it surrounds it with <nowiki>. This is expected. I don’t know what’s the case with the failing test, but it also fails on this wiki (see Special:MathStatus), so no difference compared to your wiki. Tacsipacsi (talk) 17:00, 19 November 2020 (UTC)
Documentation?
Hi, I just installed this plugin, but I have no idea of the extents of which I can use latex. Is it just normal latex, are there certain packages used, can we modify which packages are available etc... I can't find any information on how to actually use this extension. Cuppajoelad (talk) 14:10, 23 November 2020 (UTC)
- See w:Help:Math Physikerwelt (talk) 04:21, 3 December 2020 (UTC)
- Thanks, though I still don't know what packages are included in the math tags, can I use my own custom latex packages? I'd like to create algorithms, but each option requires the import of a package, is this possible? Where can I learn more? Cuppajoelad (talk) 19:21, 3 December 2020 (UTC)
- This is really complicated. If you run it on your server and you trust that the input you can set Manual:$wgMathDisableTexFilter to 'always' and use a custom mathoid installation. This uses mathjax in the background and in theory you might be able to use all the packages that exist for MathJax. However, for algorithms you should be better off with extension Extension:SyntaxHighlight. Extension math was designed only for math and some chemestry. Physikerwelt (talk) 14:07, 4 December 2020 (UTC)
- I think your right. As of right now I will use the following example from wikipedia to write my pseudocode:
algorithm Halton-Sequence is
inputs: index
base
output: result
while do
return
- Although it would be great if we could render tikz directly through mathoid (not sure if that's possible) 138.51.8.165 (talk) 20:59, 8 December 2020 (UTC)
- The above comment was me (forgot to login). Cuppajoelad (talk) 21:00, 8 December 2020 (UTC)
SVG is always rendered
In my settings I have explicitly set the render to be `mathml`, see these lines in my `LocalSettings.php`
# Allow Mathmatical formatting
wfLoadExtension( 'Math' );
$wgMathValidModes = ['mathml'];
$wgDefaultUserOptions['math'] = 'mathml';
Anything I write in the math tags always shows up as an svg.
For example one of them lead to this link: https://wikimedia.org/api/rest_v1/media/math/render/svg/a137aa404d27ba648640b3badea2c0c53e45989c, which seems to explicitly be asking for an svg, pasting that link in a new tab with svg replaced by mml yields:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block" alttext="{\displaystyle M_{f}\left(n\right)=\left\lfloor \log _{2}(n)\right\rfloor +1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>M</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>f</mi>
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mi>n</mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mrow>
<mo>⌊</mo>
<mrow>
<msub>
<mi>log</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<mo>⁡</mo>
<mo stretchy="false">(</mo>
<mi>n</mi>
<mo stretchy="false">)</mo>
</mrow>
<mo>⌋</mo>
</mrow>
<mo>+</mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle M_{f}\left(n\right)=\left\lfloor \log _{2}(n)\right\rfloor +1}</annotation>
</semantics>
</math>
Which gives the correct MathML output. I wanted to know if this issue was just on my wiki, so I looked on wikipedia, went to appearance in the preferences and the math option was checked on MathML with svg fallback. Then I went to a page on wikipedia and it also indeed only loaded svg's...
Not sure what's going on here, but any explanation/fix would be highly appreciated! Cuppajoelad (talk) 21:11, 8 December 2020 (UTC)
- This seems to work: https://en.wikipedia.org/wiki/User:Cscott/MathML -- it generates mathml, and also svg fallback. What were you expecting? cscott (talk) 21:48, 8 December 2020 (UTC)
- After some discussion on IRC we determined the problem was simply that my browser (chrome based) didn't have support for mathml, and then having a closer look at Extension:Math#Viewing math shows us that we need a certain extension. After installing said extension, everything works right. Cuppajoelad (talk) 22:02, 8 December 2020 (UTC)
Google Chrome bug causes incorrect formula display
The MediaWiki support desk is reporting a bug with the Windows 10 version of Chrome. Chrome fails to display the minus '-' sign when zooming at certain levels of magnification.
Please see: Minus sign not visible in chrome on following page
How can this be reported to the Chrome developers? Lady G2016 (talk) 16:03, 14 January 2021 (UTC)
$wgMathValidModes are ignored on Mediawiki 1.35.1
$wgMathValidModes does not forbid user or server to use the excluded options. I tested only on Mediawiki 1.35.1. For example, the below LocalSettings.php allows user to use 'source' or 'png':
wfLoadExtension( 'Math' ); $wgMathValidModes[] = 'mathml'; $wgDefaultUserOptions['math'] = 'mathml';
166.104.144.95 (talk) 02:28, 2 April 2021 (UTC)
"Math extension cannot connect to Restbase"
See example broken page: https://en.wikipedia.org/wiki/Generalized_inverse Jameshfisher (talk) 14:15, 6 April 2021 (UTC)
configure size of the formuls
hello, at the moment the extension simple math jax is the extension with setting for personalizate the formuls of math and chemistry, the extension have the config $wgSmjScale for change the size of the formuls, the extension math have that config similar? PetaloAzul (talk) 01:42, 24 April 2022 (UTC)
Math Status Errors
RESOLVED | |
Giving it loads of RAM solved the issue. |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hi,
I'm trying to understand where the Math extension writes temporary files as I want to check the folder permissions. Can anyone point me in the right direction?
I am basically trying to solve an issue where the rendering fails and when I check Math Status in the special pages on my wiki it shows:
MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools)
Running backend tests for rendering mode MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools).
Test Rendering the input "x^2+\text{a sample Text}" succeeded.
Test Comparing to the reference rendering succeeded.
Test Rendering of a+b in plain MathML mode succeeded.
Test Checking the presence of '+' in the MathML output succeeded.
Test Comparing the generated SVG with the reference failed.
Test Checking if MathML input is supported succeeded.
Test Rendering Presentation MathML sample failed.
Test Checking if the link to SVG image is correct failed.
Backend tests for rendering mode MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools) completed.
As you can see the first failure is where it tries to compare the generated SVG with the reference. I am curious as to whether it is unable to save the generated SVG to the temporary directory.
Hope someone can help me out as I've been trying to solve this for several days now.
Many thanks in advance. Oravela (talk) 14:04, 16 November 2022 (UTC)
- The code is quite complicated, but I don’t think it tries to save the image into a temporary directory at all – instead, it reads the reference image from the
images/
directory, and compares it with the generated image in memory. Since SVGs are text files, one possible issue may be wrong line ending. Are you on Windows? - Special:MathStatus also seems to log a fair amount of information. Did you enable debug logging (see Manual:$wgDebugLogFile)? Tacsipacsi (talk) 17:07, 17 November 2022 (UTC)
- Hi @Tacsipacsi,
- Many thanks for getting back to me.
- I have been further investigating and found an example in the logs where the first three math equations in a page fail, but the fourth is successful. The error log shows:
- (curl error: 56) Failure when receiving data from the peer
- (curl error: 27) Out of memory
- (curl error: 27) Out of memory
- [http] HTTP complete: code=200 size=133 total=0.167406 connect=0.039775
- This leads me to think that the failed to parse error is actually due to a memory issue on my web server. I will post any further updates I have here to hopefully help others that may have issues with the math extension.
- If you think there is any there issue causing these errors, of course, please let me know. Oravela (talk) 12:19, 22 November 2022 (UTC)
- Update.
- My log file also showed the following error:
- [http] Error fetching URL "https://wikimedia.org/api/rest_v1/media/math/check/tex": (curl error: 6) Couldn't resolve host name
- The visible error on the media wiki page looked like:
- 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://en.wikipedia.org/api/rest_v1/":
- I tried, but they did not work, the fixes explained by @Johanngan in this discussion topic:
- https://www.mediawiki.org/w/index.php?title=Extension%20talk%3AMath/Archive%202016%20to%202024/Flow%20export#c-Johanngan-2019-07-02T03%3A17%3A00.000Z-Nyet-2018-11-08T01%3A38%3A00.000Z
- What did work was increasing the memory on my web server to 2048MB. This should not have been necessary but it did solve my problem. I hope this may help others who run into the Math extension cannot connect to Restbase error message. Oravela (talk) 11:18, 23 November 2022 (UTC)
- Thanks for sharing your solution. I’s indeed strange, 2 GiB is a lot… I’ll now close this thread, but feel free to reopen it if you have anything to add. Tacsipacsi (talk) 21:15, 23 November 2022 (UTC)
Installing math problem
I have installed Math version 3.0.0 (7fac46b) today, as seen in the Special:Version page( My wiki version 1.37.1). Following the instructions I run the updatescript, my screen show's this:
...collations up-to-date.
...index rc_name_type_patrolled_timestamp already set on recentchanges table.
...rev_page_id index already non-unique.
...pl_namespace, tl_namespace, il_to indices are already non-UNIQUE.
...h
and Its still running.
Is there a so;lution/option to shorten this process?? 1957Harry (talk) 21:46, 26 December 2022 (UTC)
User interface suggestion
Recently at English Wikipedia's Help talk:Displaying_a_formula (sorry, the editor here won't actually let me link), a user raised a reasonable complaint. In Preferences / Appearance / Math, the two radio button options are to render math as LaTeX source or as SVG. The typical user doesn't know what either one is. They just want to see well-typeset math, like in publications. So how about re-wording the second option? Maybe "publication-like notation rendered via SVG"? Or something better! Thanks. Joshuardavis (talk) 13:57, 7 May 2023 (UTC)
Failed to parse. Math extension cannot connect to Restbase.
I am new to MediaWiki, and I have created private wiki and was able to display math in my wiki pages. However, after having a certain number of equations, I get these error messages:
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y=x+1}
The page contains text and about 15 equations spread throughout. The error occurs when I try to add a 16th equation, which causes all the equations to display a similar error. I also simplified the page so that the page just contained numerous lines of <math>0</math>, but it was the same issue.
Can anyone assist me on this issue? I know this error has been discussed many times before, but I couldn't get a proper fix for it.
I am using MediaWiki 1.39.3 and PHP 8.2.0 (apache2handler). In LocalSettings.php, I have simply added wfLoadExtension( 'Math' ) with no other configurations. Blyatman9000 (talk) 23:37, 13 July 2023 (UTC)
- I often receive such message "Math extension cannot connect to Restbase." Especially if I have a lot of formulas at the page. Is there a way to resolve the problem? Fokebox (talk) 14:34, 30 August 2023 (UTC)
- This is happening to our wiki as well, even when adding just a single mathemathical formula.
- Happens both in official pages and profile pages
- https://creatures-of-sonaria-official.fandom.com/wiki/User:Vic09282
- https://creatures-of-sonaria-official.fandom.com/wiki/Category:Creature_Abilities#Energy_Breath_2 138.100.155.219 (talk) 09:54, 15 December 2023 (UTC)
- I also have the same problem of "Math extension cannot connect to Restbase", can someone help me fix it? Agatnor (talk) 17:17, 16 October 2024 (UTC)
Setup Proxy for curl used by Math extension
I am fairly new to MediaWiki, please be kind :)
I have the Math extension installed (version 3.0.0) with the recommended output mode 'mathml', using Mathoid as the default service. My MediaWiki version is 1.39.4.
I receive "Fatal exception of type "MWException" when loading my wiki's page Special:MathStatus (e.g. Special:MathStatus)
In my MediaWiki log I read:
[Math] Start rendering "x^2+\text{a sample Text}" in mode mathml [http] HTTP start: POST https://wikimedia.org/api/rest_v1/media/math/check/tex [http] Error fetching URL "https://wikimedia.org/api/rest_v1/media/math/check/tex": (curl error: 28) Timeout was reached [Math] Tex check failed
It looks like I have a connection issue to the Mathoid service hosted by wikimedia.org.
I must use proxy for all external webrequests in the network my Wiki is hosted.
I have set option $wgHTTPProxy in my Wiki's LocalSettings.php and confirmed this setting took affect by enabling images on my wiki hosted by InstantCommons.
The manual pages for $wgHTTPProxy (Manual:$wgHTTPProxy) states that it sets the proxy for curl.
Does this setting also apply to curl used by the Math extension?
Or do I have to separately configure a proxy for curl used by Math extension? How can I do this? Cheellaz (talk) 14:20, 29 September 2023 (UTC)
Documentation issue
I am not sure if I identified the following as true issues, therefore, I didn't dare to change the documentaiton on myself. Maybe one of the devlopers can have a short look here?
In chapter 4 List of significant configuration settings, the table has in rows 3 and 4:
Setting name | Default value | Description |
---|---|---|
$wgMathFullRestbaseURL | false | The math extension gets the default config from the Visual Editor, if available. Details. |
$wgMathPreferRestbaseURL | true | Whether to allow using of internal RESTBase path instead of $wgMathFullRestbaseURL and $wgVisualEditorFullRestbaseURL. Set false if you want to use external RESTBase in any case. |
The table would make more sense to me, if the setting name '$wgMathFullRestbaseURL' is replaced by '$wgVisualEditorFullRestbaseURL', since '$wgMathFullRestbaseURL' is already defined in chapter 3.1.1 Mathoid as a service as https://wikimedia.org/api/rest_, and cannot be set to a boolean value at the same time.
Another question in regard to the Details link: It currently refers to MathRestbaseInterface.php#182 ($rbi = $rbis[$i++];). Is the link potentially broken? *Surak* talk 22:55, 6 January 2024 (UTC)