We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a8f3e1 commit bbd271aCopy full SHA for bbd271a
scripts.dtx
@@ -56,13 +56,13 @@ if sys.argv[1].endswith('.sagetex.sage'):
56
else:
57
src = os.path.splitext(sys.argv[1])[0]
58
59
-usepackage = r'\usepackage(\[.*\])?{sagetex}'
+usepackage = r'usepackage(\[.*\])?{sagetex}'
60
uses_sagetex = False
61
62
-# if it doesn't use sagetex, obviously running sage is unnecessary
+# if it does not use sagetex, obviously running sage is unnecessary
63
with open(src + '.tex') as texf:
64
for line in texf:
65
- if re.search(usepackage, line.replace(r'\%', '').split('%')[0]):
+ if line.strip().startswith(r'\usepackage') and re.search(usepackage, line):
66
uses_sagetex = True
67
break
68
0 commit comments