code: def generate(env):
      
      global PDFLaTeXAction
      if PDFLaTeXAction is None:
          PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR')
  
      global PDFLaTeXAuxAction
      if PDFLaTeXAuxAction is None:
          PDFLaTeXAuxAction = SCons.Action.Action(PDFLaTeXAuxFunction,
                                strfunction=SCons.Tool.tex.TeXLaTeXStrFunction)
  
      env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)
  
      from . import pdf
      pdf.generate(env)
  
      bld = env['BUILDERS']['PDF']
      bld.add_action('.ltx', PDFLaTeXAuxAction)
      bld.add_action('.latex', PDFLaTeXAuxAction)
      bld.add_emitter('.ltx', SCons.Tool.tex.tex_pdf_emitter)
      bld.add_emitter('.latex', SCons.Tool.tex.tex_pdf_emitter)
  
      SCons.Tool.tex.generate_common(env)
docs: Add Builders and construction variables for pdflatex to an Environment.