5

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.

\def\spiral#1{%
  \pgfmathparse{int(#1)}%
  \ifnum\pgfmathresult>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

1 Answer 1

5

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}
\def\spiral#1{%
  \pgfmathparse{int(#1)}%
  \ifnum\pgfmathresult>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
}
\renewcommand\thepage{\tikz[scale=0.7,overlay,shift={(-0.5,-1.1)}]{\spiral{\number\value{page}}}%
\arabic{page}}
\begin{document}
~\newpage~\newpage~\newpage~\newpage~\newpage
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .