Friday, March 27, 2015

A Fast Way to Generate LaTeX Document using VIM

Finally, I found a fast way to generate a LaTeX document using VIM, which allows me have a basic LaTeX document within few seconds. However, a little background knowledge on MarkDown syntax is required (MarkDown Cheatsheet is here).

Step 0: setup

a. install pandoc

b. add one line of setting into .vimrc (only have to do once)

map \md <ESC>:!pandoc -V geometry:margin=1in % -s -o %<.pdf<CR>:!open %<.pdf<CR>
This is for Mac, if you are using other system, please change "open" to any PDF reader you have on your machine.

Step 1: open a new .md file


Step 2: write some MarkDown and save

## This is title

### Header is here

- list 1

- list 2

Step 3: press following keys in vim: <ESC> \ m d

PDF file will popup automatically


  • More settings can be passed into pandoc by adding parameters.
  • This is fast way to have basic LaTeX documents, but may not be the most customised way.

Friday, March 20, 2015

Setup Semantic UI


There are tons of front-end development frameworks, and Semantic UI is one of them. I found it's support more elements than other with complete design. So, I am trying out this time.


There are the things needed to be install before get started:
  • node
  • gulp
    • npm install -g gulp
Other dependencies for Semantic UI:
  • cd <Semantic-UI directory>
  • npm install

Build Framework

So, we can customize our design or change the theme on Semantic UI (not included in this post), then it will generate some CSS and JS files for our website to use.
To generate the files, type: "gulp install"


Thursday, March 19, 2015

SASS - Helloworld

For people who write CSS may know that it's kind of annoying, SASS and SCSS became the solutions. We've learned some basic SCSS code in Advanced Web Design class today, and it's here.

To compile the SCSS, run "sass --watch ." in the background, and it will update the CSS file constantly.

And, I also asked Prof. Twigg which one should I go with as a beginner, SASS or SCSS. He said SCSS, which is newer.

Monday, March 16, 2015

Eclipse + Vim = eclim


As a vim lover, I am having a bad time writing Java code on Eclipse, where I am not familiar with the shortcuts to switch between files or jump the cursor to places I want. So, I am now trying to write my Java assignments on Vim using eclim plugin, which should fully support the features I used on eclipse.


Original tutorial: here
  • Install required softwares
  • Setup Vim (.vimrc)
    • set nocompatible
    • filetype plugin indent on
  • Install eclim.jar
    • file is here
    • install: java -jar eclim_2.4.1.jar


There are two ways to start eclim daemon (required):
  1. manually run eclimd under eclim directory
  2. open eclipse and "Window ‣ Show View ‣ Other ‣ Eclim ‣ eclimd" (I think this method is better to start with since you can still view/share the workspace with opening eclipse)

Then, I think one can refer to Eclim Cheatsheet for remaining usages.