Blog 1

Random Talk on Random Thoughts

A Low-Tech Approach to a High-Tech Problem

| Comments |

Nowadays, people, especially netizens, love sitting in front of a computer to do their work. To those people, we can’t deny the importance of computers and the Internet since they help us a lot in gathering information. Moreover, a printed copy is often more neat and tidier a handwritten one. It seems that working means sitting in front of a computer or a laptop.

In my opinion, though having low-tech tools, one can still make good progress in his/her work, including, but not limiting to, software development work. Not working in the IT sector1, I know that I’ve little convincing power, so I leave it to de Heredia.2 The article says that the author prefers going out and working on the problem using a pen and paper. Therefore, using traditional tools, we can still create something great.

After reading the article on ViEmu, I decided to write an outline and draft an essay using a pen and paper.

P.S. I has typed this article in Vim without doing any ruff work on paper.


  1. My about page 

  2. De Heredia, J. B. (May 16, 2007). Why, oh WHY, do those #?@! nutheads use vi?. Retrieved from http://www.viemu.com/a-why-vi-vim.html, Misconception #5. 

Complicated Pandoc Commands

| Comments |

I don’t need to memorize these commands. Instead, what I need is to create a page here so that I can make quickly get the right command for my work. This saves the time for checking and testing the right command.

Pandoc markdown

Official demo: http://johnmacfarlane.net/pandoc/demos.html

Beamer

A shell command for APA style reference list:

$ pandoc -t beamer -s -S --biblio mybib.bib\
> --csl /path/to/apa.csl % -V theme:Berlin -o %<.pdf

Customized PDF

(Added on AUG 03RD, 2014)

The command below is just an example of narrowing the margin, and choosing a larger font.

$ pandoc % -V geometry:margin=1in -V fontsize:12pt\
> -V linestretch:1.655 -o %<.pdf 

For more variables, refer to the User Guide: http://johnmacfarlane.net/pandoc/README.html#templates

For many ordinary computer users who are used to write documents using WYSIWYG editors, the above command is quite scary, so I’ve written a custom template to save the trouble. See My Pandoc Template (1) for details.

Using gVim on Windows to Create Pandoc Slides

| Comments |

At night on 25/02/14, I tried to open gVim and use the command mode to issue system commands, so that I can use pandoc to create $\rm \LaTeX$ Beamer slides. However, with the correct command, gVim went wrong and in the resulting PDF file, all lines in the source markdown files were concatenated into one single line. I hadn’t encountered such error last time.

With the same command, I managed to get back my $\rm \LaTeX$ Beamer slides. As a Vim lover, I’d like to try to do things within the editor. Therefore, I changed to the project directory and start gVim through the command prompt. Then I used q: to find the corresponding pandoc command, and re-ran it. Job done!

A Vim Lover Page

| Comments |

I’ve found a useful page introducing a Vim lover. It consists of plenty of links to many useful resources. Unfortunately, for Vim users who can’t understand Chinese, I’m not sure if they can understand the contents of the page. I hope Google Translation can help. Otherwise, they can also find some hyperlinks which take them to other English websites.

Creating a New Octopress Page

| Comments |

I haven’t learnt something about Octopress for 2 weeks. I hope that I can create a GitHub project page using Octopress successfully.

I have seen a comment for a blog post which briefly describes the procedures for making gh-pages. The user who has left the comment claims that the posts, which should be under the source/_posts directory1, is in the source branch of Octopress Git repository. I’m going to figure it out. No matter it’s true or not, it’s something that puzzles some Octopress users.

Creating an ABOUT page

I couldn’t find the answer for adding new items to the navigation bar at the top of the posts and under the header in an Octopress blog because I didn’t know the Google search words. This afternoon, I found that googling “octopress page navigation” help. I managed to find a blog post on that.2


Git Status of My Octopress Folder

| Comments |

I’d like to include my GitHub repositories here. To do so, it’s a piece of cake to slightly modify _config.yml.1

Once, I curiously typed git status in ~/octopress. The following screenshot is from my terminal.

git status

Then I blindly followed the “advice” of git status and typed

$ git add .

It seemed that I had made a mistake. Actually, without adding those modified and untracked files on the stage for commit, the following two commands will do update the contents on the GitHub pages.

$ rake generate
$ rake deploy

The final step is to view your blog again after going out for a cup water or some snacks.

How about the git status? Simply forget about it!


(Last added on MAR 15TH, 2014)

If you have more than one local repository of your Octopress or Jekyll site, you may upload your contents to the Internet as long as the corresponding branch in the local repository is newer than the one in the remote repository. To keep the Octopress or Jekyll code updated, one needs to use Git to check if the source branch contains the latest changes. Otherwise, after writing a new post, it is possible that one can’t upload the new post to the Octopress or Jekyll site using rake deploy.

Thus, eight days ago, I made Git commit 8c7be99.


  1. Mathis, B. (Jul 19, 2011). Configuring Octopress. Retrieved from http://octopress.org/docs/configuring/ 

Including a Bibliography in Pandoc Markdown on Ubuntu 12.04 LTS

| Comments |

I tried typesetting a $\rm \LaTeX$ Beamer slide using pandoc markdown since it’s easy to use. According to the official demo1, with a CSL file2, which specifies the style to the citation, users are suppose to be able to create a document with a bibliography. However, when I ran the following command in Vim on Ubuntu 12.04 LTS, pandoc hanged.

:!pandoc -s -S --biblio mybib.bib --csl foo.csl -t beamer %\
-V theme:Berlin -o %<.pdf

I admit that it’s too complicated. I tested several things:

  1. $\rm \LaTeX$ Beamer class
  2. Bibliography

To figure out which part of the command is wrong, I tried to remove the part related to item 1. Issuing a simple command for item 2, the usage of one of the CPU in my computer rose to almost 100%, and remained high with small fluctuations.

:!pandoc -s -S --biblio biblio.bib -o %<.html

This issue is indeed one faced by the community of Ubuntu users, so I can find official advices on GitHub. Eventually, the last comment on the page has solved my problem. I think installing libghc-citeproc-hs-data is quicker than installing the latest (1.9.4.2-2) version of the DEB file for pandoc.

Posted via UltraBlog.vim.


Installing Ruby Again!

| Comments |

It seems that the installation of Ruby through rvm is not as easy as I think. The following two commands have failed.

$ rvm pkg install iconv

failure of installing iconv

$ rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr

failure of compiling ruby 1.9.2

The Octopress official documentation as well as a Chinese page have those commands. Luckily, Krish's approach works on my computer.

I created this post to see if this affects UltraBlog.vim.

Posted via UltraBlog.vim.