# Greek and Latin letters in verbatim

I want to write a code snippet where the commands are in greek and variables are in latin. I use the verbatim command but automatically the latin characters are translated to their greek equivalent. I use the babel package so far and I had no issues.

\begin{verbatim}
για κάθε t:
x1 = x0 + u*Δt
\end{verbatim}


which results in

In the preamble I use

\usepackage[utf8]{inputenc}
\usepackage[greek]{babel}
\usepackage{alphabeta}
\usepackage[LGR, T1]{fontenc}


Any ideas on how to fix that? I would like not to change to another package like polyglossia because that would make me to rewrite a big portion of my report.

Set the font encoding to T1 inside verbatim:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek]{babel}
\usepackage{alphabeta}

\makeatletter
\renewcommand\verbatim@font{\normalfont\fontencoding{T1}\ttfamily}
\makeatother

\begin{document}

\begin{verbatim}
για κάθε t:
x1 = x0 + u*Δt
\end{verbatim}

\end{document}


My problem was fixed after refactoring the \usepackage command:

\usepackage[english, greek]{babel}

and inserting the command

\selectlanguage{english} before the verbatim