Wednesday, February 18, 2009

Emacs Note

1. Packages for using emacs as an IDE

2. How can I use emacs without gui when I work on a remote machine with a slow connection?
emacs -nw

3. In emacs shell mode, what setting need I modify to make the shell promote PS1 display correctly, e.g. with color like in a terminal?

Add the following code in your .emacs
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

4. After I update to emacs 23, invoking flyspell-mode gives the following error "Enabling flyspell-mode gave an error". 

This is caused by the conflicts between site dictionaries and the dictionaries in emacs 23.It can be fixed as following:
cd /usr/share/emacs23/site-lisp/dictionaries-common
sudo rm *.el *.elc
5. How do I enable double spaces in emacs?

This feature is provided in the package setspace. Add the following commands in the preamble of your tex file.
6. Which font looks pretty in emacs?
My personal favourite is Nimbus Mono L regular. 

7. In org-mode, how can I change the default browser?
Add the following two lines in your .emacs file:
(setq browse-url-browser-function (quote browse-url-generic))
(setq browse-url-generic-program "google-chrome")
Similarly, if you want to use the open sourced version of Chrome Browser instead of the Google rebranded version, replace "google-chrome" with "chromium-browser"; if you want to use firefox, replace "google-chrome" with "firefox". 

8. I copy some text in emacs, how can I paste the text another application?
In your .emacs file. add the follow line
(setq x-select-enable-clipboard t)

Monday, February 16, 2009

Latex Notes


1. How to type mathematical symbols

3. Use the following packages to make your docs more pretty
\usepackage{times, fullpage}

4.  How can I input the addition assign (+=) operator in latex?

5. How can I move all figures and tables to the end of article?
Use the package endfloat

6. How can I edit and generate files in Chinese?
Use the xelatex command, see a simple template at

Good read:
  1. 陈硕: 用 LaTeX 排版技术书籍
  2. 无有的笔记空间: LaTeX 排版学习笔记