# Creating a table around a java script code highlighted using minted

I would like to create a block around javascript code in latex.

I use minted package for format highlighting.

Here is my example code:

\documentclass[]{article}
\usepackage{minted}

%opening

\begin{document}

\begin{listing}[H]
\begin{minted}{js}
var http = require("http");
http.createServer(function(request, response) {
response.end();
}).listen(8080);
\end{minted}
\caption{Example of a listing.}
\end{listing}

\end{document}


And I get the output as

I would like to create a block around the code. Or a table embedding the code.

Any help is really appreciated.

And one more thing, whenever I run the above example on TexmakerX, I get an error Package

minted Error: You must invoke LaTeX with the -shell-escape flag


But when I run it in the cmd, using

pdflatex -shell-escape filename


it seems to work fine.

How can I make it run in Texmakerx?

-
Please ask one question at a time. I have answered the part regarding the "block". I am posting a follow-up question regarding how to invoke -shell-escape in TeXStudio (the new name of TeXMakerX) –  hpesoj626 Feb 22 '13 at 18:09
I have posted the other part of the question here: How to invoke latex with the -shell-escape flag in TeXMakerX? –  hpesoj626 Feb 22 '13 at 18:24

Do you want to achieve something like this?

Do you mean you want to put a frame around your code? You have to use the frame option. You can choose from the values none (the default), leftline, topline, bottomline, lines, single.

\documentclass[]{article}
\usepackage{minted}

%opening

\begin{document}

\begin{listing}[H]
\begin{minted}[frame=single]{js}
var http = require("http");
http.createServer(function(request, response) {