<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://gezhi.org" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
 <title>latex</title>
 <link>http://gezhi.org/taxonomy/term/118</link>
 <description>The taxonomy view with a depth of 0.</description>
 <language>zh-hans</language>
<item>
 <title>Asymptote简介</title>
 <link>http://gezhi.org/node/823</link>
 <description>&lt;p&gt;&lt;strong&gt;Asymptote学习系列&lt;/strong&gt;&lt;br /&gt;
 Asymptote学习系列(1)&lt;br /&gt;
Asymptote类似于Metapost 但是语法相对来说比较简单&lt;br /&gt;
面向对象 有自己的类C++语法。&lt;br /&gt;
软件主页：http://asymptote.sourceforge.net/&lt;br /&gt;
安装：&lt;br /&gt;
安装很简单，从主页上下载就可以了。如果是windows版的话，在asymptote的安装目录下，建config.asy，输入内容如下：&lt;br /&gt;
import settings;&lt;br /&gt;
psviewer=&quot;D:\CTeX\Ghostgum\gsview\gsview32.exe&quot;;&lt;br /&gt;
pdfviewer=&quot;C:\Program Files\Adobe\Acrobat 7.0\Acrobat\acrobat.exe&quot;;&lt;br /&gt;
gs=&quot;D:\CTeX\gs\gs8.51\bin\gswin32.exe&quot;;&lt;br /&gt;
python=&quot;python.exe&quot;;&lt;/p&gt;
&lt;p&gt;简单测试&lt;br /&gt;
运行程序，在命令状态下输入：&lt;br /&gt;
&gt;draw((0,0)--(100,100));&lt;br /&gt;
你应该就可以从一个启动的ghostview窗口中看到一条对角线了。&lt;/p&gt;
&lt;p&gt;当然，你也可以把上面的命令写入一个文件，如test.asy，然后输入&lt;br /&gt;
asy -V test&lt;br /&gt;
然后你就可以看到目录上生成了test.eps文件，同时启动了一个ghostview窗口显示你的文件(-V参数的作用);&lt;/p&gt;
&lt;p&gt;在asymptote中使用中文 &lt;/p&gt;
&lt;p&gt;//asymptote是一种矢量图形生成工具，提供了一种程序设计语&lt;br /&gt;
//言，语法类似C++,公式输入部分支持latex语法。&lt;br /&gt;
///////////////////////////////////////////////////////////////////////&lt;br /&gt;
texpreamble(&quot;\usepackage{CJK}&quot;);&lt;br /&gt;
texpreamble(&quot;\AtBeginDocument{\begin{CJK}{UTF8}{song}}&quot;);&lt;br /&gt;
texpreamble(&quot;\AtEndDocument{\clearpage\end{CJK}}&quot;);&lt;br /&gt;
///////////////////////////////////////////////////////////////////////&lt;/p&gt;
&lt;p&gt;几个入门的例子&lt;/p&gt;
&lt;p&gt;draw((0,0)--(100,100));&lt;/p&gt;
&lt;p&gt;draw((0,0)--(100,0)--(100,100)--(0,100)--cycle);&lt;/p&gt;
&lt;p&gt;size(101,101);&lt;br /&gt;
draw((0,0)--(1,0)--(1,1)--(0,1)--cycle);&lt;/p&gt;
&lt;p&gt;size(0,3cm);&lt;br /&gt;
draw(unitsquare);&lt;br /&gt;
label(\&quot;&lt;img class=&quot;teximage&quot; src=&quot;/files/tex/6516190db8c94290389a46c0336d20e4d50531ac.png&quot; alt=&quot;$ A $&quot; /&gt;&quot;,(0,0),SW);&lt;br /&gt;
label(\&quot;&lt;img class=&quot;teximage&quot; src=&quot;/files/tex/85cd016419f25c9c4428e912147fed1c9651258b.png&quot; alt=&quot;$ B $&quot; /&gt;&quot;,(1,0),SE);&lt;br /&gt;
label(\&quot;&lt;img class=&quot;teximage&quot; src=&quot;/files/tex/94ceb4269c70fdc03b7c405ee8a758a23e33a108.png&quot; alt=&quot;$ C $&quot; /&gt;&quot;,(1,1),NE);&lt;br /&gt;
label(\&quot;&lt;img class=&quot;teximage&quot; src=&quot;/files/tex/6f72f24575d67cbc3a783088a79fde9caf51e63e.png&quot; alt=&quot;$ D $&quot; /&gt;&quot;,(0,1),NW);&lt;br /&gt;
//S,W,E,N是标准的指南针方向&lt;/p&gt;
&lt;p&gt;size(100,0);&lt;br /&gt;
draw((1,0){up}..{left}(0,1));&lt;/p&gt;
&lt;p&gt;path unitcircle=E..N..W..S..cycle;&lt;/p&gt;
&lt;p&gt;//The user can specify explicit control points between two nodes like this:&lt;br /&gt;
draw((0,0)..controls (0,100) and (100,100)..(100,0));&lt;/p&gt;
&lt;p&gt;draw((100,0){curl 0}..(100,100)..{curl 0}(0,100));&lt;/p&gt;
&lt;p&gt;draw((100,0)..tension 2 ..(100,100)..(0,100));&lt;br /&gt;
draw((100,0)..tension 2 and 1 ..(100,100)..(0,100));&lt;br /&gt;
draw((100,0)..tension atleast 1 ..(100,100)..(0,100));&lt;/p&gt;
&lt;p&gt;draw((0,0){up}..(100,25){right}..(200,0){down});&lt;/p&gt;
&lt;p&gt;draw((0,0){up}::(100,25){right}::(200,0){down});&lt;/p&gt;
&lt;p&gt;size(0,100);&lt;br /&gt;
path unitcircle=E..N..W..S..cycle;&lt;br /&gt;
path g=scale(2)*unitcircle;&lt;br /&gt;
filldraw(unitcircle^^g,evenodd+yellow,black);&lt;/p&gt;
&lt;p&gt;看看每一个的效果吧&lt;/p&gt;
&lt;p&gt;Asymptote学习系列(3)&lt;br /&gt;
size和unitsize&lt;br /&gt;
参考： http://www.artofproblemsolving.com/Wiki/index.php/Asymptote:_Basics &lt;/p&gt;
&lt;p&gt;asymptote是基于坐标的图形语言。每个点都表示为(a,b)，其中a是x坐标，b是y坐标。&lt;/p&gt;
&lt;p&gt;当然，在一个平面上，你可以任意选一个点作为原点，在两个坐标方向上选任意长度作为单位长度。asymptote会在整个作图完成后，自动地把图形调整到输出页面的中心，因此，原点是可以忽略的。在asymptote中，单位长度有个缺省的值1/72英寸（PostScript中一个大点的长度）。如果你不改变图形的缩放比例的话，在asymptote中，(0,0)点和(72,0)点之间就是正好1英寸的距离。如果你要画3cm和图的话，用这个单位就不是很方便。 &lt;/p&gt;
&lt;p&gt;函数unitsize可以用来指定你的图形的单位长度。如：&lt;br /&gt;
unitsize(72);   // 当前图形的x,y的单位都是72*(1/72)英寸&lt;br /&gt;
unitsize(72,36); // 当前图形的x的单位都是72*(1/72)英寸， y方向是0.5英寸&lt;br /&gt;
unitsize(pic,72,36); //图形pic中的x的单位都是72*(1/72)英寸，y方向是0.5英寸&lt;br /&gt;
unitsize(3cm); //当前图形的x,y的单位都是3cm&lt;br /&gt;
asymptote中有些内定的常量：pt(1/72.72英寸)，inch(英寸)，cm，mm。运行过 unitsize(72)后，(0,0)到(72,0)间距离就变成了72英寸长度了。&lt;/p&gt;
&lt;p&gt;函数size是用来指定你的图形最终的大小是多少。如：&lt;br /&gt;
size(5cm,0);&lt;br /&gt;
size(5cm,3cm);&lt;br /&gt;
size(5cm);&lt;br /&gt;
size命令把图形的最终大小给出来了，会忽略unitsize指定的单位大小。即&lt;br /&gt;
size(5cm);&lt;br /&gt;
unitsize(3cm);&lt;br /&gt;
draw(unitsquare);&lt;br /&gt;
和&lt;br /&gt;
size(5cm)&lt;br /&gt;
unitsize(5cm);&lt;br /&gt;
draw(unitsquare);&lt;br /&gt;
两组命令会得到同样大小的一个图形。&lt;br /&gt;
Asymptote学习系列(4)&lt;br /&gt;
基本的数据类型:&lt;/p&gt;
&lt;p&gt;asymptote中的基本数据包括&lt;/p&gt;
&lt;p&gt;bool        只有 true 和 false 两种状态   true,false,1&gt;2(false)&lt;br /&gt;
string    字符串，由两个双引号包含    &quot;HI&quot;,&quot;This is a string&quot;&lt;br /&gt;
int          整数&lt;br /&gt;
real        浮点数&lt;br /&gt;
pair       由两个整数或浮点数组成的数对，表示坐标      (2,3),(2.3,9.0)&lt;br /&gt;
triple   由三个整数或浮点数组成的数对，表示坐标      (1,2,3),(4.5,2.3,9.0)&lt;br /&gt;
path      一条线，3次样条                                                         (0,0)--(2,3)    ,    (0,1)..(1,1)..(1,0)--cycle&lt;br /&gt;
guide     与path一样，只是在连接两个guide的时候，采用光滑连接&lt;br /&gt;
picture  由用户坐标表达的画布      currentpicture&lt;br /&gt;
frame     由PostScript坐标表达的画面   currentpicture&lt;br /&gt;
pen         画笔，由颜色、线型、粗细组成    currentpen , red+dashed , linetype(&quot;6 4&quot;)&lt;br /&gt;
void        只用于在函数声明中表示一个函数没有返回或参数&lt;br /&gt;
transform     变化，通过&#039;*&#039;号作用在任何可以画的目标上。&lt;br /&gt;
rotate(30),shift((2,3)),xscale(9)&lt;br /&gt;
Asymptote学习系列(5)&lt;br /&gt;
数据类型（续）：&lt;/p&gt;
&lt;p&gt;pair&lt;br /&gt;
pair是由两个实数组成的数对(x,y)。如果你定义了&#039;pair z&#039;， 则你可以用z.x，z.y来引用相应的分量，但不允许直接修改。如：&lt;br /&gt;
pair x=(2.0,3.0);&lt;br /&gt;
pair y=(x.x,-x.y);&lt;br /&gt;
pair z=x+3.0*y;&lt;br /&gt;
z.x=0.0;  //这是不允许的&lt;br /&gt;
预定义的常量：&lt;br /&gt;
I=(0,1);&lt;br /&gt;
你可以用： z=z.x-I*z.y;&lt;br /&gt;
内置的相关函数：&lt;br /&gt;
pair conj(pair z)&lt;br /&gt;
                  返回 z 的梯度;&lt;br /&gt;
