erroneous thoughts

my contribution to that global pool of memes, otherwise known as Internet

LaTeX miscellanea

Useful bits of information for \LaTeX users. If you’re a math dude, the first one is probably how to embed it’s source code into WordPress posts!

Article structure

Here’s what I usually put in the preamble of LaTeX articles:

\documentclass[a4paper,10pt,twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
%\usepackage[portuguese]{babel}
\usepackage[top=2.5cm, bottom=2.5cm, left=1.5cm, right=1.5cm]{geometry} 

%%% additional packages here

\usepackage[a4paper=true,pagebackref=true,bookmarks=true,colorlinks=true,linkcolor=blue,citecolor=cyan,linktocpage=true]{hyperref}

\pdfpagewidth 210mm
\pdfpageheight 297mm

\setlength{\columnsep}{20pt}

\long\def\symbolfootnote[#1]#2{\begingroup%
\def\thefootnote{\fnsymbol{footnote}}\footnotetext[#1]{#2}\endgroup}

\renewcommand{\thefootnote}{\fnsymbol{footnote}}

%opening
\title{title}
\author{author\\\texttt{authors@email}}
\date{}

% add new commands here

\begin{document}
\small
\maketitle              % need full-width title

\tableofcontents % if needed

The babel line is only needed if you’re not writing in English. The hyperref package if it used, must be THE LAST ONE to be included. It is only needed for dumping links into the PDF file that’s produced.
Finally, I remove the date from the generated title (hence the empty \date{} command) for reasons explained below. That’s also the reason for the nameless footnote; to add a numberless comment, do it like this: \symbolfootnote[0]{your comment here}.
You can also do some more fun with the footnotes if you like, but what I’ve shown here does the trick for me (note the extra bold ‘text’, it’s for avoid leaving a mark, or the space for one, in the place in the main text where the footnote was added. Quite useful).

Permanent Document ID’s

I first came across the usage of unique Document ID’s when I read this paper from Daniel J. Bernstein. He describes it in more detail. I essentially do the same thing, but I use SHA instead MD5 (for no particular reason other than it generates longer ID’s…)

$ head /dev/urandom | sha1sum

I then add it to the first page of the document like this (assuming it’s written in LaTeX):

\symbolfootnote[0]{Date of this document: month day, year. Permanent ID of this document:
\textbf{\texttt{SHA1 generated ID here}.\\ \\The author hereby places this document in the public domain.}

Written by gauthma

February 8, 2009 at 5:35 PM