The objective of this topic is to make a common place where we can share our settings for listings.sty. So we can use this as a reference.
Note that I am only interested in the following settings:
- font family, font size, font weight, font color
- background color
In other words, the layout such as frame, line numbers, etc must not be taken into account here.
The rule of the game:
Use the following code snippet as the template. Only modify the lines marked with
%<==. NOTE: Please leave the font size unchanged. I already set it to\scriptsize.\documentclass[dvips,dvipsnames]{article} \usepackage[a4paper,margin=55mm]{geometry} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{listings} \lstset% {% language={[Sharp]C}, breaklines=true, breakindent=0pt, tabsize=2, showstringspaces=true } %================================= %Rule of the Game: %You are ONLY allowed to %modify the lines marked with %<== %================================= \usepackage[rgb]{xcolor}%<== \lstset {% backgroundcolor=% \color{Black},%<== % basicstyle=\scriptsize%leave the font size unchanged please. \color{lightgray}\ttfamily,%<== % keywordstyle=% \color{Orange}\sffamily,%<== % commentstyle=% \color{Green},%<== % identifierstyle=% \color{Cyan},%<== % stringstyle=% \color{Yellow}%<== } \begin{document} \begin{lstlisting} using System; public class Foo { public static void Main() { Console.WriteLine("I Love LaTeX");//This is a comment. } /*This is a comment too.*/ } \end{lstlisting} \end{document}View the pdf output in 150% scale and make a screenshot of it in *.png format.
- Submit your screenshot followed by your modified settings (NOT complete code please). You can submit as many as you want but make sure you don't make a duplication.



