需要标签中的椭圆:
\documentclass[9pt,handout,compress,rgb]{beamer}
\usepackage{amstext}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\begin{document}
\begin{frame}
\begin{center}
\begin{tabular}{c|ccc}
& $M_1$ & \cdots & $M_n$\\
\hline\\
$W_1$ & & & \\
\vdots & & \ddots & \\
$W_m$ & & &
\end{tabular}
\end{center}
\end{frame}
\end{document}
我想要以下内容(带有更窄的椭圆):
答案1
这里可以使用nicematrix
和TikZ
库fit
(用于拟合)和(用于椭圆节点)。您可以通过更改来shapes.geometric
调整椭圆。minimum size=
myellipse
使用时记得编译两次nicematrix
。
\documentclass[9pt,handout,compress,rgb]{beamer}
\usepackage{amstext}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{fit, shapes.geometric}
\usepackage{nicematrix}
\tikzset{myellipse/.style={draw, red, very thick, ellipse, fit=#1, minimum size=3mm, inner sep=0pt}}
\begin{document}
\begin{frame}
\[
\begin{NiceArray}{c|ccc}
& M_1 & \cdots & M_n\\
\hline\\
W_1 & & & \\
\vdots & & \ddots & \\
W_m & & &
\CodeAfter
\begin{tikzpicture}
\node[myellipse=(3-|2.5)(5.5-|2.5)] {};
\node[myellipse=(3-|4.5)(5.5-|4.5)] {};
\node[myellipse=(3.5-|2.5)(3.5-|4.5)] {};
\node[myellipse=(5.5-|2.5)(5.5-|4.5)] {};
\end{tikzpicture}
\end{NiceArray}
\]
\end{frame}
\end{document}