성장 오른쪽으로 계수 나무를 그린 다음 그림에 표시된 페이지의 오른쪽(또는 왼쪽)에 배치합니다.

성장 오른쪽으로 계수 나무를 그린 다음 그림에 표시된 페이지의 오른쪽(또는 왼쪽)에 배치합니다.

오른쪽으로 성장한 다음 그림에 표시된 페이지의 오른쪽(또는 왼쪽)에 배치된 계수 나무를 그리는 방법에 대한 tikz(또는 기타 라텍스 도구)에 대한 도움이 필요합니다.

여기에 이미지 설명을 입력하세요

답변1

이것은 단지 계산 트리를 그리는 방법에 관한 것입니다.이스트게임패키지:

여기에 이미지 설명을 입력하세요

\documentclass{article}
    
\usepackage{istgame}

\begin{document}

%% tree
\begin{istgame}[scale=.7,font=\scriptsize]
\tikzset{oval node/.style={ellipse node,draw=none}}
\setistgrowdirection'{east}
\xtdistance{14mm}{60mm}
\istrooto(A){start}   \istb \istb \istb \endist
\xtdistance{12mm}{20mm}
\istrooto(0)(A-1){0}  \istb \istb \istb \endist
\istrooto(1)(A-2){1}  \istb \istb \istb \endist
\istrooto(2)(A-3){2}  \istb \istb \istb \endist
\xtdistance{10mm}{10mm}
\istrooto(00)(0-1){0}
  \istb{}{0 \quad 2^03^07^0=1}
  \istb{}{1 \quad 2^03^07^1=7}
  \endist
\istrooto(01)(0-2){1}
  \istb{}{0}
  \istb{}{1}
  \endist
\istrooto(02)(0-3){2}
  \istb{}{0}
  \istb{}{1}
  \endist
\istrooto(10)(1-1){0}
  \istb{}{0}
  \istb{}{1}
  \endist
\istrooto(11)(1-2){1}
  \istb{}{0}
  \istb{}{1}
  \endist
\istrooto(12)(1-3){2}
  \istb{}{0}
  \istb{}{1}
  \endist
\istrooto(20)(2-1){0}
  \istb{}{0}
  \istb{}{1}
  \endist
\istrooto(21)(2-2){1}
  \istb{}{0}
  \istb{}{1}
  \endist
\istrooto(22)(2-3){2}
  \istb{}{0 \quad 2^23^27^0=36}
  \istb{}{1 \quad 2^23^27^1=252}
  \endist

\node [anchor=mid] at ([yshift=-1.3cm,xshift=-1.2cm]22) {a};
\node [anchor=mid] at ([yshift=-1.3cm]22) {b};
\node [anchor=mid] at ([yshift=-1.3cm,xshift=1.3cm]22) {c};
\end{istgame}

\end{document}

답변2

~와 함께forest

\documentclass[margin=3mm]{standalone}
\usepackage{forest}
\usetikzlibrary{positioning}

\begin{document}
    \begin{forest}
for tree = {font=\scriptsize,
            anchor=west,
            math content,
            grow'=0,
            s sep=2mm,
            l sep=7mm
            }
[start
    [0
        [0  [0\quad {2^{0} 3^{0} 7^{0}=1}]
            [1\quad {2^03^07^1=7}]
        ]
        [1  [0] [1]
        ]
        [2  [0] [1]
        ]
    ]
    [1
        [0  [0] [1]
        ]
        [1  [0] [1]
        ]
        [2  [0] [1]
        ]
    ]
    [2, name=aux1
        [0  [0] [1]
        ]
        [1  [0] [1]
        ]
        [2, name=aux2  
            [0\quad {2^{2}3^{2}7^{0}=36}] 
            [1\quad {2^{2}3^{0}7^{1}=252}, name=aux3]
        ]
    ]
]
\node (a) [below,xshift=5pt]   at (aux3.south west)   {c};
\node               at (aux2 |- a)   {b};
\node               at (aux1 |- a)   {a};
   \end{forest}
\end{document}

여기에 이미지 설명을 입력하세요

문서에 배치하려면 먼저 문서의 예(더미 텍스트 포함)를 보여야 합니다. 위의 이미지가 표시된 도형을 올바른 위치에 삽입하면 간단합니다.

관련 정보