Posted by: thegooddoc | October 21, 2007

Getting Started with LaTeX

As a researcher, a huge portion of my job is spent writing reports, papers, proposals, research notes, etc. So, for me, the choice of tools for writing is critical. While I do use Microsoft Office for a fair portion of my work (you can’t avoid it if you do any cooperative work), my tools of choice are Emacs for editing, and LaTeX for document processing. Here, I’ll try to explain why, and give a few tips for getting going with this outstanding tool. Where appropriate, I’ll just summarize and link, and I’m going to avoid going into a lot of history for LaTeX, as you can find that info elsewhere. This is a topic that I’ll come back to fairly often, and will provide bite-sized chunks of tips and tidbits as they occur to me.

What is, and Why use, LaTeX?

Why not just use Word? MS Word (or WYSIWIG in general) is a great tool for writing, particularly for fairly short and simple documents. It’s easy to use, and easy to abuse. For more complicated documents, reports, books, and similar, I find it just becomes too much of a hassle to wrangle Word into working for me.

LaTeX is a text-based system that supports documents of just about any complexity and length. It isn’t a WYSIWIG tool, although you can find ways to get that also. This is, in my opinion, one of LaTeX’s great strengths – you focus on your content, rather than on fiddling with formatting and styles. For example, if you want to start a new section of a document and need to provide a header, you simply type:

\section{This is the title of my section}\label{sec:mine}

and LaTeX will format it appropriately, based on the type of document you’re creating. If it’s right to do so, LaTeX will number the section for you, and can also easily provide cross-referencing to that section number (or to just about anything else, e.g. page numbers, equation numbers, figure numbers, etc.). Here, you could say “see Section~\ref{sec:mine}”, and you’d end up with “see Section 1″ (assuming that was section 1). This really is simpler, easier, and far more robust than what you can do in Word. Later, if you add a section ahead of this one, it’d get renumbered, as would your cross-reference. Note also that the “label” part is optional, but it seems better to include it, just in case you want to do a cross-reference later on. This is just a simple example, meant to entice you into the rabbit hole.

LaTeX (actually, its eco-system, including BibTeX) provides great support for including references and bibliographies. Word, in combination with other programs (e.g. EndNote) can do this, but it’s just not as clean, at least for my style of working. If you need to include equations, LaTeX is vastly superior to using something like MS Equation Editor.

In any case, there are many reasons why you should consider using LaTeX. But, I must say that it’s not for the faint-of-heart, and the learning curve for a tool like this is somewhat steep, and long (a lifetime to really learn, I suspect). I find it’s useful to think a bit about “why” you’d want to subject yourself to the pain you are about to go through (i.e., what’s in it for you, and what you’ll have when you’re done!). One good summary is LaTeX – the very idea.

Learning and reference books

There are numerous books on getting going with LaTeX, and detailed references for once you’re up to speed. I suggest Leslie Lamport’s excellent LaTeX: A Document Preparation System (2nd Edition) (Addison-Wesley Series on Tools and Techniques for Computer Typesetting).

For reference, or as you get further along, I really like Kopka’s book, Guide to LaTeX (4th Edition) (Tools and Techniques for Computer Typesetting).

Finally, if you’re buying into this whole-hog, and know you’ll want a fairly complete and useful set of books, just go straight for The The LaTeX Companions, Revised Boxed Set: A Complete Guide and Reference for Preparing, Illustrating, and Publishing Technical Documents (2nd Edition).

Related tools

You’ll need to install LaTeX (unless you’re on Linux, in which case it may already be there). In any case (and even for Linux), I personally recommend the TeX Live distribution. There are others, and depending on your platform (Win, Mac, Linux), you may be happier with a different distribution. I’m not going to say much here, as you’ll be able to find many detailed references on how to get, install, and configure LaTeX. For starters, check out the TeX User’s Group (TUG) Getting Started with TeX, LaTeX, and Friends.

You’re going to spend your itme in an editor, or an integrated environment. As you might guess, I’d recommend Emacs. But, there are plenty of good text editors out there (you could even just use Notepad or, for reasons I’ll go into another day, Wordpad). There are also some fine integrated environments, and I’ve used a couple of these off and on for years. I was very happy with, and can fully recommend, the TeXniCenter integrated environment. It’s very complete, and a great tool. I eventually felt it was a bit too much for my needs, and I then migrated to WinShell. I really liked this tool (even better than TeXniCenter, for me), and only left it behind when I finally took my bold (some might say foolhardy) leap into Linux. The install is simple, shouldn’t be a problem. You’ll be better off to install this before you try to go any further with LaTeX. For the Mac, you should give MacTeX a look, along with the front-end TeXShop.

Other tips and resources

