listings

Highlighting a Chunk of Code within a lstlisting

和自甴很熟 提交于 2019-12-02 21:09:55
I have a bunch of code in a lstlisting environment. How can I highlight (color background) just a particular chunk of code within the environment? You can use \colorbox and an escape character inside your listing: Add to your preamble \usepackage{color} \definecolor{light-gray}{gray}{0.80} then use it like this in your document: \begin{lstlisting}[escapechar=!] def mult(m: Matrix[Int], n: Matrix[Int]) { val p = !\colorbox{light-gray}{new MatrixInt}!(m.rows, n.cols) } \end{lstlisting} Anton Geraschenko It's a bit cumbersome, but you can break the code into several lstlisting environments.

GitHub repository not listing in Google search

偶尔善良 提交于 2019-12-02 18:59:20
I created my first repository with GitHub but when I try to google it, its not listing RoboSpice-Extn-Retrofit-Tutorial EDIT I don't know how long it will take. On the other hand anyone can take a help of Google Webmaster , this would solve your problem in minutes :) That repo seems to have been created less than an hour ago. Give Google a little time to parse the new repos, and it should show up. Note that it is referenced by GitHub search already: https://github.com/search?utf8=%E2%9C%93&q=RoboSpice-Extn-Retrofit-Tutorial As the OP used the Webmaster Tools to submit its url, the repo is now

TV guide listing API [closed]

吃可爱长大的小学妹 提交于 2019-12-02 13:53:11
Does anybody know a provider offering TV listings (through API or download) for all channel and cable providers? Or is there any independent company collecting/providing such data? An API/REST/SOAP interface would be great. The MythTV folks have gathered resources for various countries here . If you're in the US or Canada, they recommend the Schedule Direct service. These services are generally based on the XMLTV data format/toolset. Phil Rovi offers both SOAP and REST APIs for TV listings. It supplies listings for all channels of the cable, satellite, and broadcast services in multiple

Make code in LaTeX look *nice* [closed]

风流意气都作罢 提交于 2019-12-02 13:49:06
I'm currently writing a project report, and to explain the slightly crazy un-intuitive code that I've used I need to put lots and lots of short excerpts of example code in. How I can get code into LaTeX that: looks nice doesn't go off the side of the page if the line's too long (list lstlisting or verbatim) is preferably inline with the rest of the text EDITED (Figured I'd add the settings so people don't have to try and figure them out themselves (taken from wikibooks (link further down) and edited for niceness)) Nice settings: \usepackage{color} \usepackage{listings} \lstset{ % language=C++,