This question already has an answer here:

I have the following C# Code

public class MeasurementData
    #region Public Properties

    public int ADC { get; set; }
    public double Latitude { get; set; }
    public double Longitude { get; set; }
    public int SensorID { get; set; }
    public DateTime Day { get;set; }
    public int CO2 { get; set; }


and the code looks with minted like this:

Minted Output

This is very very close to perfect. Except that DateTime is not colored. I know that minted can't be able to know what this is, because it does not know my code. Minted does only know a snipped. But i'd like to color it myself with telling minted how to color this Word(s). is there an option? It would be great when i could say that this are my classes:

define classes {DateTime, MyClass, ... }

and then this classes are color in bright blue or sth. The color is not that important. i think i am able to figure the coloring out myself.

Haven't found something on the net :(

marked as duplicate by TeXnician, Bobyandbob, Mensch, Troy, Torbjørn T. Dec 30 '17 at 18:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Have a look here: tex.stackexchange.com/questions/18083/… – DG' Jul 7 '15 at 11:57
  • @DG' Thank you that link is not bad. But i don't know how to change the Lexer. I found the dotnet.py and it contains the CSharpLexer, but when i add a DateTime to the line with the datatypes nothing changes.. what am i doing wrong? – Jens Jul 7 '15 at 12:32
  • @DG' Ok forget it. It worked.. it is now also red. Thats pretty cool! Thx! – Jens Jul 7 '15 at 12:35

Browse other questions tagged or ask your own question.