## Displaying code in LaTeX documents

Posted: 27th January 2014 by Tim in C++, Java, LaTeX
Tags: , , , , , , ,

There are a few ways to do this, but one of the simplest ways to pretty-print code in LaTeX documents is to use the listings package. The package can be configured to use specific colors for different parts of the code, with many programming languages supported. The following document will display code for both C++ […]

## Math blackboard (double-barred) font in LaTeX

Posted: 28th April 2010 by Tim in LaTeX
Tags: , , , , , , , , , , ,

In math, certain blackboard (double-barred) letters Z, N, R, etc. represent sets of numbers (integers, natural numbers, rational numbers, etc). These can be included in a LaTeX document using the \mathbb{[letter]} tag from within the math environment. Note that this requires the amssymb package to be included (ie: add \usepackage{amssymb} to the top of the […]

## Incorrect referencing in LaTeX documents

Posted: 24th February 2010 by Tim in LaTeX
Tags: , , , , , , , ,

If you’ve written up a LaTeX document and find that some of the figures, tables, algorithms, etc. are being referenced wrong (such as Figure 2.4 being referenced as figure 6), chances are you’ve put your caption and \label tags in the wrong order. LaTeX needs \label to be after \caption, or for \label to be […]

## DESCRIBE table in PostgreSQL

Posted: 20th January 2010 by Tim in PostgreSQL
Tags: , , , , ,

MySQL has a nice way to get the details of a table structure through the DESCRIBE command. PostgreSQL can also do this for you with \d table_name. For example (sorry about the poor layout): tim=# \d test_table Table “public.test_table” Column | Type | Modifiers ———+—————————–+——————- test_id | integer | not null default nextval(‘test_table_test_id_seq’::regclass) name | […]

## Highlighting Doxygen tags in Vim

Posted: 30th December 2009 by Tim in Software Development, Ubuntu, Vim
Tags: , , , ,

Doxygen highlighting is set up by default on most Vim installations, but for some reason it’s disabled. There are two options for enabling it. First, it can be enabled globally. This means adding the parameters to the global Vim configuration. Note that you may need to be root for this to work (ie: sudo echo […]