2
votes
1answer
259 views

How to define default 'program listing' title and parameters in Lyx

I'm using LyX software and need to embed python code snippets and the option I found is to put snippet in a file and then use: insert> file> Child Document ----> choose the snippet file ----> set ...
4
votes
2answers
96 views

How to line-number 1,5,10,15,20,25… in Program Listing in Lyx

I basically want every 5th line numbered, but would like to keep to 5,10,15,20,... as that seems intuitive to readers. So that means 1,5,10,15,... The first gap is 4, all subsequent ones are 5. Is ...
2
votes
1answer
89 views

2 column: how to squeeze line numbering closer, shift code over in Lyx

I'm using 2-column in otherwise-default Lyx, with several program listings. Some of them have line numbers. Due to the 2-column layout, the line numbers take a good chunk of the gutter between ...
3
votes
1answer
373 views

How to reduce Program-Listing line spacing in LyX

Using LyX 2.06. I have a standard document with 1.5 line spacing, but I want my program listings to use 1.0 line spacing. Is there a simple way to do this?
2
votes
1answer
178 views

Cross reference line number within program listing in lyx

I'm trying to cross reference program code line numbers within a program listing using lyx. From what I can tell, both labels and ERT are disabled within the program listing, but I'm not sure why. I ...
1
vote
0answers
105 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 ...
1
vote
0answers
25 views

Lyx program listings output wrong symbols [duplicate]

This is what I added to the preamble: basicstyle={\footnotesize\ttfamily} emph={si, //,{,}, <, >, if, para, cada, devolver, en, de} emphstyle={\color{red}} frame=single ...
3
votes
1answer
336 views

Changing lstlistoflistings title [closed]

I'm having difficulty getting the list-of-listings section to display the proper title, it simply says "Contents" no matter what sort of changes I make. Here is the command I put in the preamble at a ...
4
votes
2answers
405 views

Unicode characters changing order in listings (XeTeX)

I am trying to input code listings with unicode characters and everything seems to work (more or less) except some unicode characters being displayed out of order. For example instead of służąca ...
1
vote
1answer
265 views

How to define a hotkey in LyX to insert an inline listings?

In LyX, I can define a hot-key for listing-insert. But in this case, what appears is the \begin{lstlisting}...\end{lstlisting} environment. In fact I want to insert a inline listings command ...
6
votes
1answer
139 views

Is it possible to change the font of line numbers in a code listing?

Using LyX I can add line numbers to my code listing. However, these are in the document (serif/Roman) font and look strange next to code blocks (Typewriter font). Is it possible to change the font of ...
3
votes
2answers
2k views

Lyx is ignoring typewriter font setting for program listings

I'm using Lyx's Insert|Program Listing to insert a code listing into my document. Unfortunately, Lyx seems to ignore the Typewriter font selection I made in DocumentOptions under Fonts ⇒ ...
3
votes
1answer
1k views

LyX Error: Could not find LaTeX command for character '' (code point 0x2009)

I have been trying to copy and paste some code into LyX (via the 'Program Listings' menu item), and when I compile the document I get the LyX error: Could not find LaTeX command for character '' ...
3
votes
1answer
173 views

Problem with listings-ext [closed]

I am using listings-ext on Ubuntu 11.10 (with LyX) and listings.cfg defines the style colored-code - which I also use in the LaTeX preamble: \usepackage[style=colored-code]{listings-ext} But ...
4
votes
2answers
4k views

Is there a way to enable syntax highlighting coloring in Lyx for program listings?

I want to embed a small program listing and have used Insert -> Program Listing in LyX's menu for that. The settings dialog supports selecting a language (Java), but I can't actually see any ...
1
vote
2answers
841 views

Biblatex and listings incompatibility…

Does someone know why biblatex and listings are incompatible and if there is a way to fix it? I have a Lyx document and whenever I insert program listings I get errors like: al trabajo de ...
7
votes
1answer
1k views

Get List of Listings in an Appendix [closed]

I am using LyX with the listings package. I want to have Appendix A be titled "Code Listings" and then have the List of Listings. Right now I have \lstlistoflistings in an ERT. By using ...
2
votes
1answer
1k views

LyX: listings over multiple pages [closed]

I am trying to use LyX to insert child document-listing-program. The program imports OK but it is too long to fit on a single page. At the bottom of the page it outputs over the margin, sometimes ...
4
votes
1answer
1k views

`backgroundcolor` in `lstset` does not work

When I use the backgroundcolor option in lstset, all I get is a colored line above the listing: \lstset{% language=Matlab, backgroundcolor=\color{blue} } and in the document: ...
7
votes
3answers
5k views

Rename “Algorithm” to “Listing”

Background Syntax-highlighted source code image listings are being used as Algorithm floats with the lst: prefix for captions. Problem The following LaTeX code in the preamble renames the caption ...