不同环境中的格式化

不同环境中的格式化

我正在寻找有关如何格式化此文本的更好的想法。例如,如何通过划分降低框文本级别

       \documentclass{article}
       \usepackage{tikz,amsmath,array,xcolor,tcolorbox}
        \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
       \begin{document}
 \begin{center}
 $\begin{tabular}{r@{}l@{}c@{}c@{}c@{}c@{}c@{}l@{}c@{}}
     &        & & & &  && \tikzmark{C1}\begin{tcolorbox}[width=6cm, 
      colframe=black, colback=orange!25!white, arc=3mm] Recall that $3660$ 
      is called the  \\ dividend \end{tcolorbox}\\
      &        & &2&8&1 &&  \\ \cline{2-6} \\ [-12.3pt]
      13&\big )&3&6&6\tikzmark{a}&0\tikzmark{c} && \\
       &        &2&6& & &\phantom{xxxx}&\color{blue}{\text{$2 \cdot 13 = 
       26$}}\\ \cline{3-4} 
        &        &1&0&6\tikzmark{b}& &\phantom{xxxx}&\color{blue} 
      {\text{Subtract and bring down the next digit in the dividend}}\\ 
        &        &1&0&4& &\phantom{xxxx}&\color{blue}{\text{$8 \cdot 13 = 
       104$}} \\ \cline{3-5} 
          &        & & &2&0\tikzmark{d}&\phantom{xxxx}&\color{blue} 
       {\text{\text{Subtract and bring down the next digit in the 
       dividend}}}\\   
       &        & & &1&3 &\phantom{xxxx}&\color{blue}{\text{$1 \cdot 13 =     
   13$}} \\ \cline{5-6} 
       &        & & & &7 &\phantom{xxxx}&\color{blue}{\text{\text{Subtract. 
     There are no more digits to bring down, so the remainder is $7$.}}}
     \end{tabular}$
    \begin{tikzpicture}[overlay,remember 
     picture]%,out=65,in=110,distance=.6cm]
       \draw[->,blue,thick,smooth,shorten >=1pt,shorten <=1pt] 
     ([xshift=-2pt,yshift=3pt]a.south) to ([xshift=-2pt,yshift=3pt]b.north);
           \draw[->,blue,thick,smooth,shorten >=1pt,shorten <=1pt] 
      ([xshift=-2pt,yshift=3pt]c.south) to 
      ([xshift=-2pt,yshift=3pt]d.north);
           \draw[->] (C1)--(c);
      \end{tikzpicture}
     \end{center}
           \end{document}

在此处输入图片描述

我的目标是复制:

在此处输入图片描述

答案1

这用于\raisebox定位tcolorbox并隐藏其高度(但不隐藏其深度)tabular。请注意此处和原始版本中 26 上方的超大间隙。

\documentclass{article}
       \usepackage{tikz,amsmath,array,xcolor,tcolorbox}
        \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
       \begin{document}
 \begin{center}
 $\begin{tabular}{r@{}l@{}c@{}c@{}c@{}c@{}c@{}l@{}c@{}}
     &        & & & &  && \\
      &        & &2&8&1 &&   \\ \cline{2-6} \\ [-12.3pt]
      13&\big )&3&6&6\tikzmark{a}&0\tikzmark{c} &&\tikzmark{C1}\raisebox{-9pt}[0pt]{%
      \begin{tcolorbox}[width=6cm,
      colframe=black, colback=orange!25!white, arc=3mm] Recall that $3660$ 
      is called the  \\ dividend \end{tcolorbox}} \\
       &        &2&6& & &\phantom{xxxx}&\color{blue}{\text{$2 \cdot 13 = 
       26$}}\\ \cline{3-4} 
        &        &1&0&6\tikzmark{b}& &\phantom{xxxx}&\color{blue} 
      {\text{Subtract and bring down the next digit in the dividend}}\\ 
        &        &1&0&4& &\phantom{xxxx}&\color{blue}{\text{$8 \cdot 13 = 
       104$}} \\ \cline{3-5} 
          &        & & &2&0\tikzmark{d}&\phantom{xxxx}&\color{blue} 
       {\text{\text{Subtract and bring down the next digit in the 
       dividend}}}\\   
       &        & & &1&3 &\phantom{xxxx}&\color{blue}{\text{$1 \cdot 13 =     
   13$}} \\ \cline{5-6} 
       &        & & & &7 &\phantom{xxxx}&\color{blue}{\text{\text{Subtract. 
     There are no more digits to bring down, so the remainder is $7$.}}}
     \end{tabular}$
    \begin{tikzpicture}[overlay,remember 
     picture]%,out=65,in=110,distance=.6cm]
       \draw[->,blue,thick,smooth,shorten >=1pt,shorten <=1pt] 
     ([xshift=-2pt,yshift=3pt]a.south) to ([xshift=-2pt,yshift=3pt]b.north);
           \draw[->,blue,thick,smooth,shorten >=1pt,shorten <=1pt] 
      ([xshift=-2pt,yshift=3pt]c.south) to 
      ([xshift=-2pt,yshift=3pt]d.north);
           \draw[->] (C1.north west)--(c.north east);
      \end{tikzpicture}
     \end{center}
\end{document}

演示

相关内容