I have a modified environment for a listing called mylisting
. I wanted to know how to include the path to the file to be used in the mylisting
environment?
Here is the code that I have so far:
\documentclass{article}
\usepackage{tcolorbox}
\usepackage{xcolor}
\tcbuselibrary{listings,skins}
\usepackage{filecontents}
\begin{filecontents*}{HOG_test.m}
for i:=maxint to 0 do
begin
{ do nothing }
end;
Write('Case insensitive ');
WritE('Pascal keywords.');
\end{filecontents*}
\usepackage[numbered,framed,autolinebreaks,useliterate]{matlab-prettifier}
\lstdefinestyle{mystyle}{
numbers=left,
numberstyle=\small,
numbersep=8pt,
%language=Matlab,
style=Matlab-editor,
basicstyle=\ttfamily\small,
numbersep=25pt,
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}[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{mylisting}[hbox,enhanced,drop shadow]{Accuracy Calculation}
% How to get "HOG_test.m" code to appear in the mylisting???
\end{mylisting}]
\lstinputlisting{HOG_test.m}
\end{document}