这是我的代码:
\tikzstyle{decision} = [diamond,
minimum width=2cm,
minimum height=1cm,
text centered,
draw=black,
fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{tikzpicture}
\node at (14.5,13)[decision,text centered, text width=1cm] {$$\sum_{k=1}^{N} A_k^\dagger A_k\stackrel{?}{=}1$$};
\end{tikzpicture}
如何将这个等式放在中间而不改变菱形的大小?
在@mickep 评论之后,我尝试使用 single$
和 with \displaystyle
,但仍然不适合菱形:
答案1
我猜你想要
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\tikzset{
decision/.style = {
diamond,
minimum width=2cm,
%minimum height=1cm,
draw=black,
fill=green!30,
},
arrow/.style = {thick,->,>=stealth},
}
\begin{document}
\begin{tikzpicture}
\node at (14.5,13) [decision] {%
$\displaystyle\sum_{k=1}^{N} A_k^\dagger A_k^{\vphantom{\dagger}}\overset{?}{=}1$%
};
\end{tikzpicture}
\end{document}
请注意,该功能\tikzstyle
已被弃用几年了。