Skip to content

Drawing with TikZ · ⁨用 TikZ 绘图⁩

English

Drawing inside LaTeX

  • You can draw diagrams with code using the TikZ package — no image files needed.
  • Load it once, then draw inside a tikzpicture:
  • \draw (0,0) -- (2,1); draws a line from one point to another. Every command ends with ;.

中文

在 LaTeX 里画图

  • 你可以用代码画图,工具是 TikZ 宏包 —— 不需要任何图片文件。
  • 加载一次,然后在 tikzpicture 里绘制:
\usepackage{tikz}
...
\begin{tikzpicture}
  \draw (0,0) -- (2,1);
\end{tikzpicture}
  • \draw (0,0) -- (2,1); 从一个点画一条线到另一个点。每条命令都以 ; 结尾。

三条 TikZ 命令,以及它们画出的线、圆和矩形

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