Du bist hier: StartLaTeX › PHP-Code einbindenDieses Snippet kommentieren

\usepackage[pdftex]{color}

\definecolor{phpdoc}      {rgb} {1.0, 0.5, 0.0}
\definecolor{phpcodetags} {rgb} {1.0, 0.0, 0.0}
\definecolor{phpkeyword}  {rgb} {0.0, 0.0, 1.0}
\definecolor{phpcomment}  {rgb} {0.0, 0.5, 0.0}
\definecolor{phpstring}   {rgb} {1.0, 0.0, 0.0}

\usepackage{listings}
\lstset{
   language           = php,
   extendedchars      = true,
   basicstyle         = \ttfamily,
   backgroundcolor    = \color[gray]{0.95},
   frame              = single,
   framexleftmargin   = 5pt,
   rulesep            = 5pt,
   framexrightmargin  = 5pt,
   framexbottommargin = 5pt,
   framextopmargin    = 5pt,
   xleftmargin        = 5pt,
   xrightmargin       = 5pt,
   framerule          = 0pt,
   %numbers           = left,
   %numberstyle       = \tiny \color{gruen},
   tabsize            = 4,
   breaklines         = true,
   captionpos         = b,
   commentstyle       = \color{phpcomment},
   keywordstyle       = \color{phpkeyword},
   stringstyle        = \color{phpstring},
   literate           =
      {<?php}{{\textcolor{red}{<?php}}}{5}
      {?>}{{\textcolor{red}{?>}}}{2}
}

Das Hinzufügen von Kommentaren ist für dieses Snippet nicht erlaubt.