TransWikia.com

How do I represent a grid with few thick edges?

TeX - LaTeX Asked by Siva Jagadesh on December 9, 2020

enter image description here

How do I represent the following image in LaTeX? I could have done it using tikzpicture, however I wish to have few bold edges as described in the image (grid corresponding to time step k+1). I am not sure if that can be done using tikzpicture. Let me know how I can do this.

Thanks in advance!

2 Answers

A variant with array and boldline:

documentclass{article}
usepackage{array} 
usepackage{boldline}

begin{document}

begin{tabular}{|>{rule[-1mm]{0pt}{9mm}}m{5mm}|*{2}{>{centeringarraybackslash}m{5mm}|}}
hline
 & & 
 hlineclineB{2-2}{3}
  & multicolumn{1}{c V{3}}{A} & X 
hline
 & X & 
 hline
 multicolumn{3}{>{rule{0pt}{5mm}}c}{Time Step = k}
 end{tabular}

end{document} 

enter image description here

Correct answer by Bernard on December 9, 2020

Here are two possible solutions using a regular tabular in combination with the boldline package or using a tikz matrix:

enter image description here

documentclass{article}
usepackage{boldline} 

begin{document}
begin{tabular}{|c|c|c|}
  hline
    & x                          &     
  hline clineB{2-2}{2}
  x & multicolumn{1}{V{2}c|}{x} & x   
  hline
    & x                          &     
  hline
  multicolumn{3}{c}{text}
end{tabular}
end{document}

documentclass{article}
usepackage{tikz}
usetikzlibrary{fit,matrix}

begin{document}

begin{tikzpicture}[nodes in empty cells]
  matrix(table)[
  matrix of nodes,
  row sep =-pgflinewidth,
  column sep = -pgflinewidth,
  nodes={anchor=center,
         minimum width=0.5cm,
         minimum height=0.5cm, 
         fill=none, 
         draw=black},
  row 4/.style = {nodes={minimum height=0.75cm,
                         fill=none, 
                         draw=none}},
  ] 
  {
      & x &    
    x & x & x  
      & x &    
      &   &    
  };
  node[fit=(table-4-1)(table-4-3)]{text};
  draw [black, very  thick] (table-2-2.north east) -- (table-2-2.north west) -- (table-2-2.south west);
end{tikzpicture}

end{document}

Answered by leandriis on December 9, 2020

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