code: def is_LaTeX(flist,env,abspath):
      savedpath = modify_env_var(env, 'TEXINPUTS', abspath)
      paths = env['ENV']['TEXINPUTS']
      if SCons.Util.is_List(paths):
          pass
      else:
          paths = paths.split(os.pathsep)
      if savedpath is _null:
          try:
              del env['ENV']['TEXINPUTS']
          except KeyError:
              pass
      else:
          env['ENV']['TEXINPUTS'] = savedpath
      if Verbose:
          print("is_LaTeX search path ",paths)
          print("files to search :",flist)
      for f in flist:
          if Verbose:
              print(" checking for Latex source ",str(f))
          content = f.get_text_contents()
          if LaTeX_re.search(content):
              if Verbose:
                  print("file %s is a LaTeX file" % str(f))
              return 1
          if Verbose:
              print("file %s is not a LaTeX file" % str(f))
          inc_files = [ ]
          inc_files.extend( include_re.findall(content) )
          if Verbose:
              print("files included by '%s': "%str(f),inc_files)
          for src in inc_files:
              srcNode = FindFile(src,['.tex','.ltx','.latex'],paths,env,requireExt=False)
              fileList = [srcNode,]
              if Verbose:
                  print("FindFile found ",srcNode)
              if srcNode is not None:
                  file_test = is_LaTeX(fileList, env, abspath)
              if file_test:
                  return file_test
          if Verbose:
              print(" done scanning ",str(f))
      return 0