Typesetting mathematics on these forums with MathJax

Discussion in 'General study / exams' started by Calum, May 22, 2013.

  1. Calum

    Calum Member

    Equations in your posts

    Recently these forums were updated to facilitate the use of MathJax (www.mathjax.org).

    The short version: You can now use \(\LaTeX\) to lay out your equations, rather than attaching a word document. In other words, to produce nicely formatted mathematics, you can write out equations using some (fairly) simple coding, and your browser will render it for you.

    This guide is intended to get you started and provide a simple cheatsheet. If you find yourself wanting to know more, there is a list of links below. If you can't find the answer easily, post the question below and we'll see if we can solve it (and update this post!)

    But how does it work, I hear you cry?

    First of all, we have two choices. We can display the mathematics "inline", or "block style". To tell MathJax which, we wrap the code in delimiters.
    Code:
    Inline looks a bit \( mathematics goes here \) like this.
    
    Code:
    Block-style is  \[ mathematics \] like this or $$ this $$.
    
    A common mistake at this point is to get the order of the slashes and brackets mixed up. The double $ doesn't have this problem!

    Show me some maths!

    OK. If we enter some code like this:
    Code:
    \[ 7x + 1 = 50 \]
    
    We get \[ 7x + 1 = 50 \]

    Code:
    The solution, of course, is \(x=7\)
    
    The solution, inline, is \(x=7\).


    If you right click on the maths, you can see a useful context menu. "Show Math AS -> TeX Commands" will allow you to see the codes someone used to make their pretty equation.


    You can subscript and superscript things:
    Code:
    \[X^t_{n+\alpha_k}\]
    
    \[X^t_{n+\alpha_k}\]


    Notice that a single character can be subscripted or superscripted on its own, but for anything cleverer you need to put it in { curly brackets }.


    Symbols & other things

    Above we used \alpha. We can represent many symbols this way: for a comprehensive list see the links below. Some of the most useful are
    Code:
    \int_a^b
    \frac{x}{y}
    \sum_m^n
    \sqrt{x \cdot y \cdot \dot z}
    \prod_x\frac{\lambda^x e^-\lambda}{x!}
    
    which display:\[\int_a^b\]\[
    \frac{x}{y}\]\[
    \sum_m^n\]\[
    \sqrt{x \dot y \dot z}\]\[
    \prod_x\frac{\lambda^x e^{-\lambda}}{x!}\]

    What do we do about fancy actuarial notations?
    Most of them will work right out of the box. A noteable exception is everyone's favourite annuity symbol.
    There are several ways around this. The most simple is to use the \urcorner macro (upper-right corner), which looks a bit like this: \( a_{3\urcorner} \).
    For those who feel this isn't quite perfect enough, with a small amount of additional typing (requiring the "enclose" library) you can get this:

    Code:
    \[ \require{enclose}a_{\enclose{actuarial}{3}} \]
    \[ \require{enclose}a_{\enclose{actuarial}{3}} \]

    Much smarter!

    Another example:

    Code:
    \[
    \require{enclose}
    {}_{17|}\ddot{a}_{x:\enclose{actuarial}{n}}^{(4)}
    \]
    
    Looks like:
    \[
    \require{enclose}
    {}_{17|}\ddot{a}_{x:\enclose{actuarial}{n}}^{(4)}
    \]

    Notice we use an empty {} pair of brackets to attach the initial subscript to.

    Help!

    Here are some references which may be useful:
    1. http://amath.colorado.edu/documentation/LaTeX/Symbols.pdf
    2. http://www.onemathematicalcat.org/MathJaxDocumentation/TeXSyntax.htm
    3. http://docs.mathjaxorg/en/latest/tex.html
    4. http://www.stdout.org/~winston/latex/ - A useful general LaTeX reference.

    Or you could reply to this thread and we’ll do our best to help you but bear in mind we are studying for our exams too!
     
    Last edited by a moderator: Jan 22, 2016
  2. Harashima Senju

    Harashima Senju Ton up Member

    \[
    \require{enclose}
    {}_{17|}\ddot{a}_{x:\enclose{actuarial}{n}}^{(4)}
    \]
     
    Last edited: Aug 23, 2018
  3. biboextreme

    biboextreme Member

    \[\mathrm{EPV}=\require{enclose}500,000A^{1}_{30:\enclose{actuarial}{10}}=2,776.77\]

    \[\mathrm{EPV}=0.5(1+i_1)^{-1/2}+0.3(1+i_1)^{-1}+0.1(1+i_2)^{-3/2}+0.1(1+i_2)^{-2}=0.987\]
     
    Last edited by a moderator: Oct 27, 2017
  4. Harashima Senju

    Harashima Senju Ton up Member

    \[ \text{estimated total deposit} = \text{monthly deposit} * 12 * \text{deposit term} * (1+i)^{\frac{\text{Deposit term}}{2}}\]

    Does this feature work on the new forum threads?
     
  5. Ppan13

    Ppan13 Very Active Member

    I think they do but I decided not to bother trying it out in favour of the recommended Standard Keyboard Symbol/ Notation (listed in the Exam Handbook) that the institute suggest we use in the online exams now, as I prefer to practice using the exam format as much as possible. It's a pity in a way, cos the Mathjax version looks much smarter.
     
    Busy_Bee4422 likes this.

Share This Page