LaTeX on Windows MikTex

August 19, 2012

I'd posted about a couple of nifty tricks that one could do with LaTeX, sometime back. The post got a few people interested, but most of those interested were Windows users and the kind who'd back away a safe distance the minute I said Linux! Now, I'm not one of those FOSS brats who give Linux and FOSS a bad name by behaving like absolute boors when they get help requests from non-Linux users. ``You don't use Linux? Well, damn you!" they seem to exclaim, before moving away with a self-righteous smirk. Nope, that's not me. I strongly believe that people ought to have the right to make their own choices and not be belittled for them. I like the power that Linux has to offer to me, and I'd not be happy with anything else, and I do try to help people if they want to make a transition to Linux, but that's about it. I leave it to them to decide if and when they want to make a transition. Coming to LaTeX, I'd only used it on Linux, and when my friends who were Windows users asked for more details, I thought that it would be a pity if they could not use LaTeX, on account of them not being Linux users. I did a google search and came across MikTex.

Now, before I could point people to it, I HAD to use it myself, to see how friendly (or not) it was. I downloaded the `basic' installer of MikTex, version 2.9 from http://miktex.org/2.9/setup and ran install. It presented me a familiar notification page which I accepted and decided not to change any of the default installation options. Upon hitting next, it started downloading the required packages (oh, you need a working internet connection to complete installation), and before long, it was complete. MikTex boasts of a feature that prompts for installation of components required to render a document and proceed to set up everything on it's own, once permited to do so. I thought I'd put it to test. The MikTex installer installs an editor called TeXworks, which makes it easy to edit your LaTeX documents. I fired up Texworks, opened a tex file that I had created earlier, on Linux, and hit the green 'typeset' button (the one that looks like the mediaplayer `play' button). True to word, MikTex prompted me that I needed other packages installed, before my document could be rendered. I hit install for all of the required packages, and voila! My document compiled! Just the way it had on Linux! Just like that! To say that I was thrilled would be an understatement! Now I knew that my friends who were not onto Linux could also enjoy the power of LaTeX!

Hmm. So we now are able to create documents in LaTeX, on Windows. Great, but how are the actual documents created?
A google search on LaTeX provides a great variety of resources, but this is a good place to start: http://en.wikibooks.org/wiki/LaTeX/Basics

Let's now see a few basic examples, on how to get things done. I recommend using the `memoir' class in LaTeX as it is both powerful and simple to use.
The most basic document in LaTeX would be something like this:
<pre>\documentclass[12pt, oneside]{memoir} \begin{document} This is the body of the document. \end{document} </pre>
The 12pt refers to the size of the font and `oneside' specifies that this is going to be an ebook or a pdf document, one that does not have to have special margin settings that allow for pages to be bound together. Yes, LaTeX can take care of all that, if you intend to typeset a whole book for publication! How cool is that!
Now, how about getting a numbered list? How easy is that with LaTeX ? Your doc will look something like this:
<pre>\documentclass[12pt, oneside]{memoir} \begin{document} \begin{enumerate} \item This is the first item in the numbered list... \item ...while this is the second... \item ...and this is the last. \end{enumerate} \end{document} </pre>
And it would look like this:
<ol><li>This is the first item in the numbered list...</li>
<li>...while this is the second...</li>
<li>...and this is the last.</li>
</ol>To get a simple bulleted-list, instead of a numbered list, replace `enumerate' with `itemize'.

A few points to note:-
<ul><li>In native LaTeX, both pagination and paragraph breaks are taken care of automatically. In Miktex however, paragraph breaks need to be taken care of by the user.</li>
<li>Inserting a simple blank line in TeXworks would cause a paragraph break to be inserted.</li>
<li>Words beginning a paragraph are by default indented, in LaTeX You may turn it off by putting the following statement just before the \begin{document} directive: \setlength{\parindent}{0mm}</li>
<li>Paragraph breaks don't by default provide `whitespace'. To ensure that there is visible `whitespace', you can put in something like \vspace{3mm}\\</li>
<li>Enjoy exploring LaTeX!</li></ul>You can download the tex file for this post from here
The pdf version is available here.