Wednesday, July 11, 2012

From Microsoft Word to Latex

As much as I want to work on my papers in Microsoft Word, its been proven minutes by minutes that working on an academic research paper is not feasible without the use of LaTex.  Here, in this article, from a 'noob's perspective, I will lay down some of the fundamentals that you will need in order to have  your latex environment setup, ready, runnin' & gunnin'.  Since i am writing a paper for an upcoming SPIE conference, i'll take SPIE style class as a reference. (http://kmh-lanl.hansonhub.com/spie/)


Assuming you have been working on papers using the followings:
1) Microsoft Word
2) Endnote

At the end of this article, you will be dropping the above two, and will then be using the followings extensively hereafter.
1) Miktex (Think of this as a Compiler/Interpreter)
2) TeXnicCenter (Think of this as an IDE)
3) JabRef (Think of this as a Reference Manager)



I) Download and Install


Download and Install the followings (All of the followings will be done with a 'default' installation) Note: The version numbers are as of writing.

  • Miktex 2.9 (http://miktex.org/2.9/setup)
  • TeXnicCenter 1 RC 1 Installer (http://www.texniccenter.org/resources/downloads/29)
  • JabRef 2.8.1 (http://jabref.sourceforge.net/)
Download from "HansonHub" (see above) and save them in a folder
  • spie.cls
  • spiebib.bst
  • ifthen.sty
  • cite.sty
  • article.tex
  • report.bib
  • mcr3b.eps

II) Setup Search Path for Miktex
  1. Start > All Programs > MikTex 2.9 > Maintenance > Settings > Roots [tab]
  2. Add the path, in my case, i added the path to "My Documents"\[Papers]\[Conference_Name]\[Year]\tex\latex\"
  3. Go back to General [tab]
  4. Click Refresh FNDB

III) Get TeXnicCenter going

When you first load TeXnicCenter, it will ask you for the root path to all your tex-related executables, in my case, i specified "C:\Program Files\miktex\miktex\bin".  It will then fill in the blanks for Yap and the rest.  

4) Start writing with the SPIE format

1) Open up article.tex (you can rename this to a more sensible filename)
2) Then, click on Project > Create with active file as main file
3) Press Ctrl F7, and then Press Ctrl F5, you shall see the LaTex with SPIE format 
(if you have any errors in the output window, post it up here as comments) You can also try refreshing FNDB, to see if some of the errors are resolved.

IV) EndNote to Bibtex

ENDNOTE first
  1. Open up Endnote
  2. Click on Edit > Output Styles > select "BibTex Export" or go to Style Manager, and enable "BibTex Export" Click Apply/OK
  3. While you are still in Endnote, select all your citations, Click on File > Export  > In the output style selection list, choose BibTex Export
  4. Give it a sensible file name (it has to be in .txt, you will need to rename to .bib as you as its done saving)
  5. Save it to the folder along with your article.tex in step 3

JabRef Now
  1. Open up JabRef
  2. Open the .bib file you created and renamed in the previous step
  3. It will prompt errors saying none of the citations has BibTex Key
  4. You will need to auto-generate, while you are in JabRef, press Ctrl-G, and you will see your BibtexKey columns being filled
  5. Save the .bib
V) Completing the Circle

  1. Go back to TeXnicCenter
  2. Scroll to the bottom where you should see \bibliography{report}
  3. Change it to the .bib you saved in the previous step but without .bib (at this step, i suggest you refresh FNDB, again)
  4. Press Ctrl F7, and then Press Ctrl F5, you shall see the LaTex with SPIE format (if you have any errors in the output window, post it up here as comments) You can also try refreshing FNDB, to see if some of the errors are resolved.   You might also want to try to give a testing citation or two, just add \cite{ONE_OF_YOUR_BIBTEX_KEY} in any of the paragraphs reasonably. 

This should be it !


No comments:

Post a Comment