\documentclass[a4paper]{article} % languages \usepackage[russian,english]{babel} % layout & toc \usepackage[labelformat=empty]{caption} % remove section numbers and keep-up with toc \renewcommand{\thesection}{} \usepackage[cm]{fullpage} \usepackage{url} % utf8 fonts \usepackage{fontspec} \setmainfont{FreeSerif} \setsansfont{FreeSerif} \setmonofont{FreeMono} % code blocks & inline code \usepackage{xcolor,listings} \definecolor{mygray}{gray}{0.94} \lstset{ backgroundcolor=\color{mygray}, xleftmargin=0.5in, xrightmargin=.25in, breaklines=true, tabsize=8, } \begin{document} Here's some \colorbox{mygray}{\lstinline{inline code}} and here comes a code block. \begin{lstlisting} |\_/| **************************** (\_/) / @ @ \ * "Purrrfectly pleasant" * (='.'=) ( > º < ) * Poppy Prinz * (")_(") `>>x<<´ * (pprinz@example.com) * / O \ **************************** \end{lstlisting} \end{document}