Text Formattingcode phantom spacing

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
comandos
Posts: 15
Joined: Sat Dec 15, 2018 3:46 pm

code phantom spacing

Post by comandos »

Greetings,
when opening pdf and copying a code snippet there are phantom spaces in the code, what did I do wrong?
Example bellow:

Code: Select all

\documentclass[a4paper,oneside,12pt]{book}
\usepackage[slovene]{babel}
\usepackage[utf8]{inputenc} 
\usepackage{listings}
\usepackage{xcolor}

\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{server}{rgb}{0.75,0.95,0.92}
\definecolor{CA}{rgb}{0.90,0.75,0.92}



\lstdefinestyle{server}{
	backgroundcolor=\color{server},   
	commentstyle=\color{codegreen},
	keywordstyle=\color{magenta},
	numberstyle=\tiny\color{codegray},
	stringstyle=\color{codepurple},
	basicstyle=\ttfamily\footnotesize,
	breakatwhitespace=false,         
	breaklines=true,                 
	captionpos=b,                    
	keepspaces=true,                 
	numbers=left,                    
	numbersep=5pt,                  
	showspaces=false,                
	showstringspaces=false,
	showtabs=false,                  
	tabsize=2
}


\begin{document}
	
	
\begin{lstlisting}[style=server]
	cp /tmp/client1.crt ~/client-configs/keys/
	cp ~/easy-rsa/ta.key ~/client-configs/keys/
	sudo cp /etc/openvpn/server/ca.crt ~/client-configs/keys/
\end{lstlisting}
	
	
	
		
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

comandos
Posts: 15
Joined: Sat Dec 15, 2018 3:46 pm

code phantom spacing

Post by comandos »

Found solution:

Code: Select all

basicstyle=\ttfamily\footnotesize,
columns=fullflexible,
breakatwhitespace=false,
fullflexible was missing.

BR
Post Reply