Introduction to Latex

Latex is language that translates latex code into Mathematical. I am probably not making much sense right now so let me show you what this powerful tool can do. Here are a few examples :

Math Examples




Physic Examples

After looking at what latex can do, let’s learn how to use latex.

Learning how to write Latex

Any latex code is enclosed between two $ signs. Anything written in between is written in latex font after it has been processed by the latex compiler.

Anything that doesn’t have a forward slash, \, as a prefix, is considered to be either a number, a variable, or a operator.

Before we go ahead with latex functions, let me put my words into context with examples.

Latex CodeRendered Text
$x = 1 + 2$
$y = mx + c$
$(6 - 5) + 2 = 3$
$L = [a, b, c, d]$

Whitespace Issues:

Note that a Latex code like will not be rendered as Latex. This is because followed by the opening dollar sign ($) must be a character other than a whitespace / blank, “ ”. And the character before, the closing dollar sign ($) must be a character other than a whitespace / blank , “ ”.

Writing regular text with Latex:

Let’s take an example, let’s say we want to write:

You may decide to write the latex like this:

$sin x = 0.5$

But this will actually render out like this:

You can see the differences now, the ‘s’, ‘i’, ‘n’ in sin are not the spelling for the function but instead are treated as variables. To the a person reading, this will make no difference but for to keep things consistent we recommend using the sin function which will be explained in below

Subscripts and Superscripts

Accessing the Latex drawer

A whole collection of extras are locked behind a single character, \. Typing the symbol allows you to allow you to treat the next word that is directly after it as a:

  • Function
  • Secret operator
  • Secret variable
  • Text formatting function
  • Document functions
  • Miscellaneous

How to type the character, '\' in Latex

Forward slash or “\” in Latex and other programming languages is called as the escape character. An escape character is used to type to type functions and is more of a utility in most cases. For example, typing \sin in latex will output the sin function and the originally “\” is omitted.

If the “\” is intentional, you could type a double slash in latex like “\\” will output a single “\

How latex drawer searches work

Any word after the initial slash, \ starts scanning the letters for the name of the function, variable or operator to search for as long as the scanned is a lowercase alphabetical character (a - z). The moment it scans a character other than that, a space, a number, a operator or any other character. The scanning is stopped and the word is retrieved. The word is then searched for in the drawer and the character or function associated with that is retrieved.

Mathematical Functions

Functions like , , are hidden behind the “\”. There are also other functions too!

A list of them will be provided below soon

Secret Mathematical operators

Look at your keyboard, there are only so many keys, and most of them are either letters or numbers. But in most fields of math you will encounter other variables, specifically Greek characters but there can be other ones too. For example : , , , , , .

A list of them will be provided below soon

Hard to access variables

A list of them will be provided below soon

Text Formatting Functions

A list of them will be provided below soon

Document Functions

A list of them will be provided below soon

Miscellaneous Functions

A list of them will be provided below soon