# File lib/maruku/output/to_latex.rb, line 231
  def to_latex_code
    if get_setting(:latex_use_listings)
      @doc.latex_require_package('listings')

      s = "\\lstset{columns=fixed,frame=shadowbox}"

      if get_setting(:code_show_spaces)
        s << "\\lstset{showspaces=true,showtabs=true}\n"
      else
        s << "\\lstset{showspaces=false,showtabs=false}\n"
      end

      color = latex_color get_setting(:code_background_color)

      s << "\\lstset{backgroundcolor=#{color}}\n"

      s << "\\lstset{basicstyle=\\ttfamily\\footnotesize}\n"


      lang = self.attributes[:lang] || @doc.attributes[:code_lang] || '{}'
      s << "\\lstset{language=#{lang}}\n" if lang

      "#{s}\n\\begin{lstlisting}\n#{self.raw_code}\n\\end{lstlisting}"
    else
      "\\begin{verbatim}#{self.raw_code}\\end{verbatim}\n"
    end
  end