5

I need to draw severals tikz picture of varying size. Each picture is on a separate page. The coordinate system should be fixed, though. Whenever I do

\node at (0, 0) {hello};

'hello' should be on the page bottom left corner (current page.south west).

So the coordinate system in tikz should look like this

-------------------------------------  
|          (page width, page height)|  
|                                   |  
|                                   |  
|                                   |  
|                                   |  
|                                   |  
|                                   |  
|                                   |  
|                                   |  
|                                   |  
|                                   |  
|(0, 0)                             |  
-------------------------------------  

MWE

% the node with 'two' is way below the node with 'one'

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\node at (0, 0) {one};

\end{tikzpicture}

\clearpage

\vspace*{5cm}

\begin{tikzpicture}

\node at (0, 0) {two};

\end{tikzpicture}


\end{document}

(in the screenshot color are inverted, normally the background is white)

enter image description here

2
  • Name your coordinate something and use baseline=(<node name>) if all your pictures appear in left aligned pages
    – percusse
    May 5, 2016 at 20:40
  • @percusse I tried \begin{tikzpicture}[baseline=(current page.south west)] unsuccesfully.
    – user16609
    May 5, 2016 at 20:49

1 Answer 1

4

You can shift the origin point of a tikzpicture by adding the option shift, like this:

\begin{tikzpicture}[shift={(5,0)}]

In this case for example, I shift the origin to 5,0. In your case, you'd have to write \begin{tikzpicture}[remember picture, overlay, shift={(current page.south west)}], but keep in mind that your node will actually be there at the corner of the page.

You can of course use anchors, so adding \node[anchor=south west] ... will pin the node at the bottom left corner.

Output

enter image description here

Code

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[remember picture, overlay, shift={(current page.south west)}]
    \node at (0,0) {one};
\end{tikzpicture}

\clearpage
\vspace*{5cm}

\begin{tikzpicture}[remember picture, overlay, shift={(current page.south west)}]
    \node at (0,0) {two};
\end{tikzpicture}
\end{document}
6
  • Maybe something is missing. When I try your code, I get the same output as the picture in my question. Do you get a different output?
    – user16609
    May 5, 2016 at 21:08
  • @NicolasEssis-Breton If you paste my code in a new (empty) document, does it work?
    – Alenanno
    May 5, 2016 at 21:12
  • No, same output as in my picture. I do '% arara: pdflatex', and its 'tikz 2013/12/13 v3.0.0 (rcs-revision 1.142)'
    – user16609
    May 5, 2016 at 21:19
  • @NicolasEssis-Breton Mmh not sure what is going on.
    – Alenanno
    May 5, 2016 at 23:36
  • 1
    @NicolasEssis-Breton Did you compile twice?
    – cfr
    May 5, 2016 at 23:50

You must log in to answer this question.