Latex Code 101


This is where latex comes in handy. It is a typesetting system specially made for mathematics. The only downside of it is that it requires a bit of learning to get used to the way of writing things. Latex allows you to write equations very quickly and with ease, and you can easily format equations and make them look much better than in Word or Powerpoint.

So how do you write an equation using latex?

There are a few ways to go about this, but I will show the most straightforward way: just download the editor called Texmaker, which can be downloaded for free here.

The basic syntax for writing equations is as follows:

$$\text{This is an equation}$$

You can use regular text inside the dollar signs, or you can use special symbols that corresponds to certain operations: + – * / = etc. You can find these symbols by searching on google or by taking a look at this great post on the subject.

Latex is a typesetting language. It is used in various fields, including academic and commercial publishing, but also in many other forms of document production – primarily in the sciences and engineering.

It is especially useful for long documents such as books and theses, because it allows the user to easily cross-reference pages, equations and figures, rather than having to manually count pages or write out page numbers.

It also allows for automatic generation of tables of contents, lists of figures and tables, bibliographies and index. Latex also has its uses in design: it can easily produce high quality graphics to be included into documents.

Latex is somewhat unusual in that it isn’t a program you run to create a document: instead it’s a markup language you use to create a text file which can then be converted into a final document. The conversion process is done by another program called latex which takes your text file as input and generates your final output (usually PDF) as output. Thus using Latex is really more like programming than using a word processor. Fortunately it’s not too hard to get started with latex, although there are some concepts that may take a little getting used to.

If you’re interested in learning more about the technical aspects of Latex

Latex is a markup language whose primary purpose is to display mathematical formulas and equations. It’s used by scientists, mathematicians, engineers and other professions to write in a way that is easy to read and understand. This markdown can be easily converted into HTML or other formats. If you are not familiar with Latex, an example of the code would look like this:

$$\sum_{i=0}^{n}\frac{1}{i^2}=\frac{\pi^2}{6}$$

First, let us try to understand what is LaTeX? Well, according to Wikipedia:

LaTeX is a document preparation system and document markup language. The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to create a document in LaTeX, a .tex file must be created using some form of text editor. While most simple text editors suffice, there are many features that make life easier when writing LaTeX. Some of these features include syntax highlighting, auto-completion and spell checking.

To simplify things for you: it is a type of code that enables you to write professional documents with ease. It has many advantages over other types of code (like Markdown), but you also need to spend some time learning how it works and how it can be used.

For example, I am using LaTeX right now. This article was written in LaTeX and exported into markdown (with the help of pandoc). So let’s start by looking at the code used for this article:

LaTeX is a markup language for typesetting documents. LaTeX is most commonly used to create documents for academic, scientific, and mathematics use. This guide will focus on the writing of these documents using LaTeX, specifically the TikZ package. Since TikZ is based on the PGF Graphics package the code generated by TikZ can be included directly into LaTeX code.

LaTeX is a typesetting program that takes a plain text file with various commands in it and converts it to a formatted document based on the commands that it has been given. It was originally written by Leslie Lamport and has become quite popular within the scientific community due to its powerful mathematic functions.

To write a document in LaTex you must first create a file with extension .tex (i.e., myfile.tex) and then compile the file with a pdf compiler such as pdfLaTex or Latex. The reason you must compile the file is because all formatting is done by the compiler and not through your text editor (although some text editors such as TexStudio do offer some formatting options that can help edit your document).

%%%

%%% preamble

\documentclass[12pt]{article} % Default font size and left-justified equations

\usepackage{graphicx}

\usepackage[utf8]{inputenc} % Required for inputting international characters

\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage{amsmath} % Needed for \boldsymbol (vectors)

\usepackage{amssymb} % Needed for \mathbb (real numbers, natural numbers, etc.)

\usepackage{amsthm} % Needed for theorems

\usepackage{bm} % For bold math symbols

\usepackage{booktabs} % Top and bottom rules for tables

% Custom table rules from http://www.tablesgenerator.com/latex_tables.html

LaTeX is a very flexible program for typesetting math, but sometimes figuring out how to get the effect you want can be tricky. Most of the stock math commands are written for typesetting math or computer science papers for academic journals, so you might need to dig deeper into LaTeX commands to get the vector notation styles that are common in physics textbooks and articles.

Math in text

If you want to put a small piece of text in a specific type style, you can do it as follows:

\textit{italicized text}

\textbf{boldface text}

\texttt{typewriter text}

These commands work for all sizes, including footnotesize, scriptsize, etc. For more details see “Font Sizes” on p. 25 of the LaTeX Companion by Michel Goossens and Frank Mittelbach.

Vectors and Matrices

Vectors are often typeset in boldface (as $\mathbf{x}$), but this doesn’t look very good in a mathematical formula like $x = \mathbf{x}$, because it looks like there’s an extra bit of space between the variable and its description. I prefer to define a new command, \vv,


Leave a Reply

Your email address will not be published. Required fields are marked *