summaryrefslogtreecommitdiffstats
path: root/SCons
diff options
context:
space:
mode:
authorKeith F. Prussing <kprussing74@gmail.com>2024-10-19 00:01:56 (GMT)
committerKeith F. Prussing <Keith.Prussing@gtri.gatech.edu>2024-10-21 15:14:48 (GMT)
commitb2391119dc5203ebdc267334c864eb32079d3382 (patch)
tree1ab5ed7daf3017b3958a4fc6c9b65741ec73949a /SCons
parentc9d898304f2cec39c81a4e91801dd14868546365 (diff)
downloadSCons-b2391119dc5203ebdc267334c864eb32079d3382.zip
SCons-b2391119dc5203ebdc267334c864eb32079d3382.tar.gz
SCons-b2391119dc5203ebdc267334c864eb32079d3382.tar.bz2
Add support for tracking beamer themes
This adds a regular expression to check for beamer theme files for LaTeX that may be part of the user's build tree. Similar to package files found via `\usepackage`, this will not report a missing file because the user may just be relying on the system version.
Diffstat (limited to 'SCons')
-rw-r--r--SCons/Scanner/LaTeX.py11
1 files changed, 10 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 "