Tuesday, February 24, 2015

Why "save trees" + GNU/Linux does not work well for PhD students?

Multi-objective problems pose some serious challenges in real life. You can never have "best of both the worlds". Solving such problems is my current research focus (may be some other day on my research problems). However, I did not realize, I deal with many MO issues in my daily life. I am ranting about one such here.
  1. Reading a lot of academic papers is a part of my job description (Duh! what more do you expect a grad student to do??!!).
  2. Being a wee bit green conscious, I would love to reduce the usage of paper.
Now, as you may have guessed,  1. and 2. above don't go well with each other :(

I tend to read most of the stuff from PDF documents on the computer; I would like to annotate and markup the file as and when I read. My workstation is primarily a Linux box. Unfortunately for (many like) me, Adobe stopped supporting Linux and the various PDF readers for Linux pretty much suck. So there has been a continuous struggle to balance my objectives.

Wine was an option for me, but somehow, it wouldn't install on my work station. Hence, my setup was quite stupidly heavy. I was using a (legal copy of) Windows VM (yeah! advantages of being in NUS, I get Windows free :D) on Virtualbox solely to read PDFs. Sucks! but true :-|

Yesterday, I reached the point of saturation, Alt-Tabbing doesn't work with VBox (or I haven't figured out yet how!) and that additional Ctrl + Alt-Tab was driving me crazy. Hence, I decided to get to the root of the problem and install Wine and then Adobe reader on top of it.

My Ubuntu 14.04 was complaining that it will not allow me to install Wine 1.6.

As usual, stackoverflow and askubuntu sites came to my rescue. (Sorry, I seem to have lost the original links, and no patience to search again to link here.)

Here are the steps I followed:
  • Allow installing i386 packages on Ubuntu:
    • sudo dpkg --add-architecture i386
  • Next, downgrade all the packages to the base 14.04 (yes! I lost quite a bit of software installed due to dependency hell, but never mind, I will set them up again :P). For this, refer to my post a couple of years ago!!
  • Once this is done, install Wine:
    • sudo apt-get install wine1.6
  • This is half the work done, at the cost of losing a lot of packages I installed since upgrading to Ubuntu 14.04.
  • Now, install the dependencies for Adobe reader (oh! in the mean time, download Adobe reader installer from Adobe site, this can be slow some times :-/).
    • winetricks mspatcha
    • winetricks atmlib 
    • winetricks riched20 
    • winetricks wsh57 
    • (Even though I configured Wine to emulate Win 7, it still patched my system as a Win XP (but never mind, it worked for me :D))
  • Right click on the downloaded installer and select "Open with -> Wine Windows Program Loader". 
  • This installed Adobe reader on my Linux box (Yaaaay!!). I can now select a PDF file and say, open with Adobe reader, and Wine picks it up happily from there :)
Now, back to setting up the rest of the packages/software that I need for work. Sigghhhhhhh!!!

Monday, February 9, 2015

Citing with "theapa" style

I use LaTeX a lot for my writing (home works, reports, papers, presentations, hell even my own notes!). Anyone into scientific writing (if I can call it that!) will use bibliographic database for citing papers and other scientific materials.

Most bibliography styles provides for a couple of common ways of citing references at the basic level.

  1. Citing by numbers (mostly IEEE style) which I don't find intuitive when writing the account as first person; like this: [1].
  2. Citing fully with the author year; like this: (Narayan et al. 2015).
  3. Citing with author in the sentence and the year appears in parentheses; like this: Narayan et al. (2015)


The first two methods can be achieved using \cite{citationKey} while the third one uses \shortcite{citationKey}.

Enter theapa.sty & theapa.bst. The bibiliography style is specified as \bibliographystyle{theapa}.

I haven't been able to dig deep into how these differ from using \bibliographystyle{apalike} or \bibliographystyle{apacite}, but what I have discovered is using \bibliographystyle{theapa}, does not give the citation in the format 3 above. This pissed me off for a bit. However, not having a choice, I searched around for its usage. Some kind soul had put up an example TeX source code. The solution is the following


  1. To use author in the sentence and year appearing in parentheses use \citeA{citationKey}.
  2. To use author in the sentence, and to use the possessive noun form of the author, use \citeS{citationKey}.


That's all for now!

Until next time I feel like ranting, adios!