带有 TikZ 的人正在运行图标

带有 TikZ 的人正在运行图标

我是这方面的新手。我正在尝试用 Latex 为我的学生准备一些练习。我的主要问题是 Tikz 的使用。在这种情况下,我试图绘制一个男人/女人跑步的图标。我附上一张相当简单的图片。

你能帮助我吗?有没有办法将其他格式的图片转换为 Tikz 代码?

在此处输入图片描述

答案1

使用矩形的尝试tikz

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
    \tikzstyle{body}= [fill=black,rounded corners=14pt]
    \draw[body,rotate around={35:(1.2,0)}] (1.2,0) rectangle ++(3.5,1) ;
    \draw[body,rotate around={75:(3.8,2)}] (3.8,2) rectangle ++(3,1) ;
    \draw[body,rotate around={-90:(6.25,6)},rounded corners=10pt] (6.25,6) rectangle ++(2,0.7) ;
    \draw[body,rotate around={-30:(6.2,4.2)},rounded corners=10pt] (6.2,4.2) rectangle ++(2.5,0.7) ;
    \draw[body,rotate around={7:(2.2,1.7)},draw=white,line width=4pt] (2.2,1.7) rectangle ++(3.7,1);
    \draw[body,rotate around={-52:(3.1,4.7)},draw=white,line width=2pt] (3.1,4.7) rectangle ++(3.5,1);
    \draw[body,rotate around={7:(2.2,1.7)}] (2.2,1.7) rectangle ++(3.7,1);
    \draw[body,rotate around={25:(3.7,3.7)},rounded corners=24pt] (3.7,3.7) rectangle ++(3.9,1.7);
    \draw[body,rotate around={145:(6.7,5.8)},rounded corners=10pt,draw=white,line width=2pt] (6.7,5.8) rectangle ++(2.3,0.7) ;
    \draw[body,rotate around={190:(5,7.1)},rounded corners=10pt] (5,7.1) rectangle ++(2.5,0.7);
    \draw[body] (8.2,6) circle (1cm);

    \draw[line width=2pt] (4.8,1) -- ++(2,0);
    \draw[line width=2pt] (6,1.3) -- ++(1.6,0);
    \draw[line width=2pt] (5.6,0.7) -- ++(1.6,0);

    \draw[line width=2pt] (0.5,5) -- ++(2,0);
    \draw[line width=2pt] (1.2,5.3) -- ++(1.6,0);
    \draw[line width=2pt] (1.1,4.7) -- ++(1.6,0);
\end{tikzpicture}
\end{document}

编辑:

为了正确缩放此图片,请使用[transform canvas={scale=0.2}]withtikzpicturescope。另请阅读此答案:正确缩放 tikzpicture

答案2

\documentclass[pstricks,border=12pt]{standalone}
\def\wind{%
    \psline[linewidth=0.2](8,-9)(11,-9)
    \psline[linewidth=0.2](5,-9.4)(10,-9.4)
    \psline[linewidth=0.2](7,-9.8)(10.5,-9.8)}
\begin{document}
\begin{pspicture}[linecap=1,linejoin=1](-1,-12)(13,3)
    \psframe[fillstyle=vlines,hatchangle=-45,hatchsep=.3,hatchcolor=lightgray](-1,-12)(13,3)
    \qdisk(11,-0.5){1.5}
    \psline[linewidth=1.5](4,-4)(3,-7)(1,-10)
    \psline[linewidth=1.75,linecolor=white](3.5,-4)(6,-7)(1,-7)
    \psline[linewidth=1.5](3.5,-4)(6,-7)(1,-7)
    \psline[linewidth=2.5](8,-1)(4.1,-3.8)
    \psline[linewidth=1](8,-1)(8,-4)(11,-5)
    \psline[linewidth=1.25,linecolor=white](8,-1)(6,2)(3,1)
    \psline[linewidth=1](8,-1)(6,2)(3,1)
    \wind
    \rput(-5.5,9){\wind}
\end{pspicture}
\end{document}

在此处输入图片描述

答案3

\documentclass[pstricks,border=12pt]{standalone}
\def\wind{%
    \psline[linewidth=0.2](8,-9)(11,-9)
    \psline[linewidth=0.2](5,-9.4)(10,-9.4)
    \psline[linewidth=0.2](7,-9.8)(10.5,-9.8)}
\begin{document}
\begin{pspicture}[linecap=1,linejoin=1](-1,-12)(13,3)
    \psframe[fillstyle=vlines,hatchangle=-45,hatchsep=.3,hatchcolor=lightgray](-1,-12)(13,3)
    \qdisk(11,-0.5){1.5}
    \psline[linewidth=2.5](8,-1)(4,-4)
    \psline[linewidth=1.5](4,-4)(3,-7)(1,-10)
    \psline[linewidth=1.5](3.75,-4.25)(6,-7)(1,-7)
    \psline[linewidth=1](8,-1)(8,-4)(11,-5)
    \psline[linewidth=1](8,-1)(6,2)(3,1)
    \wind
    \rput(-5.5,9){\wind}
\end{pspicture}
\end{document}

在此处输入图片描述

答案4

您在问题中展示的类似象形图也可以从以下网站获取矢量图形:https://upload.wikimedia.org/wikipedia/commons/b/b0/Running_icon_-_Noun_Project_17825.svg

