Colin's profileSound of SilencePhotosBlogLists Tools Help

Blog


    January 01

    When to do when columns are narrow and there are overfull lines?

    1. Rewrite the text until the overfull lines disappear.
    2. Increase the tolerance. (reduce overfull boxes, but the lines will look awful)
    3. Increase the value of \emergencystretch. (reduce badness of lines and, consequently, no. of overfull boxes. better than 2)
    4. Increase the value of \hbadness and/or \hfuzz. (declare fewer lines as overfull/underfull. rarely used)
    5. Execute \overfullrule=0pt.
    6. Use \raggedright. (best way!!)
    7. Fiddle with \looseness.
    8. Change the space factor codes of the punctuation marks to get more stretch (or more shrink) than normal in the interword glue following them.
    9. If all else fails, try to increase \hsize to widen the paragraph.
    December 29

    \hangindent

    \setbox0=\vbox{\hsize=2in\tolerance=9000\hbadness=10000\parskip=0pt
    \parfillskip=0pt\parindent=0pt\baselineskip=9pt \font\big=cmr10 at 50pt
    \font\small=cmr7 \small \hangindent=24pt \hangafter=-2
    \leavevmode\smash{\lower28pt\llap{\big``\small\quad}}%
    Here is a short passage set in small type to demo hanging indentation on both ends of a paragraph. This is done by splitting a paragraph in two, indenting the first part at the\par
    \hangindent=-24pt \hangafter=3
    top and the second part at the bottom, then adding the big quotes by means of llap and rlap. The rest is just details of moving boxes and getting the spacing just right.\smash{\lower24pt\rlap{\small\quad\big''}}}
    \wd0=0pt\ht0=0pt\dp0=0pt\box0
    \nointerlineskip \hangindent=2.2in\hangafter=-8
    {\hsize=4.2in\noindent The effect shown here is used a lot in books where high-quality typesetting is important. It has been achieved by setting certain paragraph parameters to special values, and by using boxes. the spaces for two big quotes are reserved by means of hanging indentation. Th text in small type is actually made of two paragraphs, one}

    An interesting example of \expandafter

    \expandafter\expandafter\expandafter\a\expandafter\b\c Let's write it as \ex1\ex2\ex3\a\ex4\b\c.

    The steps are
    1. When \ex1 is executed, it saves \ex2 and expands \ex3.
    2. When \ex3 is expanded, ti saves \a and expands \ex4. The list of saved items now consits of \ex2, \a.
    3. When \ex4 is expanded, it saves \b and expands \c. Thus \c is the first of \a, \b, and \c to be expanded.
    4. The list of saved items (\ex2\a\b) is placed in front of the expansion of \c, and TeX continues normal processing. However, the first otken that it sees is \ex2. It therefore saves \a, expands \b, and finally expands \a.
    This example reverses the normal expansion of tokens \a, \b, and \c.

    An application: \expandafter\expandafter\expandafter\lowercase\expandafter{\jobname}.
    December 19

    TeX Roadmap

    Due to its intrinsic inflexibilities, I'm thinking about either abandoning LaTeX entirely or at least designing new class files to suit my taste. I'm planning three months' time to learn about basic Java programming so as to be able to program with greater ease in TeX.
    The short-time goal will be to switch TeX (the plain format) or to design new class files.

    Meanwhile, I'll be trying out ConTeXt. If it proves as flexible as is described, I'll be switching to ConTeXt.

    The whole pace should be faster (actually much faster) then described above.
    December 05

    CCT and CTeX

    Both packages are quite easy to install. Just drag the source files to \texmf\tex\latex and everything's set.
    December 03

    Installing TeX on Mac OS X Tiger

    1. Install TeX using I-installer.
      1) Download ll2.dmg at http://ii2.sourceforge.net.
      2) Drag i-installer to /Applicaton/utilities.
      3) Launch i-installer, choose i-package --> Known Package i-Directory.
      4) Install the following (order!)
          * FreeType 2
          * libwmf
          * Ghostscript 8
          * ImageMagick
          * FrontForge
          * TeX
    2. Install TeXshop
      1) Download TeXshop at http://www.uoregon.edu/~koch/texshop/obtaining.html
      2) Drag it into the Application folder.
      3) In Preferences --> encoding, choose "mac Chinese Simplified."
    3. Set up Chinese
      1) The first solution is to use XeTeX.
          * Launch I-installer again.
          * Choose jonathan Kew's i-Directory @ SIL in i-directories.
          * Install "TeX support: XeTeX."
          * Test file:
            \documentclas{article}
            \usepackage{fontspec}
            \setromanfont{Apple LiSung Light}
            \begin{document}
            你好
            \end{document}
           * Compile it with XeLaTeX.
      2) The better solution is to use the CJK package.
      Download the CJK package from http://cjk.ffii.org/. Uncompress it and put the output at /usr/local/teTeX/share/texmf.local/tex/latex/CJK.
      Then you have to set up the fonts, which is quite troublesome. The easiest way is to copy the localtexmf folder of CTeX to /usr/local/teTeX/share/texmf.local. Then go to texmf.local/pdftex/config, make a copy of psfonts.map and rename it to pdftex.map. In terminal, execute the command "sudo mktexlsr" and it should work.

    Other resources:
    http://www.oikos.com.tw/modules/newbb/viewtopic.php?topic_id=15850&forum=2
    http://tfcis.blogspot.com/2005/05/mac-os-x-tex.html
    http://latex.yauh.de/faq/index.php?aktion=artikel&rubrik=005003&id=30%E2%8C%A9=en
    November 30

    再谈省略号用法

    Neals问了我一个很有趣的问题:1, 2, 3, . . . 这样的无穷序列如果出现在句末省略号到底怎么点法?
    我的本能反应是用:1, 2, 3,~\dots.
    但是想想不对,根据我现在使用的规则,四点的省略号第一点才是句号(除非使用rigirous method,那就是另外一番对话了),所以这样的点法显然是有问题的。但是,1, 2, 3. . . .是不可接受的,有一条明确规定,序列中的逗号不可以随便省略。
     
    我现在的想法是,把1, 2, 3当成是语法不完整的句子,那么三个点就OK了。也就是1, 2, 3,~$\ldots$
     
    不过还有一个问题,如果按照经典的空格规则,句末的空格应该大一点,这样似乎$\ldots$后面的空格应该大一些,所以如果用经典空格的,那么可能输入成$\ldots\,$更合理一点,但是这样做的问题也是显而易见的。
    不过如果用了\frenchspacing,那么也就没有问题了……