## Mathematics tools

### Font Size in LaTex

Font Size in LaTex

I'm having trouble with LaTex. My lesson module in moodle won't display text as anything other than the default size.

I've tried:

\fs7

\fontsize{15}

\Huge

varying the numbers to try and alter the text size. \fs7 has no effect, neither does \Huge. \fontsize{15} breaks the code and displays an empty placeholder icon. I also tried \fontsize{15}{20}, which is more correct and it had no effect, but the code didn't break.

\fontsize{15} works fine in the quiz module, but isn't working in the lesson. Any ideas anyone?

Average of ratings: -
Re: Font Size in LaTex

Anyone at all?

Average of ratings: -
Re: Font Size in LaTex

Sorry no one has gotten back to you.
The Moodle LaTex filter is old and needs major reworking and no one apparently is interesting in taking that on. A number of issues with how the filter interacts with various modules have been identified over the years and often the best solution is to eschew the filter and employ something like MathJax by adding the reference to it in your AdditionalHtml. This reduces the overall functionality of LaTex but also alleviates much if the heartache.
As a matter of curiosity, what happens if you copy and paste this into your lesson: " \red \huge x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12) "
$$\red \huge x \ = \ \frac{\sqrt{144}}{2} \ \times \ (y \ + \ 12)$$

Average of ratings: -
Re: Font Size in LaTex

I just gave that a go and the lesson module does not like the \red command at all. It just shows the image placeholder rather than any tex code. The \huge tag makes no difference whether it's there or not.

Out of interest, what code do I have to add to my AdditionalHtml in order to run MathJax? I've not done that before.

Average of ratings: -
Re: Font Size in LaTex

https://moodle.org/mod/forum/discuss.php?d=193064

has a simple MathJax code (check the top right corner attachment mathjaxcdn.txt in that post)

Remember to disable tex filter if you use MathJax instead of tex filter.

Average of ratings: -
Re: Font Size in LaTex

Note also that you can freely scale MathJax math with normal html tags like

<div style="font-size: 200%;">
 \frac{d^2u}{dx^2} + L\sin u = 0 
</div>

or set the font-size of span,div,... around the double dollars with editor font size drop down list in editor toolbar - no tex commands required...

Or you can use styles and classes with mathjax like http://korpelainen.net/m2mathwiki/index.php/Style which gives much more options than plain tex commands.

Average of ratings: -
Re: Font Size in LaTex

Hi Chris,

I am curious as to which version of Moodle and what OS you have it running on? I have Moodle 2.3.4+, Moodle 2.4.1+, and the Moodle 2.5 all from last weeks git running on Centos 6.3, and all three have no problems using LaTex in the Lesson module.  In all three Moodle's I am using the default settings for the plugin. To originally get LaTex to work I had to install the 32 bit version of glibc even though the rest of my Linux is 64 bit.

Moodle 2.5

Moodle 2.4.1+

Note: I'm not sure why, but the Moodle 2.5 seems to give a bigger size than the 2.3 or 2.4 whether using huge or Huge.

Average of ratings: -
Re: Font Size in LaTex

I don't think this is a TeX problem because some TeX is working, and for the most part it is a workring or not situation unless specific codes are being stripped by Moodle (and that behavior can be modified) or unless there is an artificact in the relation between the filter and a module (as we see in the appearance of TeX in the MC quiz type.)

Frankly AL suggests a test;  zip up your lesson, Chris, and post it to the forum where AL can download and compare on a Moodle where it the same seems to be working.  If it works for AL, then Chris needs to check his parsing of the text to see if something is geting stripped,  or possibly adding the library that AL suggests.  If it does not work,  then either there is something untoward in Chris' TeX, the problem is a subset (as in the Tex won't work in drop downs, as opposed to the text portion of the lesson, a demo of which was not included in AL frame shot), AL has turned off the Moodle filtering of certain combinations that is causing the issue for Chris, or the library is causing the problem (and as I noted,  I doubt the last possibility,  but who knows.)

Re MathJax,  you might want to spend a little time after doing the step Mauno pointed you to so as to become familiar with the various tokens you may want to use and how they work.  There are a numbr of different defailt configurations that you can invoke (for example, you can also invoke ASCIIMath) and a variety of different ways you can set your tokens.  You could in fact leave your TeX filter on to address legacy TeX and then implement new tokens for MathJax, this will increase your overhead a little but also mean that you can standardize on new MathJax Tokens,  while requesting that teachers examine their legacy TeX to determine if it will run under MathJax

Average of ratings: -
Re: Font Size in LaTex

I'm running Moodle 2.4.2+ and we have it hosted by an external company so I have no access to the server at all so I don't know what Linux they're running.

This probably doesn't clarify anything but now the same problems have started happening in my quizzes too rather than only in lessons.

Average of ratings: -