Document Classeslistings package and blank space

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
sarox
Posts: 2
Joined: Wed May 02, 2007 9:07 am

listings package and blank space

Post by sarox »

Dear All,

I'm using the listings package to insert some code in some my documents. An example of the tex code in below:

Code: Select all

Code, edit and compile here:
\documentclass [10pt ,a4paper, oneside]{article}
\usepackage{listings} %per la stampa del codice
\newenvironment{C}
{\lstset{language=[ANSI]C++,
basicstyle=\small\ttfamily,
%numbers=left,
showspaces=false,
numberstyle=\tiny,
stepnumber=2,
tabsize=2,
numbersep=5pt,
numberfirstline = false,
framexleftmargin=5mm, frame=shadowbox,
breaklines = true}
}
{}
\begin{document}
\begin{C}
\begin{lstlisting}
void initIrqVectors(void) {
// IVPR = address base used with IVOR's
asm ("lis r5, IV_ADDR@h");
for (int i = 0; i < 5 ; i++) { ... }
}
\end{lstlisting}
\end{C}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The strange behavior is that for all the code inside the double quotation mark (for example "lis r5") the final document is: "lis_r5" with a "space symbol" instead of a normal blank space (even if showspaces=false).
It has to be noticed that the space symbol appears only for the code inside the double quotation mark.

Do you know how to remove the space symbol and to show just a blank space?

Recommended reading 2024:

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

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

User avatar
countbela666
Posts: 64
Joined: Thu Apr 26, 2007 2:44 pm

listings package and blank space

Post by countbela666 »

Hi sarox,

there's a special option for space symbols in strings. The following code disables the mentioned behaviour:

Code: Select all

\lstset{showstringspaces=false}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Regards,
Marcel
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
Post Reply