diff options
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/latex/adigraph/adigraph-large.png | bin | 0 -> 158870 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf | bin | 112224 -> 203860 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex | 102 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf | bin | 32299 -> 32107 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex | 17 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/adigraph/img_examples/pyadigraph.png | bin | 0 -> 83900 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/adigraph/test.tex | 57 |
7 files changed, 161 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph-large.png b/Master/texmf-dist/doc/latex/adigraph/adigraph-large.png Binary files differnew file mode 100644 index 00000000000..552c74c4ca2 --- /dev/null +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph-large.png diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf Binary files differindex abd60150a15..f97e049df7d 100644 --- a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex index 8818b12ff6b..d0c25207d73 100644 --- a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex @@ -136,7 +136,7 @@ You can renovate an older graph by calling \textbackslash RenewAdigraph \end{minted} \section{Adding nodes} -We set its nodes with the following syntax: \textit{<node name, color, border width: \(x\) coordinate, \(y\) coordinate: label>}. +We set its nodes with the following syntax: \textit{<node name[, textual color, border width]: \(x\) coordinate[, \(y\) coordinate][: label]>}. \begin{figure} \begin{subfigure}{0.49\textwidth} @@ -158,7 +158,7 @@ We set its nodes with the following syntax: \textit{<node name, color, border wi \end{figure} \subsection{Custom node colors} -To color a node you can use the following syntax: \textit{<node name, textual color: \(x\) coordinate, \(y\) coordinate>}. For example, to draw s in red and t in blue we would write: +To color a node you can use the following syntax: \textit{<node name[, textual color]: \(x\) coordinate[, \(y\) coordinate]>}. For example, to draw s in red and t in blue we would write: \begin{figure} \begin{subfigure}{0.49\textwidth} @@ -182,7 +182,7 @@ To color a node you can use the following syntax: \textit{<node name, textual co Tested available colors are: red, blue, black, green. You may extend the possible colors with LaTex libraries such as xcolor. \subsection{Custom node width} -To color a node you can use the following syntax: \textit{<node name, textual color, width: \(x\) coordinate, \(y\) coordinate>}. For example: +To color a node you can use the following syntax: \textit{<node name[, textual color[, border width]]: \(x\) coordinate[, \(y\) coordinate]>}. For example: \begin{figure} \begin{subfigure}{0.49\textwidth} @@ -204,7 +204,7 @@ To color a node you can use the following syntax: \textit{<node name, textual co \end{figure} \subsection{Custom node labels} -To add a custom label you can use the following syntax: either \textit{<node name: \(x\) coordinate, \(y\) coordinate: node label>} or \textit{<node name,textual color: \(x\) coordinate, \(y\) coordinate: node label>} will work: +To add a custom label you can use the following syntax: either \textit{<node name: \(x\) coordinate[, \(y\) coordinate][: node label]>} or \textit{<node name[, textual color]: \(x\) coordinate[, \(y\) coordinate][: node label]>} will work: \begin{figure} \begin{subfigure}{0.49\textwidth} @@ -294,7 +294,7 @@ When no coordinates are given or you just don't have time to think about where t \section{Adding edges} -We set its nodes with the following syntax: \textit{<node name: \(x\) coordinate, \(y\) coordinate, color, edge width: label>}. +We set its edges with the following syntax: \textit{<first node, second node,[color,[edge width]][:weight[:label:[label position]]]>}. \subsection{A simple edge} \begin{figure} @@ -1036,9 +1036,9 @@ If you'd like to color the cuts you just have to add the color as follows: \text \end{subfigure} \end{figure} -\section{Non oriented edges and custom edge stiles} +\section{Non oriented (undirected) edges and custom edge stiles} If you need non oriented edges or in general to ad a custom style to your edges you can proceed as follows: -\subsection{Non oriented} +\subsection{Non oriented (undirected)} \begin{figure} \begin{subfigure}{0.49\textwidth} \begin{minted}{latex} @@ -1138,6 +1138,94 @@ If you need non oriented edges or in general to ad a custom style to your edges \end{subfigure} \end{figure} +\chapter{PyAdigraph} +\href{https://github.com/LucaCappelletti94/pyadigraph}{Pyadigraph} turns your networkx into Adigraph latex package. It requires Adigraph (1.7.0+) to work. + +\section{Installation} +The package can be installed by simply running: +\begin{minted}{bash} +pip installed pyadigraph +\end{minted} +\clearpage +\section{Example} +\subsection{Python code} +For example by running the following python code: +\begin{minted}{python} +from pyadigraph import Adigraph +import networkx as nx + +A = Adigraph( + vertices_color_fallback="gray!90", + edges_color_fallback="gray!90", + sub_caption="My adigraph number {i} of {n}", + sub_label="adigraph_{i}_{n}", + row_size=1, + caption="A graph generated with python and latex.", + label="pyadigraph_example" +) + +A.add_graph( + nx.bipartite.random_graph(4, 4, 1), + vertices_color={ + 0: 'red!90', + 1: 'red!90', + 4: 'cyan!90', + 7: 'cyan!90' + }) + +A.save("test/result.tex", document=True) +\end{minted} +\clearpage +\subsection{Latex result} +You automatically obtain the following latex: + +\begin{minted}{latex} +\documentclass{report} +\usepackage{adigraph} +\usepackage{subcaption} + +\begin{document} +\begin{figure} + \begin{subfigure}{1.0\textwidth} + \NewAdigraph{myAdigraph}{ + 0,red!90,:-0.4386601404141742\textwidth,0.2091077552922947\textwidth:; + 1,red!90,:-0.15708496776680972\textwidth,0.09630690244229406\textwidth:; + 2,gray!90,:0.43887677279554366\textwidth,-0.2079924280020609\textwidth:; + 3,gray!90,:0.15678823839504888\textwidth,-0.09746320565948384\textwidth:; + 4,cyan!90,:-0.3736460590634439\textwidth,-0.327631363498189\textwidth:; + 5,gray!90,:0.3735687548614322\textwidth,0.3275275669374224\textwidth:; + 6,gray!90,:-0.042735184609099336\textwidth,-0.4998552275122768\textwidth:; + 7,cyan!90,:0.0428925858015027\textwidth,0.5\textwidth:; + }{ + 0,4,gray!90,::; + 0,5,gray!90,::; + 0,6,gray!90,::; + 0,7,gray!90,::; + 1,4,gray!90,::; + 1,5,gray!90,::; + 1,6,gray!90,::; + 1,7,gray!90,::; + 2,4,gray!90,::; + 2,5,gray!90,::; + 2,6,gray!90,::; + 2,7,gray!90,::; + 3,4,gray!90,::; + 3,5,gray!90,::; + 3,6,gray!90,::; + 3,7,gray!90,::; + }[] + \myAdigraph{} + \caption{My adigraph number 1 of 1}\label{adigraph_1_1} + \end{subfigure} + \caption{A graph generated with python and latex.}\label{pyadigraph_example} +\end{figure} +\end{document} +\end{minted} + +And once you compile that you receive a graph like the following: +\begin{figure} + \includegraphics[width=0.5\textwidth]{img_examples/pyadigraph.png} +\end{figure} \chapter{Warnings} \section{Reserved words} diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf Binary files differindex b498908af4a..749a1dff1c1 100644 --- a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex index f663aa418eb..b0a5376e06e 100644 --- a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex @@ -1,5 +1,6 @@ \documentclass{report} +\usepackage[usenames,dvipsnames]{xcolor} \usepackage{adigraph} \title{Adigraph, \AdigraphVersionNumber, small working test} @@ -10,15 +11,15 @@ \maketitle \begin{center} \NewAdigraph{myAdigraph}{ - s:0,0; + 0:0,0; 1:2,2; 3:2,-2; 2:6,2; 4:6,-2; t:8,0; }{ - s,1:25; - s,3:25; + 0,1:25; + 0,3:25; 3,4:25; 1,2:35; 2,t:20; @@ -36,7 +37,7 @@ \begin{figure} \myAdigraph{ - s,3,4,2,t:5; + 0,3,4,2,t:5; } \end{figure} @@ -103,7 +104,7 @@ \NewAdigraph{myForthAdigraph}{ 1:4; - 2,red,1:4; + 2,Melon,1:4; 3:4; 4:4; 5:4; @@ -112,8 +113,8 @@ 8:4; }{ 1,2:5; - 2,3:5; - 3,4,blue:10; + 2,3:5.0; + 3,4:10; 4,5:5; 5,6,purple,5:5; } @@ -133,7 +134,7 @@ 7:4; 8:4; }{ - 1,*,red; + 1,*,red!80; *,4,blue; 2,3; 3,4; diff --git a/Master/texmf-dist/doc/latex/adigraph/img_examples/pyadigraph.png b/Master/texmf-dist/doc/latex/adigraph/img_examples/pyadigraph.png Binary files differnew file mode 100644 index 00000000000..69c61f16fad --- /dev/null +++ b/Master/texmf-dist/doc/latex/adigraph/img_examples/pyadigraph.png diff --git a/Master/texmf-dist/doc/latex/adigraph/test.tex b/Master/texmf-dist/doc/latex/adigraph/test.tex new file mode 100644 index 00000000000..5695e13b566 --- /dev/null +++ b/Master/texmf-dist/doc/latex/adigraph/test.tex @@ -0,0 +1,57 @@ +\documentclass{report} +\usepackage{adigraph} +\usepackage{subcaption} + +\begin{document} +\begin{figure} + \begin{subfigure}{0.5\textwidth} + \NewAdigraph{myAdigraph}{ + 0,red!90,:-0.3809786411983217,-1.060040755194991:; + 1,red!90,:2.064011612238266,0.1152269298455566:; + 2,gray!90,:-1.5184462984334735,1.4027622819243912:; + 3,gray!90,:1.0781998579762053,2.9999996538001836:; + 4,cyan!90,:1.5184463673043251,-1.4027619074610054:; + 5,gray!90,:-2.064011426978595,-0.11522659721231196:; + 6,gray!90,:-1.0781999824004174,-3.0:; + 7,cyan!90,:0.3809785114920088,1.0600403942981784:; + }{ + 0,4,gray!90,::; + 0,5,gray!90,::; + 0,6,gray!90,::; + 0,7,gray!90,::; + 1,4,gray!90,::; + 1,7,gray!90,::; + 2,5,gray!90,::; + 2,7,gray!90,::; + 3,7,gray!90,::; + }[] + \myAdigraph{} + \caption{My little adigraph} + \end{subfigure} + \begin{subfigure}{0.5\textwidth} + \NewAdigraph{myAdigraph}{ + 0,red!90,:-1.0600955397170124,-0.909092429879124:; + 1,red!90,:-0.7769016878576507,2.441830442018683:; + 2,gray!90,:2.294827403537843,-1.1401225057579754:; + 3,gray!90,:2.9999983208930674,2.572669783991166:; + 4,cyan!90,:-2.2948254523229066,1.1401236892970583:; + 5,gray!90,:0.7769031550591187,-2.441828694069911:; + 6,gray!90,:-3.0,-2.5726712239220655:; + 7,cyan!90,:1.0600938004075402,0.909090938322168:; + }{ + 0,4,gray!90,::; + 0,5,gray!90,::; + 0,6,gray!90,::; + 0,7,gray!90,::; + 1,4,gray!90,::; + 1,7,gray!90,::; + 2,5,gray!90,::; + 2,7,gray!90,::; + 3,7,gray!90,::; + }[] + \myAdigraph{} + \caption{Another adigraph} + \end{subfigure} + \caption{A graph generated with python and latex.} +\end{figure} +\end{document}
\ No newline at end of file |