Listings - Error could not load requested style











up vote
2
down vote

favorite












I am trying to create some styling for my javascript snippets. My configuration looks like:



documentclass[letterpaper, dvipsnames]{article}
usepackage[utf8]{inputenc}
usepackage{listings} % Package for adding javascript code with code highlighting
usepackage[dvipsnames]{xcolor} % Package for adding colors
definecolor{purple}{rgb}{0.65, 0.12, 0.82}
definecolor{main-color}{rgb}{0.6627, 0.7176, 0.7764}
definecolor{back-color}{rgb}{0.1686, 0.1686, 0.1686}

lstdefinestyle{codeSection}
{
language= JavaScript,
basicstyle = {ttfamily color{main-color}},
backgroundcolor = {color{back-color}},
commentstyle = {color{OliveGreen}},
stringstyle = {color{green}},
keywordstyle = {color{orange}bfseries},
keywordstyle = [2]{color{orange}},
keywordstyle = [3]{color{purple}},
keywordstyle = [4]{color{lime}},
keywordstyle = [5]{color{orange}},
keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
morekeywords = [3]{Promise, Observable},
morekeywords = [4]{console},
otherkeywords = {;},
comment = [l]{//},
morecomment = [s]{/*}{*/},
morestring = [b]',
morestring = [b]",
sensitive = false,
breaklines = true,
showstringspaces= false,
showspaces= false,
extendedchars= true
}


Now when I try to add some Code it renders with the correct styling, but it gives me the error:Could not load requested styling. The Code-insertion looks like:



begin{document}
begin{figure}[H]
begin{lstlisting}[style=codeSection]
export interface FakeHttpResponse {
code: string;
message: string;
}

const scndPromise = new Promise<FakeHttpResponse>((resolve, reject) => {
setTimeout(() => {
resolve({
code: '200',
message: 'Promise kept!'
});
}, 10 * 1000);
});

console.log(scndPromise);
setTimeout(() => console.log(scndPromise), 10 * 1000);
end{lstlisting}
end{figure}
end{document}


Can anyone help me out on fixing this error?










share|improve this question









New contributor




Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Make a complete example that can be tested.
    – Ulrike Fischer
    Nov 14 at 18:10










  • Extented my config to a reproducable example.
    – Fantasia
    Nov 14 at 18:18












  • I can find no javascript definitions in the listings files. Why do you think that the language exists?
    – Ulrike Fischer
    Nov 14 at 18:30










  • I am fairly new to latex so... what should I add to prevent this error?
    – Fantasia
    Nov 14 at 21:10










  • If the language doesn't exist, you will have to create it (or adjust an existing one), see the documentation of listings.
    – Ulrike Fischer
    Nov 14 at 21:16















up vote
2
down vote

favorite












I am trying to create some styling for my javascript snippets. My configuration looks like:



documentclass[letterpaper, dvipsnames]{article}
usepackage[utf8]{inputenc}
usepackage{listings} % Package for adding javascript code with code highlighting
usepackage[dvipsnames]{xcolor} % Package for adding colors
definecolor{purple}{rgb}{0.65, 0.12, 0.82}
definecolor{main-color}{rgb}{0.6627, 0.7176, 0.7764}
definecolor{back-color}{rgb}{0.1686, 0.1686, 0.1686}

lstdefinestyle{codeSection}
{
language= JavaScript,
basicstyle = {ttfamily color{main-color}},
backgroundcolor = {color{back-color}},
commentstyle = {color{OliveGreen}},
stringstyle = {color{green}},
keywordstyle = {color{orange}bfseries},
keywordstyle = [2]{color{orange}},
keywordstyle = [3]{color{purple}},
keywordstyle = [4]{color{lime}},
keywordstyle = [5]{color{orange}},
keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
morekeywords = [3]{Promise, Observable},
morekeywords = [4]{console},
otherkeywords = {;},
comment = [l]{//},
morecomment = [s]{/*}{*/},
morestring = [b]',
morestring = [b]",
sensitive = false,
breaklines = true,
showstringspaces= false,
showspaces= false,
extendedchars= true
}


Now when I try to add some Code it renders with the correct styling, but it gives me the error:Could not load requested styling. The Code-insertion looks like:



begin{document}
begin{figure}[H]
begin{lstlisting}[style=codeSection]
export interface FakeHttpResponse {
code: string;
message: string;
}

const scndPromise = new Promise<FakeHttpResponse>((resolve, reject) => {
setTimeout(() => {
resolve({
code: '200',
message: 'Promise kept!'
});
}, 10 * 1000);
});

console.log(scndPromise);
setTimeout(() => console.log(scndPromise), 10 * 1000);
end{lstlisting}
end{figure}
end{document}


Can anyone help me out on fixing this error?










share|improve this question









New contributor




Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Make a complete example that can be tested.
    – Ulrike Fischer
    Nov 14 at 18:10










  • Extented my config to a reproducable example.
    – Fantasia
    Nov 14 at 18:18












  • I can find no javascript definitions in the listings files. Why do you think that the language exists?
    – Ulrike Fischer
    Nov 14 at 18:30










  • I am fairly new to latex so... what should I add to prevent this error?
    – Fantasia
    Nov 14 at 21:10










  • If the language doesn't exist, you will have to create it (or adjust an existing one), see the documentation of listings.
    – Ulrike Fischer
    Nov 14 at 21:16













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I am trying to create some styling for my javascript snippets. My configuration looks like:



documentclass[letterpaper, dvipsnames]{article}
usepackage[utf8]{inputenc}
usepackage{listings} % Package for adding javascript code with code highlighting
usepackage[dvipsnames]{xcolor} % Package for adding colors
definecolor{purple}{rgb}{0.65, 0.12, 0.82}
definecolor{main-color}{rgb}{0.6627, 0.7176, 0.7764}
definecolor{back-color}{rgb}{0.1686, 0.1686, 0.1686}

lstdefinestyle{codeSection}
{
language= JavaScript,
basicstyle = {ttfamily color{main-color}},
backgroundcolor = {color{back-color}},
commentstyle = {color{OliveGreen}},
stringstyle = {color{green}},
keywordstyle = {color{orange}bfseries},
keywordstyle = [2]{color{orange}},
keywordstyle = [3]{color{purple}},
keywordstyle = [4]{color{lime}},
keywordstyle = [5]{color{orange}},
keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
morekeywords = [3]{Promise, Observable},
morekeywords = [4]{console},
otherkeywords = {;},
comment = [l]{//},
morecomment = [s]{/*}{*/},
morestring = [b]',
morestring = [b]",
sensitive = false,
breaklines = true,
showstringspaces= false,
showspaces= false,
extendedchars= true
}


Now when I try to add some Code it renders with the correct styling, but it gives me the error:Could not load requested styling. The Code-insertion looks like:



begin{document}
begin{figure}[H]
begin{lstlisting}[style=codeSection]
export interface FakeHttpResponse {
code: string;
message: string;
}

const scndPromise = new Promise<FakeHttpResponse>((resolve, reject) => {
setTimeout(() => {
resolve({
code: '200',
message: 'Promise kept!'
});
}, 10 * 1000);
});

console.log(scndPromise);
setTimeout(() => console.log(scndPromise), 10 * 1000);
end{lstlisting}
end{figure}
end{document}


Can anyone help me out on fixing this error?










share|improve this question









New contributor




Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I am trying to create some styling for my javascript snippets. My configuration looks like:



documentclass[letterpaper, dvipsnames]{article}
usepackage[utf8]{inputenc}
usepackage{listings} % Package for adding javascript code with code highlighting
usepackage[dvipsnames]{xcolor} % Package for adding colors
definecolor{purple}{rgb}{0.65, 0.12, 0.82}
definecolor{main-color}{rgb}{0.6627, 0.7176, 0.7764}
definecolor{back-color}{rgb}{0.1686, 0.1686, 0.1686}

lstdefinestyle{codeSection}
{
language= JavaScript,
basicstyle = {ttfamily color{main-color}},
backgroundcolor = {color{back-color}},
commentstyle = {color{OliveGreen}},
stringstyle = {color{green}},
keywordstyle = {color{orange}bfseries},
keywordstyle = [2]{color{orange}},
keywordstyle = [3]{color{purple}},
keywordstyle = [4]{color{lime}},
keywordstyle = [5]{color{orange}},
keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
morekeywords = [3]{Promise, Observable},
morekeywords = [4]{console},
otherkeywords = {;},
comment = [l]{//},
morecomment = [s]{/*}{*/},
morestring = [b]',
morestring = [b]",
sensitive = false,
breaklines = true,
showstringspaces= false,
showspaces= false,
extendedchars= true
}


Now when I try to add some Code it renders with the correct styling, but it gives me the error:Could not load requested styling. The Code-insertion looks like:



begin{document}
begin{figure}[H]
begin{lstlisting}[style=codeSection]
export interface FakeHttpResponse {
code: string;
message: string;
}

const scndPromise = new Promise<FakeHttpResponse>((resolve, reject) => {
setTimeout(() => {
resolve({
code: '200',
message: 'Promise kept!'
});
}, 10 * 1000);
});

console.log(scndPromise);
setTimeout(() => console.log(scndPromise), 10 * 1000);
end{lstlisting}
end{figure}
end{document}


Can anyone help me out on fixing this error?







listings sharelatex overleaf






share|improve this question









New contributor




Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 14 at 18:18





















New contributor




Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 14 at 18:08









Fantasia

214




214




New contributor




Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Make a complete example that can be tested.
    – Ulrike Fischer
    Nov 14 at 18:10










  • Extented my config to a reproducable example.
    – Fantasia
    Nov 14 at 18:18












  • I can find no javascript definitions in the listings files. Why do you think that the language exists?
    – Ulrike Fischer
    Nov 14 at 18:30










  • I am fairly new to latex so... what should I add to prevent this error?
    – Fantasia
    Nov 14 at 21:10










  • If the language doesn't exist, you will have to create it (or adjust an existing one), see the documentation of listings.
    – Ulrike Fischer
    Nov 14 at 21:16


















  • Make a complete example that can be tested.
    – Ulrike Fischer
    Nov 14 at 18:10










  • Extented my config to a reproducable example.
    – Fantasia
    Nov 14 at 18:18












  • I can find no javascript definitions in the listings files. Why do you think that the language exists?
    – Ulrike Fischer
    Nov 14 at 18:30










  • I am fairly new to latex so... what should I add to prevent this error?
    – Fantasia
    Nov 14 at 21:10










  • If the language doesn't exist, you will have to create it (or adjust an existing one), see the documentation of listings.
    – Ulrike Fischer
    Nov 14 at 21:16
















Make a complete example that can be tested.
– Ulrike Fischer
Nov 14 at 18:10




Make a complete example that can be tested.
– Ulrike Fischer
Nov 14 at 18:10












Extented my config to a reproducable example.
– Fantasia
Nov 14 at 18:18






Extented my config to a reproducable example.
– Fantasia
Nov 14 at 18:18














I can find no javascript definitions in the listings files. Why do you think that the language exists?
– Ulrike Fischer
Nov 14 at 18:30




I can find no javascript definitions in the listings files. Why do you think that the language exists?
– Ulrike Fischer
Nov 14 at 18:30












I am fairly new to latex so... what should I add to prevent this error?
– Fantasia
Nov 14 at 21:10




I am fairly new to latex so... what should I add to prevent this error?
– Fantasia
Nov 14 at 21:10












If the language doesn't exist, you will have to create it (or adjust an existing one), see the documentation of listings.
– Ulrike Fischer
Nov 14 at 21:16




If the language doesn't exist, you will have to create it (or adjust an existing one), see the documentation of listings.
– Ulrike Fischer
Nov 14 at 21:16










1 Answer
1






active

oldest

votes

















up vote
1
down vote













I fixed it by the following configuration:



lstdefinelanguage{JavaScript}
{
keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
morekeywords = [3]{Promise, Observable},
morekeywords = [4]{log},
otherkeywords = {;},
comment = [l]{//},
morecomment = [s]{/*}{*/},
morestring = [b]',
morestring = [b]",
}

lstset
{
language= JavaScript,
commentstyle = {color{OliveGreen}},
stringstyle = {color{green}},
keywordstyle = {color{orange}bfseries},
keywordstyle = [2]{color{orange}},
keywordstyle = [3]{color{purple}},
keywordstyle = [4]{color{lime}},
keywordstyle = [5]{color{orange}},
basicstyle = {ttfamily color{main-color}},
backgroundcolor = {color{back-color}},
sensitive = false,
breaklines = true,
showstringspaces= false,
showspaces= false,
extendedchars= true
}





share|improve this answer








New contributor




Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















    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',
    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
    });


    }
    });






    Fantasia is a new contributor. Be nice, and check out our Code of Conduct.










     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459991%2flistings-error-could-not-load-requested-style%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    I fixed it by the following configuration:



    lstdefinelanguage{JavaScript}
    {
    keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
    morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
    morekeywords = [3]{Promise, Observable},
    morekeywords = [4]{log},
    otherkeywords = {;},
    comment = [l]{//},
    morecomment = [s]{/*}{*/},
    morestring = [b]',
    morestring = [b]",
    }

    lstset
    {
    language= JavaScript,
    commentstyle = {color{OliveGreen}},
    stringstyle = {color{green}},
    keywordstyle = {color{orange}bfseries},
    keywordstyle = [2]{color{orange}},
    keywordstyle = [3]{color{purple}},
    keywordstyle = [4]{color{lime}},
    keywordstyle = [5]{color{orange}},
    basicstyle = {ttfamily color{main-color}},
    backgroundcolor = {color{back-color}},
    sensitive = false,
    breaklines = true,
    showstringspaces= false,
    showspaces= false,
    extendedchars= true
    }





    share|improve this answer








    New contributor




    Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      1
      down vote













      I fixed it by the following configuration:



      lstdefinelanguage{JavaScript}
      {
      keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
      morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
      morekeywords = [3]{Promise, Observable},
      morekeywords = [4]{log},
      otherkeywords = {;},
      comment = [l]{//},
      morecomment = [s]{/*}{*/},
      morestring = [b]',
      morestring = [b]",
      }

      lstset
      {
      language= JavaScript,
      commentstyle = {color{OliveGreen}},
      stringstyle = {color{green}},
      keywordstyle = {color{orange}bfseries},
      keywordstyle = [2]{color{orange}},
      keywordstyle = [3]{color{purple}},
      keywordstyle = [4]{color{lime}},
      keywordstyle = [5]{color{orange}},
      basicstyle = {ttfamily color{main-color}},
      backgroundcolor = {color{back-color}},
      sensitive = false,
      breaklines = true,
      showstringspaces= false,
      showspaces= false,
      extendedchars= true
      }





      share|improve this answer








      New contributor




      Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        up vote
        1
        down vote










        up vote
        1
        down vote









        I fixed it by the following configuration:



        lstdefinelanguage{JavaScript}
        {
        keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
        morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
        morekeywords = [3]{Promise, Observable},
        morekeywords = [4]{log},
        otherkeywords = {;},
        comment = [l]{//},
        morecomment = [s]{/*}{*/},
        morestring = [b]',
        morestring = [b]",
        }

        lstset
        {
        language= JavaScript,
        commentstyle = {color{OliveGreen}},
        stringstyle = {color{green}},
        keywordstyle = {color{orange}bfseries},
        keywordstyle = [2]{color{orange}},
        keywordstyle = [3]{color{purple}},
        keywordstyle = [4]{color{lime}},
        keywordstyle = [5]{color{orange}},
        basicstyle = {ttfamily color{main-color}},
        backgroundcolor = {color{back-color}},
        sensitive = false,
        breaklines = true,
        showstringspaces= false,
        showspaces= false,
        extendedchars= true
        }





        share|improve this answer








        New contributor




        Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        I fixed it by the following configuration:



        lstdefinelanguage{JavaScript}
        {
        keywords = {typeof, new, true, false, function, return, null, switch, var, if, in, while, do, else, case, break, class, export, boolean, throw, implements, import, this, constructor, string, number, public, private, static, const, var, let, void},
        morekeywords = [2]{class, export, boolean, throw, implements, import, this, interface},
        morekeywords = [3]{Promise, Observable},
        morekeywords = [4]{log},
        otherkeywords = {;},
        comment = [l]{//},
        morecomment = [s]{/*}{*/},
        morestring = [b]',
        morestring = [b]",
        }

        lstset
        {
        language= JavaScript,
        commentstyle = {color{OliveGreen}},
        stringstyle = {color{green}},
        keywordstyle = {color{orange}bfseries},
        keywordstyle = [2]{color{orange}},
        keywordstyle = [3]{color{purple}},
        keywordstyle = [4]{color{lime}},
        keywordstyle = [5]{color{orange}},
        basicstyle = {ttfamily color{main-color}},
        backgroundcolor = {color{back-color}},
        sensitive = false,
        breaklines = true,
        showstringspaces= false,
        showspaces= false,
        extendedchars= true
        }






        share|improve this answer








        New contributor




        Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered Nov 14 at 21:40









        Fantasia

        214




        214




        New contributor




        Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Fantasia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






















            Fantasia is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            Fantasia is a new contributor. Be nice, and check out our Code of Conduct.













            Fantasia is a new contributor. Be nice, and check out our Code of Conduct.












            Fantasia is a new contributor. Be nice, and check out our Code of Conduct.















             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459991%2flistings-error-could-not-load-requested-style%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?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

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