# Quick Guide to LaTeX (Part 1)

Updated: Jun 14, 2019

### We all have used Microsoft Word, Office, Google Doc, Apple pages etc. But all of us have found problem when we want to write some math in these apps. So how to write this math documents easily and faster? Yes you guessed it right, using LaTeX.

### Many of my friends asked me to teach them LaTeX. One of my dear friends suggested me to write a blog about it & here I am..

### So what is this LaTeX? Basically LaTeX is document preparation system. While writing , writer uses plane text opposed to the formatted text found in word processors like Microsoft word, Apple pages etc.

__Downloading the software__

__Downloading the software__

### The first step in learning LaTeX is to download the software. We will require total 2 software packages

### 1] LaTeX Distribution:- This turns our code into readable document

**For Windows user : MikTeX**

**For Mac OS : MacTeX**

### 2) LaTeX Text editor:- To write our code

For beginners **Texmaker** is the best editor because it has many user friendly features.

In this blog I'm going to use Texmaker as editor.

**Setting up your document**

**Setting up your document**

### First we have to configure Texmaker. Go to Options and select Configure Texmaker

1]Under commands, **check in the Embed box** it will allow us to see the code and the output simultaneously

### 2] Under Quick build select **PdfLaTeX + view PDF**, it will automatically convert your (readable) document into PDF format.

### 3] Under Editor select **Word wrap, Completion, Show line number**. If you want you can select the last option of **Backup document in every 10 minutes**

After Following these steps we are ready to start Texing...

__Writing a Document__

__Writing a Document__

Before writing a document one has to save it first, otherwise the code will not get compiled.

Click on "New" & save it. Here i'm saving it as Tutorial

After saving the document, following will be the look of Texmaker

### In LaTeX when we want to write a command we use "Back slash" ( \ )

### All documents in LaTeX starts with one command which is **\documentclass[.]{.}**

### You can see there is 1 square bracket and 1 Curly brackets. In square bracket we are supposed to write font size. And for that we have options '**10pt**' or '**11pt**' or '**12pt**'. And in curly bracket we are supposed to write type of document. Here I'm using article as type of document.

### To start any document one must write a command ** \begin{document}. **Similarly at the end of documen**t \end{document} **command must be written. Absence of any one of them will give an error in error box below.

### In LaTeX to write math you need to follow a simple rule, "Whenever you want to write in math use Dollar ($) sign."

### Now I want to write a polynomial with degree 2. I will use **Caret (^)** symbol to assign power. Other signs (Plus, minus, equality) have their usual meaning.

### Now if we are writing a paragraph which contains an equation and we are supposed to differentiate the paragraph from an equation using space-bar will be tedious work. Instead we give double dollar sign. This command tells the software to write the equation on special line. Therefore command will look like $$MATH$$.

**Remember that if you have used dollar sign at the beginning of Mathematical text then you are supposed to give Dollar sign at the end also.**

### Now I am going to give an brief idea about how to write logarithmic functions, trigonometric functions, squares & square roots, Greek letters, subscripts etc. in LaTeX. Also i will give a brief idea about use of brackets

**Subscripts & Superscripts**

**Subscripts & Superscripts**

### For subscripts we use **underscore (_)**. For Superscripts we use **Caret (^)** sign

__Greek Alphabets__

__Greek Alphabets__

### For Greek alphabets we use back slash and then the spelling of that alphabet

### Eg. For **Alpha => \alpha, Pi => \pi**

### As shown above we can use "Double Backslash (\\)" to break the line.

**Fractions**

**Fractions**

### For Fractions we use command **$\frac{}{}$**. First of curly bracket indicate numerator and second indicates Denominator.

### When we write fraction in a sentence due to the font size numerator and denominator does not get properly separated. To solve this problem we use command **\displaystyle** before **\frac{}{}**

### Note: 1] Command **\frac{}{}** must be inside dollar sign.

**Roots**

**Roots**

### For Square roots we need to use command **$\sqrt{}$.**

### For higher roots we just have to add box bracket before curly brackets. Therefore **$\sqrt[]{}$**. If you write 3 in Box bracket software will show cube root and so on.

__Logarithmic Functions__

__Logarithmic Functions__

### For logarithmic functions we use the command $\log_n(x)$, where n denotes the base of log. For natural log we use $\ln_(x)$

__Trigonometric Functions__

__Trigonometric Functions__

### For Trigonometric functions we use command **$\sin(x)$, $\cos(x)$, $\sinh(x)$.**

### This is it for the first part. I will write more about etitting mathematics in LaTeX in coming part.

### If you have any doubts please feel free to contact me on my email **prabhanjan1804@gmail.com.**

### If you like my blog do not forget to **like** and **share**.

### Thank you & Happy Texing....

228 views3 comments