real length(pair z)&lt;br /&gt;
                  返回 z 的模长 |z| 。 如，&lt;br /&gt;
                  pair z=(3,4);&lt;br /&gt;
                  length(z);&lt;br /&gt;
                  结果为5。同样，可以用 abs(pair)；&lt;br /&gt;
real angle(pair z)&lt;br /&gt;
                  返回z的角度（弧度），取值在 [-pi,pi]；&lt;br /&gt;
real degrees(pair z, bool warn=true)&lt;br /&gt;
                  返回 z 的角度（度），取值在 [0,360) ；若 warn 为 false  且 z.x=z.y=0 时返回0而不是错误；&lt;br /&gt;
pair unit(pair z)&lt;br /&gt;
                  单位化 z ；&lt;br /&gt;
pair expi(real angle)&lt;br /&gt;
                   返回一个角度为angle（弧度）的单位向量；&lt;br /&gt;
pair dir(real angle)&lt;br /&gt;
                   返回一个角度为angle（度）的单位向量；&lt;br /&gt;
real xpart(pair z)&lt;br /&gt;
                   返回 z.x ；&lt;br /&gt;
real ypart(pair z)&lt;br /&gt;
                   返回 z.y;&lt;br /&gt;
pair realmult(pair z, pair w)&lt;br /&gt;
                   返回 (z.x*w.x,z.y*w.y);&lt;br /&gt;
real dot(pair z, pair w)&lt;br /&gt;
                    返回点积 z.x*w.x+z.y*w.y;&lt;br /&gt;
pair minbound(pair z, pair w)&lt;br /&gt;
                    返回 (min(z.x,w.x),min(z.y,w.y));&lt;br /&gt;
pair maxbound(pair z, pair w)&lt;br /&gt;
                    返回 (max(z.x,w.x),max(z.y,w.y)).&lt;/p&gt;
&lt;p&gt;Asymptote学习系列(6)&lt;br /&gt;
数据类型（续）：&lt;/p&gt;
&lt;p&gt;triple&lt;br /&gt;
triple是由三个实数组成的数对(x,y,z)。如果你定义了&#039;triple z&#039;， 则你可以用z.x，z.y，z.z来引用相应的分量，但不允许直接修改。&lt;/p&gt;
&lt;p&gt;一些内置函数：&lt;/p&gt;
&lt;p&gt;real length(triple v)&lt;br /&gt;
            返回 v 的长度 |v| 。出可以用 abs(triple) ；&lt;br /&gt;
