如何在乳胶中绘制这种形状?

如何在乳胶中绘制这种形状?

我如何在乳胶中实现这种形状

在此处输入图片描述

答案1

尽可能简单:

在此处输入图片描述

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
 \draw [thick] (0,0) -| (1,3) -| (0.7,0.5) -| cycle;
\end{tikzpicture}

\end{document}

答案2

一个高度可定制的版本(只是为了好玩)。

\documentclass{article}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\lshape}{O{}}
 {
  \group_begin:
  \keys_set:nn { teron/lshape } { #1 }
  \hbox_set:Nn \l_teron_lshape_box
   {
    \driver_draw_begin:
    \driver_draw_join_round:
    \driver_draw_linewidth:n { \l_teron_lshape_linewidth_dim }
    \driver_draw_moveto:nn { 0pt } { 0pt }
    \driver_draw_lineto:nn { \l_teron_lshape_base_dim } { 0pt }
    \driver_draw_lineto:nn
     { \l_teron_lshape_base_dim }
     { \l_teron_lshape_height_dim }
   \driver_draw_lineto:nn
     { \l_teron_lshape_base_dim - \l_teron_lshape_vertwidth_dim }
     { \l_teron_lshape_height_dim }
   \driver_draw_lineto:nn
     { \l_teron_lshape_base_dim - \l_teron_lshape_vertwidth_dim }
     { \l_teron_lshape_horwidth_dim }
   \driver_draw_lineto:nn
     { 0pt }
     { \l_teron_lshape_horwidth_dim }
   \driver_draw_closestroke:
  }
  \box_set_wd:Nn \l_teron_lshape_box { \l_teron_lshape_base_dim }
  \box_set_ht:Nn \l_teron_lshape_box { \l_teron_lshape_height_dim }
  \leavevmode\box_use:N \l_teron_lshape_box
  \group_end:
 }

\box_new:N \l_teron_lshape_box
\keys_define:nn { teron/lshape }
 {
  base      .dim_set:N = \l_teron_lshape_base_dim,
  height    .dim_set:N = \l_teron_lshape_height_dim,
  hwidth    .dim_set:N = \l_teron_lshape_horwidth_dim,
  vwidth    .dim_set:N = \l_teron_lshape_vertwidth_dim,
  thickness .dim_set:N = \l_teron_lshape_linewidth_dim,
  base      .initial:n = 2cm,
  height    .initial:n = 5cm,
  hwidth    .initial:n = 1cm,
  vwidth    .initial:n = 0.5cm,
  thickness .initial:n = 0.4pt,
 }

\ExplSyntaxOff

\begin{document}

\lshape\qquad
\lshape[thickness=0.8pt]\qquad
\lshape[base=2cm,height=2cm,hwidth=1cm,vwidth=0.3cm,thickness=1pt]

\end{document}

在此处输入图片描述

答案3

只是为了好玩,用 MetaPost (LuaLaTeX 文档) 画了一张相同的图片。几乎是代码的复制粘贴tikz。(好吧,公平地说,tikz 路径语法受到了 MetaPost 的强烈启发…… ;-))

\documentclass[border=3mm]{standalone}
\usepackage{luatex85, luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
    draw (origin -- (1,0) -- (1, 3) -- (0.7, 3) --  (0.7,0.5) -- (0, 0.5) -- cycle)
        scaled cm;
endfig;
\end{mplibcode}
\end{document}

在此处输入图片描述

答案4

你喜欢?

在此处输入图片描述

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(0.36,0.52) rectangle (3.96,5.22);
\draw [line width=2.pt] (1.,2.)-- (2.,2.);
\draw [line width=2.pt] (2.,2.)-- (2.,5.);
\draw [line width=2.pt] (2.,5.)-- (3.,5.);
\draw [line width=2.pt] (3.,5.)-- (3.,1.);
\draw [line width=2.pt] (3.,1.)-- (1.,1.);
\draw [line width=2.pt] (1.,1.)-- (1.,2.);
\end{tikzpicture}
\end{document}

相关内容