1

I wanted to write something wherein i need all confirmations of a graph side by side and argue something. How could I do that using Latex and Tikz.

Like i want all graph configurations with 3 edges and pick the one which I wanted how can i do it? **See the Images side by side and not one below the other how could i don this using tikz**

1
  • 1
    and what you try so far? do you like to have two figures side by side?
    – Zarko
    Oct 25, 2016 at 17:54

1 Answer 1

3

Draw the graphs as tikzpictures and use the baseline option to indicate on which node the pictures should get aligned.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikzset{vertex/.style={circle,draw,minimum width=3mm}}
\begin{tikzpicture}[auto,baseline=(c)]
  \node[vertex] (a) at (0,0) {};
  \node[vertex] (b) at (1,0) {};
  \node[vertex] (c) at (2,0) {};
  \node[vertex] (d) at (3,0) {};
  \draw (a) -- node{1} (b)
            -- node{2} (c)
            -- node{3} (d);
\end{tikzpicture}
\qquad
\begin{tikzpicture}[auto,baseline=(c)]
  \node[vertex] (a) at (0, 0.5) {};
  \node[vertex] (b) at (0,-0.5) {};
  \node[vertex] (c) at (1, 0  ) {};
  \node[vertex] (d) at (2, 0  ) {};
  \draw (a) -- node{1} (c)
            -- node{2} (d)
        (b) -- node[swap]{3} (c);
\end{tikzpicture}
\end{document}

enter image description here

2
  • how can label the edges in the process of making the edges.
    – Jaugust
    Oct 25, 2016 at 20:29
  • @Jaugust I have modified the answer to show how to label the edges.
    – gernot
    Oct 25, 2016 at 21:56

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.