2013-11-06

Error of the Font of the Cited URL in Bibliography Using Bib$\rm \LaTeX{}$ in APA Style

This midnight, I tried to compile my $\rm \LaTeX$ document with a so-called "bibliography", which contains a URL. The link should be in typewriter font after using the command \urlstyle{tt} under adding the url package to the preamble. I googled for almost 2 hours, but the blog posts suggested that using this method should work. I even tried to copy some minimum working examples from the web to test if they work. They really worked and so I'm puzzled. Ten minutes ago, I just find out what's going wrong: the url package should never go before the several lines in the preamble that are responsible for adding an APA-style bibliography.
The \ll command in Vim-$\rm \LaTeX$ seems not doing well with Biber. Whenever the aux file exists, \ll won't execute biber, causing the resulting pdf file to have no change in the bibliography.
Hope I can use less time to figure out any mistake next time.

This Weekend's Work on Vim

1. Installed some useful Vim plugins, such as Vundle (Vim plugins management tool), NERDTree (file browser), Easymotion, Loremipsum (random text generator), Vim-surround (surround text with brackets), Vim-snipmate (for autogenerated code), Vim-addon-mw-utils, Tlib_vim (dependency for Vim-snipmate), FuzzyFinder (quick finding tool for files, etc) and L9 (dependency for FuzzyFinder).
2. Do some custom insert mode keyboard mapping. (automatical completion of brackets)

2013-10-18

A Bug in Vim-$\rm \LaTeX$

It's a small syntax error, and can be easily fixed with the addition of a space character. I found it from a Google search result. (I've forgotten the query string.)
This shows to good things of free and open source software:
  • Find bugs quickly through effective communication between users and developers
  • Fix bugs quickly through hands-on configuration of source code
From the Vim plugins in the GitHub, you can see even more:
  • Everyone can tune the software to adapt to his/her needs.
  • Everyone can share and contribute their changes.
  • and more ...
The more the developers, the further they can see!

2013-08-16

Why Vim?

Searching something like "vim best editor", "vim vs IDE" Google, you can find too many results, and it's impossible to finish reading all those articles. Therefore, I selected some and post the link here.

Programmers

The video below is a talk given by Bram Moolenaar, creator of Vim. The handout for this talk is found on his website. However, he assumed that the audience had some basic knowledge on movements in Vim. For Chinese users, the slides below may help you. Otherwise, please go down to here

  1. Quick jumping of text: e.g. 5w,2(
  2. Text objects: e.g. da<,ci"(,dci{(
  3. Vim-Macro: e.g. 5w,2(
  4. Folds: seeing structures and moving quickly

Writers

With many keyboard shortcuts, Vim enables you to move quickly between words, sentences and paragraphs, and thus focus on writing.
See Randall Wood's Vim for Writers blog entry as well as his notes.

Vim Advocacy

  1. Why, oh WHY, do those #?@! nutheads use vi?
  2. Vi Lovers

Vim Game

  1. VIM Adventures

Vim E-Book

  1. Vi IMproved—Vim by Steve Oualline

APA Citing

Typing in the APA reference list entries are tedious. Therefore, use the biblatex-apa package.

For the sample files, please click the above "Youtube" button.

Why biblatex instead of $\text{Bib} \rm \TeX$?
Apart from the support of @online tag, see this blog post on the comparison between the apacite and biblatex-apa packages.

For writing scientific reports, refer to $\rm \LaTeX$ Style and Bib$\rm \TeX$ Bibliography Formats for Biologists: $\rm \TeX$ and $\rm \LaTeX$ Resources

Edit $\rm \LaTeX{}$ equations on Vim

With the Vim-$\rm \LaTeX$ plugin, it's possible to edit $\rm \LaTeX$ equations with Vim quickly without making syntax errors. (e.g. undefined control sequence caused by mismatched braces '{}')

For the sample files, please click the above "Youtube" button.

Why use Vim? Please refer to my post on Vim.

For a quick startup guide, see the official tutorial. If you've learnt those keyboard mappings, here's a quick review of some commands. For detailed list of all keyboard shortcuts and customizations (e.g. custom compile rule: use pdflatex instead of latex and dvipdfm), you can refer to the user manual.

There're many blog entries about how to install $\rm \LaTeX$ on Vim/GVim on UNIX/Linux and M$. Searching "vim latex" gives you millions of search results. Summarizing the articles, the three major components are:

  1. Editor
    • Vim (found on almost every distribution of *nix)
    • GVim (on GUI of any platform)
  2. $\rm \LaTeX$
    • $\rm \TeX \text{Live}$ (found in package manager on *nix)
    • $\text{Mik}\rm \TeX$ (have a $\rm \LaTeX$ package manager)
  3. Vim plugin for writing $\rm \LaTeX$: Latex-Suite

For *nix, you may find some GUI tools for installing packages. (especially in some popular distributions)


Software Centre in Ubuntu 12.04 LTS


PackageKit in Fedora 17

You can also type the install commands for these packages on the terminal. For example:
  1. Ubuntu
    # Also include `vim-gnome' if you'd like to install GVim.
    $ sudo apt get install vim-gnome vim-latexsuite texlive
    
  2. Fedora
    # Also include `vim-X11' if you'd like to install GVim.
    [root@localhost]# yum install vim-latex latex
    
Unlike M$, the dependencies will be automatically resolved.

For M$, the installation procedures for GVim (portable), Vim-$\rm \LaTeX$ and $\text{Mik}\rm \TeX$ (portable) are as followed:

  1. Go to the official websites of GVim and $\text{Mik}\rm \TeX$ (or equivalent packages) and download the packages.
  2. Put $\text{Mik}\rm \TeX$ portable and GVim portable to any folder you like
    • e.g. C:\Temp
    • DON'T put them under C:\Program Files
  3. Download Vim-$\rm \LaTeX$ from SourceForge
  4. Follow the steps here
Remarks: The installation of Vim-$\rm \LaTeX$ (items 3 and 4) is the same for portable and non-portable versions of GVim.

Testing MathJax

Following the instructions here, MathJax works on Blogpost.
I typed
$\cos^2\theta-\sin^2\theta=\cos 2\theta$
and here's the result: \(\cos^2\theta-\sin^2\theta=\cos 2\theta\)
Antoher equation: \[ ax+\frac{b}{y}=1 \] This time, the equation is in display mode.
How about the inline verbatim environment? Googling "mathjax verbatim", we have \[\verb*$x^2\sqrt y$* \text{ yields } x^2\sqrt y\] on $\rm \TeX \text{ Commands available in MathJax}$ . Nevertheless, it only works in display mode.
Finally, let's get some equations numbered, just like an example on MathJax. \begin{equation} \int_{0}^{\frac{\pi}{2}} \sin x \, \mathrm d x = 1 \end{equation}