minted: why are field variables colored and how can I change that for Java code?












2















As a minimal example I would want to highlight the following code:



(new Thread(() -> {
System.out.println("Hello");
})).start();


Given the MWE:



documentclass{article}
usepackage{minted}
usemintedstyle{borland}

begin{document}

begin{minted}{Java}
(new Thread(() -> {
System.out.println("Hello");
})).start();
end{minted}

end{document}


I get something like this:





where for some reasons, the field variables/functions are highlighted in red. I would like to remove this "highlighting-rule" or however it is being called.



Therefor I've been searching the minted docs(minted docs), but couldn't find any option to change the color of field variables

I've also been searching the pygment docs (pygment docs), but couldn't figure out yet what token identifiers belong to which specific rule.



I would be happy if I could stick to minted, as it is simple and seems to be quite smart, but also, if that's even possible, I would prefer answers using options that I can pass to the begin.. environment.










share|improve this question




















  • 1





    Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

    – samcarter
    6 hours ago











  • Thank you so much for your hint! I'll do my best to remember for the next time.

    – marcoPolio
    6 hours ago






  • 1





    The relevant line in borland.pygstyle seems to be expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} -- however I don't yet know how to influence this colour from within the document.

    – samcarter
    4 hours ago











  • wow, thanks a lot! actually putting that line before begin{document} was all I needed, as I wanted to change the behavior globally! if you want, you can post your answer so I can accept it :)

    – marcoPolio
    4 hours ago











  • Can you write a self-answer instead?

    – samcarter
    4 hours ago
















2















As a minimal example I would want to highlight the following code:



(new Thread(() -> {
System.out.println("Hello");
})).start();


Given the MWE:



documentclass{article}
usepackage{minted}
usemintedstyle{borland}

begin{document}

begin{minted}{Java}
(new Thread(() -> {
System.out.println("Hello");
})).start();
end{minted}

end{document}


I get something like this:





where for some reasons, the field variables/functions are highlighted in red. I would like to remove this "highlighting-rule" or however it is being called.



Therefor I've been searching the minted docs(minted docs), but couldn't find any option to change the color of field variables

I've also been searching the pygment docs (pygment docs), but couldn't figure out yet what token identifiers belong to which specific rule.



I would be happy if I could stick to minted, as it is simple and seems to be quite smart, but also, if that's even possible, I would prefer answers using options that I can pass to the begin.. environment.










share|improve this question




















  • 1





    Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

    – samcarter
    6 hours ago











  • Thank you so much for your hint! I'll do my best to remember for the next time.

    – marcoPolio
    6 hours ago






  • 1





    The relevant line in borland.pygstyle seems to be expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} -- however I don't yet know how to influence this colour from within the document.

    – samcarter
    4 hours ago











  • wow, thanks a lot! actually putting that line before begin{document} was all I needed, as I wanted to change the behavior globally! if you want, you can post your answer so I can accept it :)

    – marcoPolio
    4 hours ago











  • Can you write a self-answer instead?

    – samcarter
    4 hours ago














2












2








2








As a minimal example I would want to highlight the following code:



(new Thread(() -> {
System.out.println("Hello");
})).start();


Given the MWE:



documentclass{article}
usepackage{minted}
usemintedstyle{borland}

begin{document}

begin{minted}{Java}
(new Thread(() -> {
System.out.println("Hello");
})).start();
end{minted}

end{document}


I get something like this:





where for some reasons, the field variables/functions are highlighted in red. I would like to remove this "highlighting-rule" or however it is being called.



Therefor I've been searching the minted docs(minted docs), but couldn't find any option to change the color of field variables

I've also been searching the pygment docs (pygment docs), but couldn't figure out yet what token identifiers belong to which specific rule.



I would be happy if I could stick to minted, as it is simple and seems to be quite smart, but also, if that's even possible, I would prefer answers using options that I can pass to the begin.. environment.










share|improve this question
















As a minimal example I would want to highlight the following code:



(new Thread(() -> {
System.out.println("Hello");
})).start();


Given the MWE:



documentclass{article}
usepackage{minted}
usemintedstyle{borland}

begin{document}

begin{minted}{Java}
(new Thread(() -> {
System.out.println("Hello");
})).start();
end{minted}

end{document}


I get something like this:





where for some reasons, the field variables/functions are highlighted in red. I would like to remove this "highlighting-rule" or however it is being called.



Therefor I've been searching the minted docs(minted docs), but couldn't find any option to change the color of field variables

I've also been searching the pygment docs (pygment docs), but couldn't figure out yet what token identifiers belong to which specific rule.



I would be happy if I could stick to minted, as it is simple and seems to be quite smart, but also, if that's even possible, I would prefer answers using options that I can pass to the begin.. environment.







minted syntax-highlighting java






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 6 hours ago







marcoPolio

















asked 6 hours ago









marcoPoliomarcoPolio

255




