如何在字符串周围绘制椭圆形圆圈?例如,当我有“1,3,4,6”时,如何将它们放在一个圆圈中?
答案1
该shapes.misc
库提供了rounded rectangle
形状。您还可以使用该shadows
库添加阴影。
\documentclass[border=3pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.misc,shadows}
\begin{document}
\begin{tikzpicture}[baseline=(char.base)]
\node(char)[draw,fill=white,
shape=rounded rectangle,
drop shadow={opacity=.5,shadow xshift=0pt},
minimum width=1.8cm]
{1,3,4,6};
\end{tikzpicture}
\end{document}
答案2
我发现这段代码对我来说运行良好。
\usetikzlibrary{arrows}
\usetikzlibrary{shapes}
\newcommand{\mymk}[1]{%
\tikz[baseline=(char.base)]\node[anchor=south west, draw,rectangle, rounded corners, inner sep=2pt, minimum size=7mm,
text height=2mm](char){\ensuremath{#1}} ;}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
Hello, \mymk{1,2,3,4,5} world \circled{1}
答案3
为了比较,这里有一个 ConTeXt 解决方案:
\defineframed
[roundframed]
[
corner=round,
location=low,
loffset=0.1em,
roffset=0.1em,
]
\starttext
Hello \roundframed{1,2,3,4} world.
\stoptext
这使