How I Cite

Hello blog-o-sphere! It's been a long PhD thesis-induced hiatus here on If We Assume, but I'm working hard to catch up on my backlog of project ideas.

A couple months ago this question was posed on Twitter:

I offered to "quickly write something up", and in true academic fashion here it is 3 months later!

Quick Guide: how I manage citations in LaTeX for writing papers and my thesis

Note: This guide does not tell you which papers to cite... All I can advice is you should spend a long time reading the literature, especially from before you were born (applies to all age groups)

So, I just turned in my PhD thesis, which totaled 221 pages front-to-back. Like most astronomers I wrote my thesis in LaTeX. Apparently I could have written it in Word, but I cannot fathom how people write long documents in that program given how frequently it crashes on my Mac. Also I have no idea how it would have handled my citations.

My thesis was the culmination of many years of work, and included text from 3 papers I had previously published in various journals - all using LaTeX. One chapter contains material for a soon-to-be-published paper as well. All told, my thesis included citations to 236 unique sources!
Dealing with so many citations was (nearly) trivial because I had invested early on in managing all my references!
Writing the thesis was still a laborious job, of course.

You could simply type all your citations according to the proper style, and format your bibliography manually. What if you forget one? What if it's a preprint that needs updating? I also assume overworked journal editors would hate you for doing this. Instead, use the \cite command, and follow this guide!

Get bibtex citations for every paper, put them in BibDesk to make a nice "library". Every paper or manuscript, just point your bibliography to this one file. The end.

Here's what my workflow looks like:

0. Install the TexShop bundle
This includes TexShop (a very nice text editor for TeX) and BibDesk. It also includes a handy tool called LaTeXiT, which you can use to easily typeset pretty equations to copy/paste as an image in to presentations!

Other software to organize your library is available. I have no experience with and cannot comment on them, except to say: TexShop is free and stable.

Building Your Library

1. Find papers you like
Every paper I see that I might want to cite later I keep a reference to. 99% of the papers I'm reading are indexed in the SAO/NASA ADS. Occasionally I find papers or articles that aren't, but that's ok. At time of writing I have 883 papers store in my library that I can cite.

2. Get the BibTex reference for each paper
This is the magic of the whole system. BibTex is a bit of tex-nology (hah!) that is from the mid 80's, that provides a standard format for citations in LaTeX

If you're using the classic ADS, here is where you click to find the Bibtex entry for every paper:
If you're using the new ADS, here is where you click to find the Bibtex entry for every paper:

This is what a BibTex entry from ADS might look like:
Say, that's pretty readable! Almost every academic journal website will provide BibTex citations for their articles. So does Zenodo. Everybody wins with BibTex!

3. Put the BibTex reference in to BibDesk
The first time you do this, open BibDesk and create a new library (I call mine "references.bib"). Every subsequent time you do this, open that same library file

Copy and Paste the entire BibTex entry directly in to your library in BibDesk. Be sure to save your library. 

Now the paper has been added to your library!

Probably you want to change the default citation key string. BibTex entries from ADS will have obnoxious default strings like "1988PASP..100.1134B", which in your LaTeX paper you'd have to cite as:

Yuck. Instead, double click on the paper entry and edit this field in BibDesk. I'd probably change "1988PASP..100.1134B" to be "bessell1988", making the citation in my paper even easier to read:

What your "references.bib" file might start to look like in BibDesk

3b. Add the PDF of the Paper for Later Reading
This is the beauty of using BibDesk as the GUI manager for your library. Each paper you save can also have supplemental things attached to it, like a PDF file! Hopefully someday (soon) we'll all be able to have internet access 24/7 anywhere, and that journals will make web-based articles that we actually want to read. That day is not yet here, and PDF is often the only useful format for a paper.

