Skip to main content

Posts

Showing posts from 2012

Writing basic math in LaTeX - inline math and math environment

Internet abounds with LaTex tutorials on how to write mathematics equations and simple symbols in LaTeX. It is sometimes not clear as to how the math environment works in general and how to differntiate between inline math equations and how to write them on a line of their own. I earlier did a tutorial on how to write mathematical equations using Latex  which covered the "equation" environment in LaTeX. Math environment is equally important and in this tutorial I am going to talk about how to use basic math environment in LaTeX. Specifically, I am going to discuss how to do the following in LaTeX: How to initiate Math environment Writing inline math equations and writing equations in a separate line How to use frac for equations How to use paranthesis and brackets to enclose mathematical symbols and equations How to type powers and indices How to write matrices Following video illustrates the step by step instructions to use math in LaTeX   The code used in

How to create table in Latex from MS Excel files or other external databases

Latex can be used to create tables from external files such as MS-Excel files saved as comma separated values or similarly many other formats. Recently, I received a comment where a reader suggested that I should post a tutorial on how to create tables in Latex from external files. I searched around and found multiple ways to achieve this. I am going to talk about two of the most popular ways of doing it. First one is using pgfplotstable and the second one is using datatool package. Specifiacally, we are going to learn the following in this tutorial: Using datatool package to load external files Usng MS-Excel files to create tables in Latex Using \DTLloaddb to set keys and use external files Using \DTLforeach to iterate the external file Using \pgfplotstable package Using \booktabs package Using pgfplotstabletypeset Styling each column of table Using style rules from booktabs package The following video tutorial explains both metho

LaTeX Tutorial: How to use Lists in Latex - itemize, enumerate, description, and inparaenum

LaTeX is a great tool for typesetting and it is more powerful than MS-Word. It has a steep learning curve and that is why I believe these video tutorials will help you guys. Today, I am going to talk about lists in LaTeX. LaTeX can produce both bulleted lists or unordered lists, and numbered lists or ordered lists. We will also see how to use lists with descriptions given to each list item. Specifically, we are going to have an introduction of following topics in LaTex: Lists in LaTeX: Itemize, enumerate, inparalist, and description Itemized list in LaTeX for bullets enumerated list in LaTeX for numbered lists inparalist in LaTeX for lists wrapped around text description lists in LaTeX for lists with description for each item Nested lists in LaTeX Using styles for numbering lists (roman, in parenthesis etc.) Use of paralist LaTeX package Here is the video for this tutorial: If you have a question or comment please do not hesitate to leave a comment. I wil

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}

How to write an algorithm in Latex : Video Tutorial with sample algorithm

People in Computer Science and Mathematics department often write algorithms for their papers, thesis, and other research articles. In this tutorial I will explain how to write an algorithm in Latex using the algorithm and algorithmic package in Latex . I will explain the basics of an article and show how simple building blocks can be added to Latex to write a full fledged professional quality algorithm. Specifically, we will learn the following in this tutorial: How to write an algorithm in Latex Use of algorithm and algorithmic package How to use loops in an algorithm How to use IF statements in an algorithm How to add caption to an algorithm How to label an algorithm to refer it in the document The code for this algorithm is shown below and explained in the video.  Here is the code used in this video: \documentclass{article} \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{algorithm} \textbf{INPUT:} Set of Base Layer polygon $S_b$ and S

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.