LaTeX tools

Over the past few months, I have moved almost entirely to LaTeX for word processing. The transition started at the end of AER407 Space Systems Design, when OpenOffice (or my five-year-old desktop) choked on a 200-page document with over 120 figures. While it was too late to transfer that entire report to LaTeX, I now use it even for one- or two-page documents. Why?

  • I am accustomed to editing HTML and other source code files and so habitually abstract content from its appearance—exactly the purpose of LaTeX.
  • Gedit (a text editor) is much faster to start and even more responsive than OpenOffice. I can also have documents I am referring to (e.g. other LaTeX documents included in a master document, source code files) open in other tabs.
  • BibTeX. 'Nuff said.
  • The results are beautiful PDF files.
  • It's free!

Some tips and tricks to streamline LaTeX authoring:

  • Use the LaTeX plugin for gedit. This adds a handy toolbar for common commands, and the document can be compiled with a simple Ctrl+Alt+1. The plugin requires Emmanuel Beffara's excellent rubber compiler, which obviates the need to run pdflatex or other programs repeatedly (install).
  • Charter BT (PDF sample) a slightly chunky but still elegant serif font. This is in the texlive-fonts-recommended package (install).
  • Add a right-click menu item to folders in Nautilus using the nautilus-actions package (install). This item removes all the extra files (.aux, .bbl, .out, .blg) created as intermediate stages of compiling a LaTeX document.
    • System > Preferences > Nautilus Actions Configuration, click Add.
    • Label: Remove LaTeX byproducts
    • Tooltip: Remove temporary files created when rubber compiles *.tex documents.
    • Icon: gtk-clear
    • Path: find
    • Parameters: %M -name *.tex -execdir rubber --clean '{}' \;
    • Conditions: Appears if selection contains only folders.
  • Use \input{...} at the top of documents to include a header file like article-general.tex containing shortcuts and some common package includes.
  • texdoc packagename, which is like "man", only for LaTeX packages.

I also collect links at http://delicious.com/khaeru/latex.

Leadership & the 2008 Canadian election

A friend posted the following today:

I'm not going to say much on the upcoming election, mainly out of concern that this post will turn into an undirected, irate rant. Still, the above ad prompted me to scratch a weeks-old itch.

One of the parties in this election is casting its prime ministerial candidate as a strong leader, and attacking his chief competitor as "not a leader." The portrayal includes an effort to conflate demonstrating leadership with exercising authority. This elides the core question regarding positional leadership: are you a leader because of where you sit and the power you wield, or because of what you accomplish and how you accomplish it?

Most people who have encountered both strong authority figures and inspiring leaders will tell you the two sets overlap only in the rarest of cases. My Air Cadet career taught me extensively about positional leadership in a quasi-military organization. However, experiences of the past year have convinced me of the greater potential, difficulty and value of non-positional leadership. I have learned that it is especially useful in situations of great complexity and ambiguity—for example, national government.

The NDP ad covers my point: the Prime Minister has certainly thrown his weight around in the past 2.5 years, but hasn't demonstrated much in the way of actual leadership.

That's just my opinion—but consider the following statements distinguishing leaders from those who merely exercise authority.

  • Leaders inspire others and gain support from everyone by expressing a vision of the future. Authority figures exclude or marginalize those who disagree with them.
  • Leaders take the time to have open, honest discussions about their vision and plans. Authoritarians don't disclose or discuss points that would lead to opposition.
  • Leaders are open to questions from those who don't understand their motivations. Authoritarians see no use in fielding such questions.
  • Leaders show integrity in their actions. Authority figures act on the principle that "the end justifies the means."
  • Authority figures view winning as getting what they want, fastest and first. Leaders view winning as bringing as many people as possible with them to the finish.
  • Authority figures can bully. Bullying is anathema to a leader.
  • Leaders cannot afford to walk away from their mistakes or their followers. Authority figures view themselves as above and distinct from their subjects.

Think what you will about the platforms of the various parties, but please don't accept arbitrary claims about leadership without considering the grounds those claims are made on. If you're a fan of Machiavelli, I've probably failed to convince you of anything; I will say only that we live in a democracy and not a feudal city-state, and remind you that a self-styled Prince can be relied on only to say to you whatever is necessary in order to keep his throne.

Why the TTC needs capital & policy support

A Toronto Star article about the TTC potentially axing the free parking benefit for Metropass holders caught my attention this morning. While the Star's online comment system doesn't encourage nuanced viewpoints (more on that later), the general outrage is understandable. This isn't a good idea, and it wouldn't be a good choice. Unfortunately the Star fails to point out the real reason why: lack of vision and support.

