From ecd38b6aed911b2332d01f45bb01dee5d0a9bde7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 11 Mar 2018 20:26:48 +0000 Subject: adigraph (10mar18) git-svn-id: svn://tug.org/texlive/trunk@46922 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/adigraph/adigraph_documentation.pdf | Bin 0 -> 87660 bytes .../doc/latex/adigraph/adigraph_documentation.tex | 746 +++++++++++++++++++++ .../doc/latex/adigraph/adigraph_working_test.pdf | Bin 0 -> 16456 bytes .../doc/latex/adigraph/adigraph_working_test.tex | 75 +++ .../doc/latex/adigraph/documentation.pdf | Bin 83820 -> 0 bytes .../doc/latex/adigraph/documentation.tex | 670 ------------------ Master/texmf-dist/doc/latex/adigraph/test.pdf | Bin 13329 -> 0 bytes Master/texmf-dist/doc/latex/adigraph/test.tex | 42 -- 8 files changed, 821 insertions(+), 712 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf create mode 100644 Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex create mode 100644 Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf create mode 100644 Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex delete mode 100644 Master/texmf-dist/doc/latex/adigraph/documentation.pdf delete mode 100644 Master/texmf-dist/doc/latex/adigraph/documentation.tex delete mode 100644 Master/texmf-dist/doc/latex/adigraph/test.pdf delete mode 100644 Master/texmf-dist/doc/latex/adigraph/test.tex (limited to 'Master/texmf-dist/doc/latex/adigraph') diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf new file mode 100644 index 00000000000..4123dc6ead7 Binary files /dev/null and b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.pdf differ diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex new file mode 100644 index 00000000000..5ec01003f68 --- /dev/null +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_documentation.tex @@ -0,0 +1,746 @@ +\documentclass{report} + +\title{Adigraph, V1.3} +\author{Luca Cappelletti} +\date{March 2018} + +\usepackage{adigraph} +\usepackage{xcolor} +\usepackage[colorlinks=true,urlcolor=blue,pdfpagelabels,hyperindex=false]{hyperref} +\usepackage{minted} +\usepackage{multicol} +\usepackage{graphicx} % for images and generally graphics +\usepackage{caption} % enabling of nice captions +\usepackage{subcaption} % and subcaptions of images +\definecolor{mintedbackground}{rgb}{0.95,0.95,0.95} +\setminted{ + bgcolor=mintedbackground, + fontfamily=tt, + linenos=true, + numberblanklines=true, + numbersep=5pt, + gobble=0, + frame=leftline, + framerule=0.4pt, + framesep=2mm, + funcnamehighlighting=true, + tabsize=4, + obeytabs=false, + mathescape=false + samepage=false, %with this setting you can force the list to appear on the same page + showspaces=false, + showtabs =false, + texcl=false, +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% THE FOLLOWING CENTERS ALL FLOATING ITEMS BY DEFAULT % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\makeatletter +\g@addto@macro\@floatboxreset\centering +\makeatother + +\makeatletter +\apptocmd\subcaption@minipage{\centering}{}{} +\makeatother + +\makeatletter +\providecommand*\setfloatlocations[2]{\@namedef{fps@#1}{#2}} +\makeatother +\setfloatlocations{figure}{H} +\setfloatlocations{table}{H} + +\begin{document} + +\maketitle + +{\hypersetup{hidelinks} + \tableofcontents % Generates the table of contents +} + +\chapter{Introduction} +\section{What is Adigraph?} +\textbf{\href{https://ctan.org/pkg/adigraph}{Adigraph}} is a latex library for drawing directed graphs and augmenting directed graphs, and to draw cuts over them. + +It handles automatically the positioning of labels, with the exception of the horizontal position, and the inclinations of cuts. + +The latest version is available on \href{https://github.com/LucaCappelletti94/adigraph}{Github}. + +\section{License} +Copyright 2018 Luca Cappelletti + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\ + +\chapter{Setup} +\section{Installing the dependencies} +Clearly you need to have texlive installed. Then, make sure you have the following packages: + +\begin{description} + \item[\href{https://ctan.org/pkg/fp}{fp}] Used for floating point calculations. + \item[\href{https://ctan.org/pkg/xparse}{xparse}] Used for elaborating parameters. + \item[\href{https://ctan.org/pkg/xstring}{xstring}] Used for elaborating strings. + \item[\href{https://ctan.org/pkg/etoolbox}{etoolbox}] Used for operations on lists. + \item[tikz] Used for drawing the actual graphs. + \item[tikz calc library] Used for some internal calculations in tikz. +\end{description} + +To be sure you can run the following, that will install the packages only if they are not already present: + +\begin{minted}{sh} +sudo tlmgr install etoolbox fp xstring +\end{minted} + +\section{Installing Adigraph} +You can install Adigraph, if it isn't already present in your setup, by running the following on Unix systems: + +\begin{minted}{sh} +sudo tlmgr install adigraph +\end{minted} + +On windows you should check on your package manager of choice (some latex distribution have a tlmgr implementation on windows too.) + +\chapter{Usage} +\section{Creating a new graph} +Here we create a new Adigraph object, called \textit{myAdigraph}. + +\begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + +}{ + +}{ + +} +\end{minted} + +\section{Changing an existing graph} +You can renovate an older graph by calling \textbackslash RenewAdigraph + +\begin{minted}{latex} +\RenewAdigraph{myAdigraph}{ + +}{ + +}{ + +} +\end{minted} + +\section{Adding nodes} +We set its nodes with the following syntax: \textit{}. + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{Custom node colors} +To color a node you can use the following syntax: \textit{}. For example, to draw s in red and t in blue we would write: + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s,red:0,0; + t,blue:4,0; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s,red:0,0; + t,blue:4,0; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +Tested available colors are: red, blue, black, green. You may extend the possible colors with LaTex libraries such as xcolor. + +\subsection{Custom node labels} +To add a custom label you can use the following syntax: either \textit{} or \textit{} will work: + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s,red:0,0:start; + t:4,0:end; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s,red:0,0:start; + t:4,0:end; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\section{Automatically position nodes} +When no coordinates are given or you just don't have time to think abount where to put those nodes, just choose a radius and Adigraph will position them on the circle of that radius. + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + 1:0,0; + 2:2; + 3:2; + 4:2; + 5:2; + 6:2; + 7:2; + 8:2; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + 1:0,0; + 2:2; + 3:2; + 4:2; + 5:2; + 6:2; + 7:2; + 8:2; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{Colored automatically positioned nodes} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + 1:0,0; + 2,purple:2; + 3,brown:2; + 4,gray:2; + 5,blue:2; + 6,red:2; + 7,green:2; + 8,pink:2; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + 1:0,0; + 2,purple:2; + 3,brown:2; + 4,gray:2; + 5,blue:2; + 6,red:2; + 7,green:2; + 8,pink:2; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + + +\section{Adding edges} +We set its nodes with the following syntax: \textit{}. + +\subsection{A simple edge} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; +}{ + s,t; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + }{ + s,t; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{A colored simple edge} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; +}{ + s,t,red; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + }{ + s,t,red; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{A weighted edge} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; +}{ + s,t:56; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + }{ + s,t:56; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{A weighted edge with label} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; +}{ + s,t:56:myLabel; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + }{ + s,t:56:myLabel; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{Edge in both directions} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; +}{ + s,t; + t,s; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + }{ + s,t; + t,s; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{Edge with weights in both directions} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; +}{ + s,t:5; + t,s:5; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + }{ + s,t:5; + t,s:5; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{Positioning labels} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + 1:0,0; + 2:0,2; + 3:4,2; + 4:4,0; +}{ + 1,3,red:1:a:near start; + 2,4,blue:1:b:near end; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + 1:0,0; + 2:0,2; + 3:4,2; + 4:4,0; + }{ + 1,3,red:1:a:near start; + 2,4,blue:1:b:near end; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\subsection{Positioning weights} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + 1:0,0; + 2:0,2; + 3:4,2; + 4:4,0; +}{ + 1,3,red:1::near start; + 2,4,blue:1::near end; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + 1:0,0; + 2:0,2; + 3:4,2; + 4:4,0; + }{ + 1,3,red:1::near start; + 2,4,blue:1::near end; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + + +\subsection{Multiple edges with weights} +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + 1:0,3; + 2:4,3; +}{ + s,t:5; + t,s:5; + s,1:5; + 1,s:5; + 1,2:5; + 2,1:5; + 2,t:5; + t,2:5; + t,1:5; + 1,t:5; +} +\myAdigraph{} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \NewAdigraph{myAdigraph}{ + s:0,0; + t:4,0; + 1:0,3; + 2:4,3; + }{ + s,t:5; + t,s:5; + s,1:5; + 1,s:5; + 1,2:5; + 2,1:5; + 2,t:5; + t,2:5; + t,1:5; + 1,t:5; + } + \myAdigraph{} + \end{subfigure} +\end{figure} + +\section{Augmenting paths} +An augmenting path is specified by the following syntax: \textit{}. It is \textbf{very important} to note that incremental paths called upon the same object are memorized by default. + +\NewAdigraph{myAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\NewAdigraph{myAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} +\myAdigraph{ + s,3,4,2,t:5; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myAdigraph{ + s,3,4,2,t:5; + } + \end{subfigure} +\end{figure} + +For example, suppose now we'd like to send another 5 units on the graph edited by the previous incremental path, we'll have just to write the following: + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\myAdigraph{ + s,3,4,1,2,t:5; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myAdigraph{ + s,3,4,1,2,t:5; + } + \end{subfigure} +\end{figure} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\myAdigraph{ + s,3,4,t:15; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myAdigraph{ + s,3,4,t:15; + } + \end{subfigure} +\end{figure} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\myAdigraph{ + s,1,4,t:5; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myAdigraph{ + s,1,4,t:5; + } + \end{subfigure} +\end{figure} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\myAdigraph{ + s,1,2,t:10; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myAdigraph{ + s,1,2,t:10; + } + \end{subfigure} +\end{figure} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\myAdigraph{ + s,1,2,4,t:5; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myAdigraph{ + s,1,2,4,t:5; + } + \end{subfigure} +\end{figure} + +\section{Cuts} + +The following is to add cuts to show minimum cuts for example, the syntax is: \textit{} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\myAdigraph{}{ + 3,4; + 2,t; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myAdigraph{}{ + 2,t; + 3,4; + } + \end{subfigure} +\end{figure} + +\subsection{Colored cuts} +If you'd like to color the cuts you just have to add the color as follows: \textit{} + +\begin{figure} + \begin{subfigure}{0.49\textwidth} + \begin{minted}{latex} +\myAdigraph{}{ + 3,4,red; + 2,t,blue; +} +\end{minted} + \end{subfigure} + \begin{subfigure}{0.49\textwidth} + \myAdigraph{}{ + 2,t,red; + 3,4,blue; + } + \end{subfigure} +\end{figure} + + +\chapter{Warnings} +\section{Reserved words} +I reserve to use for the package the following tokens: + +\begin{multicols}{2} + \begin{enumerate} + \item \textbackslash Adigraph + \item \textbackslash AdigraphBuildEdge + \item \textbackslash AdigraphBuildEdgeWrapper + \item \textbackslash AdigraphBuildNode + \item \textbackslash AdigraphBuildNodeWrapper + \item \textbackslash AdigraphBuildPath + \item \textbackslash AdigraphCalculateOrientation + \item \textbackslash AdigraphCountPaths + \item \textbackslash AdigraphCutBuilder + \item \textbackslash AdigraphDrawEdge + \item \textbackslash AdigraphDrawNode + \item \textbackslash AdigraphEdgeBuilder + \item \textbackslash AdigraphEdgeDrawer + \item \textbackslash AdigraphElaboratePath + \item \textbackslash AdigraphExecuteCutBuilder + \item \textbackslash AdigraphGenerateNodeName + \item \textbackslash AdigraphMemorizeEdge + \item \textbackslash AdigraphMemorizeNode + \item \textbackslash AdigraphNodeBuilder + \item \textbackslash AdigraphNodeCounter + \item \textbackslash AdigraphNodeCounterSecondWrapper + \item \textbackslash AdigraphNodeCounterWrapper + \item \textbackslash AdigraphNodesCounter + \item \textbackslash AdigraphPathBuilder + \item \textbackslash AdigraphProcessAugmentingPaths + \item \textbackslash AdigraphProcessAugmentingPathsList + \item \textbackslash AdigraphProcessCuts + \item \textbackslash AdigraphProcessEdges + \item \textbackslash AdigraphProcessNodes + \item \textbackslash AdigraphProcessPaths + \item \textbackslash AdigraphSimpleSum + \item \textbackslash NewAdigraph + \item \textbackslash RenewAdigraph + \end{enumerate} +\end{multicols} + +\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf new file mode 100644 index 00000000000..f9d1eb94f6e Binary files /dev/null and b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.pdf differ diff --git a/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex new file mode 100644 index 00000000000..ac4c40406e9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/adigraph/adigraph_working_test.tex @@ -0,0 +1,75 @@ +\documentclass{report} + +\usepackage{adigraph} + +\title{Adigraph, V1.3, small working test} +\author{Luca Cappelletti} +\date{March 2018} + +\begin{document} +\maketitle +\NewAdigraph{myAdigraph}{ + s:0,0; + 1:2,2; + 3:2,-2; + 2:6,2; + 4:6,-2; + t:8,0; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} + +\myAdigraph{} + + +\myAdigraph{ + s,3,4,2,t:5; +} + +\myAdigraph{}{ + 2,t,red; + 3,4,blue; +} + +\NewAdigraph{mySecondAdigraph}{ + s:3; + 1:3; + 3:3; + 2:3; + 4:3; + t:3; +}{ + s,1:25; + s,3:25; + 3,4:25; + 1,2:35; + 2,t:20; + 4,t:30; + 3,1:10; + 4,2:10; + 2,3:15::near start; + 4,1:5::near start; +} + +\mySecondAdigraph{} + + +\mySecondAdigraph{ + s,3,4,2,t:5; +} + +\mySecondAdigraph{}{ + 2,t,red; + 3,4,blue; +} + +\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/adigraph/documentation.pdf b/Master/texmf-dist/doc/latex/adigraph/documentation.pdf deleted file mode 100644 index 911e38550ad..00000000000 Binary files a/Master/texmf-dist/doc/latex/adigraph/documentation.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/adigraph/documentation.tex b/Master/texmf-dist/doc/latex/adigraph/documentation.tex deleted file mode 100644 index d572758fe75..00000000000 --- a/Master/texmf-dist/doc/latex/adigraph/documentation.tex +++ /dev/null @@ -1,670 +0,0 @@ -\documentclass{report} - -\title{Adigraph, V1.2} -\author{Luca Cappelletti} -\date{March 2018} - -\usepackage{adigraph} -\usepackage{xcolor} -\usepackage[colorlinks=true,urlcolor=blue,pdfpagelabels,hyperindex=false]{hyperref} -\usepackage{minted} -\usepackage{multicol} -\usepackage{graphicx} % for images and generally graphics -\usepackage{caption} % enabling of nice captions -\usepackage{subcaption} % and subcaptions of images -\definecolor{mintedbackground}{rgb}{0.95,0.95,0.95} -\setminted{ - bgcolor=mintedbackground, - fontfamily=tt, - linenos=true, - numberblanklines=true, - numbersep=5pt, - gobble=0, - frame=leftline, - framerule=0.4pt, - framesep=2mm, - funcnamehighlighting=true, - tabsize=4, - obeytabs=false, - mathescape=false - samepage=false, %with this setting you can force the list to appear on the same page - showspaces=false, - showtabs =false, - texcl=false, -} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% THE FOLLOWING CENTERS ALL FLOATING ITEMS BY DEFAULT % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\makeatletter -\g@addto@macro\@floatboxreset\centering -\makeatother - -\makeatletter -\apptocmd\subcaption@minipage{\centering}{}{} -\makeatother - -\makeatletter -\providecommand*\setfloatlocations[2]{\@namedef{fps@#1}{#2}} -\makeatother -\setfloatlocations{figure}{H} -\setfloatlocations{table}{H} - -\begin{document} - -\maketitle - -{\hypersetup{hidelinks} - \tableofcontents % Generates the table of contents -} - -\chapter{Introduction} -\section{What is Adigraph?} -\textbf{\href{https://ctan.org/pkg/adigraph}{Adigraph}} is a latex library for drawing directed graphs and augmenting directed graphs, and to draw cuts over them. - -It handles automatically the positioning of labels, with the exception of the horizontal position, and the inclinations of cuts. - -The latest version is available on \href{https://github.com/LucaCappelletti94/adigraph}{Github}. - -\section{License} -Copyright 2018 Luca Cappelletti - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\ - -\chapter{Setup} -\section{Installing the dependencies} -Clearly you need to have texlive installed. Then, make sure you have the following packages: - -\begin{description} - \item[\href{https://ctan.org/pkg/fp}{fp}] Used for floating point calculations. - \item[\href{https://ctan.org/pkg/xparse}{xparse}] Used for elaborating parameters. - \item[\href{https://ctan.org/pkg/xstring}{xstring}] Used for elaborating strings. - \item[\href{https://ctan.org/pkg/etoolbox}{etoolbox}] Used for operations on lists. - \item[tikz] Used for drawing the actual graphs. - \item[tikz calc library] Used for some internal calculations in tikz. -\end{description} - -To be sure you can run the following, that will install the packages only if they are not already present: - -\begin{minted}{sh} -sudo tlmgr install etoolbox fp xstring -\end{minted} - -\section{Installing Adigraph} -You can install Adigraph, if it isn't already present in your setup, by running the following on Unix systems: - -\begin{minted}{sh} -sudo tlmgr install adigraph -\end{minted} - -On windows you should check on your package manager of choice (some latex distribution have a tlmgr implementation on windows too.) - -\chapter{Usage} -\section{Creating a new graph} -Here we create a new Adigraph object, called \textit{myAdigraph}. - -\begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - -}{ - -}{ - -} -\end{minted} - -\section{Adding nodes} -We set its nodes with the following syntax: \textit{}. - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - - -\subsection{Custom node colors} -To color a node you can use the following syntax: \textit{}. For example, to draw s in red and t in blue we would write: - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0,red; - t:4,0,blue; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0,red; - t:4,0,blue; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -Tested available colors are: red, blue, black, green. You may extend the possible colors with LaTex libraries such as xcolor. - -\subsection{Custom node labels} -To add a custom label you can use the following syntax: either \textit{} or \textit{} will work: - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0,red:start; - t:4,0:end; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0,red:start; - t:4,0:end; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\section{Adding edges} -We set its nodes with the following syntax: \textit{}. - -\subsection{A simple edge} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; -}{ - s,t; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - }{ - s,t; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\subsection{A colored simple edge} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; -}{ - s,t,red; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - }{ - s,t,red; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\subsection{A weighted edge} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; -}{ - s,t:56; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - }{ - s,t:56; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\subsection{A weighted edge with label} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; -}{ - s,t:56:myLabel; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - }{ - s,t:56:myLabel; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\subsection{Edge in both directions} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; -}{ - s,t; - t,s; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - }{ - s,t; - t,s; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\subsection{Edge with weights in both directions} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; -}{ - s,t:5; - t,s:5; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - }{ - s,t:5; - t,s:5; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\subsection{Positioning labels} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - 1:0,0; - 2:0,2; - 3:4,2; - 4:4,0; -}{ - 1,3,red:1:a:near start; - 2,4,blue:1:b:near end; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - 1:0,0; - 2:0,2; - 3:4,2; - 4:4,0; - }{ - 1,3,red:1:a:near start; - 2,4,blue:1:b:near end; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\subsection{Positioning weights} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - 1:0,0; - 2:0,2; - 3:4,2; - 4:4,0; -}{ - 1,3,red:1::near start; - 2,4,blue:1::near end; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - 1:0,0; - 2:0,2; - 3:4,2; - 4:4,0; - }{ - 1,3,red:1::near start; - 2,4,blue:1::near end; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - - -\subsection{Multiple edges with weights} -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - 1:0,3; - 2:4,3; -}{ - s,t:5; - t,s:5; - s,1:5; - 1,s:5; - 1,2:5; - 2,1:5; - 2,t:5; - t,2:5; - t,1:5; - 1,t:5; -} -\myAdigraph{} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \NewAdigraph{myAdigraph}{ - s:0,0; - t:4,0; - 1:0,3; - 2:4,3; - }{ - s,t:5; - t,s:5; - s,1:5; - 1,s:5; - 1,2:5; - 2,1:5; - 2,t:5; - t,2:5; - t,1:5; - 1,t:5; - } - \myAdigraph{} - \end{subfigure} -\end{figure} - -\section{Augmenting paths} -An augmenting path is specified by the following syntax: \textit{}. It is \textbf{very important} to note that incremental paths called upon the same object are memorized by default. - -\NewAdigraph{myAdigraph}{ - s:0,0; - 1:2,2; - 3:2,-2; - 2:6,2; - 4:6,-2; - t:8,0; -}{ - s,1:25; - s,3:25; - 3,4:25; - 1,2:35; - 2,t:20; - 4,t:30; - 3,1:10; - 4,2:10; - 2,3:15::near start; - 4,1:5::near start; -} - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\NewAdigraph{myAdigraph}{ - s:0,0; - 1:2,2; - 3:2,-2; - 2:6,2; - 4:6,-2; - t:8,0; -}{ - s,1:25; - s,3:25; - 3,4:25; - 1,2:35; - 2,t:20; - 4,t:30; - 3,1:10; - 4,2:10; - 2,3:15::near start; - 4,1:5::near start; -} -\myAdigraph{ - s,3,4,2,t:5; -} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \myAdigraph{ - s,3,4,2,t:5; - } - \end{subfigure} -\end{figure} - -For example, suppose now we'd like to send another 5 units on the graph edited by the previous incremental path, we'll have just to write the following: - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\myAdigraph{ - s,3,4,1,2,t:5; -} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \myAdigraph{ - s,3,4,1,2,t:5; - } - \end{subfigure} -\end{figure} - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\myAdigraph{ - s,3,4,t:15; -} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \myAdigraph{ - s,3,4,t:15; - } - \end{subfigure} -\end{figure} - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\myAdigraph{ - s,1,4,t:5; -} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \myAdigraph{ - s,1,4,t:5; - } - \end{subfigure} -\end{figure} - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\myAdigraph{ - s,1,2,t:10; -} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \myAdigraph{ - s,1,2,t:10; - } - \end{subfigure} -\end{figure} - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\myAdigraph{ - s,1,2,4,t:5; -} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \myAdigraph{ - s,1,2,4,t:5; - } - \end{subfigure} -\end{figure} - -\section{Cuts} - -The following is to add cuts to show minimum cuts for example, the syntax is: \textit{} - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\myAdigraph{}{ - 3,4; - 2,t; -} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \myAdigraph{}{ - 2,t; - 3,4; - } - \end{subfigure} -\end{figure} - -\subsection{Colored cuts} -If you'd like to color the cuts you just have to add the color as follows: \textit{} - -\begin{figure} - \begin{subfigure}{0.49\textwidth} - \begin{minted}{latex} -\myAdigraph{}{ - 3,4,red; - 2,t,blue; -} -\end{minted} - \end{subfigure} - \begin{subfigure}{0.49\textwidth} - \myAdigraph{}{ - 2,t,red; - 3,4,blue; - } - \end{subfigure} -\end{figure} - -\chapter{Warnings} -\section{Reserved words} -I reserve to use for the package the following tokens: - -\begin{multicols}{2} - \begin{enumerate} - \item Adigraph - \item AdigraphAugmentingPaths - \item AdigraphBuildEdge - \item AdigraphBuildEdgeWrapper - \item AdigraphBuildNode - \item AdigraphBuildPath - \item AdigraphCalculateOrientation - \item AdigraphCounter - \item AdigraphCountPaths - \item AdigraphCurrentPathNumber - \item AdigraphCutBuilder - \item AdigraphDrawEdge - \item AdigraphDrawNode - \item AdigraphEdgeBuilder - \item AdigraphEdgeDrawer - \item AdigraphEdgeList - \item AdigraphEdgeName - \item AdigraphElaboratePath - \item AdigraphElaboratePath - \item AdigraphExecuteCutBuilder - \item AdigraphFirstNode - \item AdigraphMemorizeEdge - \item AdigraphMemorizeNode - \item AdigraphNodeBuilder - \item AdigraphNodeList - \item AdigraphNodeName - \item AdigraphNumberOfPaths - \item AdigraphPathBuilder - \item AdigraphProcessAugmentingPaths - \item AdigraphProcessCuts - \item AdigraphProcessEdges - \item AdigraphProcessNodes - \item AdigraphProcessPaths - \item AdigraphRom - \item AdigraphSecondNode - \item AdigraphSimpleSum - \item AdigraphTwinEdgeWeight - \item NewAdigraph - \end{enumerate} -\end{multicols} - -\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/adigraph/test.pdf b/Master/texmf-dist/doc/latex/adigraph/test.pdf deleted file mode 100644 index bd969940ca7..00000000000 Binary files a/Master/texmf-dist/doc/latex/adigraph/test.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/adigraph/test.tex b/Master/texmf-dist/doc/latex/adigraph/test.tex deleted file mode 100644 index ba12098a92a..00000000000 --- a/Master/texmf-dist/doc/latex/adigraph/test.tex +++ /dev/null @@ -1,42 +0,0 @@ -\documentclass{report} - -\usepackage{adigraph} - -\title{Adigraph, V1.2, small working test} -\author{Luca Cappelletti} -\date{March 2018} - -\begin{document} -\maketitle -\NewAdigraph{myAdigraph}{ - s:0,0; - 1:2,2; - 3:2,-2; - 2:6,2; - 4:6,-2; - t:8,0; -}{ - s,1:25; - s,3:25; - 3,4:25; - 1,2:35; - 2,t:20; - 4,t:30; - 3,1:10; - 4,2:10; - 2,3:15::near start; - 4,1:5::near start; -} - -\myAdigraph{} - - -\myAdigraph{ - s,3,4,2,t:5; -} - -\myAdigraph{}{ - 2,t,red; - 3,4,blue; -} -\end{document} \ No newline at end of file -- cgit v1.2.3