TransWikia.com

How can I draw the table in LaTeX?

TeX - LaTeX Asked by ANUKUMAR on May 11, 2021

Enter image description here

How can I draw the table in LaTeX? Particularly the content bottom of the table?

2 Answers

You can do that with an ordinary array and pstricks: I defined the last elements in columns 5 and 8 as rnodes and connected with the relevant node connection. Note that the pstricks part of the code, used this way, has no dimension for latex, so I added a supplementary row containing only a vertical space, to prevent any overlapping with the following text.

documentclass{article}
usepackage{array}
usepackage{bm}
usepackage[semibold, condensed]{cabin}
usepackage[usestackEOL]{stackengine}
usepackage{pst-node}

begin{document}

[
setlength{extrarowheight}{3pt}
begin{array}{ |*{8}{c|}}
hline
bm{A} & bm{B} & bm{C} & bm{Bcap C}& bm{A cup ∪ (B cap C)}& bm{A cup B}& bm{A cup C}& bm{(A cup B)cap(A cup C)} 
hline
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 
0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 
0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 
0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 
1 & 0 & 0 & 0 & 1 & 1 & 1 & 1 
1 & 0 & 1 & 0 & 1 & 1 & 1 & 1 
1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 
1 & 1 & 1 & 1 & rnode{A}{1} & 1 & 1 & rnode{B}{1} 
hline
multicolumn{8}{c}{vspace{4ex}}%
ncbar[linewidth=0.6pt, arrows=<->, arrowinset=0.12,angle=-90, nodesep=1.5ex]{A}{B}
nbput{sffamilybfseriessmall Shortunderstack{Since these columns are identical, we conclude %
 that $;bm{Acup(Bcap C)=(A cup B) cap (A cup C)}$}}
end{array}
]

end{document} 

enter image description here

Answered by Bernard on May 11, 2021

Let me extend my comment to answer:

documentclass{article}
usepackage{bm}
usepackage{tikz}
usetikzlibrary{arrows.meta,
                tikzmark}
usepackage{lipsum}

begin{document}
[
renewcommandarraystretch{1.2}
begin{array}{ |*{8}{c|}}
    hline
bm{A} & bm{B} & bm{C} & bm{Bcap C}& bm{Acup (Bcap C)}
    & bm{Acup B} & bm{Acup C} & bm{(Acup B)cap (A cup C)} 
    hline
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 
0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 
0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 
0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 
1 & 0 & 0 & 0 & 1 & 1 & 1 & 1 
1 & 0 & 1 & 0 & 1 & 1 & 1 & 1 
1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 
1 & 1 & 1 & 1 & tikzmarknode{a}{1} 
                  & 1 & 1 & tikzmarknode{b}{1} 
hline
end{array}
vspace{4baselineskip} % <--- space for arrow
tikz[>=Straight Barb, overlay,remember picture]%
{
draw[<->, semithick, shorten <=2ex, shorten >=2ex]
    (a) -- ++ (0,-1) -|
    node[align=center,font=bfseries, pos=0.25, below]
        {Since these columns are identical, we conclude %
         that $;bm{Acup(Acap C)=(Acup B)cap (Acup C)}$}
                        (b); 
}
]
lipsum[1]
end{document} 

enter image description here

Answered by Zarko on May 11, 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