Tag Archives: TikZ

TikZ一例–简单流程图


下面那个大括号找了半天。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.pathreplacing
}

% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt
]
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
text width=2em, text centered, rounded corners, minimum height=4em
]
\tikzstyle{line
} = [draw, -latex']
%\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
%    minimum height=2em]

\begin{tikzpicture}[scale=0.7, node distance = 2.0cm, auto]
\node [block] (problem) {\\\\\\};

\node [block, right of=problem] (model) {\\\\\\};
\path [line] (problem) -- (model);

\node [block, right of=model] (method) {数值计算方法};
\path [line] (model) -- (method);

\node [block, right of=method] (prog) {\\\\\\};
\path [line] (method) -- (prog);

\node [block, right of=prog] (comp) {\\\\\\};
\path [line] (prog) -- (comp);

\draw[decorate, decoration={brace, mirror}, very thick, blue] (0,-2) -- (3,-2);
\draw (1.5,-2.8) node {应用数学};

\draw[decorate, decoration={brace, mirror}, very thick, blue] (5.5,-2) -- (11.5,-2);
\draw (8.5,-2.8) node {计算数学};
\end{tikzpicture
}

TikZ一例–内公切线

一下午就画这么个东西:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
\usetikzlibrary{calc}
\begin{tikzpicture}
\def\L{8}
\coordinate (m) at (0.5*\L,0);
\draw (m) node[below] {$m$};
\draw[->] (0,0) -- (1.2*\L,0);
\node [circle,draw] (i) at (0,0) [minimum size=3cm] {};
\draw (i) node[below left] {$i$};
\node [circle,draw] (j) at (\L,0) [minimum size=3cm] {};
\draw (j) node[below right] {$j$};
\coordinate (a) at (tangent cs:node=i,point={(m)},solution=1);
\coordinate (c) at (tangent cs:node=i,point={(m)},solution=2);
\coordinate (b) at (tangent cs:node=j,point={(m)},solution=1);
\coordinate (d) at (tangent cs:node=j,point={(m)},solution=2);
\draw (a) node[above] {$A$} -- (i.center)-- (c) node[below] {$C$} --
(d) node[above] {$D$} -- (j.center)-- (b) node[below] {$B$} -- cycle;

\draw[dashed] (0,0) -- (0,0.5*\L);
\draw[dashed] (\L,0) -- (\L,0.5*\L);
\node (l) at (0.5*\L,0.45*\L) {$l_{ij}$};
\draw[< -] (0,0.45*\L) -- (l);
\draw[->] (l) -- (\L,0.45*\L);

\draw (m) +(0:8mm) arc (0:22:8mm);
\path (m) +(8:1.2cm) node{$\alpha_{ij}$};

\draw[dashed] (m) +($(0,0)-(a)$) -- (0,0);

\draw[->] (0,0) +(0:18mm) arc (0:-22:18mm);
\path (0,0) +(-8:22mm) node{$\alpha_{ij}$};

\draw[->] (0,0) -- (3,-2) node[below right] {$\overrightarrow{v}_{ij}$};
\draw[->] (0,0) +(0:8mm) arc (0:-32:8mm);
\path (0,0) +(-18:12mm) node{$\beta_{ij}$};

\draw[dashed] (m) +($(0,0)-(c)$) -- (0,0);
\end{tikzpicture
}

CaR,GCLC,TikZ

C.a.R.和GCLC都可以算做类似几何画板的所谓动态几何软件,这里是维基百科上关于这类软件的一个比较。那张表并不完整,至少缺了是否跨平台这一栏。而这两个软件都具备以下特点:

  1. 免费
  2. 跨平台
  3. 支持LaTeX

另外,C.a.R.可以将动态结果输出至网页形式,只要装了Java的机器,可以直接在浏览器中操作。GCLC则有机器证明的功能,并可以将做图脚本输出为TikZ格式。

而TikZ是LaTeX上的一个宏包,可与Beamer很好的配合。

缺点是这三个软件都非常小众,无论国内还是国外,用户似乎都不多。

8月15日补充:

关于TikZ/PGF的好站(强力推荐):http://www.texample.net

无觅相关文章插件,快速提升流量