I have the following code:
\documentclass{article}
\usepackage{tikz}
\usepackage{graphicx}
\newlength{\cm}
\setlength{\cm}{1cm}
\newcommand\scalefactor{2}
\newcommand{\bintree}[5]{
\protect{\renewcommand\scalefactor{#5}}
\resizebox{\scalefactor\cm}{!}{%
\begin{tikzpicture}%
\draw (0,0)--(0,.5);%
\draw (0,.5)--(-.5,1);%
\draw (0,.5)--(.5,1);%
\node[below] at (0,0){#3};%
\node[above] at (-.5,1){#1};%
\node[above] at (.5,1){#2};%
\node[right] at (0,.4){#4};%
\end{tikzpicture}}}
\begin{document}
\bintree{$s$}{$s$}{$s$}{$*$}{1}
\bintree{$s$}{$s$}{$s$}{$*$}{3}
\end{document}
Unfortunately, it doesn't seem to work (I don't get the rescaling I would like). Here's what I obtain:
and nothing in the log. How can I fix the problem?