我想用自定义颜色为表格中的所有数学题着色。但是,在使用时,该命令似乎\RowStyle{\colorInlinedMath}
在序言选项中不起作用@
定义\colorInlinedMath
\newcommand{\colorInlinedMath}{\everymath{\color{SpringGreen3}}\sisetup{color=SpringGreen3}}
可以放置\RowStyle{\colorInlinedMath}
在所有行之前,但这是多余的
\documentclass[aspectratio=169, xcolor={x11names}, t]{beamer}
\usetheme{Dresden}
\usepackage{siunitx}
\usepackage{nicematrix}
\newcommand{\colorInlinedMath}{\everymath{\color{SpringGreen3}}\sisetup{color=SpringGreen3}}
\begin{document}
\begin{frame}
\begin{itemize}
\item In the following figure
\begin{NiceTabularX}{\linewidth}{@{\RowStyle{\colorInlinedMath}}r X[l]@{}}
$(a)$ & magnetic domains are oriented randomly
\\
$(b)$ & magnetic domains are magnetized
\\
$(c)$ & magnetic domains are fully magnetized
\\
\end{NiceTabularX}
\end{itemize}
\end{frame}
\end{document}
答案1
编辑:
我猜你喜欢表格中的所有数学表达式都采用选定的颜色。这可以简单地\everymath{\color{...}}
在表格中插入组中完成:
\documentclass[aspectratio=169, xcolor={x11names}, t]{beamer}
\usetheme{Dresden}
\usepackage{siunitx}
\usepackage{nicematrix}
\begin{document}
\begin{frame}
\begin{itemize}
\item In the following figure
{\everymath{\color{SpringGreen3}} % <---
\begin{NiceTabularX}{\linewidth}{@{} rX[l] @{}}
$(a)$ & magnetic domains are oriented randomly \\
$(b)$ & magnetic domains are magnetized \\
$(c)$ & magnetic domains are fully magnetized \\
\end{NiceTabularX}
}
\end{itemize}
\end{frame}
\end{document}