3

I keep getting this error and I am not sure what I am doing wrong.

\documentclass{report}
\usepackage{forest} %Required for trees
\usepackage{tikz}


\begin{document}

\begin{figure}

    \forestset{
  L2/.style={draw=blue,},
  L1/.style={,edge={,line width=0.9pt}},
}

\tikzset{%
  L1/.style={draw=blue},
  L2/.style={line width=0.9pt},
}%

\begin{center}

\begin{forest}
  for tree={
    grow'=0,
    parent anchor=children,
    child anchor=parent,
    edge+=L2,
    outer sep=+1pt,
    rounded corners,
    minimum width=19mm,
    minimum height=7mm,
    l sep' =31mm,
    s sep' =21mm
  }
  [S1, L1
    [aS1, L2, edge label={node[midway,fill=white,font=\scriptsize]{p1}}]

    [aS1, L2, edge label={node[midway,fill=white,font=\scriptsize]{p2}}]
  ]
\end{forest}


\bigskip


t=0~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~t=1
\end{center}

\caption{googly}

\end{figure}


\end{document}

the last time I had this issue, I adjusted my labels to not include subscripts. Not too sure what is wrong here.

1
  • 1
    Don't use the center environment inside figure. It will screw up the spacing. Use \centering instead.
    – cfr
    Commented Jul 4, 2023 at 5:01

1 Answer 1

3

Remove the empty line in l.37:

\documentclass{report}
\usepackage{forest} %Required for trees
\usepackage{tikz}


\begin{document}

\begin{figure}

    \forestset{
  L2/.style={draw=blue,},
  L1/.style={,edge={,line width=0.9pt}},
}

\tikzset{%
  L1/.style={draw=blue},
  L2/.style={line width=0.9pt},
}%

\begin{center}

\begin{forest}
  for tree={
    grow'=0,
    parent anchor=children,
    child anchor=parent,
    edge+=L2,
    outer sep=+1pt,
    rounded corners,
    minimum width=19mm,
    minimum height=7mm,
    l sep' =31mm,
    s sep' =21mm
  }
  [S1, L1
    [aS1, L2, edge label={node[midway,fill=white,font=\scriptsize]{p1}}]
    [aS1, L2, edge label={node[midway,fill=white,font=\scriptsize]{p2}}]
  ]
\end{forest}


\bigskip


t=0~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~t=1
\end{center}

\caption{googly}

\end{figure}


\end{document}

enter image description here

You must log in to answer this question.

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