开发者

Objective C code in LATEX listings

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, bre开发者_如何学运维akindent=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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