4

In my document, I need to increase \spaceskip in order to inject more space between words to make them more readable. However, the setting does not seem to apply to text that's inside a TikZ node:

\documentclass{article}
\usepackage{tikz}

\spaceskip 2ex

\begin{document}
  \noindent
  a b c\\
  \tikz{%
    \node [inner sep=0, outer sep=0] {%
      a b c%
    };
  }%
\end{document}

enter image description here

How can I get my customized word-spacing to work even inside TikZ nodes?

9

At the beginning of each tikzpicture, TikZ selects nullfont and sets \spaceskip to zero. Then, in each node content, TikZ resets \spaceskip to .3333em.

Here is a solution:

\documentclass{article}
\usepackage{tikz}
\spaceskip 2ex
\tikzset{every node/.style={execute at begin node={\spaceskip 2ex}}}
\begin{document}
  \noindent
  a b c\\
  \tikz{%
    \node [inner sep=0, outer sep=0] {%
      a b c%
    };
  }%
\end{document}
  • Ingenious! Can't believe it was that simple. =) – gablin Nov 21 '14 at 16:59
  • Mmm… still it would be nice to know why is that necessary. – Manuel Nov 21 '14 at 20:45
  • @Manuel I edited my answer. – Paul Gaborit Nov 22 '14 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.