Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use the following code to draw a tikz image between some text:


Hello\tikz[baseline=(current bounding box.north)]\draw(0,0) circle (10pt);\LaTeX.

Then I want to add a little shift to it, for example

\tikz[baseline=(current bounding box.north)-5pt]\draw(0,0) circle (10pt);

But this have no effect. I also tried yshift or transform canvas, both does not work.

Does anyone know how to solve this? thanks.

share|improve this question

1 Answer 1

up vote 13 down vote accepted

You can add the shift by one of the following ways. Only the last one needs the calc library. In both cases you need to surround the coordinate with { } to either mask the inner [ ] or ,.

Hello\tikz[baseline={([yshift=-5pt]current bounding box.north)}]\draw(0,0) circle (10pt);\LaTeX.

Hello\tikz[baseline={($ (current bounding box.north) - (0,5pt) $)}]\draw(0,0) circle (10pt);\LaTeX.

Note that the ([<options>]coordinate) style works also in general (so does the other one). If you want to shift from the center of a node you should explicitly reference the center anchor to avoid some possible issues. Without an anchor the special border anchor is used which seems to cause issues with shifts. With baseline there might be no problem, but for drawn lines there is.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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