Skip to content

Commit

Permalink
fix csv input by removing leading and trailing spaces (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
hackl committed Aug 14, 2019
1 parent 577a413 commit 6bfef6e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tikz-network.sty
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% File : tikz-network.sty -- Library for plotting networks in TikZ
% Author : Juergen Hackl <[email protected]>
% Creation : 2017-02-28
% Time-stamp: <Mon 2018-07-30 11:26 juergen>
% Time-stamp: <Wed 2019-08-14 14:49 juergen>
% Version : 1.0 (2018-07-30)
%
% Copyright (c) 2018 Juergen Hackl <[email protected]>
Expand Down Expand Up @@ -33,6 +33,7 @@
\RequirePackage{tikz}
\RequirePackage{datatool}
\RequirePackage{graphicx}
\RequirePackage{trimspaces}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\usetikzlibrary{3d}
Expand Down Expand Up @@ -797,6 +798,8 @@
\edef\vertex@rgbValues{}%
% Go through each row element
\DTLforeachkeyinrow{\thisValue}{
% Remove leading and trailing spaces
\trim@spaces@in\dtlkey
\DTLifeq{\dtlkey}{id}{
% Assign vertex id to storage variable
\edef\vertex@id{\thisValue}%
Expand Down Expand Up @@ -970,8 +973,10 @@
{1\DefaultUnit}, position = {}, loopposition = {0}, loopshape = {90},
distance = {.5}, path = {}, fontcolor = {}, fontsize = {}, fontscale ={},}
\edef\edge@rgbValues{}%
% Go through each row element
\DTLforeachkeyinrow{\thisValue}{
% Go through each row element
\DTLforeachkeyinrow{\thisValue}{
% Remove leading and trailing spaces
\trim@spaces@in\dtlkey
\DTLifeq{\dtlkey}{u}{
% Assign edge id to storage variable
\edef\edge@u{\thisValue}%
Expand Down

0 comments on commit 6bfef6e

Please sign in to comment.