1

Please consider the following MWE

\documentclass[xcolor=pdftex,t,11pt]{beamer}
\begin{document}
\begin{frame}
\frametitle{An example}
\begin{itemize}
\item Testing the hypothesis that $\widehat{\beta}_{i}$ is equal to all values between $1$ and $3$ could be boring. \medskip
\item Augmenting the null hypothesis by $0.2$ points each time implies that we need to repeat our command 11 times.\medskip
\item To shorten the procedure, we can use the command {\tt{forvalues}}.\medskip
\item {\tt{forvalues}} (and also {\tt{foreach}}) lets us to create loops.\medskip
\item Let us write the following in the command window:\medskip
\begin{center}
{\tt{forvalues i=1(0.2)3.2\,\ \{}}\\
{\tt{test ertsp=`i'}}\\
{\tt{\}}}
\end{center}
\end{itemize}
\end{frame}
\end{document}

After typesetting, I get:

enter image description here

Instead, I should obtain exactly how I wrote in latex, i.e. `i'.

How can I get it? Thanks in advance.

2

Like this?

I've added upquote package for the ticks in \verb and [fragile] for the \verb in the frame environment.

\documentclass[xcolor=pdftex,t,11pt]{beamer}
\usepackage{upquote}
\begin{document}
\begin{frame}[fragile]
\frametitle{An example}
\begin{itemize}
\item Testing the hypothesis that $\widehat{\beta}_{i}$ is equal to all values between $1$ and $3$ could be boring. \medskip
\item Augmenting the null hypothesis by $0.2$ points each time implies that we need to repeat our command 11 times.\medskip
\item To shorten the procedure, we can use the command {\tt{forvalues}}.\medskip
\item {\tt{forvalues}} (and also {\tt{foreach}}) lets us to create loops.\medskip
\item Let us write the following in the command window:\medskip
\begin{center}\ttfamily
forvalues i=1(0.2)3.2\,\ \{\\
test ertsp=\verb|`|i\verb|'|\\
\}
\end{center}
\end{itemize}
\end{frame}
\end{document}

enter image description here

Credits to How to properly display backticks in verbatim environment?.

  • @Dario You're welcome, thank you for accepting my answer! – CarLaTeX Oct 23 '17 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.