0

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

Vivid
  • 399
  • 1
  • 8
  • 19

1 Answers1

1

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

Community
  • 1
  • 1
robince
  • 10,826
  • 3
  • 35
  • 48