Friday, September 26, 2014

Starting out in LaTeX

Part 1

Now that we have texmaker on our computer, we can begin to create Tex documents!

Today I am going to introduce to you to a basic "Hello World" type program that will show you basic concepts in TeX. 

Open up texmaker. When you open it up, you should see something like this:

To create a new file you can do one of two things:
  • Go to File -> New
  • Ctrl + n
Once you have created a file, type in the following code into the right window:

\documentclass[12pt]{article}
\begin{document}
Hello, \emph{World}!
\end{document}


Now, save the file wherever you want and then go to Tools -> PDFLaTeX. This will convert the file into a PDF file so that other computers can see it. Go into the folder where you saved the TeX file, and you should find a PDF there. When you open it, it should look something like this:


 
As you can see, we now have a PDF that shows the words "Hello, World!" but...

How does this code work exactly?

Code explanation

The line \documentclass[12pt]{article} declares what type of document type it will be. Here, the document type is being declared as an article. This line also shows what the font size will be. This line makes the font size 12pt font, but we can edit this to be either 10, 11, or 12. So I could have written:

\documentclass[10pt]{article}

\begin{document} and \end{document} should be fairly self explanatory. We are designating the beginning and the end of the document. Anything within these two lines will be put into the document. 

Hello, \emph{World}!

Here, we are putting Hello, World! in the PDF.

The portion that should be noted here is \emph{World}! 
  
As you may have guessed, \emph is short for emphasis. Anything between the braces will be emphasized. In other words, they will be italicized. However, this is not the only way to italicize text. Text can also be italicized by using \textit{} where, again, everything between the braces are italicized. 


Hopefully you learned some more about LaTeX. In my next tutorial, I will go over how to make lists in LaTeX as well as basic formatting. The next tutorial will be longer than this, so it will be up by Sunday night. 

Thanks for reading. If you liked this tutorial, make sure to share this blog with others. 







Thursday, September 25, 2014

Installing LaTeX

Installing LaTeX

What is LaTeX?


Before I begin about how to install LaTeX and setting it up, it would be best to go over what LaTeX is exactly. TeX is a typesetting system that was first created by Donald Knuth. TeX is extremely powerful in that it allows fine-grain customization but, as a result, it was also rather cumbersome to use. This is where LaTeX comes in. LaTeX is essentially an extension of TeX.

Installing LaTeX

 

Now that we know a little bit about LaTeX, let's begin the installation process. I am using a Linux system (Ubuntu specifically) and so the installation process may be different for you if you are using a computer with Mac OS X or Windows. You will have to look up how to install the following software that I will be using in my tutorials:
  • LaTeX
  • Texmaker

However, if you are using Ubuntu, all you need to do is simply open a terminal and enter the following commands:

sudo apt-get update

sudo apt-get install texlive-full

Once you have entered those commands, you should have LaTeX completely installed on your system. Now let's install texmaker, which was made specifically for creating and editing TeX documents.

So, in your terminal enter:

sudo apt-get install texmaker  

And you will now have texmaker on your computer.



In my next post, I will go over some basic things that you can do with LaTeX as well as making a "Hello World" file for LaTeX.