From 317d5120c71ff0b68807b397b711a0f853657f43 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Wed, 2 Jan 2019 12:31:22 +0100 Subject: copy added [tikzfig] style by default --- src/data/graph.cpp | 1 + tex/sample/figures/fig.tikz | 10 +++++----- tex/sample/sample.tex | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/data/graph.cpp b/src/data/graph.cpp index da7b345..1dd5574 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -279,6 +279,7 @@ Graph *Graph::copyOfSubgraphWithNodes(QSet nds) { Graph *g = new Graph(); g->setData(_data->copy()); + g->data()->setAtom("tikzfig"); QMap nodeTable; foreach (Node *n, nodes()) { if (nds.contains(n)) { diff --git a/tex/sample/figures/fig.tikz b/tex/sample/figures/fig.tikz index e485d9f..b7074a8 100644 --- a/tex/sample/figures/fig.tikz +++ b/tex/sample/figures/fig.tikz @@ -1,4 +1,4 @@ -\begin{tikzpicture} +\begin{tikzpicture}[tikzfig] \begin{pgfonlayer}{nodelayer} \node [style=red node] (0) at (0, 1) {}; \node [style=blue node 2] (1) at (1, 0) {}; @@ -6,9 +6,9 @@ \node [style=yellow square] (3) at (0, -1) {foo}; \end{pgfonlayer} \begin{pgfonlayer}{edgelayer} - \draw [in=-90, out=0] (3.center) to (1.center); - \draw [bend right=45, looseness=1.25] (3.center) to (2.center); - \draw (2.center) to (0.center); - \draw (0.center) to (1.center); + \draw [in=-90, out=0] (3) to (1); + \draw [bend right] (3) to (2); + \draw (2) to (0); + \draw (0) to (1); \end{pgfonlayer} \end{tikzpicture} diff --git a/tex/sample/sample.tex b/tex/sample/sample.tex index bbb20e0..1b10cf6 100644 --- a/tex/sample/sample.tex +++ b/tex/sample/sample.tex @@ -26,10 +26,10 @@ It is also possible to paste a \texttt{tikzpicture} directly from TikZiT, withou \node [style=yellow square] (3) at (0, -1) {foo}; \end{pgfonlayer} \begin{pgfonlayer}{edgelayer} - \draw [in=-90, out=0] (3.center) to (1.center); - \draw [bend right=45, looseness=1.25] (3.center) to (2.center); - \draw (2.center) to (0.center); - \draw (0.center) to (1.center); + \draw [in=-90, out=0] (3) to (1); + \draw [bend right] (3) to (2); + \draw (2) to (0); + \draw (0) to (1); \end{pgfonlayer} \end{tikzpicture} \] -- cgit v1.2.3