Something very cool that I came across while writing this: The Visual LaTeX FAQ. This is such an innovative way to present an FAQ, I’m going to spend a bit of time going over it, as I expect I’ll learn some tricks I’ve been wondering about at a low level for years, but haven’t been sufficiently motivated to bother to look into them.

A few simple example LaTeX documents: the really small small2e, the slightly less small sample2e, and the more comprehensive (whacking big) The Not So Short Introduction to LaTeX2e by Tobias Oetiker, also as PDF. In the spirit of those ridiculous “Teach yourself brain surgery in 24 hours” books, this one is subtitled “Or LaTeX 2e in 138 minutes”.

General resources: the TeX user’s group, the Comprehensive TeX Archive Network (CTAN), and the PracTeX Journal.

And finally, a couple of discussions about getting going with LaTeX, why you might want to bother, and some of the troubles you’ll find (and overcome) along the way:

“The beginner’s forest of LaTeX,” by Theresa Song Loong, and “LaTeX isn’t for everyone but it could be for you,” by Andy Roberts

Thanks, and happy LaTeXing.

Posted by: thegooddoc | September 10, 2007

Finding My Muse

I’ll speak often of things Emacs and Linux. I do not consider myself an expert in either (but won’t let that stop me!). In future posts, I’ll give a bit of a history for my use of these and similar tools (everything is ultimately a tool to get your work done). For now, I’m going to talk about my latest find, and it’s great.

Muse

Muse is a mode for Emacs. This may mean little to you. Eventually, it should mean a lot, if I can persuade you to “convert” to Emacs. But, if you’re there already, you should know about Muse. For those interested in getting to know Emacs now, you should start with the excellent O’Reilly book, Learning GNU Emacs. You can think of Emacs as a text editor. This is, um, a bit of an understatement.

I’m trying out Muse for the first time in writing this post. This is, my friends, some tasty dog food. I am using that term a bit loosely (as I have nothing to do with developing Muse), but I think you get the point.

What is it?

Muse allows you to write plain text with really simple mark-up (similar to wiki markup). From this plain text, you can generate other formats. Examples include HTML, XHTML, PDF, LaTeX (more on this in other posts), etc.

So, to me, it’s a dream tool. One source, many output formats. One source to rule them all… Sorry, letting my geek flag fly.

What’s the input look like?

Truthfully, your best bet is to look at the QuickStart guide. Just a few items here to pique your interest. First, to indicate a new paragraph, you just leave one or more blank lines in the text file. Simple, eh?

Headings are indicated by asterisk(s). So, this input:

* First level heading

** Second level heading

*** Third level heading

will format as:

First level heading

Second level heading

Third level heading

Emphasizing text is also easy, and wiki-like. Examples:

*emphasis*

**stronger**

***really strong***

_underlined_

=verbatim, monospaced=

give, when output:

emphasis

stronger

really strong

underlined

verbatim, monospaced

I’ll leave it to you to look further. You can really easily do tables, verse (great, for us researcher types…), footnotes, lists (bullet, numbered, and definition). URLs and email are as simple as typing them in (i.e. you’ll end up with a clickable link in the formatted output), and there are other options if you want to make it more complicated. You can (with additional Emacs modules) produce syntax-highlighted source code. You can even use embedded bits of Lisp (who does that?), Python, Perl, shell, and Ruby, and these end up being interpreted when the output gets generated. This is so cool, and opens up so many possibilities, it makes me want to quit my day job! Oh wait, that’s right, I was already thinking about that!

Where can you find out more?

Well, I first heard about Muse in a post by Credmp about using Emacs for Getting Things Done (GTD). I found a reference to the post on 43 Folders. I then went to the outstanding Emacs wiki, and quickly found info on Muse. Ultimately, I ended up at the project’s site. Yes, a simple Google search would have been easier, but far less interesting!

To date, I’ve been using org mode in Emacs for GTD. If you’re interested, check out Using Emacs org-mode for GTD. It’s a really useful tool, but based on the little bit I’ve seen of Muse, I think I’m heading towards Muse for GTD and other tasks. I will say that “org” is nice and light-weight (as is Muse), but I’ve found too many ways to easily abuse it and the whole GTD process at the same time. Muse won’t be any better in that regard, but looks like a closer match for my needs. I did also try GTD.php, but, for me, too process-intensive. A nice tool, and if it fits your style, I would still recommend it. Ultimately, Muse looks at least as good as “org” mode for GTD, and better for many other things (e.g. blogs, research notes, tutorials, etc.).

By the way, you can provide links in the following manner:

