I asked this question Graphs in beamer. I need to make a graph like in the image below. This is part of a directed graph which has lots of nodes, edges that intersect and nodes that make the edges can not be straight but curved, also I need a text to be displayed at the end of some of those edges.

enter image description here

I realised that it would be complicated to build a graph with this kind of nodes, is there a way of doing that in a simple and modular way?


This addresses the question how to make things more modular. The answer is: use pgf styles, keys, and macros. In your case this could mean something like the following, in which



enter image description here

As you can see, you only provide the varying data, the rest is done by LaTeX.

This can be embedded in a matrix, say.

    eblob/.style={circle,draw,minimum size=5em},
    label={[anchor=center,circle,draw,fill=gray!10,minimum size=2.8em,inner
 \matrix[column sep=2em,row sep=3em](m){
 \node[blob={1,3}](A){\MC3A5}; \\
 \node[blob={2,3,4}](B){\MC4B5}; &
 \node[blob={2,3,2}](B'){\MC5B6}; & &
 \node[eblob](E){\MC8\varepsilon8}; \\
 & \node[blob={2,5,5}](C){\MC5C6}; \\
 \draw[->] (A) to[out=-45,in=135] (C);
 \draw[->] (B.45) to[bend left] (E);

enter image description here

One could also embed this in tikz-cd, say, but any of these design choices depend on information that is not provided like the general structure of these graphs. The edge labels can be dealt with similarly.

Note also that when you want to embed this in beamer you need to make the frame fragile or move the styles and macros out of the tikzpicture (or add several #).


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.