Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using listings package for code highlighting and I want to have a different color frame around my code examples. Any ideas how to do it? There is backgroundcolor but there isn't framecolor so I can't figure out how to do it.

share|improve this question
    
I found it, it was rulecolor. –  Peteris Krumins Apr 30 '11 at 0:48
1  
You can answer it yourself and accept it. –  Leo Liu Apr 30 '11 at 1:18
3  
It's fine to put this as an answer (maybe with a small example document to show others who have this question.) –  Alan Munn Apr 30 '11 at 1:20

1 Answer 1

up vote 5 down vote accepted

The answer has been given above. But to have at least an answer to this question I'll give an example how to use rulecolor:

\documentclass{minimal}
\usepackage{listings,color}
\lstset{
    language=PHP,
    frame=lines,
    rulecolor=\color{red}
}
\begin{document}
\begin{lstlisting}
<?php
echo 'Hello World!';
?>
\end{lstlisting}
\end{document}

enter image description here

share|improve this answer
    
Thanks for the full example. –  Peteris Krumins May 2 '11 at 8:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.