[[http://www.emacswiki.org][Emacs wiki]]

and this will get formatted in the output as Emacs wiki.

I believe the Muse project’s maintainer now is Michael Olson. He’s currently (as of September 2007) near graduating with a BS in CS. I mention this, as it is, to me, staggering. These kids (no offense intended) aren’t even out of school, and they’re releasing tools that may become key enablers for my work and research, as well as my blogging. Astounding.

On a side note, I tooled around Michael’s pages, and found some quite interesting things. First, he lists his tastes in music. Now, I really feel old. I can’t say whether any of this music is good or not, as I don’t recognize a single group/artist. Some, I can’t even pronounce. Elsewhere, Michael speaks of his philosophy, and I found out something about myself. I always referred to myself as anti-social (hence, I’m talking to you via a blog), but this never felt quite right. Michael uses the term social minimalist, and somehow it’s like a light going on. This is it for me! And he provides an interesting systems-oriented view of people, their need for acknowledgment, and how he, as a minimalist, deals. You may not agree with him, but I find it interesting.

Posted by: thegooddoc | August 28, 2007

Ravings of a Mad Scientist

#include <stdio.h>
void main(void)
{
printf(“Hello, World.\n”);
}

Greetings, and welcome to TheGoodDoc.net and please forgive the lame starting geek code “joke”.

First off, I’m a bit of a mad scientist, and a mad engineer. Not stark raving mad—at least not so far. Perhaps a better choice would be irritable, or at least irritated. But, for now, it’s not Festivus, so we’ll save the Airing of the Grievances for another time.

I’ve spent the last 20 years of my life as a research scientist and engineer, working on robotics, automation, and Mechatronics. More about all of that in a later post.

This blog will provide useful (hopefully, and let me know!) tech tips, tutorials, and similar, in software, technology, tools, and other areas that may help you get your work done more efficiently, or at least with a bit of fun and flair. I’ll also chime in on the occasional productivity topic, along the lines of David Allen’s outstanding Getting Things Done (GTD), and the always entertaining and helpful 43 Folders by the ubiquitous and hilarious Merlin Mann. For a quick tip right off the bat, I strongly recommend you get David Allen’s book Getting
Things Done: The Art of Stress-Free Productivity
, and I also highly recommend Thomas Limoncelli’s Time Management for System Administrators. These two are a bit contradictory, but for anyone working in the tech field, they both offer great tools and advice to get moving and keep going.

Per the tagline, you’ll find the occasional rantings and ravings, as well as some digressions on modern culture or lack thereof.

Since this is my start in the blogging world, I’ll also include some reflections on getting going with blogging and related issues. As I run into problems and find solutions, I’ll provide the info, or, more likely, the links. For most of what I have needed to know to get started, I’ve been able to find information online, e.g. at Bob Walsh’s ClearBlogging. I also would recommend that anyone getting started in blogging (yes, I know I’m late to the party!) read Bob’s excellent book, Clear Blogging: How People Blogging Are Changing the World and How You Can Join Them.

You’ll also find scintillating reviews of books, software, gadgets, and technology. I think you’ll find a lot of this quite useful. And, to be honest, it’s where the monetization concept of this comes in. I’m not doing this strictly for my health. My sanity, perhaps, but not my health.

I may provide some more technical posts related to engineering, robotics, automation, and
Mechatronics. Feel free to skip these, but please don’t let them scare you away forever! You may be surprised, some of
this stuff is quite fascinating. You wouldn’t be able to tell that from the typical research paper (including mine!), but that’s just another motivator for talking about this stuff in a more informal setting. Some possible topics:

  • Sensors
  • Actuators / Motors
  • Robotics
  • Programming
  • GPS and GIS
  • Google Earth

I will definitely delve into tools I use to get my day-job done, including:

  • Gnu/Linux (Ubuntu if it matters)
  • LaTeX (no, not the rubber stuff)
  • and emacs.

I’ll also talk about Microsoft Office and Windows, and this won’t be all bad raps! I’m a big fan of Linux, even on the desktop, but I also know it’s not for everyone. I used Microsoft products for years, and they really are great for getting the job done. I still use them now, just by way of a virtual machine using VMware. More about that, another day.

Well, enough blather for now. Please do check back if any of this is of interest to you, and I hope to really provide you some info that improves your skill set and ability to get your job done, so you can move past that and work on getting a life!

A few notes:

I’m sure I will be tweaking look and feel, theme, etc., of the blog over the next month or so. We ask that you please bear with us. Thanks!

The goal will be at least one post per week. We’ll see, I may get roped in! If my OCD nature kicks in, this could become my new compulsion, and you folks won’t be able to get rid of me!

Finally, for the title of the blog, and in the interest of full disclosure, I am a doctor (Ph.D.), but I’m not an M.D.. Please don’t come looking for medical advice! I’ll likely talk a bit more about M.D. vs. Ph.D. some day. Let me just summarize this by quoting my Mom’s last words to me: “You know, there’s still time, you could become a real doctor.” Can you feel my pain? :-)

Categories