TransWikia.com

Adding Binary Overflow Character

TeX - LaTeX Asked by Alexander Michalak on February 28, 2021

How would I show a 1 carry over an empty space?

Such as this;

enter image description here

Currently I have this as code;

usepackage{array,mathtools}
newcommand*{carry}[1][1]{overset{#1}}
newcolumntype{B}[1]{r*{#1}{@{,}r}}

[
begin{array}{B3}
    carry 0 carry 1 carry 11 
      {} + 0101  hline
           1100 
end{array}
]

When I use carry carry, I get an error.

One Answer

The following solution employs an array environment.

enter image description here

documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{array,xcolor}
newcommandcy{scriptstyletextcolor{blue}{1}} % short for "carry"

begin{document}
[
setlengtharraycolsep{0pt}
begin{array}{*{6}{c}}
  & cy & cy &     & cy &   [-0.8ex]
  &     &   1 &   1 &   0 & 1 
+ &     &   0 &   1 &   0 & 1  
hline
  &   1 &   0 &   0 &   1 & 0 
end{array}
]
end{document}

Correct answer by Mico on February 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP