I'm trying to write

\texttt{gap> M:=Group(r*u^2*d^-1*b*d^-1);}

exactly this way. But latex return an error because of the powers.

How can I fix this?

2 Answers 2

\texttt{gap> M:=Group(ru\^{}2d\^{}-1bd\^{}-1);}

{\ttfamily gap> M:=Group(ru\^{}2d\^{}-1bd\^{}-1);}

\verb|gap> M:=Group(ru^2d^-1bd^-1);|

enter image description here


I believe you are trying to do verbatim text. Therefore, I would suggest using the \verb command.

\documentclass[preview, border=.2cm]{standalone}

Lorem \verb|gap> M:=Group(ru^2d^-1bd^-1);| ipsum

Output: LaTeX output

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .