LyXChanging page margins for Code Listing doesn't work

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
GuyL44
Posts: 1
Joined: Sat Oct 26, 2013 11:33 am

Changing page margins for Code Listing doesn't work

Post by GuyL44 »

Hey there,

I'm writing a document that has a few Code Listings inserted into it. It's in the "Article (Hebrew)" format - which, as far as I know, isn't any different from the standard "Article" - it only has added language support.

Anyway, I'm trying to have only one of the listings start off more to the left than usual - basically to have a negative left page margin, on that specific listing only.

I've tried 3 methods so far, none managed to do the trick:
1. Document->Settings->Listings
I entered the command xleftmargin=-3cm, the program recognizes it, but only changes the comments in the code. Meaning, only on the lines where there's a "%" (the code is set in MATLAB) the negative indentation is performed. The rest of the code stays right where it was.
2. \usepackage{changepage}
This method looked promising, but it didn't work as well. I used the aforementioned package and inserted the proper commands ("{adjustwidth}{-3cm}{}" etc.) and nothing worked. Only simple text (i.e. outside of the Code Listing) was moved. The listing stayed the same.
3. http://stackoverflow.com/a/1670572
This one didn't do the trick either. Again, only "plain" text was affected, never the code listing.


Can anyone help me? It's been driving me crazy and I have no idea what I'm doing wrong!
(Added: I'm using Lyx 2.0.5.1)

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply