File size: 1,383 Bytes
b27bfb3
 
 
 
1
2
3
4
5
{"type": "session", "harness": "opencode", "id": "doc-0009", "name": "LaTeX code listings and verbatim"}
{"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}}
{"type": "message", "message": {"role": "user", "content": "How to include code in LaTeX"}}
{"type": "message", "message": {"role": "assistant", "content": "Verbatim environment preserves all formatting literally. Double backslash verb command for inline verbatim.\n\nListings package provides lstlisting environment with syntax highlighting. Set language, basicstyle for font, keywordstyle for color, commentstyle, stringstyle.\n\nLstinputlisting for including external source files. Lstset for global configuration.\n\nMinted package uses pygments for superior syntax highlighting. Requires shell-escape compiler flag. Minted environment with language parameter.\n\nPackage fancyvrb for customizable verbatim. Package alltt for almost-verbatim with macro expansion.\n\nLine numbers, frame, background color all configurable in listings."}}