I used the listings package with single frame and I had an equation before my code. The problem is that the frame intersects a little with the equation and the output is ugly. This happens both when I leave a blank line bewtween the equation and the code and when I am not. How can I fix that? Why did this happenned?

Edit I:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{listings}
\begin{document}
$\displaystyle y(t)=\frac{1}{12}-\frac{e^{2t}}{4}+\frac{e^{3t}}{6}$, for $t\ge 0$
\begin{lstlisting}[frame=single,breaklines=true]
clc;
clear all;
close all;
t=0:0.1:20;
y= 1/12 -exp(2*t)/4 + exp(3*t)/6;
G=tf(1,[2 -10 12]);
[y2, t2]=step(G,t);
subplot(2,2,1)
plot(t,y);
subplot(2,2,2)
plot(t2,y2);
\end{lstlisting}
\end{document}



matlab-prettifierpackage; see this answer. – jub0bs Apr 04 '14 at 00:00