diff options
author | randomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64> | 2012-02-02 12:15:57 +0000 |
---|---|---|
committer | randomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64> | 2012-02-02 12:15:57 +0000 |
commit | 397cd4071a2f313b3b3b40f8b748c9f6103f5002 (patch) | |
tree | f0fd9b381d13640ee6bc1527418eb64db5a38415 /tikzit/src/common/Preambles.m | |
parent | 071fea73851125d78a7df3a9b749fa90ab41b0fa (diff) |
Generate definitions for the edge styles in the default preamble
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@407 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/src/common/Preambles.m')
-rw-r--r-- | tikzit/src/common/Preambles.m | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tikzit/src/common/Preambles.m b/tikzit/src/common/Preambles.m index 4f74dd0..d41f9b0 100644 --- a/tikzit/src/common/Preambles.m +++ b/tikzit/src/common/Preambles.m @@ -28,6 +28,7 @@ static NSString *PREAMBLE_HEAD = @"\\documentclass{article}\n" @"\\usepackage[svgnames]{xcolor}\n" @"\\usepackage{tikz}\n" +@"\\usetikzlibrary{decorations.markings}\n" @"\\pagestyle{empty}\n" @"\n" @"\\pgfdeclarelayer{edgelayer}\n" @@ -102,7 +103,7 @@ static NSString *POSTAMBLE = NSMutableString *colbuf = [NSMutableString string]; NSMutableSet *colors = [NSMutableSet setWithCapacity:2*[styles count]]; for (NodeStyle *st in styles) { - [buf appendFormat:@"%@", [st tikz]]; + [buf appendFormat:@"%@\n", [st tikz]]; ColorRGB *fill = [st fillColorRGB]; ColorRGB *stroke = [st strokeColorRGB]; if ([fill name] == nil && ![colors containsObject:fill]) { @@ -117,8 +118,12 @@ static NSString *POSTAMBLE = [fill hexName], [fill redFloat], [fill greenFloat], [fill blueFloat]]; } } + [buf appendString:@"\n"]; + for (EdgeStyle *st in [styleManager edgeStyles]) { + [buf appendFormat:@"%@\n", [st tikz]]; + } - NSString *defs = [[NSString alloc] initWithFormat:@"%@%@", colbuf, buf]; + NSString *defs = [[NSString alloc] initWithFormat:@"%@\n%@", colbuf, buf]; [pool drain]; return [defs autorelease]; |