2010年3月23日 星期二

boxing equations

作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: boxing equations
時間: Tue Mar 23 12:11:12 2010


   With amsmath package, there is one simple command to box a
   displayed equation: \boxed. Here is an example:

   \begin{equation} % equation, align, ... all work
   \boxed{f = ma}
   \end{equation}

   The above will give a boxed equation like

     __________
    |                       |
    |     f = ma       |       (1)
    |__________|

   However, whenever multiple lines are involved, this does not work.
   The empheq package is helpful here. This package is compatible with
   many commonly used packages such as amsmath and fancybox.

   Simplest usage is like

   \begin{empheq}[box=\fbox]{align}
   f & = ma \\
   p & = mv
   \end{empheq}

   These will give something like
    _______
   |                 |
   |   f = ma   |     (1)
   |   p = mv  |     (2)
   |_______|

   There are other types of boxes that can be called within the help
   of fancybox package. They are doublebox, ovalbox, and shadowbox.
   The last one may cause problem and needs some advanced modification.
   For the other two, one can just, for example,

   \begin{empheq}[box=\doublebox]{align}
   ....
   \end{empheq}

   ovalbox actually sucks. So ignore it.

2010年3月18日 星期四

\itemize in pspicture

作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: \itemize in pspicture
時間: Thu Mar 18 11:44:17 2010


   Within pspicture environment, \itemize has to be wrapped within \parbox
   (or some others). For example,

   ...
   \pspicture(0,0)(8,8){
   ...
   \rput[l](1,2){\parbox{5cm}{\begin{itemize}%
   \item This is a test%
   \end{itemize}}%
   ...
   \endpspicture
   ...

2010年3月3日 星期三

eps file output by pstricks

作者: hantis (呢呢是豬) 看板: Hantis
標題: [隨寫] Note: eps file output by latex
時間: Wed Mar  3 11:02:38 2010


   pstricks and other extending packages provide
   great ps figures, but the output is tricky.

   The summary is:
   =========================
   \documentclass{article}
   \usepackage{pstricks}
   ...
   \pagestyle{empty}

   ...
   \fcolorbox{white}{white}{
   \pspicture(x1,y1)(x2,y2)
   ...
   \endpspicture
   }
   =========================
   (Better one figure one file.)
   compile commands:

   latex fig
   dvips fig ----> this allows a quick preview
   when done, then
   dvips fig -E -o fig.eps

   The file has to be (or not?) an eps file.