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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Creating a Diagram

Code: Select all
\Tree [.first second1}
[.second2 third1}
third2 ]]
- Attachments
-
- diagram2.JPG (14.15 KiB) Viewed 4554 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}