我有一个如下所示的投影仪框架。问题是当我绘制节点时A
,B
如何指定它们的大小?我希望它们都是边长为的正方形1.5cm
,并且文本位于正方形的中心。
\documentclass[xcolor=table,10pt,aspectratio=169]{beamer}
\usetheme{metropolis}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[beamer,customcolors]{hf-tikz}
\usepackage{booktabs} % Tables
\usepackage{tikz}
\usetikzlibrary{
arrows,
calc,
chains,
decorations,
decorations.text,
decorations.pathmorphing,
matrix,
overlay-beamer-styles,
positioning,
shapes,
tikzmark
}
\begin{document}
\begin{frame}{Obf}
\begin{center}
\begin{tikzpicture}[every text node part/.style={align=center}]
\node[draw] (A) {$C$};
\node[draw, right=3cm of A] (B) {$\mathsf{Obf}(C)$};
\node[above=1cm of A] (C) {$x$};
\node[below=1cm of A] (D) {$C(x)$};
\node[above=1cm of B] (E) {$x$};
\node[below=1cm of B] (F) {$C(x)$};
\draw[->] (C)--(A);
\draw[->] (A)--(D);
\draw[->] (E)--(B);
\draw[->] (B)--(F);
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}