1

I am trying to draw a simple tree in Beamer using tikz-qtree. To signal that the a branch of the tree I am drawing continues to infinity, I want one of the last node to be \ldots. However, because the other node at the same level is made of text, the edge draws has lines of different length, while I would like the lines to be of the same length. Would you know how to correct that? Many thanks for your help.

Here is a minimal working example:

\documentclass[10pt]{beamer}
\usepackage{tikz}
\usepackage{tikz-qtree} 
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
    \centering
    \begin{tikzpicture}
            \Tree [.{} 1 
                    [.2 1 
                        [.2 1 {\ldots} ]]]
    \end{tikzpicture}
\end{frame}

\end{document}
2
  • 1
    You could change it to {\vphantom{1}\ldots}. \vphantom{1} gives no output but takes the same vertical space as if 1 was there.
    – Celdor
    Sep 27, 2022 at 9:51
  • Welcome to TeX.SE!
    – Zarko
    Sep 27, 2022 at 10:17

1 Answer 1

1

If this is just one example, {\vphantom{1}\ldots} would give you correct output for this particular case. If you have more than one similar example, it is better to add global settings regarding each node

enter image description here

\documentclass[10pt]{beamer}
\usepackage{tikz}
\usepackage{tikz-qtree}
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
  \centering
  \begin{tikzpicture}[
      text height=6pt,
      inner ysep=5pt,
      outer sep=0pt,
    ]
    \Tree [.{} 1
    [.2 1
    [.2 1 {\ldots} ]]]
  \end{tikzpicture}
\end{frame}

\end{document}
1
  • Many thanks for your help!
    – Guilhem
    Sep 27, 2022 at 13:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .