\documentclass[a4paper]{article} \usepackage{lmodern} \usepackage{amssymb,amsmath} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{hyperref} \usepackage{minted} \begin{document} \thispagestyle{empty} \begin{minted}[ fontfamily=tt, linenos=true, numberblanklines=true, numbersep=12pt, numbersep=5pt, gobble=0, frame=leftline, framerule=0.4pt, framesep=2mm, funcnamehighlighting=true, tabsize=4, breaklines=true, texcl=false, ]{html}

Installation

Minted, another LaTeX package, is very useful to display source code. It requires the Python programming language.

As soon as Python is installed, we can download the corresponding Python package Pygments using a command prompt:

pip install Pygments

Add the LaTeX package and we are good to go:

\usepackage{minted}
\end{minted} \end{document}