4

By adapting the codes in an answer to the question How to draw these (closed contours) diagrams using TikZ or PSTricks?, I get the following picture.

enter image description here

Would anybody help me to make the following improvement?

  • How can I have arrows in the line segment (-R,0) and also the smaller arc? (And only one arrow in the bigger arc.)
  • How can I make the sizes of 1-\epsilon, 1+\epsilon smaller?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}

\begin{tikzpicture}[decoration={markings,
mark=at position 0.5cm with {\arrow[line width=1pt]{>}},
mark=at position 2cm with {\arrow[line width=1pt]{>}},
mark=at position 7.85cm with {\arrow[line width=1pt]{>}},
mark=at position 9cm with {\arrow[line width=1pt]{>}}
}
]
% The axes
\draw[help lines,->] (-4,0) -- (4,0) coordinate (xaxis);
\draw[help lines,->] (0,-1) -- (0,4) coordinate (yaxis);


\node at (0,2) {$\times$};
\node at (-.5,2) {$2i$};
\node at (1,0) {$\times$};

% The path
%\path[draw,line width=0.8pt,postaction=decorate] (1,0) node[below] {$\epsilon$} -- (2,0) node[below] {$r$} arc (0:180:2) -- (-1,0) arc (180:0:1);

\path[draw,line width=0.8pt,postaction=decorate] (1.5,0) node[below] {$1+\epsilon$} -- (3,0) node[below] {$R$} arc (0:180:3) node[below] {$-R$} -- (.5,0) node[below]{$1-\epsilon$} arc (180:0:.5);

% The labels
\node[below] at (xaxis) {$x$};
\node[left] at (yaxis) {$y$};
\node[below left] {$O$};
\node at (1,.8) {$C_{\varepsilon}$};
\node at (2,3) {$\Gamma_{R}$};
\end{tikzpicture}
\end{document}
0

1 Answer 1

3

font=\scriptsize, for example, can be added to the node options for nodes you want set in a smaller size.

Please see the decorations.markings library documentation in the TikZ manual for an explanation of the various options for configuring the position and number of arrows used.

For example:

\documentclass[border=10pt,tikz,multi]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
  [
    decoration={%
      markings,
      mark=at position 0.5cm with {\arrow[line width=1pt]{>}},
      mark=at position 2cm with {\arrow[line width=1pt]{>}},
      mark=at position 0.5 with {\arrow[line width=1pt]{>}},
      mark=at position 0.75 with {\arrow[line width=1pt]{>}},
      mark=at position -5mm with {\arrow[line width=1pt]{>}},
    }
  ]
  \draw [help lines,->] (-4,0) -- (4,0) coordinate (xaxis);
  \draw [help lines,->] (0,-1) -- (0,4) coordinate (yaxis);
  \node at (0,2) {$\times$};
  \node at (-.5,2) {$2i$};
  \node at (1,0) {$\times$};
  \path [draw, line width=0.8pt, postaction=decorate] (1.5,0) node [below, font=\scriptsize] {$1+\epsilon$} -- (3,0) node [below] {$R$} arc (0:180:3) node [below] {$-R$} -- (.5,0) node [below, font=\scriptsize] {$1-\epsilon$} arc (180:0:.5);
  \node [below] at (xaxis) {$x$};
  \node [left] at (yaxis) {$y$};
  \node [below left] {$O$};
  \node at (1,.8) {$C_{\varepsilon}$};
  \node at (2,3) {$\Gamma_{R}$};
\end{tikzpicture}
\end{document}

tweaked arrows, fonts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy