考试选择中的 Tikz QTree 渐变边缘

考试选择中的 Tikz QTree 渐变边缘

在考试中,Tikz 用渐变绘制了一些(垂直)QTree 边缘。我发现,只有当 tikzpicture 是选择的一部分并且不居中时,才会发生这种情况。

例如,此图形重复三次,但只有中间实例具有渐变边缘:

\usepackage[utf8x]{inputenc}

\usepackage{tikz}
\usepackage{tikz-qtree}

\tikzstyle{impTreePos} = [draw,circle, fill,inner sep=2pt]
  
%tikz command to set up impartial trees (using tikz-qtree package)
\newcommand{\impartialTreeTikzStyling}{%
  %\tikzstyle{every node}=[draw, circle]
  \tikzset{edge from parent/.style=
    {draw,
     edge from parent path={(\tikzparentnode.south)
                            -- +(0,-8pt)
                            -| (\tikzchildnode)}}}
}

\newcommand{\drawSampleTree}{%
    \begin{tikzpicture}
        \tikzset{level distance=30pt}
        \tikzset{sibling distance=15pt}
        \tikzset{every tree node/.style={align=center, impTreePos}}
        
        \impartialTreeTikzStyling
        
        \Tree 
        [.{}
            [.{} ]]
    \end{tikzpicture}
}


\begin{document}

\drawSampleTree %no gradient

\begin{questions}
            
\question

Question

\begin{choices}
\choice 
\drawSampleTree %gradient!!!!!!!

\choice 
\begin{center}\drawSampleTree\end{center} %no gradient
\end{choices}

\end{questions}
\end{document}

中间的图有渐变边缘

我不想要这些渐变边缘。我该怎么做才能使它们变得坚固?

答案1

相同的代码不再导致渐变边缘。(这与一年前提出问题时在不同的计算机上编译。)

\usepackage[utf8x]{inputenc}

\usepackage{tikz}
\usepackage{tikz-qtree}

\tikzstyle{impTreePos} = [draw,circle, fill,inner sep=2pt]
  
%tikz command to set up impartial trees (using tikz-qtree package)
\newcommand{\impartialTreeTikzStyling}{%
  %\tikzstyle{every node}=[draw, circle]
  \tikzset{edge from parent/.style=
    {draw,
     edge from parent path={(\tikzparentnode.south)
                            -- +(0,-8pt)
                            -| (\tikzchildnode)}}}
}

\newcommand{\drawSampleTree}{%
    \begin{tikzpicture}
        \tikzset{level distance=30pt}
        \tikzset{sibling distance=15pt}
        \tikzset{every tree node/.style={align=center, impTreePos}}
        
        \impartialTreeTikzStyling
        
        \Tree 
        [.{}
            [.{} ]]
    \end{tikzpicture}
}


\begin{document}

\drawSampleTree %no gradient

\begin{questions}
            
\question

Question

\begin{choices}
\choice 
\drawSampleTree %no gradient

\choice 
\begin{center}\drawSampleTree\end{center} %no gradient
\end{choices}

\end{questions}
\end{document}````

相关内容