Using LaTeX, Mendeley, and Bibtex in Windows

Most publications such as a Thesis, Dissertation, conference paper, Journal article, etc. have specific required formatting. We’ve all hit the point where we simply can’t get our word processor to format things the way we want, and we can’t figure out why. The way these apps work is to code in manipulations to raw text. It is kind of like HTML code in Micro$oft Word and LibreOffice formats. In fact if you have a .docx or .odt file, you an open them in an unzipping tool such as 7zip and see all the nitty gritty, including saved images, etc.

LaTeX is basically programming what a document should look like directly. You have to write code to tell the document where to create a subsection, bulleted list, insert images, even to italicize or bold something, but it (usually) gives you much more direct control over formatting.  All through college, I wrote only a few documents in LaTeX because honestly, it was a pain. It is not WYSIWYG editing at all. After you make changes to the code of your document, you have to compile it into a PDF document before you can see what the end result will look like. I avoided using it because I hadn’t found an editor I liked.  Now I have found a workable setup and I’ve solved a few problems for myself that I think might be helpful for others (as well as my future self).

Firstly, you must install an editor, as well as the compiler tools. There are many editors out there and two compilers.

Editor:

I tested several editors (namely Texmaker, TexWorks) but I settled on using TeXstudio.  Texmaker looks nice, but I had trouble getting it to display a recompiled version of my PDF. Texworks has a much more “Linuxy” feel, as it uses two separate windows to display the code and the resulting PDF.  Again, the winner for me was TeXstudio.

Compiler:

There are two LaTeX compiler setups. TexLive and Miktex. I had used Miktex in the past so I tested out TexLive with this installation.

Setup:

Open TeXstudio, then select “Options–>Configure TeXstudio”  then select the “commands” tab.  Here, we must tell TeXstudio where all the compiler programs live. The main thins to fill out are “LaTeX”, “PdfLaTeX”, “External PDF Viewer”, “BibTex”, and “Biber”.  Don’t worry about the other text in the file paths in my screenshot here, That’s automatically entered by TeXstudio when you select the path. Simply click on the file icon on the right hand side for each of these entries and drive to the compiler installation. Here you see that my texlive installation is directly on my C drive. Miktex can be installed the same way. Then wind your way through the fines until you find the “binaries” (which are the actual executable programs) in the “bin” folder.

texstudio

 

Templates:

Now you can start editing and compiling your paper. You can start from scratch, or if the conference or journal you are submitting your paper to has a template you can download, start there.  In my case, IEEE has templates available for download here. Now I recommend you go through a few tutorials  and play with some files like these before using a full-on journal template just to get your bearings with LaTeX. There are commented things in the template that you can add in (uncomment) and multiple ways of doing things you might want to do, so research is king.  Once you’ve written some of the paper and formatting code, compile it by clicking the “compile and View” button in TeXstudio.compile and display  You might need to compile the bibliography separately. For finer grain compiling options, click the “Tools”menu.

References:

