## Printing the nth word on each line using awk

Posted: 7th January 2015 by Tim in Awk, Bash, Linux
Tags: , , , , , , , , ,

There are many ways in the linux terminal to print the nth word of a given file or output. One way to do this without worrying about tabs, extra spaces or word length is to use awk. With awk, this can be done on one line by using the {print \$<n>} syntax. For example, the […]

## Spanning columns in LaTeX tables

Posted: 27th November 2011 by Tim in LaTeX
Tags: , , , , , , ,

Tables are a fairly important part of LaTeX. Often you will want data to span multiple columns of the table, similar to colspan in HTML. In LaTeX it’s pretty easy too, using the \multicolumn{<cols>}{<format>}{<cell_text>} command, where <cols> is the number of columns to span and <format> is the cell format (l, c or r for […]

## LaTeX align right or left

Posted: 24th April 2011 by Tim in LaTeX
Tags: , , , , , ,

Occasionally you may want to have text right-aligned in a LaTeX document. Other times you may want a block of left-aligned text next to a block of right-aligned text. LaTeX provides this functionality with the \hfill keyword. \hfill is a horizontal fill keyword. It tells LaTeX that you want to expand the space between the […]