views:

116

answers:

1

Hi everybody,

I'am searching for a way to use objective C in LATEX. I want to display the same syntax highlighting in LATEX as it is in XCode.

I tried it this way:

\lstset{language=[Objective]C,label=code:MyCodeLabel,caption=A small caption,name=code:MyCode, breakindent=40pt, breaklines}
\begin{lstlisting}
NSLog(@"Test it: %@",[[[[XMLNavigation objectAtIndex:1] elementsForName:@"text"] objectAtIndex:0] stringValue]);
\end{lstlisting}

I think, I have to add some more keywords to the Library. Or is there a way to make it look like in XCode? For me it is important that all NS-Libraries are visible as keywords.

Thanks

A: 

You could try the minted package which uses pygments and can give better results than the basic keyword highlighting in listings.

Also see this question

thrope