August 2009 Archives

LaTeX + BibTeX: Where Have You Been All My Life

| 1 Comment
Here is the first thing I am going to do when I have a free moment: I am going to call my alma mater (the Bible college I attended for four years) and I am going to demand all my money back. Through out my entire education at that school, I was quite under the impression that there was only one process available for completing reports, papers, and theses:

  1. Read through a dozen books at the library.
  2. Each time you find some significant information, jot a note about it on an index card.
  3. When you are done, stuff all the index cards in your backpack and go back to your dorm room.
  4. Pour all the index cards onto your desk and then copy them into a Word document.
  5. Spend the next 75% of the process trying to make the Word document conform to something looking like proper formatting.
  6. Weep when you get your paper back covered with red marks and complaints from your teacher about the lousy formatting.
Not one of my teachers bothered to tell me that there was an entire electronic system which has been around for decades, and which is completely free, that practically takes care of the formatting part for you. To think of all the hours and hours I could have saved!

I do not want to turn this post into a LaTeX + BibTeX tutorial, but the basic concept works like this: as you write your LaTeX document, you write like you naturally would, except that you place small tags here and there to indicate the structure of your document (part, chapter, section, and so on.)  You put information about each work that you reference into a separate file--a BibTeX file--with an identifying keyword. Whenever you want to cite one of those works in your document, you simply place a cite tag with that keyword into your LaTeX document.

When you are all done, you use the LaTeX and BibTeX programs to produce automatically the final document (report, book, etc.) with proper kerning, line-spacing, margins, and so forth. It will give you the output in pretty much whatever file format you want, such as postscript or PDF. (Technically, LaTeX produces a .dvi file, and other programs take care of the rest of the conversion.)

Of course, sometimes it can be more complex than what I described. But there is plenty of help available online, as well as some cool free programs like Texmaker, which put many of the tags and build commands into icons and menus so that you do not have to remember them all. I have been using LaTeX + BibTeX for about a month now, and it has already made my personal research much more fun. It does this by 1) allowing me to focus on content as I write rather than typographical formatting and style, 2) helping me write logically by integrating document structure into the writing process, and 3) saving me much of the headache of trying to figure out how references should be formatted in the bibliography.

First Week With Gentoo

| 1 Comment
Last week I installed Gentoo on my laptop. As you will recall from my previous post, I was quite enamored with the distribution, but now it has been forced to endures the rigors of my real-world work environment for a full work week.

First, the negative. The biggest frustration I faced was in the area of (drum roll please) setting up wireless support. Setting up the wireless drivers and support was fundamentally the same in Gentoo as it was when I set them up in Debian. But Debian handled many of the details automatically, while Gentoo (characteristically) left more of these to me, the end user. This is, of course, to be expected in a distribution like Gentoo, but wireless configuration is already such a delicate and elusive activity that it was difficult not to get frustrated.

Also, it took some adjustment to get used to the longer installation time requirements. Since Gentoo is entirely source based, packages (usually) must be downloaded and compiled, a process which often requires an extra hour or two even for medium-sized packages. While I believe the trade off is worth it, nevertheless it can be problematic, as it can be difficult to know in advance how long an installation will take. I was sometimes caught spending an extra half-hour or more at work because I did not want to interrupt an installation which I had thought was nearly over.

And now, the positive. I must say that I am still quite enamored with Portage, Gentoo's package management system, and Gentoo's source-based software schema. It is a wonderful feeling to be able to set global compiler options, so that every package on my system can be optimized for my processor's specific instruction set, using the compiler flags that I prefer. And I love being able to not only set global compiling parameters (USE flags) but also before every installation I am able to get a quick view of which parameters will be passed to the configuration scripts. And therefore I am able to make quick, on-the-spot decisions about what components will and will not be compiled into my software.

Gentoo has been especially helpful in regard to my coding efforts. Being a developer often requires having the absolute latest version of certain libraries, or at least very recent builds. In Gentoo these libraries are almost always available through either the stable or the testing software tree. And if they are not available there, Gentoo has an official "overlays" system, which allows users to submit custom packages without those packages needing to be integrated into the main Portage tree.

Overall, I would say I am quite happy with Gentoo. Gentoo has given me a sense of improved performance, better customizability, and greater freedom and possibilities. However, Gentoo's customizability and freedom also make it something of a "loose-cannon", more vulnerable to my mistakes, and more open to unexpected interaction between packages. There will likely be several cases in the future in which I will choose to install Debian instead of Gentoo, owing to Debian's short setup time and rock-solid stability.

Gentoo: I Think I'm In Love

| No Comments
Last week I decided I wanted to try a source-based distribution. A few Google searches revealed that Gentoo was the most popular, so I decided to give it a try.

I think I'm hooked.

So what's so great about Gentoo? Well, here is what I've found so far:

1) The real Linux experience. Using the minimal install CD from the Gentoo website, I did the entire installation from the command line. I did it all myself - built the kernel, partitioned the drive, layered on the encryption and LVM. It was the first time I've done a Linux installation where I felt like I really understood what was going on every step of the way.

I had one problem which took a while to solve: I layered LVM on top of dm-crypt encryption, and I couldn't get the kernel to initialize the LVM during boot. But it was actually fun finding the solution: I just dropped into the initramfs, read the init script, and found the kernel argument I was looking for. I posted the details on linuxquestions.org.

2) Source-based + dependency handling. We all love installing from source. But it adds hours of pain to the experience when we have to find all those dependencies and libs. Gentoo has portage, their source package management system, which tells you what you need and gets it for you.

3) Optimization. In Gentoo's make.conf file, you can specify your make architecture, which dictates what architecture is specified when all the source packages are compiled. This is awesome because it means all the code you install on your system can be optimized for the instruction set of your specific processor.

4) USE flags. In the make.conf file, you can specify a short list of flags describing what you do and don't want automatically compiled into your software. So, for example, you can have the flags "gtk -qt" set. This tells the system that, whenever a package has gtk and/or qt components, the gtk component will be compiled in but the qt component will not.

This is especially cool because, before you install any software, you can take a look at what USE flags are relevant to that code, and modify them just for that installation. So, for example, you can tell Gentoo to compile Firefox with the noscript plugin included automatically, or even have Firefox rebranded as Iceweasel (like in Debian).

Well, the romance has blossomed. But the real world test will take place when I take my laptop to work with me next week. We will see if the infatuation survives the honeymoon.
The site blog for indicium.us.
Linux Projects
Online Games
Unsung Linux Games

RSS Feed

Powered by Movable Type 4.21-en
and GNU/Linux


Creative Commons License
The content of this blog is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License. See my copyleft page for more details.