List of listings - how to add












2














I have defined listings. How to create a list of listings? I mean something similar to listoftables. Thank you



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstinputlisting{code.txt}
end{document}









share|improve this question
























  • Please make compilable minimal working example (MWE) instead of code fragments.
    – samcarter
    Jan 2 at 21:48










  • I editted my question
    – Elisabeth
    Jan 2 at 21:51
















2














I have defined listings. How to create a list of listings? I mean something similar to listoftables. Thank you



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstinputlisting{code.txt}
end{document}









share|improve this question
























  • Please make compilable minimal working example (MWE) instead of code fragments.
    – samcarter
    Jan 2 at 21:48










  • I editted my question
    – Elisabeth
    Jan 2 at 21:51














2












2








2


0





I have defined listings. How to create a list of listings? I mean something similar to listoftables. Thank you



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstinputlisting{code.txt}
end{document}









share|improve this question















I have defined listings. How to create a list of listings? I mean something similar to listoftables. Thank you



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstinputlisting{code.txt}
end{document}






listings tcolorbox






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 22:13









Christian Hupfer

148k14193390




148k14193390










asked Jan 2 at 21:42









ElisabethElisabeth

4876




4876












  • Please make compilable minimal working example (MWE) instead of code fragments.
    – samcarter
    Jan 2 at 21:48










  • I editted my question
    – Elisabeth
    Jan 2 at 21:51


















  • Please make compilable minimal working example (MWE) instead of code fragments.
    – samcarter
    Jan 2 at 21:48










  • I editted my question
    – Elisabeth
    Jan 2 at 21:51
















Please make compilable minimal working example (MWE) instead of code fragments.
– samcarter
Jan 2 at 21:48




Please make compilable minimal working example (MWE) instead of code fragments.
– samcarter
Jan 2 at 21:48












I editted my question
– Elisabeth
Jan 2 at 21:51




I editted my question
– Elisabeth
Jan 2 at 21:51










2 Answers
2






active

oldest

votes


















5














Here is the tcolorbox - way to generate list of 'something', here list of listings with the settings list type=... and list inside.



The title=... is used by default for inserting the name of the entry.



