4

I've starting using TiKZ, just 2 days ago, and I found it beautiful. I've already used \scope, \node etc.

My problem is: How can I start the picture from the upper left corner of the page?

I looked at some syntax guide of TikZ, but I didn't find it.

Can someone help me?

3

You can use the current page node, either in a drawing or in positioning a drawing.

I will show how to position a drawing to the top left corner of a page, using a node which contains a TikZ drawing. The benefit is, that the inner picture doesn't need to know about the page position at all.

A specialty is, that nodes of the inner drawing inherit options, such as the anchor, from the parent node. So see, how I took care: I stated the node anchor style in the inner drawing, even if center is the default.

\documentclass{article} 
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[remember picture, overlay, transform shape]
  \node [anchor=north west, inner sep=0pt]
    at (current page.north west)
    {
      \begin{tikzpicture}[every node/.append style = {anchor=center}]
        \begin{scope}[blend group = soft light]
          \fill[red!30!white]   ( 90:1.2) circle (2);
          \fill[green!30!white] (210:1.2) circle (2);
          \fill[blue!30!white]  (330:1.2) circle (2);
        \end{scope}
        \node at ( 90:2)    {Typography};
        \node at ( 210:2)   {Design};
        \node at ( 330:2)   {Coding};
        \node [font=\Large] {\LaTeX};
      \end{tikzpicture}
    };
\end{tikzpicture}
\end{document}

Output at the page corner

I took the example from my upcoming LaTeX book, as it was easy for me to grab from my hard disk.

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.