Tuesday, 28 May 2013

How to combine framed and listings packages in new environment

How to combine framed and listings packages in new environment

I always use this latex code to display a source code in my article.
\begin{listingbox}{VB style}
\begin{singlespace}
\begin{lstlisting}[style=BASIC]

Private Sub Form_Load()
Dim tex As String
MsgBox "welcome to LaTeX"
End Sub

\end{lstlisting}
\end{singlespace}
\end{listingbox}
Where listingbox is a environment based on framed packages.
So, how can I combine all of them into one environment? maybe like this one
\begin{BASIC}
code here
\end{BASIC}

No comments:

Post a Comment