3

I have been trying to draw a diagram that looks a little bit like the MWE below shows; as the title suggests, I'm wanting to place labeled arrows (only two labels: a or b) indicating a direction in the middle of each edge.

I'm hoping there is a cleaner way to do it than calculating the position for each vertex and drawing an edge with an arrow for a particular direction; alas, even something as rudimentary as that escapes me because I'm not familiar with this package.

I've been searching this site (as well as whatever sites Google thought were relevant), and so I know I can do the above using Loop Space's answer from TikZ: How to draw an arrow in the middle of the line? The problem I experience with this approach is the size of the arrow heads seems to clutter the diagram a lot more than I want (I haven't actually tested the full set, just the bottom edge).

To summarize: is it possible to set up a command that distributes a certain number of arrows (on the bottom edge, for example, I'd want 6 exactly) uniformly using a prescribed direction for each arrow (after looking at my free-hand drawing, it might be easier to simply have the arrows alternate)?

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
    \begin{scope}[thick]
        \draw (0,0)--  (3,5.196);
        \draw (2,0)--  (5,5.196);
        \draw (4,0)--  (7,5.196);
        \draw (6,0)--  (9,5.196);
        \draw (0,0)-- (6,0);
        \draw (1,1.732)-- (7,1.732);
        \draw (2,3.464)-- (8,3.464);
        \draw (3,5.196)-- (9,5.196);
        \draw (0.5,0.866)-- (1,0);
        \draw (1.5,2.598)-- (3,0);
        \draw (2.5,4.33)-- (5,0);
        \draw (4,5.196)-- (6.5,0.866);
        \draw (6,5.196)-- (7.5,2.598);
        \draw (8,5.196)-- (8.5,4.33);
    \end{scope}
\end{tikzpicture}
\end{document}
  • Also, I apologize if my formatting is really pathetic. I've really just been trying to get a picture that I want and haven't worried about cleanliness of the typesetting (not that I'd know how even if I were poring over the text). As such, please feel free to edit as necessary. :-) – Clayton Nov 14 '14 at 6:23
4

Some thing like this? The distribution is manual and in this case not uniform.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings,arrows.meta}
\tikzset{
    arrowmark/.style 2 args={decoration={markings,mark=at     position #1 with \arrow{#2}}}
    }
\begin{document}
\begin{tikzpicture}
    \begin{scope}[thick]
        \draw (0,0)-- node {} (3,5.196);
        \draw (2,0)-- node {} (5,5.196);
        \draw (4,0)-- node {} (7,5.196);
        \draw (6,0)-- node {} (9,5.196);
        \draw (0,0)--  (6,0);
        \foreach \x/\a in {0.1/a,0.26/b,0.43/c,0.6/d,0.76/e,0.92/f}{
        \path (0,0) -- node[xshift=-1mm,below=1mm,pos=\x,inner sep=0pt]{\strut \a} (6,0);
        \path[postaction={decorate}, arrowmark={\x}{Stealth[scale=0.8]}] (0,0)--  (6,0);
        }
        \draw (1,1.732)-- node {} (7,1.732);
        \draw (2,3.464)-- node {} (8,3.464);
        \draw (3,5.196)-- node {} (9,5.196);
        \draw (0.5,0.866)-- node {} (1,0);
        \draw (1.5,2.598)-- node {} (3,0);
        \draw (2.5,4.33)-- node {} (5,0);
        \draw (4,5.196)-- node {} (6.5,0.866);
        \draw (6,5.196)-- node {} (7.5,2.598);
        \draw (8,5.196)-- node {} (8.5,4.33);
    \end{scope}
\end{tikzpicture}
\end{document}

enter image description here

1

I wanted to post an answer to my question including all of the code I used so there is a (somewhat) comprehensive example of covering space diagrams (specifically, this is from Hatcher 1.3.13); if there is a better or more efficient way to write the code, please feel free to edit.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.markings,arrows.meta}\tikzset{
arrowmark/.style 2 args={decoration={markings,mark=at     position #1 with \arrow{#2}}}
}
\begin{document}
\hspace{-0.75in}{\tiny
\begin{tikzpicture}[x=1.75cm,y=1.75cm]
        \begin{scope}[thick]
    \draw (0,0)-- (3,5.196);
    \foreach \x/\a in {0.1/a,0.26/b,0.43/a,0.6/b,0.76/a,0.92/b}{
    \path (0,0) -- node[xshift=-2.5mm,below=-0.8mm,pos=\x,inner sep=0pt]{\strut \a} (3,5.196);
    \path[postaction={decorate}, arrowmark={\x}{}] (0,0)--  (3,5.196);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8,reversed]},
    arrowmark={0.26}{Stealth[scale=0.8]},
    arrowmark={0.43}{Stealth[scale=0.8,reversed]},
    arrowmark={0.60}{Stealth[scale=0.8]},
    arrowmark={0.76}{Stealth[scale=0.8,reversed]},
    arrowmark={0.92}{Stealth[scale=0.8]},] (0,0)--  (3,5.196);

    \draw (2,0)-- (5,5.196);
    \foreach \x/\a in {0.1/a,0.26/b,0.43/a,0.6/b,0.76/a,0.92/b}{
    \path (2,0) -- node[xshift=-2.5mm,below=-0.8mm,pos=\x,inner sep=0pt]{\strut \a} (5,5.196);
    \path[postaction={decorate}, arrowmark={\x}{}] (2,0)--  (5,5.196);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8,reversed]},
    arrowmark={0.26}{Stealth[scale=0.8]},
    arrowmark={0.43}{Stealth[scale=0.8,reversed]},
    arrowmark={0.60}{Stealth[scale=0.8]},
    arrowmark={0.76}{Stealth[scale=0.8,reversed]},
    arrowmark={0.92}{Stealth[scale=0.8]},] (2,0)--  (5,5.196);

    \draw (4,0)-- (7,5.196);
    \foreach \x/\a in {0.1/a,0.26/b,0.43/a,0.6/b,0.76/a,0.92/b}{
    \path (4,0) -- node[xshift=-2.5mm,below=-0.8mm,pos=\x,inner sep=0pt]{\strut \a} (7,5.196);
    \path[postaction={decorate}, arrowmark={\x}{}] (4,0)--  (7,5.196);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8,reversed]},
    arrowmark={0.26}{Stealth[scale=0.8]},
    arrowmark={0.43}{Stealth[scale=0.8,reversed]},
    arrowmark={0.60}{Stealth[scale=0.8]},
    arrowmark={0.76}{Stealth[scale=0.8,reversed]},
    arrowmark={0.92}{Stealth[scale=0.8]},] (4,0)--  (7,5.196);

    \draw (6,0)-- (9,5.196);
    \foreach \x/\a in {0.1/a,0.26/b,0.43/a,0.6/b,0.76/a,0.92/b}{
    \path (6,0) -- node[xshift=-2.5mm,below=-0.8mm,pos=\x,inner sep=0pt]{\strut \a} (9,5.196);
    \path[postaction={decorate}, arrowmark={\x}{}] (6,0)--  (9,5.196);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8,reversed]},
    arrowmark={0.26}{Stealth[scale=0.8]},
    arrowmark={0.43}{Stealth[scale=0.8,reversed]},
    arrowmark={0.60}{Stealth[scale=0.8]},
    arrowmark={0.76}{Stealth[scale=0.8,reversed]},
    arrowmark={0.92}{Stealth[scale=0.8]},] (6,0)--  (9,5.196);

    \draw (0,0)--  (6,0);
    \foreach \x/\a in {0.1/a,0.26/b,0.43/a,0.6/b,0.76/a,0.92/b}{
    \path (0,0) -- node[xshift=-1mm,below=0.8mm,pos=\x,inner sep=0pt]{\strut \a} (6,0);
    \path[postaction={decorate}, arrowmark={\x}{}] (0,0)--  (6,0);
    }
    \draw[postaction={decorate}, arrowmark={0.1}{Stealth[scale=0.8]},
    arrowmark={0.26}{Stealth[scale=0.8,reversed]},
    arrowmark={0.43}{Stealth[scale=0.8]},
    arrowmark={0.60}{Stealth[scale=0.8,reversed]},
    arrowmark={0.76}{Stealth[scale=0.8]},
    arrowmark={0.92}{Stealth[scale=0.8,reversed]},] (0,0)--  (6,0);

    \draw (1,1.732)--(7,1.732);
    \foreach \x/\a in {0.1/a,0.26/b,0.43/a,0.6/b,0.76/a,0.92/b}{
    \path (1,1.732) -- node[xshift=-1mm,below=0.5mm,pos=\x,inner sep=0pt]{\strut \a} (7,1.732);
    \path[postaction={decorate}, arrowmark={\x}{}] (1,1.732)--  (7,1.732);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8]},
    arrowmark={0.26}{Stealth[scale=0.8,reversed]},
    arrowmark={0.43}{Stealth[scale=0.8]},
    arrowmark={0.60}{Stealth[scale=0.8,reversed]},
    arrowmark={0.76}{Stealth[scale=0.8]},
    arrowmark={0.92}{Stealth[scale=0.8,reversed]},] (1,1.732)--  (7,1.732);

    \draw (2,3.464)--(8,3.464);
    \foreach \x/\a in {0.1/a,0.26/b,0.43/a,0.6/b,0.76/a,0.92/b}{
    \path (2,3.464) -- node[xshift=-1mm,below=0.5mm,pos=\x,inner sep=0pt]{\strut \a} (8,3.464);
    \path[postaction={decorate}, arrowmark={\x}{}] (2,3.464)--  (8,3.464);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8]},
    arrowmark={0.26}{Stealth[scale=0.8,reversed]},
    arrowmark={0.43}{Stealth[scale=0.8]},
    arrowmark={0.60}{Stealth[scale=0.8,reversed]},
    arrowmark={0.76}{Stealth[scale=0.8]},
    arrowmark={0.92}{Stealth[scale=0.8,reversed]},] (2,3.464)--  (8,3.464);

    \draw (3,5.196)--(9,5.196);
    \foreach \x/\a in {0.1/a,0.26/b,0.43/a,0.6/b,0.76/a,0.92/b}{
    \path (3,5.196) -- node[xshift=-1mm,below=0.5mm,pos=\x,inner sep=0pt]{\strut \a} (9,5.196);
    \path[postaction={decorate}, arrowmark={\x}{}] (3,5.196)--  (9,5.196);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8]},
    arrowmark={0.26}{Stealth[scale=0.8,reversed]},
    arrowmark={0.43}{Stealth[scale=0.8]},
    arrowmark={0.60}{Stealth[scale=0.8,reversed]},
    arrowmark={0.76}{Stealth[scale=0.8]},
    arrowmark={0.92}{Stealth[scale=0.8,reversed]},] (3,5.196)--  (9,5.196);

    \draw (0.5,0.866)-- (1,0);
    \foreach \x/\a in {0.5/a}{
    \path (0.5,0.866) -- node[xshift=-1.5mm,below=-0.25mm,pos=\x,inner sep=0pt]{\strut \a} (1,0);
    \path[postaction={decorate}, arrowmark={\x}{}] (0.5,0.866)--  (1,0);
    }
    \draw[postaction={decorate},
    arrowmark={0.5}{Stealth[scale=0.8,reversed]},] (0.5,0.866)-- (1,0);

    \draw (1.5,2.598)--(3,0);
    \foreach \x/\a in {0.166/a,0.5/b,0.833/a}{
    \path (1.5,2.598) -- node[xshift=-1.5mm,below=-0.8mm,pos=\x,inner sep=0pt]{\strut \a} (3,0);
    \path[postaction={decorate}, arrowmark={\x}{}] (1.5,2.598)--  (3,0);
    }
    \draw[postaction={decorate},
    arrowmark={0.166}{Stealth[scale=0.8,reversed]},
    arrowmark={0.5}{Stealth[scale=0.8]},
    arrowmark={0.833}{Stealth[scale=0.8,reversed]},] (1.5,2.598)--  (3,0);

    \draw (2.5,4.33)--(5,0);
    \foreach \x/\a in {0.1/a,0.3/b,0.5/a,0.7/b,0.9/a}{
    \path (2.5,4.33) -- node[xshift=-1.5mm,below=-0.8mm,pos=\x,inner sep=0pt]{\strut \a} (5,0);
    \path[postaction={decorate}, arrowmark={\x}{}] (2.5,4.33)--  (5,0);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8,reversed]},
    arrowmark={0.3}{Stealth[scale=0.8]},
    arrowmark={0.5}{Stealth[scale=0.8,reversed]},
    arrowmark={0.7}{Stealth[scale=0.8]},
    arrowmark={0.9}{Stealth[scale=0.8,reversed]}] (2.5,4.33)--  (5,0);

    \draw (4,5.196)-- (6.5,0.866);
    \foreach \x/\a in {0.1/b,0.3/a,0.5/b,0.7/a,0.9/b}{
    \path (4,5.196) -- node[xshift=-1.5mm,below=-0.8mm,pos=\x,inner sep=0pt]{\strut \a} (6.5,0.866);
    \path[postaction={decorate}, arrowmark={\x}{}] (4,5.196)--  (6.5,0.866);
    }
    \draw[postaction={decorate},
    arrowmark={0.1}{Stealth[scale=0.8]},
    arrowmark={0.3}{Stealth[scale=0.8,reversed]},
    arrowmark={0.5}{Stealth[scale=0.8]},
    arrowmark={0.7}{Stealth[scale=0.8,reversed]},
    arrowmark={0.9}{Stealth[scale=0.8]}] (4,5.196)--  (6.5,0.866);

    \draw (6,5.196)--(7.5,2.598);
    \foreach \x/\a in {0.166/b,0.5/a,0.833/b}{
    \path (6,5.196) -- node[xshift=-1.5mm,below=-0.8mm,pos=\x,inner sep=0pt]{\strut \a} (7.5,2.598);
    \path[postaction={decorate}, arrowmark={\x}{}] (1.5,2.598)--  (3,0);
    }
    \draw[postaction={decorate},
    arrowmark={0.166}{Stealth[scale=0.8]},
    arrowmark={0.5}{Stealth[scale=0.8,reversed]},
    arrowmark={0.833}{Stealth[scale=0.8]},] (6,5.196)--  (7.5,2.598);

    \draw (8,5.196)--(8.5,4.33);
    \foreach \x/\a in {0.5/b}{
    \path (8,5.196) -- node[xshift=-1.5mm,below=-0.25mm,pos=\x,inner sep=0pt]{\strut \a} (8.5,4.33);
    \path[postaction={decorate}, arrowmark={\x}{}] (8.5,5.196)--  (8.5,4.33);
    }
    \draw[postaction={decorate},
    arrowmark={0.5}{Stealth[scale=0.8,reversed]},] (8,5.196)-- (8.5,4.33);

\end{scope}
\end{tikzpicture}
}
\end{document} 

This code produces the following diagram:

Covering Space Diagram for the Wedge Sum of Two Circles

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.