When I am drawing illustrations with TikZ, the most common mistake I make is incorrectly writing the relative position of a node. I would for example write "left above" in stead of "above left". It is probably due to my native language where you would state "linksboven" when you indicate a position of an object.

Of course this is just a question of correcting and recompiling, but it remains a disturbing annoyance. Is it possible to make an alias for all those above|below left|right, so my document would simply compile when I write Dunglish TikZ?

  • 2
    \tikzset{left above/.style={above left}}
    – JLDiaz
    Jul 24 '14 at 9:19
  • 4
    or better \tikzset{linksboven/.style={above left}}
    – percusse
    Jul 24 '14 at 9:21

As JLDiaz and percusse where pointing out, you can define styles for TikZ by the means of \tikzset. The principal mechanism is, that you can define a style and then set it content: \tikzset{<my style>/.style={<content of my style>}}.

So what you can do in your example is \tikzset{left above/.style={above left}} or \tikzset{linksboven/.style={above left}}.

Be aware however that you should not overwrite existing styles in that way.

  • I would rather suggest \tikzset{left above/.style={above left={#1}}} Jul 26 '20 at 22:13
  • ... or better \tikzset{left above/.forward to=/tikz/above left} Jul 26 '20 at 22:16

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.