How to do something like "inner sep west"? -- specify inner sep on just only one side

I'm wondering how to create a node with TikZ which has different inner separations/padding on each side.

Imagine something like this:

\node [inner xsep=10pt, draw=blue, very thick, rectangle] (box) {Some Text in here};
\node [fill=blue, text=white] at (box.west) {\MySymbol}


Now, the problem is that the text is too close to my symbol -- simply increasing "inner xsep" is not a good idea, because it would look awkward on the left side of the text node.

Any hints on how to increase the padding of the right side of the box?

Using \hspace* you can manually control the padding:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node [inner xsep=10pt, draw=blue, very thick, rectangle] (a) at (0,0) {\hspace*{20pt}Some Text in here};
\node [inner xsep=30pt, draw=blue, very thick, rectangle] (d) at (0,-1) {Some Text in here\hspace*{-20pt}};
\node [inner xsep=10pt, draw=blue, very thick, rectangle] (b) at (0,-2) {Some Text in here\hspace*{20pt}};
\node [inner xsep=30pt, draw=blue, very thick, rectangle] (c) at (0,-3) {\hspace*{-20pt}Some Text in here};
\end{tikzpicture}

\end{document}


• Thank you! This also works with \vspace for vertical padding. Dec 3 '18 at 20:51

I think that a more neat approach is to use xshift key. So you use xsep to define the width of a frame and xshift to align it.

• If I understand correctly, this does not shift the text inside a node, but the node position instead. A visual example would help to make this clear.
– John
Jul 26 '21 at 9:56