KTUG마당은 KTUG를 방문하는 모든 이용자가 대화를 나누고 소식을 전하는 곳입니다.
- 로그인 없이 자유롭게 글을 읽고 쓸 수 있는 철학은 처음과 같이 계속됩니다.
- Team Blog의 글을 이곳 게시판의 "정보글"로 모았습니다. Team blog는 기고자가 올린 글에 질문을 받는 부담을 줄이기 위하여 댓글을 허용하지 않았습니다. 그러나 이곳 게시판으로 모으면서 댓글을 달 수 있습니다. 게시물을 작성하실 때 댓글을 원하지 않으시면 댓글을 허용하시지 않으시기를 바랍니다. 또한 불필요한 소모성 댓글을 달지 않도록 주의하여 주시기를 바랍니다.
- TeX과 관련된 질문이나 답변은 QnA 마당을 이용하십시오. TeX과 관련된 질문은 지웁니다
- MathJax를 이용한 수식조판을 사용하실 수 있습니다. 여기를 참조하세요.
- 스팸 글을 막기 위하여 짧은 시간 내에 다시 글이 등록되는 IP를 막거나, 광고 글을 막기 위하여 금지어로 .com, .net 등을 설정하고 있습니다. 다소간의 불편함이 있으시더라도 양해 바랍니다.
- 금지어에서 stackexchange, stackoverflow, ctan, overleaf, , github, google.com, gmail.com, .org, .io, sil.org, wiki.com, tistory.com등은 해제하였습니다.
- 사용하는 편집기는 CKeditor입니다. 편집기에서 [enter]를 누르면 <p> 태그가 들어가고, 문단으로 생각하고 한줄을 비웁니다. 글줄만 바꾸려면 shift-enter 를 누르시면 <BR>가 들어가므로 용도에 맞게 나누어 쓸 수 있습니다.
자유글 게임 트리 그리기 2-1 (with tikz)
2015.08.17 18:05
다음 단계는...
반복되는 코드를 대체하는 명령으로 코딩을 간단하게 합니다.
\documentclass{article}
\usepackage{xparse}
\usepackage{tikz}
\tikzstyle{hollow node}=[circle,draw,fill=white,inner sep=.85,outer sep=0pt]
\tikzstyle{solid node}=[circle,draw,inner sep=.75,fill=black]
\newcommand\move[3]{edge from parent [#1] node [#2] {$#3$}}
\newcommand\payoff[2]{node[inner sep=0pt, outer sep=0pt, label={#1:{$#2$}}]{}}
\newcommand\xxxdistance[3][1]
{\tikzstyle{level #1}=[level distance=#2,sibling distance=#3]}
\NewDocumentCommand\xxxRoot{O{down}mO{}D<>{}G{}}
{\node #2 [solid node,#3,{label={#4:{#5}}}] {} [grow=#1]}
\begin{document}
%% tikz (parent-child) - new
\begin{tikzpicture}[>=stealth,shorten >=1pt,font=\scriptsize]
\xxxdistance{15mm}{30mm}
\xxxRoot{(0)}[hollow node]{Child}
child{\payoff{below}{(0,2)}\move{->}{left}{Good}}
child{\move{->}{right}{Bad}};
\xxxRoot{(1) at (0-2)}<30>{Parent}
child{\payoff{below}{(1,1)}\move{->}{left}{Forgive}}
child{\payoff{below}{(-1,-1)}\move{->}{right}{Punish}};
\end{tikzpicture}
\end{document}
댓글 2
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
» | 게임 트리 그리기 2-1 (with tikz) [2] | ischo | 2015.08.17 | 14078 |
687 | [번역] 2015년판, essential-kr과 latex4wp-kr [3] | ischo | 2015.08.15 | 4310 |
686 | 게임 트리 그리기 2 (with tikz) [5] | ischo | 2015.08.14 | 4745 |
685 | pdftex에서 truetype을 써보자 | DohyunKim | 2015.08.07 | 5196 |
684 | syshan 패키지 | anony | 2015.08.05 | 4329 |
683 | tex를 배워보려는 학생입니다. [7] | ghg | 2015.08.01 | 4290 |
682 | josaref, 자동조사를 취하는 \ref | nanim | 2015.07.30 | 4090 |
681 | polyglossia를 이용하는 한국어 조판 [2] | nanim | 2015.07.27 | 5529 |
680 | 금지어 문의 [1] | 세벌 | 2015.07.26 | 4119 |
679 | 메타 님께 여쭙습니다. [5] | nanim | 2015.07.23 | 4428 |
678 | 예비회원 승인문제 [1] | Pi | 2015.07.22 | 4113 |
677 | 하루가 지났는데도.. 아직 흥분이 다 가라안지는 않네요... 아니 그냥 뭐.. 그러네요.. 기분도 붕 뜨고 ㅎㅎㅎ [9] | 불량양파 | 2015.07.15 | 4317 |
676 | tex 사용 후 코딩 실력이 늘었네요 ... [2] | tex_초보자... | 2015.07.14 | 4107 |
675 | 그리고 보니 KTS 마스코트 이름이 메타네요 [2] | 메타 | 2015.07.02 | 4112 |
674 | 바퀴 [2] | yihoze | 2015.06.29 | 4112 |
673 | 표준자판 유감 [6] | 세벌 | 2015.06.29 | 4051 |
672 | 오랜만에 방문한 소감 [14] | 옛날 세벌 | 2015.06.27 | 8017 |
671 | 텍의 노드(node) [10] | JangNa | 2015.06.27 | 4120 |
670 | 스타일 파일을 찾아 열기 [2] | yihoze | 2015.06.26 | 4566 |
669 | 설문 [4] | yihoze | 2015.06.26 | 4146 |
어떻게 하면 최대한 간결하게 입력할 수 있을까 생각해봤습니다.
결국 위에서 제시하신 코드의 재배열에 불과합니다만.
\begin{istgame}
\istroot{Child}
\istbranch{Good}
\istbranch{Bad}[r]
\istdone