Code: Select all
\documentclass{article}
% Preamble Setting for {minted} package
\usepackage{minted}
\usemintedstyle{friendly}
% Specify Custom Styles for minted Source Codes
\newmintedfile[codec]{c}{linenos=true}
\usepackage{keyval}% http://ctan.org/pkg/keyval
\newcommand{\tempsrc}{./tmpsrc/} % Just a path!
\newcounter{cntTmp}
\makeatletter
\newcommand{\gitRepoDir}{S:/temp/git_test/}
\newcommand{\tmpSrcDir}{./tmpsrc/}
\newcommand{\mysome}[1]{#1}
% \gFile{<Init Directory>}{<Tag>}{<Source Directory>}{Filename}
\newcommand{\gFile}[4]{
% Define Key
\define@key{}{fdTmp\arabic{cntTmp}}[]{tmp#2#4}
\stepcounter{cntTmp}
}
\makeatother
\begin{document}
- Add a key.
\gFile{src}{first-tag}{./}{test.txt}
- End Key creation. \newline
- Verify SETKEYS (for fdTmp0): \setkeys{}{fdTmp0} \newline
-- At this point assume the following files exist:\newline
+++++ \setkeys{}{fdTmp0} \newline
- Now the minted command WITH file name.
\codec[firstline=5, lastline=50]{\tempsrc tmpfirst-tagtest.txt}
- Now the same command, but where the parameter is given by setkeys.
%%% HERE LIES THE PROBLEM
%\codec[firstline=5, lastline=50]{\tempsrc \setkeys{}{fdTmp0}}
% The following error appears if the above line is added:
% Traceback (most recent call last): File "<string>", line 1, in <module> IOError: [Errno 2] No such file or directory: './tmpsrc/\\def KV@FV@{KV@@}\\let \\par '
\end{document}