2

I am looking for better ideas on how to format this text. For example, how can I bring down the box text level with the division

       \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}

enter image description here

My goal is to replicate:

enter image description here

2
  • 1
    You may greatly benefit from adding a sketch of what you would like to achieve. I personally would put the division table in the center and then annotate the steps with TikZ. I would also refrain from using such prominent tcolorbox (which you forgot to load BTW) for a side remark. Then you got several answers to your previous questions, out of which you only accepted 2. Were the other answers really not acceptable? Even if you think so, you may at least have learned that there is the tikzmark library, which has a superior version of \tikzmark to offer, which I'd like to advertize here.
    – user121799
    Sep 17 '18 at 1:43
  • Hi Marmot , I will have to review my participation here. Thank you for your input. I would not say that any answer was unacceptable. I am not judging anyone. I added another image to the goal I was trying to replicate. Sep 17 '18 at 3:32
1

This uses \raisebox to position the tcolorbox and hide its height (but not its depth) from tabular. Note the extra large gap above 26 both here and in the original.

\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}

demo

2
  • I didn't realize the gap until I tried compiling myself. Maybe I would have to restructure the table to get the better division procedure in my original attempt. Thanks though Sep 17 '18 at 21:06
  • Reducing inner sep in the tcolorbox will help. Sep 17 '18 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.