Listings can be well typeset with the listings package. However, it requires some setup before listings look very well. See the example below. These examples use the lstcustom.sty language and style definitions. Just copy that style file into the same directory as your latex file.

The result is given here: lstcustom.pdf Download



% beramono or luximono give very nice ttfamily fonts

\section{Listings in Latex}
Here is some normal text for comparison. The looks of your listings are most
influenced by the type of font you use, i.e. teletype (\verb|\ttfamily|) or 
serife free (\verb|\sffamily|). Still within one of those two classed there are
very big differences according to the concrete fonts you use for the two
classes. The default font for tt have quite classic looks. Hence I
actually prefer tt fonts with a nicer font, e.g. \emph{beramono},
\emph{luximono} or \emph{palatino}. See \url{}
on how to use other fonts.
\subsection{Black \& White Listings}
\begin{lstlisting}[language=pseudo, style=black]
  algorithm calcMyNumbers(n)
        foreach number till n do
                calc something important
                if result is good then be happy else continue
\subsection{Eclipse like Listings}

\begin{lstlisting}[language=c, style=eclipse]
int main(int argc, char* argv){
        // comment 
        int a = 5 + 3;
                a = a-- /* another comment */    
\begin{lstlisting}[language=java, style=eclipse]  
public class MyClass{    
        int    myVar1     = 27; 
        float  thisIsCool = 3.234f; 
        String myString   = "Hello World!";           
        /** This is a Javadoc Comment */   
        /* This is a normal comment */  
        public MyClass(String param){
                myString = param; // comment  
\begin{lstlisting}[language=oaw, style=eclipse]
import meta1 
import meta2  
extension test::myextension  
/* comment */
create meta2::Type1 this transform(meta1::Type2 in):
        let a = 5: // comment
        this.setName( + a) 

\begin{lstlisting}[language=xml, style=eclipse]
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
    xmlns:xmi="" xmlns:xsi=""
    xmlns:ecore="" name="synccharts"
    nsURI="" nsPrefix="synccharts">
  <eClassifiers xsi:type="ecore:EClass" name="Action">
    <eStructuralFeatures xsi:type="ecore:EReference" name="effects" upperBound="-1"
        eType="#//Effect" containment="true"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Expression"
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="delay" eType="ecore:EDataType"
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="isImmediate" eType="ecore:EDataType"/>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="label" eType="#//Parsable"/>

Eclipse Xpand uses french guillemots ('«', '»'). The listings
package unfortunately does not support multibyte characters of UTF-8.
So you have to (1) encode the whole tex file in latin1 (inputenc) or
(2) write the code in separate files (lstinputlisting) which have latin1
encoding while your tex file may have UTF encoding or (3)
use an escape character in the listing to escape special symbols or 
(4) use \emph{literate} in language definition to map the symbols to 
other ones (this is used here). Either way I did not get guillemots
to be recognized in any of the enviornments (keywords, delimiters, \ldots). 

(3) is shown here:
Hall@ö@ @ä@ @ü@ @ß@!

(4) is shown here, the literate is in the language definition of oaw.  
\begin{lstlisting}[language=oaw, style=eclipse, caption={Listing in tex File}] 
/* Copyright by me   
«EXTENSION xpt::diagram::ViewmapAttributesUtils»
«DEFINE createNodeShape(node : gmfgen::GenNode) FOR gmfgen::FigureViewmap-»
  «LET (if figureQualifiedClassName = null 
     then 'org.eclipse.draw2d.RectangleFigure' 
     else figureQualifiedClassName
     AS fqn-»  
     «EXPAND xpt::Common::generatedMemberComment»
     «REM Another Comment»
     «REM» Comment «ENDREM»
    protected java.lang.String createSomething() {
\begin{lstinputlisting}[language=oaw, style=eclipse, caption={Imported Listing
from external file}, inputencoding=latin1]{lstxpand.xpt}