<< BACK

How to write an equation or formula within a question

Introduction

No matter mathematics, physics or economic, usually when we describe principles, we can't escape from using formulae. When you read textbooks or articles of Wikipedia, there are a large number of formulae:

An article of Wikipedia which contains a lot of formulas
(From General relativity - Wikipedia)

However, it's very difficult to write them into websites. It requires the understanding of HTML, CSS and even JavaScript (some technical syntax and programming languages for composing every web page). If you're familiar with those technical stuffs, it's also very tedious for you as a computer expert to write a single formula by using a piece of long long code. Moreover, it's nearly impossible for a teacher who hasn't any professional training related to computers.

Therefor we provide a simpler solution for you to compose those formulae in handout or on screens.

Principles and Concepts

Our system introduced two markup languages to represent formulae, they are:

  • Simple mode: using commonly used characters to write equations, but only limited functionality;
  • LaTeX mode: a professional markup language to typeset documents which is widely used in industry. It can produce very complex equations.

Our system will translate the syntax of simple mode into LaTeX, which can be further translated into those tedious technical long long stuffs mentioned before (academically speaking: HTML, CSS and JavaScript) to display the formulae. These translations can be done in an automatic way, so you don't need to worry about those complex things.

Steps

While editing, you can write an equation or formula in any input boxes.

Simple mode

You can write an equation by enclosing it in [math] and [/math] tag, for example:

[math]1/x+1/y[/math]
$$ \frac{1}{ x}+\frac{1}{ y} $$
[math]sin(x)[/math]
$$ \sin\left( x\right) $$
[math]x^y[/math]
$$ { x}^{ y} $$
[math]ax^2+bx+c==0[/math]
$$ { ax}^{2}+ bx+ c=0 $$

LaTeX mode

You can write an equation by enclosing it in [latex] and [/latex] tag, for example:

  • [latex]x = {-b \pm \sqrt{b^2-4ac} \over 2a}[/latex]
    $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
  • [latex]
    \vec{\nabla} \times \vec{F} =
        \left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z} \right) \mathbf{i}
      + \left( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \right) \mathbf{j}
      + \left( \frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right) \mathbf{k}
    [/latex]
    

    $$ \vec{\nabla} \times \vec{F} = \left( \frac{\partial F_z}{\partial y} - \frac{\partial F_y}{\partial z} \right) \mathbf{i} + \left( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \right) \mathbf{j} + \left( \frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y} \right) \mathbf{k} $$
  • [latex]
    \left(\int \left|f(x)+g(x)\right|^p\,dx \right)^{1/p} \leq
    \left(\int \left|f(x)\right|^p\,dx \right)^{1/p} +
    \left(\int \left|g(x)\right|^p\,dx \right)^{1/p}
    [/latex]
    

    $$ \left(\int \left|f(x)+g(x)\right|^p\,dx \right)^{1/p} \leq \left(\int \left|f(x)\right|^p\,dx \right)^{1/p} + \left(\int \left|g(x)\right|^p\,dx \right)^{1/p} $$

Conclusion

LaTeX is a powerful and commonly used language. You can use it to write any complex equations. If you want to know more about LaTeX, there is more detailed information:

It’s easy to get started!

And it's free.
© 2024 Professor Beaver. All rights reserved.
Contact us
Photo by Clarisse Meyer on Unsplash