-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config.asy and psviewer that removes trash
To remove the useless eps.out file that is created by Asymptote and to prevent an annoying gv popup, we create our own config.asy, and arrange to have it run a program to remove the out.eps (the programs file argument).
- Loading branch information
Showing
5 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// This is an Asymptote configuration file for mathicsscript. | ||
// We set up a fake_previewer which will remove out.eps | ||
// that Asymptote wants to create | ||
import settings; | ||
psviewer="fake_psviewer.py"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env Python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
This is a replacement for a PostScript previewer like gv | ||
which does nothing, but remove any file argument it is | ||
given. | ||
Asymptote run via mathicsscript will create an embeded postscript file out.eps | ||
which should be removed. | ||
""" | ||
import os | ||
import sys | ||
|
||
|
||
def main(): | ||
if len(sys.argv) > 1: | ||
eps_file = sys.argv[1] | ||
if os.path.exists(eps_file): | ||
os.remove(eps_file) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters