summaryrefslogtreecommitdiffstats
path: root/SCons
diff options
context:
space:
mode:
authorJoseph Brill <48932340+jcbrill@users.noreply.github.com>2024-10-26 11:47:41 (GMT)
committerJoseph Brill <48932340+jcbrill@users.noreply.github.com>2024-10-26 11:47:41 (GMT)
commitca866a25eb7caa2ff4c15048271441c1d8d2ba75 (patch)
treecfa52ae9aa3e11762e2d6cd7fcdadd8a0b4612ee /SCons
parentf13babbe48114770effba65ed39f528afa56fcce (diff)
parent3b6e4d1248886c557838f938cff4f0cf8b850619 (diff)
downloadSCons-ca866a25eb7caa2ff4c15048271441c1d8d2ba75.zip
SCons-ca866a25eb7caa2ff4c15048271441c1d8d2ba75.tar.gz
SCons-ca866a25eb7caa2ff4c15048271441c1d8d2ba75.tar.bz2
Merge branch 'master' into jbrill-msvs-tests
Manually resolve conflicts: CHANGES.txt and RELEASE.txt
Diffstat (limited to 'SCons')
-rw-r--r--SCons/Scanner/LaTeX.py11
-rw-r--r--SCons/Scanner/LaTeXTests.py22
2 files changed, 32 insertions, 1 deletions
diff --git a/SCons/Scanner/LaTeX.py b/SCons/Scanner/LaTeX.py
index 4412aee..93c2752 100644
--- a/SCons/Scanner/LaTeX.py
+++ b/SCons/Scanner/LaTeX.py
@@ -169,6 +169,11 @@ class LaTeX(ScannerBase):
'addsectionbib': 'BIBINPUTS',
'makeindex': 'INDEXSTYLE',
'usepackage': 'TEXINPUTS',
+ 'usetheme': 'TEXINPUTS',
+ 'usecolortheme': 'TEXINPUTS',
+ 'usefonttheme': 'TEXINPUTS',
+ 'useinnertheme': 'TEXINPUTS',
+ 'useoutertheme': 'TEXINPUTS',
'lstinputlisting': 'TEXINPUTS'}
env_variables = SCons.Util.unique(list(keyword_paths.values()))
two_arg_commands = ['import', 'subimport',
@@ -193,6 +198,7 @@ class LaTeX(ScannerBase):
| addglobalbib
| addsectionbib
| usepackage
+ | use(?:|color|font|inner|outer)theme(?:\s*\[[^\]]+\])?
)
\s*{([^}]*)} # first arg
(?: \s*{([^}]*)} )? # maybe another arg
@@ -362,6 +368,9 @@ class LaTeX(ScannerBase):
if inc_type in self.two_arg_commands:
inc_subdir = os.path.join(subdir, include[1])
inc_list = include[2].split(',')
+ elif re.match('use(|color|font|inner|outer)theme', inc_type):
+ inc_list = [re.sub('use', 'beamer', inc_type) + _ + '.sty' for _ in
+ include[1].split(',')]
else:
inc_list = include[1].split(',')
for inc in inc_list:
@@ -411,7 +420,7 @@ class LaTeX(ScannerBase):
if n is None:
# Do not bother with 'usepackage' warnings, as they most
# likely refer to system-level files
- if inc_type != 'usepackage':
+ if inc_type != 'usepackage' or re.match("use(|color|font|inner|outer)theme", inc_type):
SCons.Warnings.warn(
SCons.Warnings.DependencyWarning,
"No dependency generated for file: %s "
diff --git a/SCons/Scanner/LaTeXTests.py b/SCons/Scanner/LaTeXTests.py
index ae3ae66..a3f0263 100644
--- a/SCons/Scanner/LaTeXTests.py
+++ b/SCons/Scanner/LaTeXTests.py
@@ -63,6 +63,18 @@ test.write('test4.latex',r"""
\only<2>{\includegraphics{inc7.png}}
""")
+test.write('test5.latex',r"""
+\usetheme{scons}
+""")
+test.write('beamerthemescons.sty',r"""
+\usecolortheme[option]{scons}
+\usefonttheme{scons}
+\useinnertheme{scons}
+\useoutertheme{scons}
+""")
+for theme in ('color', 'font', 'inner', 'outer'):
+ test.write('beamer' + theme + 'themescons.sty', "\n")
+
test.subdir('subdir')
test.write('inc1.tex',"\n")
@@ -167,6 +179,16 @@ class LaTeXScannerTestCase4(unittest.TestCase):
files = ['inc1.tex', 'inc2.tex', 'inc5.xyz', 'inc7.png']
deps_match(self, deps, files)
+class LaTeXScannerTestCase5(unittest.TestCase):
+ def runTest(self) -> None:
+ env = DummyEnvironment(TEXINPUTS=[test.workpath("subdir")],LATEXSUFFIXES = [".tex", ".ltx", ".latex"])
+ s = SCons.Scanner.LaTeX.LaTeXScanner()
+ path = s.path(env)
+ deps = s(env.File('test5.latex'), env, path)
+ files = ['beamer' + _ + 'themescons.sty' for _ in
+ ('color', 'font', 'inner', 'outer', '')]
+ deps_match(self, deps, files)
+
if __name__ == "__main__":
unittest.main()