3
votes
2answers
80 views

Listings problem with quotes in a string

A single quote occuring inside a listings string seems to be interpreted as ending the string. Is there a way to avoid this from happening? \documentclass[12pt]{article} \usepackage[top=0.3in, ...
5
votes
2answers
158 views

How to have straight single quotes in lstlistings [duplicate]

All single quotes in code samples are displayed as backticks and the copy-pasted code can't be compiled without fixing the quotation. Is it possible to prevent this? for example: ...
4
votes
1answer
232 views

lstlistings - How to highlight single quotes og keywords

I want to highlight some keywords in a listing. One keyword has an apostrophe. I searched and read already quite some time and found a couple of postings that textcomp could be very helpful for ...
1
vote
0answers
109 views

Lyx - quotation mark in C program [closed]

I have a problem with double quotation marks in program listing. When I load a file.c as a child document in lyx and set it as program listing, I get error: #include "softSPI.h" undefined control ...
0
votes
1answer
722 views

Standard single quotes for code in listings [duplicate]

In my code, I have curved quotes (see screenshot). Can I replace them with vertical quotes? This is my formatting code: \lstset{% % General design backgroundcolor=\color{lightgray}, ...
7
votes
1answer
4k views

How to improve listings display of JSON files?

I was wondering if there is a good way for JSON files to be listed with the listings package. The only language definition I could come up with, is this: \lstdefinelanguage{json} { ...
1
vote
0answers
64 views

Listings remove single quotes after I made it look good [duplicate]

Possible Duplicate: Listings package not correctly showing PHP strings So I've used this code for my listings. However it seems to ignore single and double quotes and everything inside them ...
15
votes
1answer
840 views

In the minted package, how do I enforce straight single quotes?

Basically I want \mint{python}|'banana'| to produce straight single quotes, rather than the curly ones it normally produces (in pdflatex).
7
votes
1answer
250 views

How do I get guillemets in a listing?

I'm wondering if it's possible to use guillemets («») in a lstlisting block? I have seen some solutions for including it in the document, but none with the listings package.
10
votes
3answers
913 views

Avoiding “minus sign” dash in listings commentstyle

Is there a general way to get listings package to typeset a hyphen as a minus character in the rest of the code (the default behavior), but typeset a hyphen as a true hyphen if it occurs in comments ...
12
votes
3answers
904 views

How to typeset - - with lstlisting package?

Consider this small example: \documentclass[a4paper,10pt]{article} \usepackage[utf8x]{inputenc} \usepackage{listings} %for listings of the source code \begin{document} \lstset{language=sh} ...
15
votes
1answer
686 views

listings package changes hyphens to minus signs

The listings package transforms source-code hyphens (-, U+002D) into minus signs (−, U+2212) when using the default proportional fonts, though not when using the default monospaced typewriter font. A ...
5
votes
1answer
340 views

Listing index uses wrong dashes

When generating an index of all my Listings, the library seems to use the wrong dashes to connect words: Expected Unported-2.0-Graphic Actual Unported—2.0—Graphic In the title of the listings, ...
5
votes
2answers
3k views

How do I prevent LaTeX from showing a whitespace following a quote when in an lstlistings environment? [closed]

When I am inside the lstlistings environment, it seems that using a quote such as (') or (") will toggle on the showing of whitespace indicators (small little half rectangles). Am I doing something ...
4
votes
1answer
551 views

How to make sure I get regular ASCII quotes in code examples when using `listings`

So I am writing a book on AWK and when using listings code highlighting module, I get the fancy quotes “ ” and ‘ ’ instead of the regular ASCII ones " " and ' '. I hate these fancy quotes because when ...