1

I want to talk about git and created some slides, where I use a listings enviroment to mark code that can be typed into the terminal (see minimal example).

Unfortunately, when I want to copy the code from my .pdf file into the terminal, unwanted blanck spaces appear.

For example:

$ git config --global alias.st status 

is copied into the terminal the following

$ git config -- global alias . st status

Is this a problem of my pdf viewer (I tried evince and okular) or is this a latex-beamer problem and how can I solve this?

EDIT: sorry I forgot the code

\documentclass[11pt]{beamer}
\usetheme{Boadilla}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{listings}
\lstset{basicstyle=\ttfamily,
  showstringspaces=false,
  commentstyle=\color{red},
  keywordstyle=\color{blue}
}
\begin{document}
\begin{frame}[fragile]
        \frametitle{aliases} 
        \begin{lstlisting}
$ git config --global alias.st status
$ git config --global alias.ci commit
$ git config --global alias.co checkout
\end{lstlisting}
\tiny{
\begin{lstlisting}
$ git config --global alias.lg "log --graph --abbrev-commit --decorate 
--format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) 
%C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''
          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
\end{lstlisting}
}
\end{frame}

\end{document}

0 Answers0