Graphics, Figures & Tables ⇒ Creating a Diagram
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: Creating a Diagram
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Creating a Diagram

Code: Select all
\Tree [.first second1}
[.second2 third1}
third2 ]]
- Attachments
-
- diagram2.JPG (14.15 KiB) Viewed 4511 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Creating a Diagram
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Creating a Diagram
Code: Select all
\Tree [.first second1}
[.second2 third1}
third2 ]]

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Creating a Diagram
No, you did not. Regardless of that please follow the link in my last reply and provide a self-contained and minimal example. Otherwise this discussion is academic. And reading the qtree manual can't do any harm.steFON wrote:I wrote above, that I use package: qtree […]
By the way, there is an equivalent tikz-qtree package, now that you are doing the other diagram with PGF/TikZ.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Creating a Diagram
Creating a Diagram
Packages:
Code: Select all
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usetikzlibrary{positioning}
\usetikzlibrary{trees}
\begin{document}
\begin{center}
\begin{tikzpicture}[sibling distance=40pt]
\tikzset{edge from parent/.style=
{draw,
edge from parent path={(\tikzparentnode.south)
-- +(0,-8pt)
-| (\tikzchildnode)}}}
\Tree [.\textrm{} [.$x_2=1$ ]
[.$x_2\neq1$ [.$x_2=2$ ]
[.$x_2\neq2$ [.$x_2=3$ ]
[.$x_2=4$ ] ] ] ]
\end{tikzpicture}
\end{center}
\end{document}