The manual way:
- Add citation to BibDesk (see #3 above)
- Download the PDF
- With the article selected in BibDesk, drag/drop the PDF in to BibDesk.

The auto-magical way:
Jonathan Sick has an awesome widget that will add the BibTex entry AND the paper to your library. Awesome. I use this a ton, and should buy Sick another beer next time I see him.

Now when you want to read the paper itself, just search your library for the paper (by author, year, etc) and then double-click on the PDF. So helpful!

3c. Add Bonus Stuff to the Entry!
Just like you can store the PDF attached to a paper, you can store basically anything. If a useful paper makes a long table available as an ASCII file, I will save the file and drop it in BibDesk. This is especially helpful if you've taken the time to digitize or transcribe something from an old paper!

A very helpful table stored in my library

4. Organize Your Library
Honestly, the GUI and organization is kind of clunky in BibDesk. I had to move and resize lots of panels to get it to look nice. There are a TON of features I don't know how to use, from citation formatting to connecting to web-based libraries.

One nice feature: You can create "Static" groups (basically lists), perhaps by topic or author, and drag papers in to them from your main library. I have groups for major separate research ares that I'm reading about. This is very helpful when you start to forget that one obscure paper in some topic you meant to reference....

5. Use the Library
Now in every paper or thesis you write, point to the same file, forever, the end.

When I'm writing a paper, I usually have to include these lines in the top of the file:

This example requires the journal-specific file "apj.bst" to be available. You can either have it in the paper working directory, or someplace TexShop can always see it.

If your bibliography style doesn't know the standard AAS journal abbreviations used by ADS and others, you might need to include near the top of your document a reference to aas_macros.sty:

When I want to reference a paper from the library I just use the citation key as needed. For example:

This is the last 2 lines of every paper I'm working on:

To be clear, that's the path to my library file (references.bib), but omitting the .bib in the path (LaTeX assumes it).

6. Typeset Your Paper
If you're using TexShop, this is the typical sequence to typeset:
LaTeX (shortcut is CMD + t)
BibTex (shortcut is CMD + b)
LaTeX (shortcut is CMD + t)
LaTeX (shortcut is CMD + t)

The underlying BibTex magic will create the needed .bbl file locally that holds all the references you've cited. If you mistype a key, or try to cite a paper you haven't downloaded, TexShop will warn you in the second typeset step. LaTeX will organize and format the bibliography as needed.

7. Submit Your Paper
To ensure things work smoothly, usually when I submit a paper I put the references directly in to the manuscript file. This makes 1 less file to upload and keep updated, but there are downsides too...

Just delete the line pointing to your "references.bib" file from Step 5, and copy the contents of "your_paper.bbl" in its place. When typesetting now, don't include the BibTex step.

Probably you don't need to do this usually, but if an automated LaTeX system is messing your references up it can help.

So that's it! By using this system for many years I was able to copy/paste my published papers in to my thesis without worrying about my references. Whenever I start writing a new paper it's trivial find papers to ensure the bibliography will work.

What did I miss? Want to advocate for a different tool or approach? Am I totally wrong? Tweet me or leave a comment below!

Gender study at the IAU meeting

No comments:

For any astronomers heading to Hawaii next week for the big IAU meeting, please consider helping me continue the study of gender demographics at astronomy conferences!

This conference brings together the largest and most diverse group of astronomers for 2 weeks of science and sunshine. It's also a perfect chance to continue my ongoing study of gender in speakers versus question askers.

The web form is here, and will be active for the entire 2 weeks of the conference!

See you in Hawaii!

PhD Thesis Done!

No comments:
Last week I defended my PhD thesis in astronomy! My brother-in-law was good enough to capture the event with my iPhone, so I'm sharing it here for anyone interested. The talk is full of astronomy data visualizations, some that I created last year for talks, and some new! Plus, the subject matter is NASA's epic Kepler mission, so I got that going for me...

Davenport PhD Thesis Talk from James Davenport on Vimeo.

The slides are a bit hard to see, so I'll post those online soon (and will update with a link)

Moving forward I'm excited to work on some of the ideas for If We Assume that have fallen to the backburner these past few months. On the professional side of things, starting in the fall I'll begin a 3 year NSF Postdoctoral Fellowship in the department of Physics and Astronomy at Western Washington University!

Finally, if you're not watching along as New Horizons passes by Pluto tomorrow (Tuesday, 2015 July 14), then you're missing a once-in-a-lifetime opportunity! Press conferences will be streamed online, starting at 0730 EDT. Images and videos will be going online constantly over the next few days. Follow the mission on Twitter: @NewHorizons2015, and my friend Alex Parker who works on this exciting mission: @Alex_Parker!
from APOD

Don't touch that dial...

No comments:
It's been radio silence here since March. In case anyone was wondering "what the hell happened to Davenport's blog?!" I wanted to post a note saying: thesis

My PhD thesis defense is scheduled for mid July, and currently I'm racing to get the final chapter written! While this blog has languished, my GitHub profile has been conspicuously green...

The above image is a play on the famous cover art from Joy Division's album "Unknown Pleasures", but uses actual data from my thesis!

I've got a whole mess of blog posts and data visualization ideas on the back-burner (like 40 draft posts/ideas started!), and hopefully in July there will be enough time to get them out. Until then, don't touch that dial...

In the meantime, check out this amazing data visualization by my friend and fellow UW graduate student Ethan Kruse!
View post on
Related Posts Plugin for WordPress, Blogger...