德国人的形式主义
March 7, 2008 8:35 pm UTC | In Life, Tech | 6 Comments | hide下面这个材料转载自 Guide to LaTeX(第四版 146 页 7.5.1 节)。如果你直接看第三列,可能会觉得有点别扭,但又不一定说的上来哪里别扭;事实上,别扭的是有些符号之间的水平间距不理想。而第二列则是微调过水平间距的,看起来比第三列好看一些。熟悉 LaTeX 的可以仔细看第一列里相应的水平间距微调命令(这材料很有名,很多 LaTeX 书里都有,如果你看见过不要说我 TOOOOOLD!)。举例来说,第一行根号 2 和后面那个 x 之间需要稍微有点空隙;如果不留空隙(如第三列所示) ,看起来就比较难看。

如果你没觉得第二列比第三列好看,甚至没看出来两列有什么不一样,这很正常,不要觉得自己有问题!即便是每年成千上万屁挨着地用 LaTeX 生产出来的博士论文里,也只有极少数专门美化了这个水平间距问题,而这里面德国人占了大多数。为什么德国人这么注重形式?我也不知道,可能和他们民族严谨的作风有关。事实上,上面那本葵花宝典 Guide to LaTeX 的作者 Helmut Kopka 和 Patrick W. Daly 就是俩德国人。
说起德国人的严谨,我倒也认识一位严谨的德国物理学家。他光是让别人设计个 FPGA,就要专门写一个 RFC。这可不是拿 RFC 做个标题而已,而是严格按照标准 RFC 格式和风格书写,并且写完了那个 XHTML Strict 文档他还专门去 W3C 通过了验证。他把这个 RFC 发给同事们,结果半个月过去还没有人理他。于是他召集开会,说我老早就 request for comments,你们怎么一点 comments 都没有?你想啊,这么一群笨蛋物理学家,有谁会知道他电子邮件标题里的缩写 RFC 就是要 comments 的意思啊。
该德国仁兄给实验组建了一个内部 wiki,服务器装的是 Debian。在那个 wiki 的某个小角落里,他写了一大段使用 Debian 的理由,其中的废话包括:我最爱 Debian;Debian stable 很 stable;我装的,当然我选!等等……是因为有人和他争论哪个 Linux 发行版好的无聊问题么?不,事实上,整个实验组只有他一个人懂 Linux……
是严谨?还是形式主义呢?
Microsoft Visio save as EPS
February 8, 2008 2:04 pm UTC | In Tech | 3 Comments | hideI wrote the following procedure on 2008.02.08:
To convert a Microsoft Visio document to EPS without losing scalable vector format (and without installing 3rd-party software…):
- Install Microsoft Save as PDF or XPS Add-in for 2007 Microsoft Office programs (only available for Office 2007?).
- Save Visio document as PDF in Visio 2007.
- Convert PDF to Postscript (.ps) with pdf2ps utility.
- Open .ps file with gsview, and select File -> PS to EPS, be sure to check “Automatically calculate Bounding Box”.
Now you have an EPS file to be embedded into your LaTeX document. Many other converting methods exist, see also Visio and EPS.
Here are some updates (edited on 2009.01.30):
- In theory, you should be able to open that saved PDF directly in gsview and convert to EPS, but gsview either crashes or refuses to accept the PDF.
- In some cases, e.g. when you compile LaTeX directly to PDF using pdflatex, you just need a PDF figure with correct size. In that case, you can set the document size in Visio: File -> Page Setup -> Page Size (tab) -> Size to fit drawing contents, and then save the Visio document to PDF, which will then be in correct size ready to be embedded into LaTeX.
- To create a Postscript file, you don’t necessarily need to save as PDF and convert to .ps using pdf2ps. All you need to do is to use a postscript printer (most modern printers are, including most PDF writers) and print to file. That would create a postscript file which can then be passed to gsview and converted to EPS by adding a bounding box. Note: this is in fact a generic way of converting anything to (vector-format) EPS/PDF with bounding box.
LaTeX quick start
January 12, 2007 10:00 pm UTC | In Tech | 1 Comment | hideThere are many different ways to compile a LaTeX source file to a PDF. Following is one of the many ways to create a such LaTeX working environment on a completely new Windows box:
- Without saying, you need a PDF viewer, e.g. Adobe Reader.
- Install Ghostscript and GSview
- Install MiKTeX. A basic MiKTeX system is enough for most purpose.
- Install TeXnicCenter. This is an integrated LaTeX editor, by which you will compile your LaTeX source and view result using tools installed above.
- When you start TeXnicCenter:
- A configuration wizard may ask for a LaTeX distribution location, select where file latex.exe is. In my case, it’s “C:\Program Files\MiKTeX 2.6\miktex\bin”.
- Next, wizard may ask PDF viewer location, select your viewer. Mine is “C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe”.
- Wizard will then create output profiles (compile/view commands) for DVI/PS/PDF.
- Compile your first LaTeX:
- Create a new file and save to a new directory.
- Type in a simple document, like:
\documentclass{article} \begin{document} \[ x_{1,2}=\frac{-b\pm\sqrt{b^2-4ac}}{2a}. \] I can do math! \end{document} - In the toolbar, select “LaTeX => PDF” output profile, and click “Build current file” right next to it.
- Click “View Output” in the same toolbar. You should have math in your PDF. Congratulation!
LaTeX: easy to start, hard to master…
This weblog is licensed under a Creative Commons License.
Powered by WordPress. Theme based on Pool by Borja Fernandez.







