The question is building off the solution give here.
How do you remove the mcode package so that listings 1 - 3 will have the Matlab code that resembles the last listing and also contain the line numbers outside of the box :
Here is the original solution as given by hbaderts:
\documentclass{article}
\usepackage{tcolorbox}
\usepackage{xcolor}
\tcbuselibrary{listings,skins}
\usepackage[numbered,framed,autolinebreaks,useliterate]{matlab-prettifier}
\lstdefinestyle{mystyle}{
numbers=left,
numberstyle=\small,
numbersep=8pt,
%language=Matlab,
style=Matlab-editor,
basicstyle=\ttfamily\small,
frame=none
}
\newtcblisting{mylisting}[2][]{
arc=0pt, outer arc=0pt,
listing only,
colback=blue!10,
colbacktitle=blue!75!black,
listing style=mystyle,
title=#2,
#1
}
\begin{document}
\begin{mylisting}{}
%% Accuracy Calculation
Equal_Rows = find(diff(matrix_rec,[],2) == 0);
percent_success = (size(Equal_Rows,1)/numFolders) * 100
\end{mylisting}
\begin{mylisting}[hbox]{}
%% Accuracy Calculation
Equal_Rows = find(diff(matrix_rec,[],2) == 0);
percent_success = (size(Equal_Rows,1)/numFolders) * 100
\end{mylisting}
\begin{mylisting}[hbox,enhanced,drop shadow]{Accuracy Calculation}
Equal_Rows = find(diff(matrix_rec,[],2) == 0);
percent_success = (size(Equal_Rows,1)/numFolders) * 100
%% Save data to be used in pgfplots
switch nn
case 1
fileID = fopen('PCA_KNN1.dat','w');
case 2
fileID = fopen('PCA_KNN2.dat','w');
end
\end{mylisting}
\begin{lstlisting}[
backgroundcolor=\color{blue!05},
style=Matlab-editor,
basicstyle=\ttfamily\small
]
%% Accuracy Calculation
Equal_Rows = find(diff(matrix_rec,[],2) == 0);
percent_success = (size(Equal_Rows,1)/numFolders) * 100
%% Save data to be used in pgfplots
switch nn
case 1
fileID = fopen('PCA_KNN1.dat','w');
case 2
fileID = fopen('PCA_KNN2.dat','w');
end
\end{lstlisting}
\end{document}



[hbox]– samcarter_is_at_topanswers.xyz Nov 25 '16 at 20:47hbox. – samcarter_is_at_topanswers.xyz Nov 25 '16 at 21:09