You already know I love Mendeley, but you can actually get Mendeley to export a .bib file.  A .bib file is a list of all your references in a format called BibTex, which you can open in any text editor, even in TeXstudio.  The .bib file Mendeley exports is only as good as the data you entered in Mendeley, so make sure it is correct first! You can enter these reference entries directly into your .tex file (the code  you are writing describing your paper) or keep the references in the .bib file and import that file into your paper.   What is great is that you cite something using /cite{nameOfBibtexEntry} and LaTeX and BibTex do all the rest for you. It will enter the citation in the correct format, then it’ll generate your references section of your paper.  The format,  like MLA, APA, etc, is different for each conference, journal, and even discipline in which you are submitting. You can tell your document which format to use using some simple commands, however the template you download likely already sets you up for the correct format.  To get the name you must use in your /cite{} command, open the .bib file and find the entry you want to cite. The first name next to the @article{ tag is the name to use. for example:

In my bibtex file I have the following entry:

@inproceedings{Rao2003,
address = {New York, New York, USA},
author = {Rao, Ananth and Papadimitriou, Christos and Shenker, Scott and Stoica, Ion},
booktitle = {Proceedings of the 9th annual international conference on Mobile computing and networking – MobiCom ’03},
doi = {10.1145/938985.938996},
isbn = {1581137532},
keywords = {Vehicle,Wireless,ad-hoc,coordinate-based,detection,geographoc,routing,sensornets},
mendeley-tags = {Vehicle,Wireless,detection},
month = {sep},
pages = {96},
publisher = {ACM Press},
title = {{Geographic routing without location information}},
url = {http://dl.acm.org/citation.cfm?id=938985.938996},
year = {2003}
}

In my LaTex file, I might have the following line:

Ad hoc wireless sensor networks can be used to track vehicle locations as shown in /cite{Rao2003}.

Once I “compile and view” this document, it will generate a PDF with references automatically generated and in all it’s two-column perfectly formatted glory…. if all goes right.

Doctoral Dissertation or Master’s Thesis Template

I’ve already mentioned one good tool for research papers, so here’s another that might be helpful.

Most schools have a set format for their dissertations and theses. My school was the same.  They provide a manual showing what they expect your formatting to be.  Many people have trouble with this. You must make a meeting with a specific faculty member in the graduate school and she will take a ruler and measure your margins, and go over in extreme detail the spacing, numbering, etc. of your document. Many many people get rejected and I’ve even talked to people who pay lots of money for other people to format the documents for them.  They don’t provide an exact template for any specific software, but using the google machine can help you find Microsoft Word or LaTeX tempaltes.  Personally, I like LibreOffice it is completely cross-platform (works on windows, mac, and linux systems)  completely free, open source, has lots of great plugins and it lives in the world between Microsoft Windows and LaTeX. It is GUI-based (WYSIWYG, visual) like Microsoft Word, but also much more powerful like LaTeX.   I dislike LaTeX because it is incredibly buggy and you have to program your text documents.  I program other stuff all day long, I am sick of that!

Anyway, I made my own template and write up a very detailed explanation on how to use it and my best tips and tricks for modifying the basic template if you want.  I also have a chart of suggested plugins to make your papers look amazingly good and professional. Again, I used LibreOffice, so it can be used in OpenOffice as well. This is specific to my school, so be sure you double check your school’s documents to see exactly what kind of margins and page numbering they require.  (Note it is in Open document Format and though I haven’t tested it, it *might* work in other programs like Microsoft Word).

Download my template here!

Adam-Atom

Reference Managment in Scientific Papers

Citing references in papers has always been a tough nut to crack. Everyone has their own preferences and style when it comes to writing, and different scientific journals all have their own specifications for how to cite references. Some people swear by LaTeX and BibTeX, others use word and Endnote.

While writing my thesis, I’ve come across a set of applications that I believe can be useful for almost any and everyone who is writing a paper.

Read more

Tips on Getting into Grad School: Part 2

In the first part of this two-part series, I went over some of the basics of graduate school applications.  In this part, I’ll go over some more detailed aspects you should consider when choosing a program and tell you some tips that might help you get in even if you don’t fully meet the requirements.

After each detailed section, there’s a “TLDR” notice. This stands for “Too Long; Didn’t Read” and gives just the basics of the section.

Read more

Tips on Getting into Grad School: Part 1

From time to time, people ask my advice for how to get accepted into Graduate school. Reading the school websites, and talking to professors and administrators isn’t enough.  Not to mention you need people skills to get in.  In this, the first of a two-part series, I’ll break down the very basics of what many programs require, and give you tips and tricks to help out.  The second half will be advanced tips, that show that you really want in the program.

I’ll be the first to admit that I’m not an expert on this subject. I don’t have the best people skills, and I don’t know all there is to know about Grad school, but I do know what worked for me, and my advice has helped a few people to get accepted so far.

I’ll begin with some general questions I get asked.  The second part of this series will go into more advanced aspects of Grad school selection and even some tips that may help you get in even if you don’t meet the requirements.

After each detailed section, there’s a “TLDR” notice. This stands for “Too Long; Didn’t Read” and gives just the basics of the section.

Read more