6

I use the following code

\begin{center}
\begin{tikzpicture}[scale=2]
    \draw(0,0)  +(90:1) arc(90:100:1)       arc(15:195:0.05);
    \draw(0,0)  +(90:1) arc(175:-5:0.05)        arc(85:77:1)    arc(160:343:0.05);

    \draw(0,0)  +(71:1) arc(71:65:1)    arc(155:90:0.085)   --(0.5,1.3);
    \draw(0,0) +(106:1) arc(106:115:1)  arc(25:90:0.085)    --(-0.5,1.3);
\end{tikzpicture}
\end{center}

to get something that looks like the following


enter image description here


But as you can see, there is a lot of extra white-space included because I am using (0,0) as an anchor to get at the relevant points and make everything line up correctly.

Question: Is there some way that I can just get Tikz to show the relevant part and keep the code as it is, i.e. get rid of the unnecessary white-space?

  • 4
    Use \clip[draw] (-.75,.5) rectangle (1,1.5); and adjust the coordinates of the left bottom and right top corners of the rectangle. Then remove [draw] to simply clip the area. – Sigur Jan 27 '14 at 12:38
4

You can use the bounding box:

 \path[draw,use as bounding box] (-.55,0.85) rectangle (0.55,1.35);

Remove draw option after you get the coordinates right.

\documentclass{article}
\usepackage{tikz}
\begin{document}
Some text here above the picture

\begin{tikzpicture}[scale=2]
    \path[use as bounding box] (-.55,0.85) rectangle (0.55,1.35);
    \draw(0,0)  +(90:1) arc(90:100:1)       arc(15:195:0.05);
    \draw(0,0)  +(90:1) arc(175:-5:0.05)        arc(85:77:1)    arc(160:343:0.05);

    \draw(0,0)  +(71:1) arc(71:65:1)    arc(155:90:0.085)   --(0.5,1.3);
    \draw(0,0) +(106:1) arc(106:115:1)  arc(25:90:0.085)    --(-0.5,1.3);
\end{tikzpicture}

Some text here below the picture
\end{document}

enter image description here

  • 2
    \clip is more cleaner than this. – user11232 Jan 27 '14 at 13:07

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.