# How can I insert blank spaces into displayquote text?

I'm using displayquote and texttt to write a piece of software code in a LaTeX document:

\begin{displayquote}
\texttt{install.packages("ggplot2",}
\texttt{repos="http://cran.us.r-project.org")}
\end{displayquote}

which results into this text in the pdf document:

install.packages("ggplot2",
repos="http://cran.us.r-project.org")

I would like to move the 2nd line a bit to the right, this way:

install.packages("ggplot2",
repos="http://cran.us.r-project.org")

but I cannot find a way to insert some blank spaces near the word repos. I tried with \hspace{1cm}, with $\;\;\;$, with \indent, but nothing worked. Does anybody know how to insert these blank spaces?

Thank you

• @Ingmar I just tried, it did not work. Thanks anyway Jan 20 at 18:32
• or maybe \hpantom Jan 20 at 18:32
• @riccs_0x Do you mean \phantom? It worked but it removed the first letter of repos, that now became epos Jan 20 at 18:36
• @DavideChicco.it, no I mean the \hphantom as far as I remember. Jan 20 at 18:58

First of all, you have to end the first line with \\. Then \hspace*{1cm} (note the asterisk) will work.

\begin{displayquote}
\texttt{install.packages("ggplot2",}\\
\hspace*{1cm}\texttt{repos="http://cran.us.r-project.org")}
\end{displayquote}

Another solution:

\begin{verbatim}
install.packages("ggplot2",
repos="http://cran.us.r-project.org")
\end{verbatim}

This solution allows you to add all kinds of funny characters that you cannot use directly as in \texttt.

\documentclass{article}
\usepackage{csquotes}
\begin{document}

\paragraph{displayquote}

\begin{displayquote}
\texttt{install.packages("ggplot2",}\\
\hspace*{1cm}\texttt{repos="http://cran.us.r-project.org")}
\end{displayquote}

\paragraph{verbatim, left-aligned}

\begin{verbatim}
install.packages("ggplot2",
repos="http://cran.us.r-project.org")
\end{verbatim}

\paragraph{verbatim, shifted}

\begin{verbatim}
install.packages("ggplot2",
repos="http://cran.us.r-project.org")
\end{verbatim}

\end{document}