code: def visit_snippet_latex(self, node):
      
      code = node.rawsource.rstrip('\n')
  
      lang = self.hlsettingstack[-1][0]
      linenos = code.count('\n') >= self.hlsettingstack[-1][1] - 1
      fname = node['filename']
      highlight_args = node.get('highlight_args', {})
      if 'language' in node:
          # code-block directives
          lang = node['language']
          highlight_args['force'] = True
      if 'linenos' in node:
          linenos = node['linenos']
  
      def warner(msg):
          self.builder.warn(msg, (self.curfilestack[-1], node.line))
  
      hlcode = self.highlighter.highlight_block(code, lang, warn=warner,
                                                linenos=linenos,
                                                **highlight_args)
  
      self.body.append(
          '\n{\\colorbox[rgb]{0.9,0.9,0.9}'
          '{\\makebox[\\textwidth][l]'
          '{\\small\\texttt{%s}}}}\n' % (
              # Some filenames have '_', which is special in latex.
              fname.replace('_', r'\_'),
          )
      )
  
      if self.table:
          hlcode = hlcode.replace('\\begin{Verbatim}',
                                  '\\begin{OriginalVerbatim}')
          self.table.has_problematic = True
          self.table.has_verbatim = True
  
      hlcode = hlcode.rstrip()[:-14]  # strip \end{Verbatim}
      hlcode = hlcode.rstrip() + '\n'
      self.body.append('\n' + hlcode + '\\end{%sVerbatim}\n' %
                       (self.table and 'Original' or ''))
  
      # Prevent rawsource from appearing in output a second time.
      raise nodes.SkipNode
docs: Latex document generator visit handler