## Dissertation fixes for the Thesis Office LaTeX template

The Thesis Office offers a LaTeX template for dissertations (https://gradschool.utah.edu/thesis/thesis-templates/). Here are some of the changes I had to make in LaTeX to fix my dissertation (modifications are grouped by file):

%%%%% dissertation.tex %%%%%
% Make sure citations are listed in order and hyphenates consecutive
% citation numbers (i.e. [4]-[10])
\usepackage{cite}

% You may need to add \EMX to equations to get the spacing right with
% the surrouning text. The thesis editor will complain if it needs it
% but I decided to apply it to all my equations.
% \EMX is already defined in uuthesis.cls
% \EMX \label{...}
% ...
%

%%%%% uuthesis.cls %%%%%%
% Add this to uuthesis.cls to fix citations from [5-10] to [5]-[10]
% for IEEE citation stlye
\def\@citex[#1]#2{%
\let\@citea\@empty
\@cite{\@for\@citeb:=#2\do
{\@citea\def\@citea{], [}%
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
\if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
\@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
\G@refundefinedtrue
\@latex@warning
{Citation \@citeb' on page \thepage \space undefined}}%
{\hbox{\csname b@\@citeb\endcsname}}}}{#1}}
\def\citepunct{], [}
\def\citedash{]--[}

% Find and change the corresponding fptop, fpsep, and fpbot values so
% figures aren't spaced so far apart if they're on their own pages and
% there are multiple figures per page.
% These are my best guess for "triple space" between figures. It got
% by the thesis editor.
\@fptop 0pt plus 1fil
\@fpsep 33pt plus 0fil
\@fpbot 0pt plus 1fil

%%%%%% dissertation.bbl (generated from dissertation.bib) %%%%%%
% By default all lines in the bibliography a fully justified, that is
% they are flush on both the left and right margins. If there isn't
% much text on a line, full justify will space words too much. Here
% are some ways to prevent that for just one bib entry.

% Full justify all lines
\bibitem{...}
\BIBentryALTinterwordspacing
...entry...
\BIBentrySTDinterwordspacing

% Left justify all lines
\bibitem{...}
\begin{flushleft}
...entry...
\end{flushleft}

% Full justify lines except the URL
\bibitem{...}
% Nothing
...entry...
% Nothing

%%%%% Other notes %%%%%
% Check the .blg and .log files for warnings and errors. Try to fix
% anything it lists.

% The bibliography will be very closely checked. I'd just let the
% thesis editor do the work for you to find the errors.

% Be consistent with the use of Figure vs. Fig., capitalization, etc.

## Removing white space around matplotlib figures

When I make figures in python scripts, the default settings is to leave a white border around the figure. But when I use the command

import matplotlib.pyplot as plt
...
script
...
plt.savefig('example_plot.pdf',bbox_inches='tight')

the white border is taken out. Leaving out bbox_inches='tight' will give you the default settings.

## LaTeX Template for University of Utah Thesis and Dissertation

The University of Utah Graduate School now offers a LaTeX template for your Thesis or Dissertation. It can be found here: http://gradschool.utah.edu/thesis/thesis-templates/

This is great news if everything you've written so far for you academic work has been written with LaTeX. Without a LaTeX style file and a skeleton example (like the graduate school has now provided), it requires an enormous amount of work to hand craft a Word document from your LaTeX source text. Thanks University of Utah Graduate School!

## Tips for U of U thesis format approval

I have used both MS word and Latex for thesis formatting. Although it is easier to use the Latex template, there are still several things that could make you print another one hundred pages again. To save trees on our planet, here are some tips that could make your thesis writing a little easier.

1. My first suggestion is to put all your tables and figures at the end of each chapter. This will save you a lot of time dealing with the strict space and format requirements for tables and figures.

2. If the fonts in your figures are not big enough (at least 2mm), simply increase the size of those figures in your thesis instead of searching your long-time-no-see Python or Matlab code and changing the plot script there.

3. If you use the Latex template from the Math department of the U, there are at least two things that you should pay attention to.

a. If you use “\usepackage{uuthesis-2011}” as in the template, you will find that the spaces between paragraphs could be a little bigger than the spaces between lines inside a paragraphs. Simply commenting that line will solve the problem.
b. If you have a section headline immediately following a chapter headline, make sure to use “\fixchapterheading” in between. For example, the beginning of your Latex file should be something like this:

\section{Introduction}

4. If you use copyrighted material from published papers, even if your own papers, you must get permission documents from journals or conferences. Also remember to get the multiple author release forms from your coauthors. If you only need material from IEEE journal/conference, things will be a little easier. Just go to the IEEE Xplore webpage of the paper, click on “request permissions”, then choose “reuse in a thesis/dissertation”. Print out the page shown to you, and submit it to the thesis office.

5. Finally, before printing your pdf, make sure to check printer settings. Don’t check the “auto rotate and center” option, and also make sure to choose “none” for page scaling so that the page scale is 100%.

I'm impressed with the quantity and quality of videos created about people's research in device-free localization and radio tomographic imaging. I think it is time to group them together in some way so that someone interested in this area of research can find them all and watch them. I created a Youtube playlist called "RSS-based Device-Free Localization". When you run out of things to watch on Hulu and Netflix, take a view!

Also -- if you've put up a public video on the topic and want me to include it, post a note on the playlist.

## Capturing camera photos at regular intervals

In my research, I sometimes need to record video from an experiment. But in reality, I don't need multiple frames per second video, I just need a photo of the environment at a regular interval, like once per second. These photos allow me to go back in post-processing to figure out exactly where people were in the environment, for example. Here are the problems with using, for example, a Flip video recorder to record video:

• Low quality: I need images that perhaps can go into publications. Even a HD video frame is not really a high quality image for a print publication.
• Un-synchronized: I am typically collecting data simultaneously on my laptop. The video time stamps are not synchronized to my laptop's clock, so then the problem is that in post-processing I have to figure out what time each frame was taken in terms of my laptop's clock.

Another problem with my web cam is that it hard to point it in the right direction to capture a picture of the environment. Instead, I use a usb-connected camera with a stand that I can point in whatever direction I want.

The solution I use to capture images at a regular interval is to use the "streamer" program. It will allow me to collect images at a set rate (with the -r option). It allows me to change the video camera from the web cam, which appears as /dev/video0 on ubuntu, to the usb camera, which appears as /dev/video1. Also, it automatically increments the file name, and will stop after a known period of time. For example, here is my command to collect a picture once per second for 10 minutes:

 streamer -c /dev/video1 -t 600 -r 1 -f jpeg -o temp000.jpeg 

The files will have a unique number as the last three digits of the file name, and the "date modified" field will show my laptop's system time when it was created.

## Radio Tomographic Imaging Improvements - Nov 2011

Yang Zhao, Neal Patwari and I just got done testing a totally new system for radio tomographic imaging. It uses new radio node hardware that we manufactured ourselves, a new imaging algorithm, and new "teepee" stands for quick and easy demos. The new images are bright and clear, the hardware/firmware is fast/stable, and the new stands set up in a fraction of the time. We're pretty psyched because every element of the system has been improved.

By the way, I am using Google+ more and more these days. If you're interested in following me, here's the link: https://plus.google.com/101773630805931921626/posts

## Book review - "e: The Story of a Number"

Have you ever wondered where the number “e” comes from? While I was looking at geek books at the store, one called "e: The Story of A Number” by Eli Manor caught my eye. I bought it, read it, and really enjoyed it.

The book starts with the discovery of the logarithm by John Napier as a tool to calculate complex multiplications. I learned that Napier spent 20 years of his life doing extremely tedious work: compiling log tables so that computations could be done much easier. 20 years! His logs were a huge revolution in math in the 1500s, now considered to be one of the most important mathematical discoveries ever. As the book progresses, the relationship of the log function to the number e is revealed, along with many insightful discussions about other areas of math.

We often take for granted the math concepts we use without really asking ourselves where they come from. For example, when I learned how to take the derivative of a polynomial, I never bothered to learn why we were “bringing down” then decreasing the exponent. I've used the formula “exp(ix) = cos(x) + i sin(x)” many times, but I never really understood why the formula was true. Why is the derivative of exp{x} = exp{x}? While reading this book, I said to myself many times “So that's where that comes from!”

The book is very inexpensive and definitely worth the read. Here's a link to a preview of the book: http://goo.gl/lR2sP

## Converting PDF to EPS on entire directory

We recently had a paper accepted to a journal, and they required that all figures be submitted in EPS format. I normally export all of my figures from Matplotlib in PDF, so I had to figure out a way to convert them. I got good results using the "pdftops -eps file.pdf" command in Ubuntu. The only problem was that I had to do it for a whole directory of figures, and when I tried "pdftops -eps *.pdf" it choked.

Python to the rescue. Here's a simple python script that will grab all PDFs in the current directory (wherever the script is placed), and automatically convert them to nice EPS files.


from glob import *
from os import system
fileList = glob('*.pdf')
for f in fileList:
system('pdftops -eps {0}'.format(f))

`

So easy! I love python. The glob command grabs all the names of files that match the patten you want. In this case "*.pdf" returns a python list of all files with PDF extension. Then, it just iterates through the filenames, inserting each filename into a system command using the string format function. DONE!