2009年5月19日星期二

Emacs + LaTeX, even easier

OK.

sudo apt-get install auctex

This thing can give you a whole new style of syntax highlighting dedicated to make your LaTeX life easier.

Changing fonts
C-c C-f C-i \textit{} - Italics
C-c C-f C-b \textbf{} - Bold face (In math mode, this will invoke the \mathbf{} font)
C-c C-f C-e \emph{} - Emphasized
C-c C-f C-s \textsl{} - Slanted
C-c C-f C-r \textrm{} - Roman
C-c C-f C-f \textsf{} - Serif
C-c C-f C-t \texttt{} - Typewriter
C-c C-f C-c \textsc{} - Small Caps
If you want to change font attributes of existing text, mark it as a region, and then invoke the commands.

Sections, Environments, formatting, etc
C-c C-s \section{} \chapter{} \subsection{} - Sections
C-c C-e \begin{} & \end{} - Environment
C-c ] - Close Environment
C-c C-m - Macros
C-c RET(Enter) - Macros
C-c C-j() - Newline with \item inside itemize and so
C-c { - Insert balanced braces
M-q - Fill and indent current paragraph (format it)
C-c C-q C-e - Format current environment

Commenting
C-c ; - Comment current region
C-c : - Uncomment current region
C-c % - Comment current paragraph

Running and viewing
C-c C-c - Run LaTeX on text
C-c C-c after compling - Default View
C-c ` - Go to the next error
C-c C-t C-p - Toggles between DVI and PDF output

Queried search and replace
To do a queried search and replace (with a prompt for replacing each occurrence of a text string), press M-% . You will then be prompted for your search and replace strings. Emacs will find and display each occurrence of the search string and ask you for further instructions. You can respond with any of the following options:
Spacebar Replace text and find the next occurrence
Del Leave text as is and find the next occurrence
. (period) Replace text, then stop looking for occurrences
! (exclamation point) Replace all occurrences without asking
^ (caret) Return the cursor to previously replaced text

If you type any other character, Emacs will stop looking for occurrences and execute the character as a command. To restart the queried search and replace, type:
C-x M- M-RET

2009年5月4日星期一

写在搬家之前

一个下午算是完结了这个学期的 所有课程,效率可谓相当的高。不过出门的时候脑子里除了一锅沸腾的汤汤水水之外并没有什么轻松的感觉,因为接下来还有两门TA课4次作业1次期末考试的卷 子要批,还要在这期间抽空预约医生,还要搬家搬办公室,一切都在一个星期之内完成。不过想想倒不会觉得可怕,因为都是一些不需要费脑子的事情,坐在那里的 时候心里会很确定在多少时间之内我可以完成多大的百分比。可以剥个橘子,听个音乐,浏览那帮小盆有富有新意的错误然后飙粗口。还没有开始的时候就可以看到 的每一个场景的每一个细节,让我很是安心。

在我和眼前的电脑缠绵够了之后,我会在33摄氏度的暖风中晃到车站,等车回家。 然后放上很暴力或者很激昂的歌,开始洗床罩和被单,开始把东西放进纸箱。中间会穿插洗澡和吃饭,Skype,有时间的话没准儿还会看一场电影。"17 Again",就是这部。然后明早朋友们如期而至,大家一起搬家,下午收拾房间,等等。

马上就要离开住了9个月的公寓,没 有任何的感觉。很像链表的操作,指针里面的地址换一下,整个内存波澜不惊。很像去年来美国的时候,或者是寒假回国的时候,旅途上没有分毫的激动,只是在想 各种各样的清单,下一个小时要做什么,明天要做什么,见到谁谁谁脸上的第一个表情会是怎样,对方的表情会是怎样。风未动,幡亦未动。或者这说明我变成了一 个长大了的男生,或者说我变得懒了。或者说两者兼而有之。高二的时候每天心潮澎湃不已,思考各种有一搭没一搭的问题。记得那时有一天跟语文老师侃大山,颇 为担心长大之后是不是这么多的想法就全都没有了,还是会继续把现在没有想明白的问题接着想下去。现在觉得自己还是没有长大,毕竟还是个学生。但当初的我如 果遇到了现在的我,估计也会很无语。不过我懒得去构想这样的见面,相当没救了。

小时候养了很多小乌龟,到了冬天奶奶就会铲 一簸箕土倒进鱼缸里面,然后它们就会冬眠然后在春天的时候爬出来。至今觉得很神奇。每个小乌龟都会在自己的周围整出一个椭球形状的小空间,然后缩在壳子里 睡去。有时鱼缸壁的曲面会和这个椭球体有小小的交集,然后我就可以透过那个剖面看到这个小空间里面的小乌龟,看到它们眯起的眼睛和折起的前爪。小时候也经 常幻想自己周围有一个大大的泡泡,里面恒温而且不会下雨。自己每天就可以顶着这个大泡泡走来走去,看着外面的世界来来往往。

现 在,泡泡外面的自习室变成了一张只有我一个人坐的大桌子,泡泡外面的人变得五颜六色花花绿绿。泡泡外面的天空变成了一成不变的晴天,泡泡外面的中央空调发 出呼呼的喘息。泡泡外面的公寓即将变成一堆满满的箱子再变回一堆空空的箱子,泡泡外面的电脑上一篇好长好长的日志正在被敲完。我就坐在泡泡里面,眯着眼 睛。