1

I am reading some papers regarding flag algebras, in particular this one. It can be seen that there are nice graphical representations of simple graphs such as triangles and squares, e.g. on the second page. There are also 'inline' examples on for instance the middle of page 6. Do you guys know of some package that the author may have used for this? I asked because I saw the same nice notational tools used in other papers. Thanks in advance!

EDIT: Some of the examples are in figures which I know how to do, but there are both inline and single line examples where the figures are used also.

EDIT2: Other examples include e.g. this one on page 7 and beyond

  • 1
    I do not know if there is a dedicated package for that, but with the shapes.geometric library of TikZ you can certainly draw all these things very easily. You may get a real answer more quickly if you provide a catalogue of symbols you want to create, a clear way of how to determine the symbol (i.e. some logic that indicates which edges are to be drawn) and, in particular, show us what you've tried. – user121799 Dec 18 '18 at 18:44
  • @marmot Thanks for the response! I have tried nothing so far because I have no idea to how generate especially the inline symbols, sorry if this seems lazy but I genuinely would not know where to start. As for what I want it is hard to predict, but I think it should suffice to have all graphs of order 1,2,3 and 4. Perhaps I could try simply drawing these examples and storing them in a small format and using that... – Slugger Dec 18 '18 at 18:47
3

This is to give you a start.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\tikzset{gon/.style={name=tmp,regular polygon,regular polygon sides=#1,minimum
size=10pt,inner sep=0pt},
polygon side/.style args={#1--#2}{
insert path={(tmp.corner #1)-- (tmp.corner #2)}}}
\newcommand{\FlagGraph}[3][]{\ifnum#2=2%
\tikz[baseline=(tmp1)]{\node[circle,inner sep=0.7pt,fill] (tmp1) at (0,0){};
\node[#1,circle,inner sep=0.7pt,fill] (tmp2) at (0,10pt){};
\ifx#3\empty%
\else
\draw[#1] (tmp1) -- (tmp2);
\fi}
\else%
\tikz[baseline=(tmp.south)]{\node[#1,gon=#2]{};
\foreach \X in {1,...,#2}{\fill (tmp.corner \X) circle (1pt);}
\draw[#1,polygon side/.list={#3}]}
\fi}
\begin{document}
This answer comes with a command 
\[ \texttt{\textbackslash FlagGraph}\{n\}\{\langle\texttt{connection}~1\rangle,
\langle\texttt{connection}~2\rangle,\dots\}\;,\]
where $n$ denotes the number of corners and the second argument is a list of
connections that are to be drawn.

These are some sample graphs: \FlagGraph{5}{1--2,1--4} \FlagGraph{3}{1--2} \FlagGraph{2}{1--2} \FlagGraph{2}{}
\FlagGraph{5}{3--1,3--2,3--4,3--5}

\end{document}

enter image description here

| improve this answer | |
  • Thanks so much for the effort, this is exactly what I was hoping was possible! Thanks – Slugger Dec 18 '18 at 19:35

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.