Note the info box at the side of the page:

BALANCE SHEET
Impact of ending free parking at TTC lots for Metropass holders:
Parking revenues (after increase): $5.5M to $7.5M
Reduced fare revenues as a result: $2.5M to $3.5M
Increased operating costs: $100,000
Net: $2.9M to $3.9M
Source: TTC staff report

What has happened here?

One, the environmental cost is wrongly excluded from the balance sheet. I acknowledge that the TTC has no mandate to consider the environmental impact of their decisions, and no authority to spend money to reduce such. Without free parking, a Metropass holder from the 905 might elect to drive into the downtown core instead of parking at Kipling, Downsview, Finch or Kennedy and taking the subway. Under a reasonable scheme for taxing pollution, the extra cost of gas or toll roads would outweigh the ~$6 for TTC parking. Mass transit would remain the more attractive option. Absent this incentive, observe that the TTC expects to lose up to $3.5M annually (almost 3000 full-year Metropass subscriptions) from the change; i.e. it is a net disincentive to ridership.

Second, I refer to the Hong Kong model again:

MTR Corporation has always been reliant on developing properties next to railway stations for its profits (although the rail lines are profitable themselves); many recently built stations are incorporated into large housing estates or shopping complexes.

Far from reliance, the TTC does no property development whatsoever; even hints at repurposing its lands involve their sale to developers who would retain any revenue. Consider the three Tridel Nuvo/Essex condominiums on the north side of St. Albans Road at Kipling Station. These >25-story buildings are nearly sold out; 1 bedroom + den units are already being resold for over $230,000. A fourth building is planned, and you can be certain this is not because Tridel is losing money on the first three.

An identical building, owned by the TTC, could fit in the South Lot at Kipling. A fraction of the revenue from rent or residents' fees could fund the simultaneous building of a 3+-layer parking garage (above or below grade) on the North Lot; with a net increase in parking spaces. Further, a majority of the residents/tenants would certainly be Metropass holders who would not use parking spaces — because they could walk directly into the station — so free parking could be maintained for Etobicoke and Mississauga commuters.

However this sort of win-win-win-win-etc. proposition is only feasible if someone will fund the capital cost of the new building on the South Lot. The province of Ontario provides little money for this sort of project, and the federal government offers none. This is what I consider when voting in provincial and federal elections: who is likely to make this sort of positive change possible?

Password strength

https://secure.pctools.com/guides/password/ is a useful tool. Many people use weak passwords, and further use the same password for many sites online. Knowing this was a bad idea, for a long time I used a system that involved choosing an obscure word with several vowels and applying a simple cypher to make it more secure:

aeiost
431057

...so that, for example, 'supercalifragilisticexpialidocious' became 5up3rc4l1fr4g1l1571c3xp14l1d0c10u5'. Occasionally I would also capitalize a non-leading letter. This is what is referred to as "leet speak", and the substitutions quickly feel natural, even if you use them for nothing but passwords.

However, these passwords are just as weak as the dictionary words they are based on, because it is as easy for a password-cracking program to perform these substitutions as it is for a human. If we use Firefox, we can do better with the help of smart keywords and the password storage feature. We can use a different password for each website, and rely on a master password (or a locked screen on our workstation) to prevent their use by someone with physical access to a machine.

Go to the password generator, click all the checkboxes, choose 50 from the Quantity drop-down, and finally click Generate Password(s). Presto! Pick one of the passwords and use it. Note that since the site was accessed via HTTPS, no one else is likely to have snooped the list you received. Even if the site is maliciously remembering passwords (which I doubt), it does not know which of the 50 you have chosen, or where you used it.

Finally, examine the URL:

https://secure.pctools.com/guides/password/?length=8&phonetic=on&alpha=on&mixedcase=on&numeric=on&punctuation=on&nosimilar=on&quantity=50&generate=true

Replace the length with a wildcard:

https://secure.pctools.com/guides/password/?length=%s&phonetic=on&alpha=on&mixedcase=on&numeric=on&punctuation=on&nosimilar=on&quantity=50&generate=true

Save this as a bookmark with the keyword pw, and you can generate passwords quickly by typing F6 (select the Address Bar), "pw 10", Alt+Enter (open in new tab). For important passwords, you can even write the phoenetics on a card and keep it in your wallet, relying on your own memory to associate the password with the place you use it; or send the phoenetics (never the actual password) over e-mail or (preferably) instant messaging.