summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/engine/SCons/Scanner/LaTeX.py1
-rw-r--r--src/engine/SCons/Scanner/LaTeXTests.py16
2 files changed, 16 insertions, 1 deletions
diff --git a/src/engine/SCons/Scanner/LaTeX.py b/src/engine/SCons/Scanner/LaTeX.py
index f48c84d..ce4c310 100644
--- a/src/engine/SCons/Scanner/LaTeX.py
+++ b/src/engine/SCons/Scanner/LaTeX.py
@@ -187,7 +187,6 @@ class LaTeX(SCons.Scanner.Base):
# lines), interfering with a match on the next line.
# add option for whitespace before the '[options]' or the '{filename}'
regex = r'''
- ^[^%\n]*
\\(
include
| includegraphics(?:\s*\[[^\]]+\])?
diff --git a/src/engine/SCons/Scanner/LaTeXTests.py b/src/engine/SCons/Scanner/LaTeXTests.py
index 6dd7dac..409699c 100644
--- a/src/engine/SCons/Scanner/LaTeXTests.py
+++ b/src/engine/SCons/Scanner/LaTeXTests.py
@@ -61,6 +61,12 @@ test.write('test3.latex',r"""
\includegraphics[width=60mm]{inc5.xyz}
""")
+test.write('test4.latex',r"""
+\include{inc1}\include{inc2}
+\only<1>{\includegraphics{inc5.xyz}}%
+\only<2>{\includegraphics{inc7.png}}
+""")
+
test.subdir('subdir')
test.write('inc1.tex',"\n")
@@ -73,6 +79,7 @@ test.write(['subdir', 'inc3c.tex'], "\n")
test.write(['subdir', 'inc4.eps'], "\n")
test.write('inc5.xyz', "\n")
test.write('inc6.tex', "\n")
+test.write('inc7.png', "\n")
test.write('incNO.tex', "\n")
# define some helpers:
@@ -155,6 +162,15 @@ class LaTeXScannerTestCase3(unittest.TestCase):
files = ['inc5.xyz', 'subdir/inc4.eps']
deps_match(self, deps, files)
+class LaTeXScannerTestCase4(unittest.TestCase):
+ def runTest(self):
+ env = DummyEnvironment(TEXINPUTS=[test.workpath("subdir")],LATEXSUFFIXES = [".tex", ".ltx", ".latex"])
+ s = SCons.Scanner.LaTeX.LaTeXScanner()
+ path = s.path(env)
+ deps = s(env.File('test4.latex'), env, path)
+ files = ['inc1.tex', 'inc2.tex', 'inc5.xyz', 'inc7.png']
+ deps_match(self, deps, files)
+
if __name__ == "__main__":
unittest.main()