diff options
author | Alex Merry <alex.merry@cs.ox.ac.uk> | 2013-08-07 16:56:23 +0100 |
---|---|---|
committer | Alex Merry <alex.merry@cs.ox.ac.uk> | 2013-08-07 17:04:48 +0100 |
commit | ac7b53be102860d76f318ab0575cfb546635d04e (patch) | |
tree | 5e869a1390c224b9b601d55a4e267160af7ab585 /tikzit/src/osx/PreviewController.m | |
parent | 5a94458d9ee3ee8afd978477c755200df432a9b0 (diff) |
Allow preambles to omit the tikzit-specific preview stuff
The editable preambles include a bunch of things that *have* to be there
for previews to work, which makes figuring out what you can edit hard.
We now add a \documentclass automagically if it is missing, and if
\begin{document} is missing, we assume the preview-specific stuff should
be added.
OSX changes are untested.
Diffstat (limited to 'tikzit/src/osx/PreviewController.m')
-rw-r--r-- | tikzit/src/osx/PreviewController.m | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tikzit/src/osx/PreviewController.m b/tikzit/src/osx/PreviewController.m index 7c41562..94a80a4 100644 --- a/tikzit/src/osx/PreviewController.m +++ b/tikzit/src/osx/PreviewController.m @@ -52,10 +52,7 @@ static PreviewController *preview = nil; int fnum = typesetCount++; - NSString *tex = [NSString stringWithFormat:@"%@%@%@", - [preambleController currentPreamble], - tikz, - [preambleController currentPostamble]]; + NSString *tex = [preambleController buildDocumentForTikz:tikz]; NSString *texFile = [NSString stringWithFormat:@"%@/tikzit_%d.tex", tempDir, fnum]; NSString *pdfFile = [NSString stringWithFormat:@"%@/tikzit_%d.pdf", tempDir, fnum]; |