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 5820 times

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
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