5

I'm after a way to draw an oval that is in the centre of my page and touches all sides of the A4 page. I need it to happen many times as I'm drawing a complicated graphic.

So far I have been hindered by TikZ picture drawing things with default left hand margins and odd positioning offsets and the documentclass apparently putting in pargins "left, right, and centre". I've been at this for 12 hours and gotten nowhere so I thought I'd ask for help.

A second question worth answering is when I type in Texmakerx (remembering I'm using pdfLaTeX) something like \documentclass{} <- when I type these curly brackets, how can I select from a drop down, all appropriate entries -- or at least find out what the limitations to them are?

The following code draws a circle (in a box) with a border I don't want inside that box, adjusted from the left by a distance I don't want. I haven't even begun to investigate what happens near the other borders.

\documentclass[11pt]{article}
\pagestyle{empty}
\usepackage{tikz}
\usepackage{color}
\usepackage[top=0cm,right=0cm,bottom=0cm,left=0cm]{geometry}

\title{Practice}

\begin{document}

    \fbox{
        \begin{tikzpicture}[node distance=0cm, auto, >=stealth]
            \filldraw [gray] (0,0) circle (2pt);
        \end{tikzpicture}
    }

\end{document}
5

You can use the special node current page to refer to coordinates on the actual page. It's a node that exactly fits the page. To use it, you need the overlay and remember picture options on your tikzpicture.

\documentclass[11pt]{article}
%\url{http://tex.stackexchange.com/q/107911/86}
\pagestyle{empty}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[overlay,remember picture]
\filldraw[gray] (current page) circle[x radius=\paperwidth/2, y radius=\paperheight/2];
\end{tikzpicture}
\end{document}
  • 2
    This will do for now. Any hint on how to learn all this bizarre syntax? \draw [some parameters] {more parameters} anotherFunctionMagicallyGettingData [its parameters]; <- does what? etc makes no sense to me. I've been programming for 10 years and still this confuses the hell out of me. – Supernovah Apr 10 '13 at 12:24
  • 2
    @Supernovah you should read the pgf manual, and specially the pgfkeys section which describes the syntax. – zeroth Apr 10 '13 at 12:27
  • Why would the pgf manual contain LaTeX syntax? And also why is the tikz package called pgf yet there are multple small tikz-something packages in /doc/latex? – Supernovah Apr 10 '13 at 20:48

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.