real polar(triple v)&lt;br /&gt;
            返回 v 与 z 轴的弧度；&lt;br /&gt;
real azimuth(triple v)&lt;br /&gt;
            返回 v 与 x 轴的弧度；&lt;br /&gt;
real colatitude(triple v)&lt;br /&gt;
            返回 v 与 z 轴的夹角（度）；&lt;br /&gt;
real latitude(triple v)&lt;br /&gt;
            返回 v 与 xy 平面的夹角（度）；&lt;br /&gt;
real longitude(triple v, bool warn=true)&lt;br /&gt;
            返回 v 与 x 轴的角度（度）；当warn=false且v.x=v.y=0 时会返回0，而不是产生错误；&lt;br /&gt;
triple unit(triple v)&lt;br /&gt;
            单位化向量 v ；&lt;br /&gt;
triple expi(real colatitude, real longitude)&lt;br /&gt;
            返回方向为 (colatitude,longitude) （弧度）的单位向量；&lt;br /&gt;
measured in radians;&lt;br /&gt;
triple dir(real colatitude, real longitude)&lt;br /&gt;
            返回方向为 (colatitude,longitude) （度）的单位向量；&lt;br /&gt;
real xpart(triple v)&lt;br /&gt;
            返回 v.x;&lt;br /&gt;
real ypart(triple v)&lt;br /&gt;
            返回 v.y;&lt;br /&gt;
real zpart(triple v)&lt;br /&gt;
            返回 v.z;&lt;br /&gt;
real dot(triple u, triple v)&lt;br /&gt;
            返回内积 u.x*v.x+u.y*v.y+u.z*v.z;&lt;br /&gt;
triple cross(triple u, triple v)&lt;br /&gt;
            返回外积 (u.y*v.z-u.z*v.y,u.z*v.x-u.x*v.z,u.x*v.y-v.x*u.y);&lt;br /&gt;
triple minbound(triple u, triple v)&lt;br /&gt;
            返回 (min(u.x,v.x),min(u.y,v.y),min(u.z,v.z));&lt;br /&gt;
triple maxbound(triple u, triple v)&lt;br /&gt;
            返回 (max(u.x,v.x),max( u.y,v.y),max(u.z,v.z)).&lt;/p&gt;
&lt;p&gt;Asymptote学习系列(7)&lt;br /&gt;
数据类型（续）：&lt;/p&gt;
&lt;p&gt;string&lt;br /&gt;
string字符串类，由STL string 类实现。与C/C++中的字符串是一致。&lt;br /&gt;
内置函数包括：&lt;br /&gt;
int length(string s)&lt;br /&gt;
int find(string s, string t, int pos=0)&lt;br /&gt;
int rfind(string s, string t, int pos=-1)&lt;br /&gt;
string insert(string s, int pos, string t)&lt;br /&gt;
string erase(string s, int pos, int n)&lt;br /&gt;
string substr(string s, int pos, int n=-1)&lt;br /&gt;
string reverse(string s)&lt;br /&gt;
string replace(string s, string before, string after)&lt;br /&gt;
string replace(string s, string[][] table)&lt;br /&gt;
string format(string s, int n)&lt;br /&gt;
string format(string s, real x)&lt;br /&gt;
string time(string format=&quot;%a %b %d %T %Z %Y&quot;)&lt;br /&gt;
            time();&lt;br /&gt;
            time(&quot;%a %b %d %H:%M:%S %Z %Y&quot;);&lt;br /&gt;
int seconds(string t=&quot;&quot;, string format=&quot;&quot;)&lt;br /&gt;
            seconds(&quot;Mar 02 11:12:36 AM PST 2007&quot;,&quot;%b %d %r PST %Y&quot;);&lt;br /&gt;
            seconds(time(&quot;%b %d %r %z %Y&quot;),&quot;%b %d %r %z %Y&quot;);&lt;br /&gt;
            seconds(time(&quot;%b %d %r %Z %Y&quot;),&quot;%b %d %r &quot;+time(&quot;%Z&quot;)+&quot; %Y&quot;);&lt;br /&gt;
            1+(seconds()-seconds(&quot;Jan 1&quot;,&quot;%b %d&quot;))/(24*60*60);&lt;br /&gt;
