TeX Filter : Images are blurred

TeX Filter : Images are blurred

by Vignesh Gurusamy -
Number of replies: 11

Hello,

Initially the mathematical equations were not loading because the tex modules were missing in the my server (Ubuntu 14.04). After installing the modules, the images are loading fine. But the images are blurred

I have tested with multiple Moodle instances like 2.1, 2.4, 2.6. All are producing the same blurred images.

Commands used to install the packages

  • sudo apt-get install texlive-full
  • sudo apt-get install imagemagick

I have attached the settings screenshot of tex Notation. Please help me to fix this issue.

Thanks in advance.

Attachment tex.PNG
Average of ratings: -
In reply to Vignesh Gurusamy

Re: TeX Filter : Images are blurred

by Sakshi Goel -

Hello Vignesh,

Please debug your equation. Follow docs here https://docs.moodle.org/26/en/TeX_notation_filter#Debugging_TeX_filter .

Sometime by unticking and ticking the 'Use slash argument' setting in Moodle fix this. Go to Administration > Site administration > Server > HTTP  for setting.

In reply to Sakshi Goel

Re: TeX Filter : Images are blurred

by Colin Fraser -
Picture of Documentation writers Picture of Testers

ummm Running the debug is not going to show anything, but look at the settings. See Density 120pixels.  In short, it is the filter that cannot render the images properly. If you look here, 

\( \small x \times 14 \div 4 = 21 \)

All I have done is to enter the equation  \small x \times 14 \div 4 = 21 in the MathJax equation editor. In TeX it looks the same:  

$$ \small x \times 14 \div 4 = 21 $$

The quality of the render is pretty good in this forum, but not in a production Moodle. It also renders large, the 120px density, so I have added the required \small command. Pity... 

But please do not feel you are an orphan here. I have given up on Moodle's TeX non-capabilities, so am writing everything in TeXLive and uploading the PDFs to Moodle. Definitely NOT my preferred option, but it is the only way I am going to get the quality of reproduction I want.

However, if you disable the TeX filter and use the MathJax equation editor, you are likely to get a better result. Please ignore the fact that using MathJax is more labour intensive, and is not as responsive as TeX,  However, having said all that, I get a much better render in v2.7.1 than I ever has been before, and I have disabled TeX. Try it...  

BTW, if you want a chemistry TeX then have a look at this page: https://moodle.org/mod/forum/discuss.php?d=269149 and don't be put off by the issue I had... is vastly improved.

In reply to Colin Fraser

Re: TeX Filter : Images are blurred

by Mauno Korpelainen -

Colin,

THIS IS a production Moodle (moodle.org) - Moodle version 2.7 where MathJax is the default renderer in mathjaxloader filter and Atto editor plugin wink

In reply to Mauno Korpelainen

Re: TeX Filter : Images are blurred

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Well, Mauno... I am not having a lot of luck with it. Agreed, there is an improvement in the rendering when using TeX and PNG, but the quality is not a lot better. This image below is four different results, each labelled:

mixed results  

I have tried to keep them as faithful to what was seen onscreen, by not changing size or density. and the difference in results between each different state is not what could be called reasonable. 

Mauno, I have tried to be patient, and I accept the comment you have made regarding PDFs and mobiles, scalability etc, but the simple fact is that I just cannot get the quality or ease of editing I want in Moodle. It just takes too much time to get an uncertain result. For me, this is really disappointing, and I am now teaching other maths and science teachers to use TeXLive. They saw what I was doing and asked, then wanted in on it. I will pass on your concerns to them when we meet next Tuesday, things I had not considered so thank you. I must admit though, I am getting a far more positive response with TeXLive than with Moodle - and I should not be.   

In reply to Colin Fraser

Re: TeX Filter : Images are blurred

by Mauno Korpelainen -

There is no big difference in normal text vs images on screen resolution but try to press a couple of times CTRL + , CTRL + ... and CTRL 0 back to normal

or print for example page http://www.mathjax.org/demos/tex-samples/ with laser printer and compare it to a page created with latex images.

Here you see the difference:

example

(MathJax alpha vs TexLive alpha created in 100 dpi and scaled on screen/browser)

If scale is set to 100 (100%) MathJax takes surrounding font size and color automatically or you can change styles just as "easily" as you can change sizes or colours of normal font  - in latex images everything is pre-set or you need commands like \small or \Big (that do work also in MathJax)

 

In reply to Colin Fraser

Re: TeX Filter : Images are blurred

by Mauno Korpelainen -

 

And your opinion about difficulty of editing mathematical notations in moodle is of course correct - I totally agree.

I am writing this post with a mobile phone and even this "normal typing" letter by letter is slow. I have used some years in testing different maths output & input methods from students and teachers viewpoint and it is really frustrating to notice that no solution is perfect. Personally I use at home nowadays mostly MathType (99 USD) if I need to create equations quickly and copy&paste them directly to moodle that renders equations with mathjax. In MathType I have moodle export format on and it adds double dollars automatically when I copy "wysiwyg maths". One benefit is also that moving formulas from office tools like MS Word or Libre Office Math is easier. The sad thing is that there is no good free open source online tool option available for students - so far. Still I am sure we are going to have such tools in the near future. I gave up but some other open source tool developers are going to finish that task

In reply to Mauno Korpelainen

Re: TeX Filter : Images are blurred

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

Mauno,

The slow typing feature is one of several issues with the equation editor. See MDL-45867.  Resolving them will make entering mathematics significantly easier.


In reply to Daniel Thies

Re: TeX Filter : Images are blurred

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Daniel is right...if it was just me I would say "Well, get over yourself and just get on with it!" And it is that interrupted workflow created by the stop start nature of using the equation editor that is turning a lot of my colleagues off. Not just Moodle, but Word as well. Decent tools are, as you point out Muano, not that readily available and the ones that are well.. they suck. I have a copy of Libre Office, but have just not gotten around to testing it out... been so long I will have to download it again I expect. It's boiling down to time spent on doing things. Long emails even on my super-duper, ultra, you beaut smartphone thingy are still slow. If I need to make a detailed response, I will wait until I have my laptop or desktop in front of me. 

Oh, Visvanath posted this video link in another forum, Richard Stallmann talking at Geneva earlier this year (it was posted in June), its not over-long.. enjoy... says some things that we need to be somewhat mindful of, i would suggest...  



In reply to Vignesh Gurusamy

Re: TeX Filter : Images are blurred

by Mauno Korpelainen -

Try to change the convert output format to PNG (only Mimetex fallback should use GIFs)

Moodle.org forums are using MathJax (with filter in moodle 2.7) and if you want you can as well disable tex filter and add mathJax script  tags to Additional HTML in Site Administration > Appearance > Additional HTML in any version of moodle 2.X

 Attached file example.txt with one example code that uses double dollars for inline maths and @d:s for display  maths and can use also mhchem commands for chemistry.

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: TeX Filter : Images are blurred

by Vignesh Gurusamy -

Thanks Guys. 

It worked after changing the output format from GIF to PNG.