4
votes
1answer
75 views

What can I do if a listing is too wide to fit in my two-column document?

I am writing a IEEE document with a LaTeX template I downloaded from the IEEE webpage. I inserted some MATLAB code into the document through the mcode package. It looks something like this: ...
10
votes
2answers
224 views

How can I hide (or blur) some code in a listing?

I have a code listing to write in a report, but I'd like to blur or hide some code parts with a colored box (of same length as the hidden text), so that readers cannot see the hidden parts. (Another ...
3
votes
2answers
90 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, ...
4
votes
3answers
229 views

How to get listings to print only the header of a Matlab file?

How to extract the first line of a simple matlab file and the following lines just after that begin with the character % ? The number of lines to extract is unknown. Then I want to use listingsutf8 to ...
1
vote
0answers
26 views

Using mcode within a beamer frame [duplicate]

I have a presentation that I would like to include some matlab code in. For that purpose I have included the mcode package, that basically configures the listings package. My problem is that the ...
5
votes
1answer
248 views

The % symbol overlaps inside a listing with MatLab code

I'm using the listings package to insert MatLab routines that I've created for some papers I need to write. Everything works awesome, except the symbol % (comment in MatLab) which overlaps with the ...
0
votes
1answer
154 views

Long codes using listing or mcode which do not break into 2 pages

I'm using the mcode package for including my codes into my documents, but the problem is that when my codes are too long, and they need more than one page the program tries to keep them in one page, ...
1
vote
1answer
275 views

Bug? Colored frame in mcode package

While using mcode.sty, I recognized that at linebreaks with long comments parts of the surrounding frame got colored green or were even left white at using mathematical formulas, e.g. in the following ...
6
votes
1answer
579 views

change code font using mcode package

I'm using mcode package to insert into my document matlab code. I would change the default font. what command I should use to get this font?
2
votes
0answers
42 views

Aligning comments that break in several lines? [duplicate]

Possible Duplicate: How to align comments with lstlistings? I want to include Matlab code with long comments. The next MWE shows that it is achieved by using the listings package. However I ...
30
votes
3answers
17k views

What can I use to typeset MATLAB code in my document?

This question led to a new package: matlab-prettifier Does anybody have a quick and easy way to typeset some relatively long MATLAB code in the appendix? I looked up a few methods, and the ...
12
votes
1answer
7k views

Using listing for displaying Matlab code

I'm trying to display matlab code in a LaTeX document and the comments are typeset with an ugly space between letters: \documentclass{article} \usepackage{listings} \lstset{language=Matlab} ...