Graphics, Figures & TablestikZ | Different Line Thickness in a split Node

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm

tikZ | Different Line Thickness in a split Node

Post by usr345 »

I have a splitted node. And wanted it to have ultra thick external border and thin internal. How to do it?

Code: Select all

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{shapes}

\begin{document}
  \begin{tikzpicture}[
    nodes={draw,ultra thick},
    rectangle split,
    rectangle split parts=2
  ]
    \node {
      top part
      \nodepart{second} bottom part
    };
  \end{tikzpicture}
\end{document}
Attachments
snapshot2.png
snapshot2.png (3.88 KiB) Viewed 5293 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

tikZ | Different Line Thickness in a split Node

Post by cgnieder »

Maybe there is another (and better?) way, but this works:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes}

\tikzset{
  outernode/.style={draw,ultra thick,inner sep=0},
  innernode/.style={inner sep=.3333em,draw,rectangle split,rectangle split parts=2}
  }
\newcommand\innernode[1]{\tikz\node[innernode]{#1};}

\begin{document}
  \begin{tikzpicture}
    \node[outernode]
     { \innernode {top part \nodepart{second} bottom part} } ;
  \end{tikzpicture}
\end{document}
Regards
site moderator & package author
usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm

tikZ | Different Line Thickness in a split Node

Post by usr345 »

cgnieder wrote:Maybe there is another (and better?) way, but this works
Yeah. Thx.
Post Reply