我定义了一个命令 \kr 来绘制一个小圆圈,将其用作字母。后来我想取消一个圆圈。但取消线在背景中,见图。我怎样才能使取消线位于前景中?
代码:
\documentclass{beamer}
\usepackage{tikz}
\usepackage{cancel}
\newcommand*\kr[1]{%
\begin{tikzpicture}[baseline=(C.base),inner sep=0pt,minimum size=0pt]
\node (C) {\phantom{a}};
\node[fill=#1!50,draw,circle,minimum size=0.3cm] (C.center) {};
\end{tikzpicture}}
\begin{document}
\kr{green} \cancel{\kr{green}}
\end{document}
答案1
也许是这样的:
\documentclass{beamer}
\usepackage{tikz}
\usepackage{cancel}
\newcommand*\kr[1]{%
\begin{tikzpicture}[baseline=(C.base),inner sep=0pt,minimum size=0pt]
\node (C) {\phantom{a}};
\node[fill=#1!50,draw,circle,minimum size=0.3cm] (C.center) {};
\end{tikzpicture}}
\newcommand*\mycancel[1]{\makebox{\rlap{#1}\cancel{\phantom{#1}}}}
\begin{document}
\kr{green} \mycancel{\kr{green}}
\end{document}