Monday, November 5, 2012

LaTex: White Text Black Background

With a name like 'White Text Black Background', this blog should demonstrate how to create such a document in Latex.

First you will need to add the package 'color' to the preamble.

\usepackage{color}

Next place that following lines at the beginning of the document:


\color{white}
\pagecolor{black}

Example:


\documentclass[11pt]{article}
\usepackage{color}
\begin{document}
\color{white}
\pagecolor{black}
Do you see me?
\end{document}



Wednesday, June 27, 2012

LaTex: Subequations with a left brace

A colleague in my lab wanted to use subequations (he wanted to number two equations with the same number but with .a and .b) while keeping a large left brace around the two equations.  I stumbled upon the way to do this using the package empheq.

To use the empheq package be sure to use the following line in your preamble.

\usepackage{empheq}

Then in your document you can use:

\begin{subequations}
\begin{empheq}[left=\empheqlbrace]{align}
    x &= y + z \\
     y &= \sin(\theta)
\end{empheq}
\end{subequations}



Tuesday, June 5, 2012

Mac OS: Click non-highlighted buttons without using the mouse

I recently discovered this trick in Mac OSX Lion that allows you to navigate pop-up windows without taking your hands off the keyboard.

When I want to save a document I press 'cmd - s', but if the document exists I get a pop-up window with two buttons 'Cancel' and 'Save' with 'Save' highlighted.  If I hit the 'return' button on the keyboard I get a second pop-up window with two buttons 'Cancel' and 'Replace' with 'Cancel' highlighted.  I tried all sorts of combinations of tab to highlight the second button but nothing worked.  Then I discovered that you should hit 'cmd - "first letter of the button tag"'.  In this case I hit 'cmd-r', and it was equivalent to clicking the 'Replace' button.  I still don't know how to highlight the replace button so that I can then hight the 'return' button to click on the button, so if you know please comment.

Tuesday, February 21, 2012

Wednesday, January 25, 2012

LaTex: Difference between \overline and \bar





Today I wanted to put a bar over an uppercase variable W. When I used \bar{W} it was way too small. I used \overline{W} in instead.

\bar{W}
\overline{W}

Terminal: DU to show disk usage

I saw my advisor use this command today. I can't believe I didn't know about it.

$ du

returns the disk usage of each file in the current directory.

-s returns the sum of the disk usage for all the files.
-h puts output in human readable format

example:
$ du -sh
900G


Tuesday, December 6, 2011

LaTeX: Draw a horizontal line

In LaTex if you want to draw a horizontal line across the page you can use the rule command.

\rule[lift]{width}{height}

Example:

\rule[-0.1cm]{16.51cm}{0.05cm}