跳至正文
Wener Notes

tikz

约 2 分钟阅读
      • Portable Graphic Format for TeX
    • tikzit.github.io
      • editor
    • tikz.dev
    • TikZ running under WebAssembly in the browser
  • tikz.net/neural_networks
tex
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}[scale=0.7]
\draw [help lines] (0,-4) grid [step=1] (10,4);
\draw (0,0) -- (10,0);
\draw plot [domain=0.1:10,samples=100] (\x,{log2(\x)});
\draw plot [domain=0.1:10,samples=100] (\x,{log2(\x)});
\end{tikzpicture}

\vspace{1cm}

\begin{tikzpicture}[trim axis left]
\begin{axis}[domain=0:10,
  samples=100,
  enlarge x limits=false,
  grid=both,
  no markers,
  axis equal]
\addplot +[thick] {ln(x)/ln(2)};
\end{axis}
\end{tikzpicture}
\end{document}
bash
docker run --rm -it -v $PWD:/host -w /host wener/base
# AlpineLinux
apk add texlive texmf-dist-pictures icu-data-full texmf-dist-latexextra texmf-dist-langchinese
apk add -X http://mirrors.aliyun.com/alpine/edge/testing pdf2svg

# Linux GUI
# apk add -X http://mirrors.aliyun.com/alpine/edge/community tikzit
demo.tikz
\documentclass[crop,tikz,multi=false]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{document}

\begin{tikzpicture}
  \fill[red!90!black]  ( 90:.6) circle (1);
  \fill[green!80!black](210:.6) circle (1);
  \fill[blue!90!black] (330:.6) circle (1);
\end{tikzpicture}

\end{document}
bash
# demo.aux demo.log demo.pdf
# -output-directory=/tmp
pdflatex -interaction=batchmode -halt-on-error demo.tikz
pdf2svg demo.pdf demo.svg 1

Examples

markdown
## Minimal Axis

$$
\begin{tikzpicture}
\draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
\draw[->,ultra thick] (-5,0)--(5,0) node[right]{$x$};
\draw[->,ultra thick] (0,-5)--(0,5) node[above]{$y$};
\end{tikzpicture}
$$

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub7 条
其他外链6 条
最近更新commit 9aede42编辑