I am writing my thesis using LaTeX, and a would like to add some code in it. I tried so far the listings by I am not satisfied with the result. Is there a way to add a pre-formated code in HTML into LaTeX?
I want to take my code from Kate as a pre-formated text in HTML and put it into my thesis text. Is that possible?
For example I have the following code in C:
struct cpu_info {
long unsigned utime, ntime, stime, itime;
long unsigned iowtime, irqtime, sirqtime;
};
I copy from Kate that code as HTML. The contents of the clipboard are
<pre style='color:#141312;background-color:#ffffff;'>
<b>struct</b> cpu_info {
<span style='color:#0057ae;'>long</span> <span style='color:#0057ae;'>unsigned</span> utime, ntime, stime, itime;
<span style='color:#0057ae;'>long</span> <span style='color:#0057ae;'>unsigned</span> iowtime, irqtime, sirqtime;
};</pre>
I want to insert this code in Latex in order to produce the formatted text of the above HTML code without using listings if it is possible.
My code is written in C so if anyone has a good lstset for C, that would be also great for me.
I use \documentclass[a4paper,10pt]{article}.

verbatimenvironment... – phimuemue Oct 24 '11 at 20:50listings. See XML syntax highlighting, which might be a duplicate. There is also themintedpackage which uses Pygments, a Python syntax highlighter, which might have better XML support. – Martin Scharrer Oct 24 '11 at 22:27It is always best to compose a MWE that illustrates the problem including the
– Peter Grill Oct 24 '11 at 22:36\documentclassso that those trying to help don't have to recreate it.