255








  • 1





    Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

    – samcarter
    6 hours ago











  • Thank you so much for your hint! I'll do my best to remember for the next time.

    – marcoPolio
    6 hours ago






  • 1





    The relevant line in borland.pygstyle seems to be expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} -- however I don't yet know how to influence this colour from within the document.

    – samcarter
    4 hours ago











  • wow, thanks a lot! actually putting that line before begin{document} was all I needed, as I wanted to change the behavior globally! if you want, you can post your answer so I can accept it :)

    – marcoPolio
    4 hours ago











  • Can you write a self-answer instead?

    – samcarter
    4 hours ago














  • 1





    Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

    – samcarter
    6 hours ago











  • Thank you so much for your hint! I'll do my best to remember for the next time.

    – marcoPolio
    6 hours ago






  • 1





    The relevant line in borland.pygstyle seems to be expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} -- however I don't yet know how to influence this colour from within the document.

    – samcarter
    4 hours ago











  • wow, thanks a lot! actually putting that line before begin{document} was all I needed, as I wanted to change the behavior globally! if you want, you can post your answer so I can accept it :)

    – marcoPolio
    4 hours ago











  • Can you write a self-answer instead?

    – samcarter
    4 hours ago








1




1





Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

– samcarter
6 hours ago





Welcome to TeX.SE. It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

– samcarter
6 hours ago













Thank you so much for your hint! I'll do my best to remember for the next time.

– marcoPolio
6 hours ago





Thank you so much for your hint! I'll do my best to remember for the next time.

– marcoPolio
6 hours ago




1




1





The relevant line in borland.pygstyle seems to be expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} -- however I don't yet know how to influence this colour from within the document.

– samcarter
4 hours ago





The relevant line in borland.pygstyle seems to be expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} -- however I don't yet know how to influence this colour from within the document.

– samcarter
4 hours ago













wow, thanks a lot! actually putting that line before begin{document} was all I needed, as I wanted to change the behavior globally! if you want, you can post your answer so I can accept it :)

– marcoPolio
4 hours ago





wow, thanks a lot! actually putting that line before begin{document} was all I needed, as I wanted to change the behavior globally! if you want, you can post your answer so I can accept it :)

– marcoPolio
4 hours ago













Can you write a self-answer instead?

– samcarter
4 hours ago





Can you write a self-answer instead?

– samcarter
4 hours ago










1 Answer
1






active

oldest

votes


















0














thanks to samcarter, I found out that adding the line expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} before begin{document} already did what I wanted (though not quite sure why)



documentclass{article}
usepackage{minted}
usemintedstyle{borland}

expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}}

begin{document}

begin{minted}{Java}
(new Thread(() -> {
System.out.println("Hello");
})).start();
end{minted}

end{document}


The output,as intended, is:








share|improve this answer
























    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%2f482818%2fminted-why-are-field-variables-colored-and-how-can-i-change-that-for-java-code%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









    0














    thanks to samcarter, I found out that adding the line expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} before begin{document} already did what I wanted (though not quite sure why)



    documentclass{article}
    usepackage{minted}
    usemintedstyle{borland}

    expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}}

    begin{document}

    begin{minted}{Java}
    (new Thread(() -> {
    System.out.println("Hello");
    })).start();
    end{minted}

    end{document}


    The output,as intended, is:








    share|improve this answer




























      0














      thanks to samcarter, I found out that adding the line expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} before begin{document} already did what I wanted (though not quite sure why)



      documentclass{article}
      usepackage{minted}
      usemintedstyle{borland}

      expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}}

      begin{document}

      begin{minted}{Java}
      (new Thread(() -> {
      System.out.println("Hello");
      })).start();
      end{minted}

      end{document}


      The output,as intended, is:








      share|improve this answer


























        0












        0








        0







        thanks to samcarter, I found out that adding the line expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} before begin{document} already did what I wanted (though not quite sure why)



        documentclass{article}
        usepackage{minted}
        usemintedstyle{borland}

        expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}}

        begin{document}

        begin{minted}{Java}
        (new Thread(() -> {
        System.out.println("Hello");
        })).start();
        end{minted}

        end{document}


        The output,as intended, is:








        share|improve this answer













        thanks to samcarter, I found out that adding the line expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}} before begin{document} already did what I wanted (though not quite sure why)



        documentclass{article}
        usepackage{minted}
        usemintedstyle{borland}

        expandafterdefcsname PYGborland@tok@naendcsname{defPYGborland@tc##1{textcolor[rgb]{1.00,0.00,0.00}{##1}}}

        begin{document}

        begin{minted}{Java}
        (new Thread(() -> {
        System.out.println("Hello");
        })).start();
        end{minted}

        end{document}


        The output,as intended, is:









        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 32 mins ago









        marcoPoliomarcoPolio

        255




        255






























            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%2f482818%2fminted-why-are-field-variables-colored-and-how-can-i-change-that-for-java-code%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

            Lallio

            Futebolista

            Jornalista