Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Are you asking how to do this in latex? If so, consider using the listings package, linked to here. It wont look that that right out the gate, but its very configurable
– WillFeb 17 at 18:34
Thank you for the answer, I'm aware of the listing, but actually I was looking for the listing configurations that can get as close as those on O'reilly as shown on the example above.
– maths sosoFeb 17 at 19:23
@mathssoso: What language is used in the book?
– WernerFeb 17 at 19:29
@Werner: It's Scala, but several other books use Python, Java.
– maths sosoFeb 17 at 19:35
2
Welcome to TeX.se. As asked, this is either too broad or unanswerable. If O'Reilly doesn't make their source available (do they even use TeX?) then there is no such configuration. But as others have said, the listings package supports many languages out of the box, and adding associated colouring is not that difficult. Alternatively there is also pygments which can do similar things. So then make a sample document using one of those, using the appropriate language definition file, and then we can help you with the specifics.
– Alan MunnFeb 17 at 20:06
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
listings
package, linked to here. It wont look that that right out the gate, but its very configurable – Will Feb 17 at 18:34listings
package supports many languages out of the box, and adding associated colouring is not that difficult. Alternatively there is alsopygments
which can do similar things. So then make a sample document using one of those, using the appropriate language definition file, and then we can help you with the specifics. – Alan Munn Feb 17 at 20:06