string time(int seconds, string format=&quot;%a %b %d %T %Z %Y&quot;)&lt;br /&gt;
string string(real x, int digits=realDigits)&lt;br /&gt;
abort(string s);&lt;/p&gt;
&lt;p&gt;Asymptote学习系列(8)&lt;br /&gt;
数据类型（续）：&lt;/p&gt;
&lt;p&gt;guide 和 path&lt;br /&gt;
guide 和 path 都表示分段的三次曲线，参数t从0变化到n（也就是节点数）。不同的是，guide 是在最后画这前才计算出这条曲线，而path则是在定义的时候就计算好的。这样，guide在做两条曲线连接的时候，就可以得到光滑连接的曲线。&lt;br /&gt;
如下所示的例子：&lt;br /&gt;
size(200);&lt;br /&gt;
real mexican(real x) {return (1-8x^2)*exp(-(4x^2));}&lt;/p&gt;
&lt;p&gt;int n=30;&lt;br /&gt;
real a=1.5;&lt;br /&gt;
real width=2a/n;&lt;br /&gt;
guide hat;&lt;br /&gt;
path solved;&lt;br /&gt;
for(int i=0; i &lt; n; ++i) {&lt;br /&gt;
    real t=-a+i*width;&lt;br /&gt;
    pair z=(t,mexican(t));&lt;br /&gt;
    hat=hat..z;&lt;br /&gt;
    solved=solved..z;&lt;br /&gt;
}&lt;br /&gt;
draw(hat);&lt;br /&gt;
dot(hat,red);&lt;br /&gt;
draw(solved,dashed);&lt;/p&gt;
&lt;p&gt;一个点也可以看作是一个长度为0的path，如：&lt;br /&gt;
path p=(0,2); &lt;/p&gt;
&lt;p&gt;构造一个path的最简单方法就是连接两个path或点，常用的算子有：&lt;br /&gt;
p--q   表示用直线连接p的最后一个点和q的第一个点&lt;br /&gt;
p..q    表示用一条Bezier三次样条曲线来连接p和q，这样连接是光滑的&lt;br /&gt;
p^^q    它并不真正连接p和q，而是把它们从新参数化，从而使它们成为一条曲线，也就是说画笔从p的最后一个点移到q的第一个点然后再画&lt;/p&gt;
&lt;p&gt;在构造path的时候，还可以显式指定控制点，曲率，方向，张力等，如：&lt;br /&gt;
draw((0,0)..controls (0,100) and (100,100)..(100,0));&lt;br /&gt;
draw((100,0)..tension 2 ..(100,100)..(0,100));           // 张力&lt;br /&gt;
draw((100,0)..tension 2 and 1 ..(100,100)..(0,100));&lt;br /&gt;
draw((100,0)..tension atleast 1 ..(100,100)..(0,100));&lt;br /&gt;
draw((100,0){curl 0}..(100,100)..{curl 0}(0,100));   // 指定曲率，0表示直线，1表示圆弧&lt;br /&gt;
draw((0,0){up}::(100,25){right}::(200,0){down});   // ::是..tension at least 1..&lt;br /&gt;
draw((0,0){up}---(100,25){right}---(200,0){down}; //---表示..tension atleast infinite..&lt;/p&gt;
&lt;p&gt;常量：&lt;br /&gt;
path unitcircle ;&lt;/p&gt;
&lt;p&gt;常用的函数：&lt;br /&gt;
path circle(pair c, real r);&lt;br /&gt;
path Circle(pair c, real r, int n=400);  //比circle更精确的圆&lt;br /&gt;
path arc(pair c, real r, real angle1, real angle2);&lt;br /&gt;
path arc(pair c, explicit pair z1, explicit pair z2,bool direction=CCW) //CCW表示逆时针，CW表示顺时针&lt;br /&gt;
path Arc(pair c, real r, real angle1, real angle2,int n=400); //比arc更精确的圆弧&lt;br /&gt;
path ellipse(pair c, real a, real b); //椭圆&lt;/p&gt;
&lt;p&gt;int length(path p);&lt;br /&gt;
         p由几个段组成，若p是个封闭的图形，则与p中的节点个数是一样的。&lt;br /&gt;
int size(path p);&lt;br /&gt;
         p的节点个数，若p是个封闭的图形，则与length(p)是相等的。&lt;br /&gt;
pair point(path p, int t);&lt;br /&gt;
         若p是个封闭的图形，则返回节点 t mod length(p) 的坐标。否则，返回节点 t 的坐标，t&lt;0时，返回节点0的坐标，t&gt;length(p)时，则返回length(p)处的坐标。&lt;br /&gt;
pair point(path p, real t);&lt;br /&gt;
         与前面类似，不同的是返回的是节点 floor(t) 和节点 floor(t)+1 之间的三次样条曲线在参数&lt;br /&gt;
t-floor(t)  处的坐标。若 t 在 [0,length(p)] 之外，且p是个封闭的图形，则先取模 length(p)  ，否则，就取相应端点处的坐标。&lt;br /&gt;
pair dir(path p, int t, int sign=0);&lt;br /&gt;
         若 sign &lt; 0 ，返回 p 中节点 t 处的入流切线方向，若 sign &gt; 0 ，则为出流切线方向，若 sign=0 ，则两个方向的平均。若 p 只含一个点，返回 (0,0) 。&lt;br /&gt;
pair dir(path p, real t);&lt;br /&gt;
         返回 p 在节点 floor(t)  和 floor(t)+1 之间的样条曲线在参数 t-floor(t) 处的切线方向。若 p 只有一个点，则返回 (0,0)  。&lt;br /&gt;
pair precontrol(path p, int t);&lt;br /&gt;
         返回 p 在节点 t 处的precontrol控制点。&lt;br /&gt;
pair precontrol(path p, real t);&lt;br /&gt;
         返回 p 在 参数 t 处的有效precontrol控制点&lt;br /&gt;
pair postcontrol(path p, int t);&lt;br /&gt;
         returns the postcontrol point of p at node t.&lt;br /&gt;
pair postcontrol(path p, real t);&lt;br /&gt;
         returns the effective postcontrol point of p at parameter t.&lt;br /&gt;
real arclength(path p);&lt;br /&gt;
         返回 p 的长度&lt;br /&gt;
real arctime(path p, real L);&lt;br /&gt;
         返回从第一个节点开始达到 arclength 为 L 的参数值。&lt;br /&gt;
real dirtime(path p, pair z);&lt;br /&gt;
         返回切线方向为 z 的参数值。若不存在的话，则返回－1。&lt;br /&gt;
real reltime(path p, real l);&lt;br /&gt;
         returns the time on path p at the relative fraction l of its arclength.&lt;br /&gt;
pair relpoint(path p, real l);&lt;br /&gt;
         returns the point on path p at the relative fraction l of its arclength.&lt;br /&gt;
pair midpoint(path p);&lt;br /&gt;
         returns the point on path p at half of its arclength.&lt;br /&gt;
path reverse(path p);&lt;br /&gt;
         返回一条沿 p 反向运动的path。&lt;br /&gt;
path subpath(path p, int a, int b);&lt;br /&gt;
         返回沿 p 的第 a 个节点到第 b 个节点的子路径。若 a &lt; b ，则为反向运动。&lt;br /&gt;
path subpath(path p, real a, real b);&lt;br /&gt;
         与前面类似。&lt;br /&gt;
real[] intersect(path p, path q, real fuzz=0);&lt;br /&gt;
        若 p 和 q 有至少一个交点，则返回一个长度为2的real型数组，其中是相应的路径参数(time)。若没有相交，则返回长度为0的数组。&lt;br /&gt;
pair intersectionpoint(path p, path q, real fuzz=0);&lt;br /&gt;
         返回 p 和 q 的交点坐标： point(p,intersect(p,q,fuzz)[0]) 。&lt;br /&gt;
pair[] intersectionpoints(path p, path q);&lt;br /&gt;
         返回 p 和 q 的所有交点。&lt;br /&gt;
slice firstcut(path p, path q);&lt;br /&gt;
         返回  p 中 在 p 和 q 第一个交点的&quot;前&quot;和&quot;后&quot;两部分。若没有交点，则整个 path 看作是&quot;前&quot;部&lt;br /&gt;
         struct slice {&lt;br /&gt;
                  path before,after;&lt;br /&gt;
         }&lt;br /&gt;
slice lastcut(path p, path q);&lt;br /&gt;
          返回  p 中 在 p 和 q 最后一个交点的&quot;前&quot;和&quot;后&quot;两部分。若没有交点，则整个 path 看作是&quot;后&quot;部&lt;br /&gt;
path buildcycle(... path[] p);&lt;br /&gt;
         This returns the path surrounding a region bounded by a list of consecutively intersecting paths, following the behaviour of the MetaPost buildcycle command.&lt;br /&gt;
pair min(path p);&lt;br /&gt;
         returns the pair (left,bottom) for the path bounding box of path p.&lt;br /&gt;
pair max(path p);&lt;br /&gt;
         returns the pair (right,top) for the path bounding box of path p.&lt;br /&gt;
bool cyclic(path p);&lt;br /&gt;
         若 p 是封闭的，则返回 true。&lt;br /&gt;
bool straight(path p, int i);&lt;br /&gt;
         若 p 中节点 i 和 i+1 之间是直线的话，则返回 true。&lt;br /&gt;
int windingnumber(path p, pair z);&lt;br /&gt;
         returns the winding number of the cyclic path g relative to the point z. The winding number is positive if the path encircles z in the counterclockwise direction.&lt;br /&gt;
bool inside(path g, pair z, pen p=currentpen);&lt;br /&gt;
         若 z 点在由封闭的 g 所包含的区域内的话，返回 true。&lt;br /&gt;
Asymptote学习系列(9)&lt;br /&gt;
数据类型（续）：&lt;/p&gt;
&lt;p&gt;pen&lt;br /&gt;
pen是个作图环境，它包括颜色、线型、粗细等，还有line join, fill rule, text alignment, font, font size,pattern, overwrite mode, 及 calligraphic transforms on the pen nib。pen之间可以用&quot;+&quot;号来融合，这会混合两种pen的颜色，对于其它的特性，则会用后面的替代前面的。如一支黄色的画点线的pen，可以用下面的任何一种方法得到：&lt;br /&gt;
dotted+red+green&lt;br /&gt;
red+green+dotted&lt;br /&gt;
red+dotted+green&lt;br /&gt;
符号&quot;*&quot;作用到pen上表示对pen的颜色*相应的数，如：&lt;br /&gt;
red*0.5&lt;/p&gt;
&lt;p&gt;颜色&lt;br /&gt;
定义pen的颜色的函数包括：&lt;br /&gt;
pen gray(real g);&lt;br /&gt;
      灰度笔，其中 g 在 [0,1] 上，0.0 表示黑色，1.0 表示白色。&lt;br /&gt;
pen rgb(real r, real g, real b);&lt;br /&gt;
      用 RGB 颜色构造 pen ，每个变量都在 [0,1] 间。&lt;br /&gt;
pen cmyk(real c, real m, real y, real k);&lt;br /&gt;
      由 CMYK（cyan, magenta, yellow, black） 构造 pen ，同样每个变量在 [0,1] 间。&lt;br /&gt;
pen colorless(pen);&lt;br /&gt;
      得到一个没有颜色的pen（可以用来避免颜色混合）。&lt;br /&gt;
real[] colors(pen)&lt;br /&gt;
      得到pen的颜色的各个分量&lt;/p&gt;
&lt;p&gt;一些常量：&lt;br /&gt;
pen invisible;&lt;br /&gt;
      不可见的pen，它会调节整个的边界。&lt;br /&gt;
还有如下预定义好的颜色可以用：&lt;br /&gt;
palered,lightred,mediumred,red,heavyred,brown,darkbrown,&lt;br /&gt;
palegreen,lightgreen,mediumgreen,green,heavygreen,deepgreen,darkgreen&lt;br /&gt;
paleblue,lightblue,mediumblue,blue,heavyblue,deepblue,darkblue&lt;br /&gt;
palecyan,lightcyan,mediumcyan,cyan,heavycyan,deepcyan,darkcyan&lt;br /&gt;
pink,lightmagenta,mediummagenta,magenta,heavymagenta,deepmagenta,darkmagenta&lt;br /&gt;
paleyellow,lightyellow,mediumyellow,yellow,lightolive,olive,darkolive&lt;br /&gt;
palegray,lightgray,mediumgray,gray,heavygray,deepgray,darkgray&lt;br /&gt;
black&lt;br /&gt;
white&lt;br /&gt;
orange&lt;br /&gt;
fuchsia&lt;br /&gt;
chartreuse&lt;br /&gt;
springgreen&lt;br /&gt;
purple&lt;br /&gt;
royalblue&lt;br /&gt;
Cyan&lt;br /&gt;
Magenta&lt;br /&gt;
Yellow&lt;br /&gt;
Black&lt;br /&gt;
cmyk+red&lt;br /&gt;
cmyk+blue&lt;br /&gt;
cmyk+green&lt;/p&gt;
&lt;p&gt;线型&lt;br /&gt;
线型由函数定义：&lt;br /&gt;
pen linetype(string s, real offset=0,bool scale=true, bool adjust=true)&lt;br /&gt;
其中 s 是由空格分开的整数或实数，如下是些预定义的量：&lt;br /&gt;
pen solid=linetype(&quot;&quot;);&lt;br /&gt;
pen dotted=linetype(&quot;0 4&quot;);&lt;br /&gt;
pen dashed=linetype(&quot;8 8&quot;);&lt;br /&gt;
pen longdashed=linetype(&quot;24 8&quot;);&lt;br /&gt;
pen dashdotted=linetype(&quot;8 8 0 8&quot;);&lt;br /&gt;
pen longdashdotted=linetype(&quot;24 8 0 8&quot;);&lt;br /&gt;
pen Dotted=dotted+1.0;&lt;br /&gt;
pen Dotted(pen p=currentpen) {return dotted+2*linewidth(p);}&lt;br /&gt;
s 中的数中，第1个表示用pen画多长，第2个表示不用这个pen画多长，依次下去。&lt;/p&gt;
&lt;p&gt;粗细&lt;br /&gt;
精细由函数定义：&lt;br /&gt;
pen linewidth(real).&lt;br /&gt;
一支pen与实数的加法&quot;+&quot;定义为：&lt;br /&gt;
static pen operator +(pen p, real w) {return p+linewidth(w);}&lt;br /&gt;
static pen operator +(real w, pen p) {return linewidth(w)+p;}&lt;br /&gt;
如：&lt;br /&gt;
pen p=red+1.0;&lt;/p&gt;
&lt;p&gt;还有一些其它的特性，请参考帮助文件。&lt;/p&gt;
&lt;p&gt;Asymptote学习系列(10)&lt;br /&gt;
数据类型（续）：&lt;br /&gt;
transform&lt;br /&gt;
transform t=(t.x,t.y,t.xx,t.xy,t.yx,t.yy) 把一个点 pair (x,y) 变为点 (x&#039;,y&#039;) ，其中&lt;br /&gt;
x&#039; = t.x + t.xx * x + t.xy * y&lt;br /&gt;
y&#039; = t.y + t.yx * x + t.yy * y&lt;br /&gt;
它和 PostScript 中的 transformation [t.xx t.yx t.xy t.yy t.x t.y] 是一样的。&lt;br /&gt;
另外，它可以通过[ * ]号从左边作用在pair、path、guide、pen、transform、frame 和 picture 上。transform 之间可以互相组合，还有个求逆的操作：&lt;br /&gt;
transform inverse(transform t);&lt;br /&gt;
还支持整数的指数操作 [ ^ ] ，如：&lt;br /&gt;
transform t=shift((0,1));&lt;br /&gt;
transform t2=t^2;   //表示t操作两次，&lt;br /&gt;
常用的函数包括：&lt;br /&gt;
transform identity();&lt;br /&gt;
      单位变换&lt;br /&gt;
transform shift(pair z);&lt;br /&gt;
      移动距离坐标 z;&lt;br /&gt;
transform shift(real x, real y);&lt;br /&gt;
      移动距离坐标 (x,y);&lt;br /&gt;
transform xscale(real x);&lt;br /&gt;
      x方向放大x倍&lt;br /&gt;
transform yscale(real y);&lt;br /&gt;
      y方向放大y倍&lt;br /&gt;
transform scale(real s);&lt;br /&gt;
      在x和y方向同时放大s倍&lt;br /&gt;
transform slant(real s);&lt;br /&gt;
      把点 (x,y) 变为 (x+s*y,y);&lt;br /&gt;
transform rotate(real angle, pair z=(0,0));&lt;br /&gt;
      以z为中心旋转 angle 度角&lt;br /&gt;
transform reflect(pair a, pair b);&lt;br /&gt;
      以线 line a--b 为轴，求镜像&lt;/p&gt;
&lt;p&gt;shift(transform t) 返回 transforms (t.x,t.y,0,0,0,0)&lt;br /&gt;
shiftless(transform t) 返回 transforms (0,0,t.xx,t.xy,t.yx,t.yy) &lt;/p&gt;
&lt;p&gt;Asymptote学习系列(11)&lt;br /&gt;
数据类型（续）：&lt;/p&gt;
&lt;p&gt;frame和picture&lt;/p&gt;
&lt;p&gt;frame 是用PostScript坐标系的画布。通常不会直接用到它，而会使用相同功能的picture。一些常用函数包括：&lt;br /&gt;
bool empty(frame f)&lt;br /&gt;
      f是否为空&lt;br /&gt;
pair min(frame f)&lt;br /&gt;
      返回f的(left,bottom)&lt;br /&gt;
pair max(frame f)&lt;br /&gt;
      返回f的(right,top)&lt;br /&gt;
void add(frame dest, frame src);&lt;br /&gt;
void prepend(frame dest, frame src);&lt;br /&gt;
frame align(frame f, pair align);&lt;/p&gt;
&lt;p&gt;picture 是在模块&#039;plain&#039;中定义的高层结构，用来提供以用户坐标下的画布。有个缺省的picture是currentpicture ，所有命令的缺省picture参数都是这个currentpicture。前面介绍的 size和unitsize函数的原型是：&lt;br /&gt;
void size(picture pic=currentpicture, real x, real y=x,bool keepAspect=Aspect);&lt;br /&gt;
void unitsize(picture pic=currentpicture, real x, real y=x);&lt;br /&gt;
其中，若x与y均为0，则会把它当作PostScript坐标系，此时，把pic变换到最后的输出frame时用的是单位变换。若x或y中有一个为0，则不会在这个方向上作限制，它会用与另一个方向相同的大小作变换。若 keepAspect 为 Aspect 或 true 的话，则在x和y方向作协同变换，这样，最后的picture在x方向不会超过x，以及在y方向上不会超过y；若 keepAspect 为 IgnoreAspect 或 false 的话，则picture会在x和y方向上同时放缩，从而最后的picture宽为x，高为y。&lt;br /&gt;
还有一些常用的函数包括：&lt;/p&gt;
&lt;p&gt;void size(picture pic=currentpicture, real xsize, real ysize,pair min, pair max);&lt;br /&gt;
        这个函数的作用是重新计算pic中的放缩，使得它满足把box(min,max)中的区域变为xsize宽，ysize长。&lt;br /&gt;
transform fixedscaling(picture pic=currentpicture, pair min,pair max, pen p=nullpen);&lt;br /&gt;
        这个函数&lt;br /&gt;
void shipout(string prefix=defaultfilename, picture pic,frame preamble=patterns,orientation orientation=orientation,string format=&quot;&quot;, bool wait=NoWait, bool view=true);&lt;br /&gt;
void shipout(string prefix=defaultfilename,orientation orientation=orientation,string format=&quot;&quot;, bool wait=NoWait, bool view=true);&lt;br /&gt;
        这两个函数可以把pic放入preamble中，并且写入文件prefix中，其中的orientation的取值包括：Portrait，Landscape，Seascape， UpsideDown。&lt;br /&gt;
frame pic.fit(real xsize=pic.xsize, real ysize=pic.ysize,bool keepAspect=pic.keepAspect);&lt;br /&gt;
frame pic.scale(real xsize=this.xsize, real ysize=this.ysize,bool keepAspect=this.keepAspect);&lt;br /&gt;
        这两个函数用于显式地把pic映射到frame中去。&lt;br /&gt;
frame bbox(picture pic=currentpicture, real xmargin=0,real ymargin=xmargin, pen p=currentpen,filltype filltype=NoFill);&lt;br /&gt;
        这个函数与前两个函数的不同之处在于，它同时还画边框。其中的参数filltype可以设为：&lt;br /&gt;
FillDraw Fill with the pen used to draw the boundary.&lt;br /&gt;
FillDraw(real xmargin=0, real ymargin=xmargin, pen p=nullpen)&lt;br /&gt;
        If p is nullpen, fill with the pen used to draw the boundary; otherwise fill with pen p. An optional margin of xmargin and ymargin　can be specified.&lt;br /&gt;
Fill Fill with the drawing pen.&lt;br /&gt;
Fill(real xmargin=0, real ymargin=xmargin, pen p=nullpen)&lt;br /&gt;
        If p is nullpen, fill with the drawing pen; otherwise fill with pen p.An optional margin of xmargin and ymargin can be specified.NoFill Do not fill.&lt;br /&gt;
Draw Draw only the boundary.&lt;br /&gt;
Draw(real xmargin=0, real ymargin=xmargin, pen p=nullpen)&lt;br /&gt;
        If p is nullpen, draw the boundary with the drawing pen; otherwise draw with pen p. An optional margin of xmargin and ymargin can be specified.&lt;br /&gt;
UnFill Clip the region.&lt;br /&gt;
UnFill(real xmargin=0, real ymargin=xmargin&lt;br /&gt;
        Clip the region and surrounding margins xmargin and ymargin.&lt;br /&gt;
RadialShade(pen penc, pen penr)&lt;br /&gt;
        Fill varying radially from penc at the center of the bounding box to penr at the edge. &lt;/p&gt;
&lt;p&gt;pair min(picture pic);&lt;br /&gt;
pair max(picture pic);&lt;br /&gt;
        用于给出pic和边界&lt;br /&gt;
pair point(picture pic=currentpicture, pair dir);&lt;br /&gt;
        用来计算以pic的中心为起点，方向在dir的线交pic的边界的坐标。&lt;br /&gt;
pair truepoint(picture pic=currentpicture, pair dir);&lt;br /&gt;
pair framepoint(picture pic=currentpicture, pair dir);&lt;br /&gt;
        这两个函数与前面的point类似，framepoint返回的是最后的PostScript坐标。&lt;br /&gt;
void add(picture src, bool group=true,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
void add(picture dest, picture src, bool group=true,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
void add(picture dest, picture src, pair position, bool group=true,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
void add(picture src, pair position, bool group=true,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
void add(picture dest=currentpicture, frame src, pair position=0,bool group=true, filltype filltype=NoFill,bool put=Above);&lt;br /&gt;
void add(picture dest=currentpicture, frame src, pair position,pair align, bool group=true, filltype filltype=NoFill,bool put=Above);&lt;br /&gt;
        这些函数把src放入dest或currentpicture中。&lt;br /&gt;
void attach(picture dest=currentpicture, frame src,pair position=0, bool group=true,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
void attach(picture dest=currentpicture, frame src,pair position=0, pair align, bool group=true,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
        把src放入dest，同时调整dest的大小&lt;br /&gt;
path box(frame f, Label L=&quot;&quot;, real xmargin=0,real ymargin=xmargin, pen p=currentpen,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
path ellipse(frame f, Label L=&quot;&quot;, real xmargin=0,real ymargin=xmargin, pen p=currentpen,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
void box(picture pic=currentpicture, Label L,real xmargin=0, real ymargin=xmargin, pen p=currentpen,filltype filltype=NoFill, bool put=Above);&lt;br /&gt;
        用来在Label，frame或pic周围画一个矩形或椭圆。&lt;br /&gt;
void erase(picture pic=currentpicture);&lt;br /&gt;
save().&lt;br /&gt;
restore().&lt;br /&gt;
        用来消除，保存，恢复pic的环境&lt;br /&gt;
还有更多的函数，都定义在模块plain中。&lt;/p&gt;
&lt;p&gt;在pic中，你还可以直接插入PostScript命令和tex命令：&lt;br /&gt;
void postscript(picture pic=currentpicture, string s);&lt;br /&gt;
void postscript(picture pic=currentpicture, string s, pair min,pair max)&lt;br /&gt;
void tex(picture pic=currentpicture, string s);&lt;br /&gt;
void tex(picture pic=currentpicture, string s, pair min, pair max)&lt;/p&gt;
&lt;p&gt;Asymptote学习系列(12)&lt;br /&gt;
作图命令：&lt;/p&gt;
&lt;p&gt;所有的Asymptote图形都是基于4个基本的作图命令：其中的3个PostScript命令draw、fill和clip以它们出现的顺序处理，最后出现的会放在最上面，而label命令可以用于增加文本标签或外部EPS图形，则会放于所有上面的3个PostScript命令上面。&lt;br /&gt;
若你想在一个label上作图的话，可以使用layer函数：&lt;br /&gt;
void layer(picture pic=currentpicture);&lt;br /&gt;
它全重新创建一个新的PostScript/Latex图层，所有的图层顺序处理，最后出现的放在最上面。当然在图形内部，label命令还是会在其它3个PostScript命令的上面。&lt;/p&gt;
&lt;p&gt;•	draw&lt;br /&gt;
 void draw(picture pic=currentpicture, Label L=&quot;&quot;, path g,align align=NoAlign, pen p=currentpen,arrowbar arrow=None, arrowbar bar=None, margin margin=NoMargin,Label legend=&quot;&quot;, marker marker=nomarker);&lt;br /&gt;
用于在pic上画path g，用画笔p。还有些其它的参数，其中意义为：&lt;br /&gt;
bar ： 用来在g两端画条竖线，可取值为 None, BeginBar, EndBar (= Bar), Bars(=BeginBar &amp;amp; EndBar) ，而且它们都可以接受一个real型参数，用来指定竖线的长度(PostScript单位)。&lt;br /&gt;
arrowbar ： 用来画箭头，可取为： None, Blank, BeginArrow, MidArrow, EndArrow(=Arrow), Arrows ，而且它们可以接受的参数包括：一个real型参数，用来指定大小（PostScript单位）；一个real型参数angle用来指定角度； FillDraw, Fill, NoFill, Draw ；一个real型参数position指定位置。&lt;/p&gt;
&lt;p&gt;void dot(picture pic=currentpicture, pair z, pen p=currentpen);&lt;br /&gt;
void dot(picture pic=currentpicture, pair[] z, pen p=currentpen);&lt;br /&gt;
void dot(picture pic=currentpicture, pair[] x, pair[] y, pen p=currentpen);&lt;br /&gt;
void dot(picture pic=currentpicture, Label L, pair z, align align=NoAlign,string format=defaultformat, pen p=currentpen)&lt;br /&gt;
void dot(picture pic=currentpicture, Label L, pen p=currentpen);&lt;br /&gt;
void dot(picture pic=currentpicture, path g, pen p=currentpen);&lt;br /&gt;
用于画点&lt;/p&gt;
&lt;p&gt;示例：&lt;/p&gt;
&lt;p&gt;path line=(0,0)--(5cm,0);&lt;/p&gt;
&lt;p&gt;draw(line, Arrow(20bp,position=.75));&lt;br /&gt;
draw(shift(0,-2cm)* line,Arrow(20bp,40,.75,filltype=NoFill));&lt;/p&gt;
&lt;p&gt;position pos=BeginPoint ;&lt;br /&gt;
pos.position=.75;&lt;br /&gt;
draw(shift(0,-4cm)*line, BeginArrow(20bp,pos));&lt;br /&gt;
draw(shift(0,-6cm)*line, BeginArrow(20bp,40,pos,filltype=NoFill));&lt;br /&gt;
path line=(0,0)--(5cm,0);&lt;br /&gt;
transform T= shift(0,-cm);&lt;/p&gt;
&lt;p&gt;draw(line,linewidth(1mm),Bars);&lt;br /&gt;
draw(T^2*line,Bars(5mm));&lt;br /&gt;
draw(T^3*line ,linewidth(1mm),Bars(5mm));&lt;br /&gt;
draw(T^4* line,dotted+red,Bars);&lt;br /&gt;
pair O=0;&lt;br /&gt;
draw(scale(2)*Label( &quot;N&quot;,.8red),O,10*N,linewidth(3mm));&lt;br /&gt;
draw(scale(2)*Label(&quot;S&quot;,.8red),O,10* S);&lt;br /&gt;
draw(scale(2)*Label(&quot;E&quot;,.8red), O,10*E);&lt;br /&gt;
draw(scale(2)*Label(&quot;W&quot;,.8 red),O,10*W);&lt;/p&gt;
&lt;p&gt;draw(rotate(45)*Label( &quot;NE&quot;),O,5NE);&lt;br /&gt;
draw(rotate(-45)*Label (&quot;SE&quot;),O,5SE);&lt;br /&gt;
draw(rotate(-45)* Label(&quot;NW&quot;),O,5NW);&lt;br /&gt;
draw(rotate(45)* Label(&quot;SW&quot;),O,5SW);&lt;/p&gt;
</description>
 <comments>http://gezhi.org/node/823#comments</comments>
 <category domain="http://gezhi.org/taxonomy/term/782">Asymptote</category>
 <category domain="http://gezhi.org/taxonomy/term/118">latex</category>
 <pubDate>Thu, 06 Dec 2007 18:36:36 -0800</pubDate>
 <dc:creator>白云蓝天</dc:creator>
 <guid isPermaLink="false">823 at http://gezhi.org</guid>
</item>
<item>
 <title>公式输入法</title>
 <link>http://gezhi.org/node/549</link>
 <description>&lt;p&gt;升级 drupal 到 5.1，顺便安装了一个新的 LaTeX 插件：&lt;a href=&quot;http://drupal.org/project/drutex&quot;&gt;DruTeX&lt;/a&gt;。比一直来用的 Latexrender 强大，更重要的是这个 DruTeX 有人更新维护。&lt;/p&gt;
&lt;p&gt;现在在格志输入公式和在 LaTeX 环境下是一样的，复制一段 &lt;a href=&quot;http://groups.drupal.org/node/1263&quot;&gt;DruTeX 的使用方法&lt;/a&gt;，方便参考。&lt;/p&gt;
&lt;p&gt;Writing maths works as in LaTeX. Use dollar signs to enclose inline math, e.g. $x^2$. Examples for paragraph math are [ x^2 ] and $$x^2$$ (both variants are equivalent). There is also a display-style inline math environment, compare $\sum_{k=1}^\infty \frac{1}{k}$ and $!\sum_{k=1}^\infty \frac{1}{k}$.&lt;/p&gt;
&lt;p&gt;To make a dollar sign, you have to type \$ as in LaTeX!&lt;/p&gt;
&lt;p&gt;Arbitrary LaTeX code can be rendered as in this example: &amp;lt;tex&gt;Let $x^2$ be a natural number.&amp;lt;/tex&gt;&lt;/p&gt;
&lt;p&gt;There are also more elaborate environments to write math - they support auto-numbering, referencing and more. These environments are &amp;lt;equation&gt; and &amp;lt;equations&gt;. They both support the same attributes.&lt;/p&gt;
&lt;p&gt;E.g. rendering an equation with a different resolution: &amp;lt;equation dpi=&quot;200&quot;&gt;e^{i \cdot \pi} = -1.&amp;lt;/equation&gt;&lt;/p&gt;
&lt;p&gt;To give the equation automatically a number, you have to give it an id: &amp;lt;equation id=&quot;euler&quot;&gt;e^{i \cdot \pi} = -1.&amp;lt;/equation&gt;&lt;/p&gt;
&lt;p&gt;You now can produce a link to that equation by typing \ref{euler}, or even better (\ref{euler}).&lt;/p&gt;
&lt;p&gt;You can also give it a name instead of a number: &amp;lt;equation id=&quot;euler&quot; name=&quot;Euler&#039;s Identity&quot;&gt;e^{i \cdot \pi} = -1.&amp;lt;/equation&gt;&lt;/p&gt;
&lt;p&gt;An example for the &lt;equations&gt; environment is given by:&lt;br /&gt;
&amp;lt;equations&gt;&lt;br /&gt;
\int \ln(x) \;dx&lt;br /&gt;
&amp;amp;= \int 1 \cdot \ln(x) \;dx \&lt;br /&gt;
&amp;amp;= x \cdot \ln(x) - \int x \cdot \frac{1}{x} \;dx \&lt;br /&gt;
&amp;amp;= x \cdot \ln(x) - x&lt;br /&gt;
&amp;lt;/equations&gt;&lt;/p&gt;
&lt;p&gt;The spaces on the left are optional.&lt;/p&gt;
&lt;p&gt;To prohibit some text from being processed by DruTeX, you can use &amp;lt;code&gt; and &amp;lt;notex&gt;, e.g. &amp;lt;notex&gt;$x^2$&amp;lt;/notex&gt;.&lt;/p&gt;
</description>
 <comments>http://gezhi.org/node/549#comments</comments>
 <category domain="http://gezhi.org/taxonomy/term/118">latex</category>
 <category domain="http://gezhi.org/taxonomy/term/478">公式</category>
 <pubDate>Fri, 27 Apr 2007 13:33:21 -0700</pubDate>
 <dc:creator>Yan</dc:creator>
 <guid isPermaLink="false">549 at http://gezhi.org</guid>
</item>
<item>
 <title>WordPress.com 支持 LaTeX</title>
 <link>http://gezhi.org/node/439</link>
 <description>&lt;p&gt;&lt;a href=&quot;http://wordpress.com/blog/2007/02/17/math-for-the-masses/&quot;&gt;WordPress.com&lt;/a&gt; 现在和格志一样可以在帖子里输入[tex]\LaTeX[/tex]公式了。这样一来，&lt;a href=&quot;http://WordPress.com&quot;&gt;WordPress.com&lt;/a&gt; 对格志的读者来说，可能是最好的 blog 服务选择。就是不知道现在它还在不在 GFW 之外。&lt;/p&gt;
&lt;p&gt;其实，格志也可以很容易地安装一个 WordPress mu，提供 [tex]\LaTeX[/tex]公式输入支持的 blog 服务。可是，创建容易，但维持这样一个服务还是很费精力的。&lt;/p&gt;
</description>
 <comments>http://gezhi.org/node/439#comments</comments>
 <category domain="http://gezhi.org/taxonomy/term/118">latex</category>
 <category domain="http://gezhi.org/taxonomy/term/320">WordPress</category>
 <pubDate>Mon, 19 Feb 2007 06:25:22 -0800</pubDate>
 <dc:creator>Yan</dc:creator>
 <guid isPermaLink="false">439 at http://gezhi.org</guid>
</item>
<item>
 <title>Latex 出现错误</title>
 <link>http://gezhi.org/node/308</link>
 <description>&lt;p&gt;我用latex格式来输入公式出现错误，提示如下：&lt;/p&gt;
&lt;p&gt;[Unparseable or potentially dangerous latex formula. Error 6 ]，&lt;/p&gt;
&lt;p&gt;我相信是系统设置出现了问题。&lt;/p&gt;
</description>
 <comments>http://gezhi.org/node/308#comments</comments>
 <category domain="http://gezhi.org/taxonomy/term/118">latex</category>
 <pubDate>Fri, 29 Sep 2006 03:57:54 -0700</pubDate>
 <dc:creator>zqyin</dc:creator>
 <guid isPermaLink="false">308 at http://gezhi.org</guid>
</item>
</channel>
</rss>
