Skip to main content

LaTeX Tutorial: How to write mathematical equations in LaTeX

Those who use LaTeX for their documentation related works, usually are from STEM (Science, Technology, Engineering, Mathematics) background. These people use equations more often than not. Therefore, I will introduce how to write equations in LaTeX today.

In this tutorial we will go over following features:

  • Latex amsmath package 
  • Latex equation environment 
  • Using Simple equations like x = y + z 
  • Using Summation in equations 
  •  Using Integration in equations 
  • Using Cases in equation (if condition based values of a variable) 
  • Using fractions to write multiple-row equations
Watch the following video to learn how to do these things:


The code used in this Video can be found below:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\title{Writing Equations with Latex by http://QuickLatex.blogspot.com}
\maketitle
\begin{equation}
%x = y + z
%f(x) = x ^ 2
%f(x) = x_1 + x_2 + x_3 + ......+ x_n
%f(x) = \sum_{i=1}^{n} {x_i}
%f(x) = \int_{i=1}^{n}{x_i}
%X=
%\begin{cases}
%5, \text{if X is divisible by 5}
%\\
%10, \text {if X is divisible by 10}
%\\
%-1, \text {otherwise}
%\end{cases}
X =
\frac{\substack{\sum_{i=1}^{n} {x_i}}}
{\substack{\sum_{i=20}^{50} {x_i}}}
\end{equation}
\end{document}

Comments

  1. why exactly do you use \usepackage{amssymb}? is it useful to load it always with \usepackage{amsmath}?
    and do you know, how to create chemical structures? that would be really great!

    ReplyDelete
    Replies
    1. Dear Julia,

      Package amsmath is used for additional mathematical symbols which are not there by default.

      I will try to do some chemical symbols soon.

      Regards,
      Dinesh agarwal

      Delete
  2. How do we use the latex templates and styles? For instance, I have downloaded siamltex.cls and copied it to C:\Program Files\MiKTeX 2.9\tex\latex\ltxmisc and ran texhash. Still I get the error "! LaTeX Error: File `siamltex.cls' not found." Any pointers?

    ReplyDelete

Post a Comment

Comments on QuickLatex are strictly moderated. As much as I hate moderation, I must fight spam. Please rest assured that if your comment is relevant I will approve it and answer.

Popular posts from this blog

Latex Tutorial: How to Create Images, Diagrams, and Flow Charts Using Latex

This tutorial is an extension of previous video tutorial on how to use tikz for image creation in Latex . In this video I explain how to set up your document for flow chat design. This equally applies to any other image that uses similar structure. Specifically, in this video I talk about following things: How to create a flow chart How to setup styles for reusable components of an image How to draw arrows from one component to other How to change the styles of components How to change the arrowhead for Latex arrows How to align components left, right, top, and below of each other The code use:d in the video is here: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,shadows,arrows} \begin{document} \tikzstyle{decision} = [diamond, draw, fill=blue!50] \tikzstyle{line} = [draw, -stealth, thick] \tikzstyle{elli}=[draw, ellipse, fill=red!50,minimum height=8mm, text width=5em, text centered] \tikzstyle{block} = [draw, rectangle, fill=blue!50, text width...

LaTeX Video Tutorial: How to Create a Resume or CV (Curriculum Vitae) using LaTeX

One of the most frequent questions my colleagues ask me is how to create a Resume or Curriculum Vitae (CV), if you will, in LaTeX . I have a style file that was passed to me by a friend who found it on Internet. Since this looked good I used it and, thanks to the original contributor, I am going to share it with you all today. You will be able to download these files and create a professional Resume for yourself.  The files can be download from the linked locations: The Resume.tex file (main document) The Class file res.cls (for page setting) In the video tutorial , attached below, I have explained how to change the text for your needs. The structure of the Resume (or CV) is highly flexible and once you get hold of the basics it will be pretty straight forward for you to tweak it for your own use.  I have tried to add the basic sections that are present in most of the Resumes but you will most probably add more depending on your requirements. I am prett...

How to draw Reddit Alien in LaTeX using Tikz - Video tutorial and code

If you are not a Redditor you are a lucky person. It's a one way traffic scenario with no dead end. Once you subscribe to Reddit there is no way back and it is no good being there. I am expecting my colleagues to have an intervention for my Reddit addiction soon but till then I am all here to invest (read:waste) my precious time. Since we got that out of our way, let us get back to business. Today, we are going to see how to draw a cartoon figure using LaTeX. The motivation behind this post is /r/latex on Reddit as I wanted that subreddit to have its logo drawn in LaTeX. I did not know it already was in LaTeX but it seems my work is appreciated there so I am going to contribute my 2 cents to the community. Specifically, we will learn following things in this tutorial: How to work with Colors - defining RGB colors in LaTeX. How to use multiple layers to set order of document objects (send to back, bring forward like functionality). How to use Arcs in an effective way....