TransWikia.com

Draw table using TikZ in LaTeX

TeX - LaTeX Asked by kili on July 24, 2021

What would be a minimal TikZ example to draw the following?

Enter image description here

I am currently doing this with tables, but I would like to see how it can be done with TikZ.

4 Answers

documentclass[border=5pt]{standalone}
usepackage{tikz}

begin{document}
    sf
    
    begin{tikzpicture}
        tikzset{bignode/.style={
                        minimum width=90pt,
                        minimum height=70pt,
                        draw}}
        node[bignode] (S) {satisfiable};
        node[bignode, anchor=west] at (S.east) (U) {unsatisfiable};
        node[draw,below=15pt] at (S.center) (V) {valid};
    
    end{tikzpicture}

end{document}

satisfiable

Correct answer by SebGlav on July 24, 2021

enter image description here

documentclass{article}
usepackage{tikz}
usetikzlibrary{shapes}
begin{document}

begin{tikzpicture}
  draw (0,0) ellipse (3 and 1);
  draw (0,-1) -- (0,1);
  node at (-1,0.5) {satisfiable};
  node at (1.5,0) {unsatisfiable};
  node[ellipse,draw] at (-2,-0.2) {valid};
end{tikzpicture}

end{document}

Answered by gernot on July 24, 2021

enter image description here

documentclass[border=5pt]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, fit}

begin{document}
    sf
    
    begin{tikzpicture}
        node[] (S) {satisfiable};
        node[right=0.3cm of S] (U) {unsatisfiable};
        node[draw,below=0.2cm of S] (V) {valid};
        node[draw, fit=(S)(U)(V)]{};
        node[draw, fit=(S)(V)]{};
    end{tikzpicture}
    
end{document}

Answered by js bibra on July 24, 2021

documentclass[tikz, border=2mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
    matrix[matrix of nodes, nodes={minimum size=3cm, draw, font=sffamily}, 
            column sep=-pgflinewidth]
    {|[label={[draw, anchor=south, outer sep=2mm, minimum size=0mm]below:valid}]|satisfiable & unsatisfiable};
end{tikzpicture}
end{document}

enter image description here

Answered by Ignasi on July 24, 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