我尝试使用下面的代码,但没有得到预期的结果。
$\stackon{0}{\scriptstyle\curvearrowleft}~
\stackon[2pt]{1}{\scriptstyle\curvearrowleft}~
\stackon[1pt]{0}{\scriptstyle\curvearrowleft}$
我怎样才能得到我需要的结果?
添加:
\documentclass{article}
\usepackage{amssymb} % for '\curvearrowleft' macro
\usepackage{amsmath} % for '\overset' macro
\usepackage{stackengine}
\stackMath
\renewcommand\useanchorwidth{T}
\begin{document}
$\stackon{0}{\scriptstyle\curvearrowleft}~
\stackon[2pt]{1}{\scriptstyle\curvearrowleft}~
\stackon[1pt]{0}{\scriptstyle\curvearrowleft}$
\end{document}
答案1
我会使用 TikZ matrix of math nodes
:
\documentclass[10pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, matrix}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\matrix[
matrix of math nodes,
nodes in empty cells,
row sep=4pt,
column sep=4pt,
] (mymatr) {
1& 0 &1 &0 &1 &0 &1& 0& 1\\
&+&1& 0& 1&0& 1& 0& 1\\
1& 0 &1 &0& 1& 0& 1& 0& 1\\
};
\draw ([yshift=-2pt]mymatr-2-1.south west) -- ([yshift=-2pt]mymatr-2-9.south east);
\draw[-Latex] (mymatr-1-4.north) to[in=90, out=90, looseness=2] node[midway, above, font=\footnotesize]{$1$} (mymatr-1-3.north);
\end{tikzpicture}
\end{document}
答案2
这是我使用 tikz 时遇到的问题的部分解决方案。如果有其他解决方案,我们将不胜感激。
\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm,trim left=0pt, trim right=0pt]
\draw (3.3,4) node {1 0 1 0 1 0 1 0 1};
\draw (3.25,3.6) node {\quad+\,1 0 1 0 1 0 1 };
\draw (1.8,3.35)-- (4.8,3.35);
\draw (3.3,3.1) node {1 0 1 0 1 0 1 0 1};
\draw [ -latex] (3.07,4.3) to [bend right] (2.7,4.3);
\begin{scriptsize}
\draw (2.93,4.55) node {$1$};
\end{scriptsize}
\end{tikzpicture}
\end{document}
输出: