I am just a beginner with TikZ and I am willing to draw in Latex the following contour, found in Serre's book :

Contour of the modular fundamental domain

Any help or references to draw this kind of contour efficiently (if it exists) is welcome !

  • 2
    Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – Max Sep 5 '18 at 10:21

It is better, at least to put some code with some basic things in the manual to escape the situation do it for me, but as it is a trivial code that you could put at the end or a fairly competent one, my habit is to rewrite it my way since this situation allows it, that way a solution using intersections, calc, and decorations.markings, there are things to improve but there you have a code to try to understand how...


enter image description here



        line width=0.75pt,
                    mark=at position #1 with {
                        \fill(0:3pt) -- (90+50:3pt) -- (180:1pt) -- (270-50:3pt) ;
            dash pattern =on 3pt off 2pt on 3pt off 2pt,
    %Defining coodinates
    \coordinate(E) at (0.5,3); \node[anchor=south west] at (E) {E};
    \coordinate(A) at (-0.5,3); \node[anchor=south east] at (A) {A};
    \coordinate (O) at (0,0);
    \coordinate (O') at (90:1);

    %Draw the X axis
        (O) circle (0.7pt) node[anchor=north]{0}
        (O') circle (0.7pt)
        (O)edge ++(1.2,0) edge++(-1.2,0);

    %Definig paths
    \path[name path=hemicircle]
            arc (0:180:1)node[anchor=north]{-1};
    \path[name path=CircleC]
        (O') circle (3pt);
    \path[name path=rectangleAE]
        (A) rectangle (E |- O);
    %Find firts intersections for centers of circles for B,B',D'D' points
    \path[name intersections={of=hemicircle and rectangleAE}]
        (intersection-1) coordinate (CenterCircleD) 
        (intersection-2) coordinate (CenterCircleB);
    %Defining paths for circles B and D
    \path[name path=CircleB] 
        (CenterCircleB) circle (5pt);
    \path[name path=CircleD] 
        (CenterCircleD) circle (5pt);

    %Find coordinates   
    \path[name intersections={of=hemicircle and CircleC}]
        (intersection-1) coordinate (C')
        (intersection-2) coordinate (C);
    \node[anchor=north] at (C') {C'};
    \node[anchor=north] at (C) {C};

    \path[name intersections={of=hemicircle and CircleB}]
        (intersection-1) coordinate (B')
        (intersection-2) coordinate (B'2);
        \node[anchor=north] at (B') {B'};
    \path[name intersections={of=rectangleAE and CircleB}]
        (intersection-1) coordinate (B)
        (intersection-2) coordinate (B2);
        \node[anchor=east] at (B) {B};

    \path[name intersections={of=hemicircle and CircleD}]
        (intersection-1) coordinate (D)
        (intersection-2) coordinate (D2);
        \node[anchor=north] at (D) {D};     
    \path[name intersections={of=rectangleAE and CircleD}]
        (intersection-1) coordinate (D')
        (intersection-2) coordinate (D'2);
        \node[anchor=west] at (D') {D'};

    \def\DrawArc[#1](#2)(#3)(#4)#5{%1:style 2: center 3: start 4: end 5: change direction if \n3>\n2 %Needs conditional improvement
        let \p1 = ($(#3)-(#2)$), \p2 = ($(#4)-(#2)$),
            \n1 = {veclen(\x1,\y1)},
            \n2 = {atan2(\y1,\x1)},
            \n3 = {atan2(\y2,\x2)}
            (#2)++(\n2:\n1) arc (\n2:\n3-#5:\n1);

    %Drawing the contour
    \draw[MyArrow=0.5] (A) -- (B);
    \draw[MyArrow=0.5] (D') -- (E);
    \draw[MyArrow=0.5] (E) -- (A);

    %Drawing other details


    \draw[Mydashed] (B) -- (B |- O)node[anchor=north]{-1/2};
    \draw[Mydashed] (D') -- (D' |- O)node[anchor=north]{1/2};


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.