I want to draw a small cross at the horizontal and vertical center of my page. (at this position I want to glue in a CD). Should I create an image with a cross and center it or draw it directly with latex?

  • Cna you share with us your file to sse how you do ? – projetmbc Oct 28 '11 at 10:12
  • I just exactly the version from wh1t3 – strauberry Oct 28 '11 at 14:49

The easiest way I know of is using Tikz. You can use the current page node and its center anchor like this:

\begin{tikzpicture}[overlay, remember picture]
  \node at (current page.center) {$\times$};

This will draw a small cross at the center of the page. You need to run it twice to get the correct location. The result looks like this:

Centered X

Update As per @Dror's request some additional information on why the remember picture and overlay specification are required. This is specified in sections 75.3.2 and 75.4 of the manual. The gist of it is, the current page node resides in a virtual remembered picure. So when we use it in our picture, we are really referencing a node in a different picture. Therefore Tikz can't manage anymore with only the relative positions used within a picture, it also needs to know the relative position of the current picture and the virtual picture the current page node is in. Now because the absolute position on the page only becomes known after compiling the document, these positions have to be remembered. They are written to the aux file when we use the overlay and remember picture options. Why the overlay? The manual doesn't specify as far as I know, but I presume it's because if we don't use overlay two pictures could keep influencing each other on sequential passes (if they reference anchors inside each other). These remembered abolute positions then allow for references to nodes in different pictures on the next pass.

|improve this answer|||||
  • @wh1t3: Can you add an explanation why did you used the overlay, remember picture options? – Dror Oct 28 '11 at 9:02
  • 1
    @Dror, I've added a 'short' explanation. Let me know if this answers your question. – Roelof Spijker Oct 28 '11 at 9:16
  • Option overlay produces a zero-width-zero-height box from tikzpicture environment. That is, it is overlaid over the page content. – AlexG Oct 28 '11 at 10:22
  • Yes, the manual does specify what the overlay option is for and what it does. It does not, however, explain why it is needed if we want to reference a node from a different picture. At least, to the best of my knowledge. So I can only guess, which is what I have done. – Roelof Spijker Oct 28 '11 at 11:34


|improve this answer|||||
  • Is eso-pic package installed within a very basic MikTeX or TeX Live distro? – Sigur May 27 '16 at 14:57

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.