0

I've been trying to create a keyhole contour where the keyhole is a tiny circle in say, the first quadrant, and the main circle is still centered at the origin. I'm specifically not trying to create a keyhole contour where the keyhole is at the origin, and can't seem to find how to do that. I've been playing around with it for a while, but can't make anything work. Does anybody have any tips?

Thanks!

Edit: Here's what I'm trying to create: enter image description here

  • 1
    Welcome to TeX.SX! Please could you share what you have done so far in the form of a minimal working example (MWE). This makes it easier both for us to understand what your issue is and provide solutions/suggestions. – Dai Bowen Apr 13 '17 at 20:42
  • 1
    Show us what you have been playing around! – Symbol 1 Apr 13 '17 at 20:44
  • 1
    Show us also what you wanted to achieve (a photo of an hand-written drawing could be enough), please! – CarLaTeX Apr 13 '17 at 20:47
  • @CarLaTeX I added a photo of what I'm going for (a poorly drawn one, I might add). I can't figure out how to make the keyhole look like that though, for every guide I've seen for drawing keyhole contours makes has the keyhole at the origin. – David Bowman Apr 14 '17 at 0:52
  • As you can see, Zarko has already answered. If his answer meets your needs, remember to upvote and accept it. Otherwise, please add a minimal working example to your question. Thank you! – CarLaTeX Apr 14 '17 at 2:47
5

Like this:

enter image description here

In image is considered $sin{alpha} ~ \alpha$ (at small \alpha) and ratio between angles of hole in locus is about 8:

\documentclass[tikz,
               border=3mm,
               ]{standalone}
\usetikzlibrary{arrows.meta, decorations.markings}

\begin{document}
\begin{tikzpicture}[>=Straight Barb,
decoration={markings,% switch on markings
            mark=between positions 0.2 and 0.8 step 0.25 with {\arrow[thick]{>}},
            mark=at position 0.86 with {\arrow[thick]{>}},
            mark=at position 0.98 with {\arrow[thick]{>}}

        }]
% curve
\draw[fill=gray!10, postaction={decorate}] 
            (47.5:2) arc (47.5:360:2   ) arc (0:42.5:2) 
       -- + (225:0.5) arc (25  :0  :0.25) arc(360:65:0.25) -- cycle;
% singularity
\fill[red]  (45:1.25) circle (1pt) node[inner sep=2pt,font=\footnotesize,right] {$a$};
% radius 
\draw[thick, ->] (0,0) -- node[sloped,above] {$r$} (330:2);
% coordinate axes
\draw[->] (-3,0) -- (3,0) node[right] {$\Re$};
\draw[->] (0,-3) -- (0,3) node[above] {$\Im$};
\end{tikzpicture}
\end{document}
  • Hi @Zarko. This looks excellent! Sorry to be such a pain, but this isn't seeming to compile for me in my document. I created a new document for which it works, and I could just print that, but I'm curious as to why it doesn't work in the one I want it to. It's giving me an error at \end{tikzpicture} and saying "Huge page cannot be shipped out." – David Bowman Apr 14 '17 at 2:51
  • @DavidBowman See if this post can help you: tex.stackexchange.com/q/225615/101651. Otherwise, please add a minimal working example that reproduces the error to your question (or, maybe better, ask another question with that MWE). – CarLaTeX Apr 14 '17 at 3:00
  • 1
    @DavidBowman, you didn't provide anything about what you try so far nor about your document. So, with not knowing preamble of your document and \documentclass{...} I can't say anything what is going wrong at you :(. Image size is 4cm x 4cm ... – Zarko Apr 14 '17 at 3:01
  • @DavidBowman Maybe, x and y are set to non-default values. Then, it helps to reset them: \begin{tikzpicture}[x=1cm, y=1cm]. – Heiko Oberdiek Apr 14 '17 at 4:15

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.