summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@cs.ox.ac.uk>2012-05-07 14:39:54 +0100
committerAlex Merry <alex.merry@cs.ox.ac.uk>2012-05-07 14:39:54 +0100
commit37e7f18392109225ca5c257d14eda2f89a938370 (patch)
tree09d6adf5d00c7ccb413cae5f2fb9df22e1d75c48
parent6c41239ab07752b4ba5009522bbaca0f3e0cdbc6 (diff)
Correctly remove $ at end of latex commands
Previously, a string like '$\alpha$' would retain the final $ when displayed on a label.
-rw-r--r--tikzit/src/common/NSString+LatexConstants.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/tikzit/src/common/NSString+LatexConstants.m b/tikzit/src/common/NSString+LatexConstants.m
index d2d0ed8..bd598b7 100644
--- a/tikzit/src/common/NSString+LatexConstants.m
+++ b/tikzit/src/common/NSString+LatexConstants.m
@@ -176,7 +176,9 @@ static NSSet *texModifiers = nil;
if (c=='\\') {
state = 1;
} else {
- [buf appendFormat:@"%C", c];
+ if (c!='$') {
+ [buf appendFormat:@"%C", c];
+ }
state = 0;
}