Math & SciencePresenting C# Code

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
sw3quant
Posts: 76
Joined: Tue Nov 02, 2010 11:40 pm

Presenting C# Code

Post by sw3quant »

If you want to include MATLAB code in your LaTeX document, then there is this excellent package [1]. It preserves layout, colours etc.

However, I now want to include C# code in my LaTeX document and I don't know of any such package. Does anyone else?

[1] M-code LaTeX Package - File Exchange - MATLAB Central

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Presenting C# Code

Post by 5gon12eder »

Have a look at the listings package.

Best
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
sw3quant
Posts: 76
Joined: Tue Nov 02, 2010 11:40 pm

Re: Presenting C# Code

Post by sw3quant »

thanks.

just had a look at their manual (http://mirror.ox.ac.uk/sites/ctan.org/m ... stings.pdf)

It doesn't appear to have been updated since 2007, nor is there any mention of C#. It does however mention Java. I will have a play with it.

Any other replies welcome!

thanks
5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Presenting C# Code

Post by 5gon12eder »

Use C with "dialect" Sharp. As mentioned in table 1. Naming the language C# wouldn't have been a good idea since the # is a LaTeX control sequence.
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
Post Reply