tbclistof[chapter*]{lol}{lstlistingname} is the tcolorbox - way of saying listof....



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[2]{%
listing file={#2},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title=Soubor thetcbcounter: #2,
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{helloworldexample.c}
end{document}


enter image description hereenter image description here



The helloworldexample.c file follows



#include<stdio.h>

int main(int argc,char **argv)
{
printf("Hello World!n");
return(0);
}


Update



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[3]{%
listing file={#3},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title={Soubor thetcbcounter: #2},
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{Some caption}{helloworldexample.c}
end{document}





share|improve this answer























  • Thank you and what is this ! Missing $ inserted.<inserted text>$ ... file.txt}}{27}{tcb@cnt@mylisting.1} ? There should be some $?
    – Elisabeth
    Jan 3 at 5:37










  • @Elisabeth: Sorry, I don't understand. My example runs without problems, having the newest TL 2018 installed, i.e. updated daily
    – Christian Hupfer
    Jan 3 at 9:21






  • 1




    mylisting[title={Vstupn...},label=input]{input.txt}. Vstupni is no parameter and tcolorbox would complain. Please read the manual!!!!
    – Christian Hupfer
    Jan 3 at 20:00






  • 1




    @Elisabeth: mylisting[label=somelabel]{Some caption}{helloworldexample.c}. -- It's all described in the manual :-(
    – Christian Hupfer
    Jan 3 at 21:31






  • 1




    @Elisabeth: Of course you can not use both tcblistof and lstlistoflistings (order does not matter). Regardless which comes first, it will close the .lol file and rewrite it, leaving it empty. The second macro will then open an empty file just print the heading...
    – Christian Hupfer
    Jan 3 at 22:14



















4














You can use lstlistoflisting that is introduced by the listings package:



 documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstlistoflistings
begin{lstlisting}[caption=test]
content of the listing
end{lstlisting}
end{document}


enter image description here



From the listings manual:




lstlistoflistings
prints a list of listings. Each entry is with descending priority either the short caption, the caption, the file name or the name of the listing, [...]




If you want to change the heading of the list of listings from 'Listings' to something else, you can use renewcommand{lstlistlistingname}{<new title>}






share|improve this answer





















  • Thank you very much and how to set an another name instead of "Listings" .
    – Elisabeth
    Jan 2 at 22:01












  • Btw, lstinputlisting takes caption as an argument: lstinputlisting[caption=test]{code.txt}
    – DG'
    Jan 2 at 22:03












  • @Elisabeth: Regarding the different title for the list of listings, please see the last sentence of my answer.
    – leandriis
    Jan 2 at 22:04












  • Thank you. I don't know where is mistake but I have only the New title (Listings) in the final file. When I compile your code separately it works well. Is it problem that codes are in include{kap00}?
    – Elisabeth
    Jan 2 at 22:08













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468324%2flist-of-listings-how-to-add%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














Here is the tcolorbox - way to generate list of 'something', here list of listings with the settings list type=... and list inside.



The title=... is used by default for inserting the name of the entry.



tbclistof[chapter*]{lol}{lstlistingname} is the tcolorbox - way of saying listof....



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[2]{%
listing file={#2},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title=Soubor thetcbcounter: #2,
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{helloworldexample.c}
end{document}


enter image description hereenter image description here



The helloworldexample.c file follows



#include<stdio.h>

int main(int argc,char **argv)
{
printf("Hello World!n");
return(0);
}


Update



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[3]{%
listing file={#3},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title={Soubor thetcbcounter: #2},
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{Some caption}{helloworldexample.c}
end{document}





share|improve this answer























  • Thank you and what is this ! Missing $ inserted.<inserted text>$ ... file.txt}}{27}{tcb@cnt@mylisting.1} ? There should be some $?
    – Elisabeth
    Jan 3 at 5:37










  • @Elisabeth: Sorry, I don't understand. My example runs without problems, having the newest TL 2018 installed, i.e. updated daily
    – Christian Hupfer
    Jan 3 at 9:21






  • 1




    mylisting[title={Vstupn...},label=input]{input.txt}. Vstupni is no parameter and tcolorbox would complain. Please read the manual!!!!
    – Christian Hupfer
    Jan 3 at 20:00






  • 1




    @Elisabeth: mylisting[label=somelabel]{Some caption}{helloworldexample.c}. -- It's all described in the manual :-(
    – Christian Hupfer
    Jan 3 at 21:31






  • 1




    @Elisabeth: Of course you can not use both tcblistof and lstlistoflistings (order does not matter). Regardless which comes first, it will close the .lol file and rewrite it, leaving it empty. The second macro will then open an empty file just print the heading...
    – Christian Hupfer
    Jan 3 at 22:14
















5














Here is the tcolorbox - way to generate list of 'something', here list of listings with the settings list type=... and list inside.



The title=... is used by default for inserting the name of the entry.



tbclistof[chapter*]{lol}{lstlistingname} is the tcolorbox - way of saying listof....



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[2]{%
listing file={#2},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title=Soubor thetcbcounter: #2,
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{helloworldexample.c}
end{document}


enter image description hereenter image description here



The helloworldexample.c file follows



#include<stdio.h>

int main(int argc,char **argv)
{
printf("Hello World!n");
return(0);
}


Update



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[3]{%
listing file={#3},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title={Soubor thetcbcounter: #2},
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{Some caption}{helloworldexample.c}
end{document}





share|improve this answer























  • Thank you and what is this ! Missing $ inserted.<inserted text>$ ... file.txt}}{27}{tcb@cnt@mylisting.1} ? There should be some $?
    – Elisabeth
    Jan 3 at 5:37










  • @Elisabeth: Sorry, I don't understand. My example runs without problems, having the newest TL 2018 installed, i.e. updated daily
    – Christian Hupfer
    Jan 3 at 9:21






  • 1




    mylisting[title={Vstupn...},label=input]{input.txt}. Vstupni is no parameter and tcolorbox would complain. Please read the manual!!!!
    – Christian Hupfer
    Jan 3 at 20:00






  • 1




    @Elisabeth: mylisting[label=somelabel]{Some caption}{helloworldexample.c}. -- It's all described in the manual :-(
    – Christian Hupfer
    Jan 3 at 21:31






  • 1




    @Elisabeth: Of course you can not use both tcblistof and lstlistoflistings (order does not matter). Regardless which comes first, it will close the .lol file and rewrite it, leaving it empty. The second macro will then open an empty file just print the heading...
    – Christian Hupfer
    Jan 3 at 22:14














5












5








5






Here is the tcolorbox - way to generate list of 'something', here list of listings with the settings list type=... and list inside.



The title=... is used by default for inserting the name of the entry.



tbclistof[chapter*]{lol}{lstlistingname} is the tcolorbox - way of saying listof....



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[2]{%
listing file={#2},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title=Soubor thetcbcounter: #2,
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{helloworldexample.c}
end{document}


enter image description hereenter image description here



The helloworldexample.c file follows



#include<stdio.h>

int main(int argc,char **argv)
{
printf("Hello World!n");
return(0);
}


Update



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[3]{%
listing file={#3},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title={Soubor thetcbcounter: #2},
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{Some caption}{helloworldexample.c}
end{document}





share|improve this answer














Here is the tcolorbox - way to generate list of 'something', here list of listings with the settings list type=... and list inside.



The title=... is used by default for inserting the name of the entry.



tbclistof[chapter*]{lol}{lstlistingname} is the tcolorbox - way of saying listof....



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[2]{%
listing file={#2},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title=Soubor thetcbcounter: #2,
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{helloworldexample.c}
end{document}


enter image description hereenter image description here



The helloworldexample.c file follows



#include<stdio.h>

int main(int argc,char **argv)
{
printf("Hello World!n");
return(0);
}


Update



documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
%usepackage{listings}
usepackage{caption}

usepackage[most]{tcolorbox}
newtcbinputlisting[auto counter,list inside=lol,list type={lstlisting}]{mylisting}[3]{%
listing file={#3},
title=Listing,
colback=white,
colframe=gray!75!black,
fonttitle=bfseries,
listing only,
breakable,
title={Soubor thetcbcounter: #2},
#1
}


renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}


begin{document}
tcblistof[chapter*]{lol}{lstlistingname}
clearpage
mylisting{Some caption}{helloworldexample.c}
end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 3 at 20:24

























answered Jan 2 at 22:09









Christian HupferChristian Hupfer

148k14193390




148k14193390












  • Thank you and what is this ! Missing $ inserted.<inserted text>$ ... file.txt}}{27}{tcb@cnt@mylisting.1} ? There should be some $?
    – Elisabeth
    Jan 3 at 5:37










  • @Elisabeth: Sorry, I don't understand. My example runs without problems, having the newest TL 2018 installed, i.e. updated daily
    – Christian Hupfer
    Jan 3 at 9:21






  • 1




    mylisting[title={Vstupn...},label=input]{input.txt}. Vstupni is no parameter and tcolorbox would complain. Please read the manual!!!!
    – Christian Hupfer
    Jan 3 at 20:00






  • 1




    @Elisabeth: mylisting[label=somelabel]{Some caption}{helloworldexample.c}. -- It's all described in the manual :-(
    – Christian Hupfer
    Jan 3 at 21:31






  • 1




    @Elisabeth: Of course you can not use both tcblistof and lstlistoflistings (order does not matter). Regardless which comes first, it will close the .lol file and rewrite it, leaving it empty. The second macro will then open an empty file just print the heading...
    – Christian Hupfer
    Jan 3 at 22:14


















  • Thank you and what is this ! Missing $ inserted.<inserted text>$ ... file.txt}}{27}{tcb@cnt@mylisting.1} ? There should be some $?
    – Elisabeth
    Jan 3 at 5:37










  • @Elisabeth: Sorry, I don't understand. My example runs without problems, having the newest TL 2018 installed, i.e. updated daily
    – Christian Hupfer
    Jan 3 at 9:21






  • 1




    mylisting[title={Vstupn...},label=input]{input.txt}. Vstupni is no parameter and tcolorbox would complain. Please read the manual!!!!
    – Christian Hupfer
    Jan 3 at 20:00






  • 1




    @Elisabeth: mylisting[label=somelabel]{Some caption}{helloworldexample.c}. -- It's all described in the manual :-(
    – Christian Hupfer
    Jan 3 at 21:31






  • 1




    @Elisabeth: Of course you can not use both tcblistof and lstlistoflistings (order does not matter). Regardless which comes first, it will close the .lol file and rewrite it, leaving it empty. The second macro will then open an empty file just print the heading...
    – Christian Hupfer
    Jan 3 at 22:14
















Thank you and what is this ! Missing $ inserted.<inserted text>$ ... file.txt}}{27}{tcb@cnt@mylisting.1} ? There should be some $?
– Elisabeth
Jan 3 at 5:37




Thank you and what is this ! Missing $ inserted.<inserted text>$ ... file.txt}}{27}{tcb@cnt@mylisting.1} ? There should be some $?
– Elisabeth
Jan 3 at 5:37












@Elisabeth: Sorry, I don't understand. My example runs without problems, having the newest TL 2018 installed, i.e. updated daily
– Christian Hupfer
Jan 3 at 9:21




@Elisabeth: Sorry, I don't understand. My example runs without problems, having the newest TL 2018 installed, i.e. updated daily
– Christian Hupfer
Jan 3 at 9:21




1




1




mylisting[title={Vstupn...},label=input]{input.txt}. Vstupni is no parameter and tcolorbox would complain. Please read the manual!!!!
– Christian Hupfer
Jan 3 at 20:00




mylisting[title={Vstupn...},label=input]{input.txt}. Vstupni is no parameter and tcolorbox would complain. Please read the manual!!!!
– Christian Hupfer
Jan 3 at 20:00




1




1




@Elisabeth: mylisting[label=somelabel]{Some caption}{helloworldexample.c}. -- It's all described in the manual :-(
– Christian Hupfer
Jan 3 at 21:31




@Elisabeth: mylisting[label=somelabel]{Some caption}{helloworldexample.c}. -- It's all described in the manual :-(
– Christian Hupfer
Jan 3 at 21:31




1




1




@Elisabeth: Of course you can not use both tcblistof and lstlistoflistings (order does not matter). Regardless which comes first, it will close the .lol file and rewrite it, leaving it empty. The second macro will then open an empty file just print the heading...
– Christian Hupfer
Jan 3 at 22:14




@Elisabeth: Of course you can not use both tcblistof and lstlistoflistings (order does not matter). Regardless which comes first, it will close the .lol file and rewrite it, leaving it empty. The second macro will then open an empty file just print the heading...
– Christian Hupfer
Jan 3 at 22:14











4














You can use lstlistoflisting that is introduced by the listings package:



 documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstlistoflistings
begin{lstlisting}[caption=test]
content of the listing
end{lstlisting}
end{document}


enter image description here



From the listings manual:




lstlistoflistings
prints a list of listings. Each entry is with descending priority either the short caption, the caption, the file name or the name of the listing, [...]




If you want to change the heading of the list of listings from 'Listings' to something else, you can use renewcommand{lstlistlistingname}{<new title>}






share|improve this answer





















  • Thank you very much and how to set an another name instead of "Listings" .
    – Elisabeth
    Jan 2 at 22:01












  • Btw, lstinputlisting takes caption as an argument: lstinputlisting[caption=test]{code.txt}
    – DG'
    Jan 2 at 22:03












  • @Elisabeth: Regarding the different title for the list of listings, please see the last sentence of my answer.
    – leandriis
    Jan 2 at 22:04












  • Thank you. I don't know where is mistake but I have only the New title (Listings) in the final file. When I compile your code separately it works well. Is it problem that codes are in include{kap00}?
    – Elisabeth
    Jan 2 at 22:08


















4














You can use lstlistoflisting that is introduced by the listings package:



 documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstlistoflistings
begin{lstlisting}[caption=test]
content of the listing
end{lstlisting}
end{document}


enter image description here



From the listings manual:




lstlistoflistings
prints a list of listings. Each entry is with descending priority either the short caption, the caption, the file name or the name of the listing, [...]




If you want to change the heading of the list of listings from 'Listings' to something else, you can use renewcommand{lstlistlistingname}{<new title>}






share|improve this answer





















  • Thank you very much and how to set an another name instead of "Listings" .
    – Elisabeth
    Jan 2 at 22:01












  • Btw, lstinputlisting takes caption as an argument: lstinputlisting[caption=test]{code.txt}
    – DG'
    Jan 2 at 22:03












  • @Elisabeth: Regarding the different title for the list of listings, please see the last sentence of my answer.
    – leandriis
    Jan 2 at 22:04












  • Thank you. I don't know where is mistake but I have only the New title (Listings) in the final file. When I compile your code separately it works well. Is it problem that codes are in include{kap00}?
    – Elisabeth
    Jan 2 at 22:08
















4












4








4






You can use lstlistoflisting that is introduced by the listings package:



 documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstlistoflistings
begin{lstlisting}[caption=test]
content of the listing
end{lstlisting}
end{document}


enter image description here



From the listings manual:




lstlistoflistings
prints a list of listings. Each entry is with descending priority either the short caption, the caption, the file name or the name of the listing, [...]




If you want to change the heading of the list of listings from 'Listings' to something else, you can use renewcommand{lstlistlistingname}{<new title>}






share|improve this answer












You can use lstlistoflisting that is introduced by the listings package:



 documentclass[12pt,a4paper]{report}   
usepackage{xcolor}
usepackage{listings}
usepackage{caption}

usepackage{tcolorbox}
tcbuselibrary{breakable}
tcbuselibrary{listings}
newtcbinputlisting[auto counter]{mylisting}[2]{listing file={#2},title=Listing,colback=white,colframe=gray!75!black,fonttitle=bfseries,listing only,breakable,title=Soubor thetcbcounter: #1}

renewcommand{lstlistingname}{Soubor}

newcommand{listingsfont}{ttfamily}

begin{document}
lstlistoflistings
begin{lstlisting}[caption=test]
content of the listing
end{lstlisting}
end{document}


enter image description here



From the listings manual:




lstlistoflistings
prints a list of listings. Each entry is with descending priority either the short caption, the caption, the file name or the name of the listing, [...]




If you want to change the heading of the list of listings from 'Listings' to something else, you can use renewcommand{lstlistlistingname}{<new title>}







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 2 at 21:56









leandriisleandriis

8,3471529




8,3471529












  • Thank you very much and how to set an another name instead of "Listings" .
    – Elisabeth
    Jan 2 at 22:01












  • Btw, lstinputlisting takes caption as an argument: lstinputlisting[caption=test]{code.txt}
    – DG'
    Jan 2 at 22:03












  • @Elisabeth: Regarding the different title for the list of listings, please see the last sentence of my answer.
    – leandriis
    Jan 2 at 22:04












  • Thank you. I don't know where is mistake but I have only the New title (Listings) in the final file. When I compile your code separately it works well. Is it problem that codes are in include{kap00}?
    – Elisabeth
    Jan 2 at 22:08




















  • Thank you very much and how to set an another name instead of "Listings" .
    – Elisabeth
    Jan 2 at 22:01












  • Btw, lstinputlisting takes caption as an argument: lstinputlisting[caption=test]{code.txt}
    – DG'
    Jan 2 at 22:03












  • @Elisabeth: Regarding the different title for the list of listings, please see the last sentence of my answer.
    – leandriis
    Jan 2 at 22:04












  • Thank you. I don't know where is mistake but I have only the New title (Listings) in the final file. When I compile your code separately it works well. Is it problem that codes are in include{kap00}?
    – Elisabeth
    Jan 2 at 22:08


















Thank you very much and how to set an another name instead of "Listings" .
– Elisabeth
Jan 2 at 22:01






Thank you very much and how to set an another name instead of "Listings" .
– Elisabeth
Jan 2 at 22:01














Btw, lstinputlisting takes caption as an argument: lstinputlisting[caption=test]{code.txt}
– DG'
Jan 2 at 22:03






Btw, lstinputlisting takes caption as an argument: lstinputlisting[caption=test]{code.txt}
– DG'
Jan 2 at 22:03














@Elisabeth: Regarding the different title for the list of listings, please see the last sentence of my answer.
– leandriis
Jan 2 at 22:04






@Elisabeth: Regarding the different title for the list of listings, please see the last sentence of my answer.
– leandriis
Jan 2 at 22:04














Thank you. I don't know where is mistake but I have only the New title (Listings) in the final file. When I compile your code separately it works well. Is it problem that codes are in include{kap00}?
– Elisabeth
Jan 2 at 22:08






Thank you. I don't know where is mistake but I have only the New title (Listings) in the final file. When I compile your code separately it works well. Is it problem that codes are in include{kap00}?
– Elisabeth
Jan 2 at 22:08




















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468324%2flist-of-listings-how-to-add%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents