TransWikia.com

Moving TikZ picture coordinates

TeX - LaTeX Asked by Sara Krauss on July 1, 2021

I came a across this post about drawing a Golden spiral in TiKZ and I tried to modify the accepted answer (Posted by Mark Wibrow) by changing the position of the picture. Basically, I would like to insert that picture around my page number at the bottom right of the page. I found the exact coordinates of the page number using the method posted here but I could not apply it correctly for the tikz picture I am using.

defspiral#1{%
  pgfmathparse{int(#1)}%
  ifnumpgfmathresult>0
    draw [help lines] (0,0) rectangle ++(1,1);
    begin{scope}[shift={(1,1)}, rotate=90, scale=1/1.6180339887]
      spiral{#1-1}
    end{scope}
    draw [red] (0,0) arc (270:360:1);
  fi
}

tikz[scale=0.7]{spiral{12} at (page cs:0.586,-0.68)}

I don’t want to add this to every page (number), just some, therefore editing page number style is not suitable for my case.
Could you point me in the right direction? Thanks

One Answer

You probably want to add overlay, remember picture to the options of tikz. However, it might be better to redefine the page number command. Then you do not need to find out the location of the page number on the page. Notice that I introduced an additional shift of shift={(-0.5,-1.1)}, which you could change to fit your needs.

documentclass{article}
usepackage{tikz}
defspiral#1{%
  pgfmathparse{int(#1)}%
  ifnumpgfmathresult>0
    draw [help lines] (0,0) rectangle ++(1,1);
    begin{scope}[shift={(1,1)}, rotate=90, scale=1/1.6180339887]
      spiral{#1-1}
    end{scope}
    draw [red] (0,0) arc (270:360:1);
  fi
}
renewcommandthepage{tikz[scale=0.7,overlay,shift={(-0.5,-1.1)}]{spiral{numbervalue{page}}}%
arabic{page}}
begin{document}
~newpage~newpage~newpage~newpage~newpage
end{document}

enter image description here

Answered by user237902 on July 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP