In relation to my comment. You can use the option literate only for the brackets.
\documentclass[10pt]{article}
\usepackage{bera}
\usepackage{xcolor}
\usepackage{listings}
\lstset{basicstyle=\footnotesize\ttfamily,columns=flexible,frame=single,framerule=0pt,%
backgroundcolor=\color{gray!20},%
xleftmargin=\fboxsep,%
xrightmargin=\fboxsep,
language=[LaTeX]TeX,%
keywordstyle=\color{blue},%
texcsstyle=*\color{red}\bfseries,%
texcs={end,begin,documentclass,graphicspath},%
mathescape=false,escapechar=|,%
literate={<B>}{\textcolor{blue}{\string\usepackage}}1
{\{ }{\textcolor{red}{\{}}1
{\}}{\textcolor{red}{\}}}1
{[}{\textcolor{green}{[}}1
{]}{\textcolor{green}{]}}1
}
\pagestyle{empty}
\begin{document}
\begin{lstlisting}
\documentclass[12pt]{article}
<B>{xcolor}
<B>{listings}
<B>[options]{graphicx}
\graphicspath{{img/pdf}}
\begin{document}
Text
\end{document}
\end{lstlisting}
\end{document}
you could use the listings
package if what you have is just code. It does not have the definition for Maple, however, lucky for you, Alexander Shapiro already ran into that problem. The following is taken from Here, and should go in your preamble.
%%
%% Maple definitions (c) 2008 Alexander Shapiro
%%
\lst@definelanguage{Maple}%
{morekeywords={and,assuming,break,by,catch,description,do,done,%
elif,else,end,error,export,fi,finally,for,from,global,if,%
implies,in,intersect,local,minus,mod,module,next,not,od,%
option,options,or,proc,quit,read,return,save,stop,subset,then,%
to,try,union,use,uses,while,xor},%
sensitive=true,%
morecomment=[l]\#,%
morestring=[b]",%
morestring=[d]"%
}[keywords,comments,strings]%
If you want to include whole worksheets with inputs and outputs, then look into maple2e
. The file maple2e.sty is supplied by Maplesoft, and you should move it to the proper folder on your machine look here for instructions.
Documentation of maple2e
can be found Here and here.
Best Answer
After I try listings package based on some previous answers, it turns out like this @@