答案1
如果这种变体在某个地方不存在,我会感到惊讶,但这里有一种方法可以用 Ti 绘制这样的东西钾Z。
\documentclass{article}
\usepackage{tikz}
\definecolor{mygreen}{RGB}{203,222,158}
\definecolor{myblue}{RGB}{144,206,244}
\newcommand{\FFcolorbox}[2][]{\begin{tikzpicture}[FF/.cd,
Fcol/.code={\colorlet{fcol}{##1}},Fcol=myblue,
a/.initial=0.5ex,w/.initial=2em,h/.initial=2em,#1]
\def\pv##1{\pgfkeysvalueof{/tikz/FF/##1}}%
\node[minimum width=\pv{w},minimum height=\pv{h},fill=fcol,
align=center,outer sep=0pt](F){#2};
\path[left color=fcol,right color=white,shading angle=180]
(F.north west) -- ++ (-\pv{a},\pv{a}) --
([xshift=\pv{a},yshift=\pv{a}]F.north east) -- (F.north east);
\path[left color=fcol,right color=white,shading angle=-90]
(F.north west) -- ++ (-\pv{a},\pv{a}) --
([xshift=-\pv{a},yshift=-\pv{a}]F.south west) -- (F.south west);
\path[left color=fcol,right color=gray!50!black,shading angle=0]
(F.south west) -- ++ (-\pv{a},-\pv{a}) --
([xshift=\pv{a},yshift=-\pv{a}]F.south east) -- (F.south east);
\path[left color=fcol,right color=gray!50!black,shading angle=90]
(F.south east) -- ++ (\pv{a},-\pv{a}) --
([xshift=\pv{a},yshift=\pv{a}]F.north east) -- (F.north east);
\end{tikzpicture}}
\begin{document}
\FFcolorbox[Fcol=mygreen]{Fe}\quad\FFcolorbox{C}\quad\FFcolorbox{P}\quad\FFcolorbox{O}
\end{document}
将其变为 很简单tcolorbox
。
\documentclass{article}
\usepackage[skins]{tcolorbox}
\definecolor{mygreen}{RGB}{203,222,158}
\definecolor{myblue}{RGB}{144,206,244}
\tcbset{Fcol/.code={\colorlet{fcol}{#1}}}
\newtcbox{\Embossed}[1][]{enhanced,Fcol=myblue,sharp corners,
width=2em-2pt,height=2em-0.5ex-1pt,boxrule=0pt,left=1pt,right=1pt,top=0.7ex,bottom=1pt,
on line,#1,colback=fcol,
frame code={
\path[left color=fcol,right color=white,shading angle=180]
(frame.north west) -- ++ (-0.5ex,0.5ex) --
([xshift=0.5ex,yshift=0.5ex]frame.north east) -- (frame.north east);
\path[left color=fcol,right color=white,shading angle=-90]
(frame.north west) -- ++ (-0.5ex,0.5ex) --
([xshift=-0.5ex,yshift=-0.5ex]frame.south west) -- (frame.south west);
\path[left color=fcol,right color=gray!50!black,shading angle=0]
(frame.south west) -- ++ (-0.5ex,-0.5ex) --
([xshift=0.5ex,yshift=-0.5ex]frame.south east) -- (frame.south east);
\path[left color=fcol,right color=gray!50!black,shading angle=90]
(frame.south east) -- ++ (0.5ex,-0.5ex) --
([xshift=0.5ex,yshift=0.5ex]frame.north east) -- (frame.north east);
},
}
\begin{document}
\Embossed[Fcol=mygreen]{Fe}\quad\Embossed{C}\quad\Embossed{P}\quad\Embossed{O}
\end{document}