답변1
나는 이것이 언젠가 다시 현대화되기를 항상 바랐습니다. ;-)
\documentclass{article}
\begin{document}
\begin{verbatim}
/\ /\
/\ / \/\ /\ / \
/ \ /\/ \ / \ /\ / \/\
/ \ / \ /\/\/\/ \ / \/ \/\
\end{verbatim}
\end{document}
Ti로 그렇게 하는 것은 오히려 간단합니다.케이Z(제가 개인적으로 가장 좋아하는 제안은 세 번째 제안입니다). 대시 패턴을 다이얼하면 됩니다.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[dash pattern=on 7.5pt off 3.5pt,shorten <=1.5pt,x=1ex,y=1em]
\draw[thick] (0,0) -- ++ (3,3) -- ++ (3,-3);
\draw[thick] (11,0) -- ++ (2,2) -- ++ (1,-1) -- ++ (3,3) -- ++ (2,-2)
-- ++ (1,1) -- ++ (3,-3);
\draw[thick] (33,0) foreach \X in {1,2,3}{-- ++ (1,1) -- ++ (1,-1)}
-- ++ (3,3) -- ++ (3,-3);
\draw[thick] (55,0) -- ++ (2,2) -- ++ (2,-2)
-- ++ (4,4) -- ++ (3,-3) -- ++ (1,1) -- ++ (2,-2) -- ++ (1,1) -- ++ (1,-1);
\end{tikzpicture}
\end{document}
+
혹은 선택사항이 위( ), 아래( ) 뿐이므로 모듈 -
을 이용하면 됩니다 parser
.
\documentclass{article}
\usepackage{tikz}
\usepgfmodule{parser}
\pgfparserdef{pft}{initial}{the character -}%
{\tikzset{insert path={-- ++(1,-1)}}}%
\pgfparserdef{pft}{initial}{the character +}%
{\tikzset{insert path={-- ++(1,1)}}}%
\pgfparserdef{pft}{initial}{the character ;}%
{\pgfparserswitch{final}}%
\tikzset{hillside/.code={\pgfparserparse{pft}#1;%
}}
\begin{document}
\begin{tikzpicture}[dash pattern=on 7.5pt off 3.5pt,shorten <=1.5pt,x=1ex,y=1em,
thick]
\draw (0,0)[hillside={+++---}];
\draw (11,0) [hillside={++-+++--+---}];
-- ++ (1,1) -- ++ (3,-3);
\draw[thick] (33,0) [hillside={+-+-+-+++---}];
\draw[thick] (55,0) [hillside={++--++++---+--+-}];
\end{tikzpicture}
\end{document}
그러면 대시 패턴을 없앨 수도 있습니다.
\documentclass{article}
\usepackage{tikz}
\usepgfmodule{parser}
\pgfparserdef{pft}{initial}{the character -}%
{\tikzset{insert path={edge[shorten <=1.75pt,shorten >=1.75pt] ++(1,-1) ++(1,-1)}}}%
\pgfparserdef{pft}{initial}{the character +}%
{\tikzset{insert path={edge[shorten <=1.75pt,shorten >=1.75pt] ++(1,1) ++(1,1)}}}%
\pgfparserdef{pft}{initial}{the character ;}%
{\pgfparserswitch{final}}%
\tikzset{hillside/.code={\pgfparserparse{pft}#1;%
}}
\begin{document}
\begin{tikzpicture}[x=1ex,y=1em,thick]
\draw (0,0)[hillside={+++---}];
\draw (11,0) [hillside={++-+++--+---}];
\draw (33,0) [hillside={+-+-+-+++---}];
\draw (55,0) [hillside={++--++++---+--+-}];
\end{tikzpicture}
\end{document}