3

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

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

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

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

enter image description here

4

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

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

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

Output: LaTeX output

You must log in to answer this question.

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