I'm writing a document in which I want to insert some Python code. I wanted to display it in a tabular so I used the
\verb
tag, it is working pretty well, but it just removes the leading spaces for each instruction, which is problematic as I show Python code ...
Here is a MWE :
\documentclass{article}
\usepackage[left=4cm,right=4cm,top=2cm,bottom=2cm]{geometry} % Marges
%%% For french
\usepackage[utf8]{inputenc}
\usepackage[cyr]{aeguill}
\usepackage{xspace}
\usepackage[francais]{babel}
\usepackage{fancyvrb}
\begin{document}
\begin{tabular}{l l}
\hline
Boucle & Code \\
\hline \\[-0.2cm]
while &
\verb|while (condition d'arrêt non vérifiée): | \\
& \verb| instructions | \\
& \verb|else: | \\
& \verb| instructions exécutées lorsque le while est terminé|\\
\end{tabular}
\end{document}