这带来了几种可能性:

  1. 使用该svg包包含图形(需要 shell-escape 进行编译并安装 inkscape)

  2. 使用 inkscape 等外部程序将图形转换为 pdf,然后可以将其包含\includegraphics在您的文档中

  3. 将 .svg 转换为 tikz,例如可以使用 inkscape 来完成:


\documentclass{standalone}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\fill (2.7298,2.9966) .. controls (2.6046,2.9966) and (2.5032,2.8951) .. (2.5032,2.7702) .. controls (2.5032,2.6453) and (2.6046,2.5438) .. (2.7298,2.5438) .. controls (2.8547,2.5438) and (2.9560,2.6453) .. (2.9560,2.7702) .. controls (2.9560,2.8952) and (2.8547,2.9966) .. (2.7298,2.9966) -- cycle(1.8120,2.9130) .. controls (1.7960,2.9125) and (1.7807,2.9106) .. (1.7674,2.9074) -- (1.3128,2.7960) .. controls (1.2596,2.7830) and (1.2161,2.7320) .. (1.2161,2.6827) .. controls (1.2161,2.6333) and (1.2596,2.6035) .. (1.3129,2.6163) -- (1.7107,2.7116) .. controls (1.7640,2.7244) and (1.8460,2.7118) .. (1.8930,2.6837) -- (2.0218,2.6065) .. controls (2.0689,2.5784) and (2.0689,2.5322) .. (2.0221,2.5037) -- (1.6233,2.2623) .. controls (1.5764,2.2339) and (1.5162,2.1788) .. (1.4894,2.1396) .. controls (1.4626,2.1006) and (1.5647,1.8858) .. (1.5882,1.8363) -- (1.7125,1.5730) .. controls (1.7360,1.5235) and (1.7103,1.4815) .. (1.6555,1.4815) -- (1.1510,1.4815) .. controls (1.0962,1.4815) and (1.0551,1.4383) .. (1.0596,1.3837) -- (1.0660,1.3196) .. controls (1.0704,1.2650) and (1.1189,1.2345) .. (1.1738,1.2345) -- (2.0524,1.2345) .. controls (2.1071,1.2345) and (2.1361,1.2629) .. (2.1166,1.3142) -- (1.9628,1.7126) .. controls (1.9433,1.7638) and (1.9151,1.8455) .. (1.9002,1.8982) -- (1.8951,1.9147) .. controls (1.8801,1.9674) and (1.9066,2.0323) .. (1.9539,2.0599) -- (2.2306,2.2209) .. controls (2.2779,2.2485) and (2.3414,2.2829) .. (2.3717,2.2977) .. controls (2.4020,2.3125) and (2.4391,2.2815) .. (2.4541,2.2287) -- (2.5489,1.8960) .. controls (2.5638,1.8433) and (2.6199,1.8096) .. (2.6734,1.8212) -- (3.2002,1.9352) .. controls (3.2537,1.9468) and (3.2975,1.9933) .. (3.2975,2.0386) .. controls (3.2975,2.0839) and (3.2531,2.1140) .. (3.1990,2.1056) -- (2.8194,2.0463) .. controls (2.7653,2.0379) and (2.7083,2.0740) .. (2.6930,2.1265) -- (2.5884,2.4840) .. controls (2.5730,2.5365) and (2.5205,2.5997) .. (2.4716,2.6244) -- (1.9532,2.8861) .. controls (1.9165,2.9046) and (1.8603,2.9147) .. (1.8120,2.9130) -- cycle(0.4593,2.4347) .. controls (0.4045,2.4347) and (0.3596,2.4167) .. (0.3596,2.3994) .. controls (0.3596,2.3821) and (0.4045,2.3641) .. (0.4593,2.3641) -- (1.5070,2.3641) .. controls (1.5618,2.3641) and (1.6067,2.3821) .. (1.6067,2.3994) .. controls (1.6067,2.4167) and (1.5618,2.4347) .. (1.5070,2.4347) -- cycle(0.5811,2.2935) .. controls (0.5263,2.2935) and (0.4815,2.2755) .. (0.4815,2.2582) .. controls (0.4815,2.2409) and (0.5263,2.2229) .. (0.5811,2.2229) -- (1.3545,2.2229) .. controls (1.4092,2.2229) and (1.4542,2.2409) .. (1.4542,2.2582) .. controls (1.4542,2.2755) and (1.4093,2.2935) .. (1.3545,2.2935) -- cycle(0.6622,2.1523) .. controls (0.6074,2.1523) and (0.5626,2.1342) .. (0.5626,2.1170) .. controls (0.5626,2.0997) and (0.6075,2.0817) .. (0.6622,2.0817) -- (1.3041,2.0817) .. controls (1.3588,2.0817) and (1.4037,2.0997) .. (1.4037,2.1170) .. controls (1.4037,2.1342) and (1.3588,2.1523) .. (1.3041,2.1523) -- cycle(1.5539,1.1639) .. controls (1.4991,1.1639) and (1.4177,1.1442) .. (1.3730,1.1125) -- (1.1237,0.9389) .. controls (1.0790,0.9072) and (1.0684,0.8463) .. (1.1001,0.8016) -- (1.1495,0.7328) .. controls (1.1812,0.6881) and (1.2422,0.6799) .. (1.2851,0.7140) -- (1.7881,1.1079) .. controls (1.8309,1.1420) and (1.8211,1.1639) .. (1.7663,1.1639) -- cycle;
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容