昨天装 Fedora 想起了文字编码问题,为了一劳永逸,决定从现在开始改用 UTF-8 编码。
一切都还顺利,刚发现 LaTeX 编译出来的 dvi 文件中文部分是乱码,原来是导言区的编码写错了,改成 \begin{CJK}{UTF8}{fs} 就 OK 。
现在把 LaTeX 模板都改成了 UTF8 编码。 vim 的配置文件增加了 UTF-8 编码设置,把 vim 消息改成了英文的,右键弹出菜单是乱码,不过基本上不用右键菜单。
google sites 和 blogspot 默认的就是 UTF-8
(2008年8月1日17:52:28)UTF-8 的使用有点小障碍, windows 默认编码都是国标码,cmd 窗口都是 gb 编码的,这样在 utf-8 编码文件中用 sort 工具的排序输出就可能有乱码。还有就是写程序时如果用 utf-8 的话,在标准输出上显示的内容就是乱码。暂时在 vim 中做了设置,编辑 pl 和 cpp 文件时还用 cp936 编码。
2008年7月25日星期五
What is Vim
What Is Vim?
Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.
Vim is often called a "programmer's editor," and so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.
What Vim Is Not?
Vim isn't an editor designed to hold its users' hands. It is a tool, the use of which must be learned.
Vim isn't a word processor. Although it can display text with various forms of highlighting and formatting, it isn't there to provide WYSIWYG editing of typeset documents. (It is great for editing TeX, though.)
Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.
Vim is often called a "programmer's editor," and so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.
What Vim Is Not?
Vim isn't an editor designed to hold its users' hands. It is a tool, the use of which must be learned.
Vim isn't a word processor. Although it can display text with various forms of highlighting and formatting, it isn't there to provide WYSIWYG editing of typeset documents. (It is great for editing TeX, though.)
2008年7月18日星期五
My google site and ...
现在改用 google sites 做主页了,和 box.net 配合用可以挂10M的文件 ^^
http://sites.google.com/site/redspid
今天在帮管敬做远程教育计算机课程的作业,做得一头恼火,全是 ms word、excel 和 windows 操作这些无聊的垃圾题目。中国的计算机教育简直是太畸形了,恐怕100年内能抓住 U.S.A. 的尾巴也只能是痴人说梦了。
http://sites.google.com/site/redspid
今天在帮管敬做远程教育计算机课程的作业,做得一头恼火,全是 ms word、excel 和 windows 操作这些无聊的垃圾题目。中国的计算机教育简直是太畸形了,恐怕100年内能抓住 U.S.A. 的尾巴也只能是痴人说梦了。
make LaTeX template
今天别人问我使用 word 制作文档模板的问题,自己还从没想过用这个功能呐。突然想起利用 latex-suite 也可以很容易地制作 LaTeX 模板,在需要修改的地方插入 <+待修改的内容+> 就 OK 了。 HOHO~ 爽啊
(2008年7月18日1:26:58)看了一下 latex-suite 文档,原来里面已经定义了模板存放目录($VIM/ftplugin/latex-suite/templates/)和读取模板的命令 :TTemplate
(2008年7月22日8:41:53)仔细翻了下 Vim 手册,用 autocmd 解决了 latex-suite 导入模板时自动缩进导致的格式错乱问题。
(2008年7月24日14:31:49)模板导入还是有问题。
(2008年7月18日1:26:58)看了一下 latex-suite 文档,原来里面已经定义了模板存放目录($VIM/ftplugin/latex-suite/templates/)和读取模板的命令 :TTemplate
(2008年7月22日8:41:53)仔细翻了下 Vim 手册,用 autocmd 解决了 latex-suite 导入模板时自动缩进导致的格式错乱问题。
(2008年7月24日14:31:49)模板导入还是有问题。
2008年7月15日星期二
Asmyptote study 2
1 size(5cm,0);
2 import graph;
3
4 draw((-1,-1)--(1,1));
5
6 // 画带箭头的 x 轴;以 0.6 为单位画刻度,不显示刻度值
7 // 标记 "x" 字样
8 xaxis("$x$", Ticks("%",0.6), Arrow);
9
10 // 画带箭头的 x 轴,标记 "y" 字样
11 yaxis("$y$", Arrow);
12
13 // 在 x 轴 0.6 位置标记 "a"
14 labelx("a",0.6, S);
2008年7月7日星期一
Asmyptote study 1
MetaPost 看得有点晕,而且搞定在 GSview 中预览加了 label 的图形还得配置参数。还好,在搜索解决方案的过程中发现了 Asymptote,嘿嘿,模仿 MetaPost 的原理和 C++ 语法,这个我喜欢。用 C++ 的语法绘出和 MetaPost 一样酷的图形,想想都能得意地笑出来。
不过似乎 Asymptote 的中文资料比较少,只有 bbs.ctex.org 上一位网友翻译了一部分文档,而且还没译完,看来还得啃英文的了。
下面是我研究了2个小时的部分成果:
不过似乎 Asymptote 的中文资料比较少,只有 bbs.ctex.org 上一位网友翻译了一部分文档,而且还没译完,看来还得啃英文的了。
下面是我研究了2个小时的部分成果:
1 //导入 math 模块,里面包含下面要用到的 extension 函数
2 import math;
3
4 //将 cm 长度缩到 50%
5 //real cm = 0.5cm;
6
7 //线条宽度 1bp(我理解相当于 MetaPost 里的 pen 为直径 1bp 的圆点)
8 //灰度 50%
9 pen grid = linewidth(1bp) + gray(0.5);
10
11 //画出坐标。将 Arrow 换成 Arrows 则画出双箭头
12 draw((0,0)--(0,7.5cm), grid, Arrow);
13 draw((0,0)--(7.5cm,0), grid, Arrow);
14
15 pair a=(0,0), b=(5cm,5cm), c=(5cm,0), d=(0,5cm);
16 draw(a--b);
17 draw(c--d);
18
19 //计算 a--b 和 c--d 的交点,要用到 math 模块
20 pair e = extension(a,b,c,d);21
22 //用红色标记出点 c
23 dot(e, red);
24
25 //文字标签
26 label("$x$", (7.5cm,0), S);
27 label("$y$", (0,7.5cm), W);
28 label("$Nodal$", e, E);
29 label("$A$", a, S);
30 label("$B$", b, E);
31 label("$C$", c, S);
32 label("$D$", d, W);
2008年7月3日星期四
Knuth said
“[T]he TEX research project that I embarked on was driven by two major goals. The first goal was quality: we wanted to produce documents that were not just nice, but actually the best.”
“I never intended to have a system that would be universal and used by everybody. I always wanted to write a system that would be used for just the finest books.”
“The current version number for TEX is 3.1, and for METAFONT it is 2.7. If corrections are necessary, the next versions of TEX will be 3.14, 3.141, then 3.14159, . . . , converging to the ratio of a circle’s circumference to its diameter; for METAFONT the sequence will be 2.71, 2.718, . . . , converging to the base of natural logarithms. I intend to be fully responsible for all changes to these systems for the rest of my life.”
“I never intended to have a system that would be universal and used by everybody. I always wanted to write a system that would be used for just the finest books.”
“The current version number for TEX is 3.1, and for METAFONT it is 2.7. If corrections are necessary, the next versions of TEX will be 3.14, 3.141, then 3.14159, . . . , converging to the ratio of a circle’s circumference to its diameter; for METAFONT the sequence will be 2.71, 2.718, . . . , converging to the base of natural logarithms. I intend to be fully responsible for all changes to these systems for the rest of my life.”
Donald E. Knuth
Digital Typography (1999)
Digital Typography (1999)
订阅:
博文 (Atom)
