Wednesday, February 18, 2009

Emacs Note

1. Packages for using emacs as an IDE

http://xtalk.msk.su/~ott/common/emacs/rc/emacs-rc-cedet.el.html
http://cedet.sourceforge.net/
http://cscope.sourceforge.net/
http://ecb.sourceforge.net/

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.
\usepackage{setspace}
\doublespacing
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

Tips:

1. How to type mathematical symbols
http://www.artofproblemsolving.com/LaTeX/AoPS_L_GuideSym.php

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?
\mathrel{\mathop+}=

5. How can I move all figures and tables to the end of article?
Use the package endfloat  http://www.ctan.org/pkg/endfloat

6. How can I edit and generate files in Chinese?
Use the xelatex command, see a simple template at https://github.com/songqiang/latex-templates/blob/master/latex-template-xelatex.tex



Good read:
  1. 陈硕: 用 LaTeX 排版技术书籍 https://github.com/chenshuo/typeset
  2. 无有的笔记空间: LaTeX 排版学习笔记 http://zoho.is-programmer.com/posts/30662.html