Questions tagged [matlab-prettifier]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
46 views

How to escape to LaTeX inside \lstinline? [duplicate]

The escape character works inside lstlisting environment but not inside \lstinline \documentclass[aspectratio=169, xcolor={x11names}, t]{beamer} \usetheme{Dresden} \usefonttheme{professionalfonts} \...
Al-Motasem Aldaoudeyeh's user avatar
0 votes
1 answer
61 views

Using .\ inside lstlisting causes issues crashes

I want to produce MATLAB prettified code with MATLAB code. Using .\ causes error. alsoletter={.\\} in \lstdefinestyle does not seem to work \documentclass[aspectratio=169, xcolor={x11names}, t, ...
Al-Motasem Aldaoudeyeh's user avatar
0 votes
0 answers
52 views

How to customize the color of ) in matlab-prettifier?

I want to customize the color of the closing brace ), but it does not seem to work. I tried passing the following to literate option {)}{\textcolor{IndianRed1}{)}}{1} This issue arises when using ...
Al-Motasem Aldaoudeyeh's user avatar
1 vote
1 answer
32 views

How to get listings to identify \ as letter?

With listings, it is possible to identify \\ as letter using the following literate entry {\\\\}{{\textcolor{IndianRed1}{\textbackslash{}\textbackslash{}}}}{1} However, I want to do the same thing ...
Al-Motasem Aldaoudeyeh's user avatar
0 votes
1 answer
37 views

How to get lstdefinestyle to accept a custom command with an argument?

I want to customize the style of Matlab-editor in matlab-prettifier package. What I want is to produce background for MATLAB styled commands, but it does not seem that basicstyle key accepts commands ...
Al-Motasem Aldaoudeyeh's user avatar
1 vote
0 answers
182 views

\usepackage{listings} prevents file from compiling

I am trying to use the listings package to show code in my document, but for some reason, if I include this package, the whole document doesn't compile. I don't get any error messages, just: Process ...
user279043's user avatar
0 votes
1 answer
193 views

[matlab-prettifier]: Package Listings Error: Couldn't Load Requested Style

I am using matlab-prettifier to write matlab codes inside my LaTeX files. The block codes work fine, but the inline codes gives the error Package Listings Error: Couldn't Load Requested Style. How can ...
Math_Novice's user avatar
0 votes
1 answer
111 views

tcolorbox in a footnote

I want to put a tcolorbox (or actually a lstlisting defined by \newtcblisting ) into a footnote. Thus, something like the following (which does not compile) \documentclass{article} \usepackage{matlab-...
tommsch's user avatar
  • 429
1 vote
2 answers
166 views

Include MATLAB code listing compiled into HTML with correct colors

I am compiling a LaTeX file my_document.tex into an HTML page my_document.html using htlatex with the following command: htlatex my_document.tex "xhtml,mathml-" " -cmozhtf" I have ...
Paul Wintz's user avatar
1 vote
0 answers
83 views

How to color second words in blue with matlab-prettifier

I'm using the Matlab-prettifier package quite happy with it. Even if it can mimic almost perfectly the Matlab style it just doesn't color second words in blue (like MATLAB does). Somebody know how to ...
Leon's user avatar
  • 473
0 votes
1 answer
152 views

How to improve spacing in `lstlisting` environment?

I would like to post some MATLAB codes in beamer using matlab-prettifier. I want to create a main title for codes using title option from lstlisting. However, the result becomes as follows Is it ...
Al-Motasem Aldaoudeyeh's user avatar
0 votes
1 answer
155 views

Automatically include a listing of all files in a folder [duplicate]

My thesis supervisor requires me to include all my MATLAB code in the PDF. My code is scattered in a dozen .m files, all in the same folder. I know I can include code, using the matlab-prettifier ...
Riccardo Orlando's user avatar
2 votes
0 answers
130 views

How to customize \lstset for each \lstinputlisting environment in my document?

These are the settings of my overleaf project (they were given to me by my Professor): % Listings and related stuff \usepackage[hyper]{listings} %%%%%%%%%%%%%%%%%%%%%%%% pacchetto caricato da G....
g_don's user avatar
  • 779
1 vote
1 answer
471 views

Matlab Code in a Thesis

I'd like to insert matlab code just by copying and pasting the code I want, I'd like it in black, no colours, if it's possible I'd like in a text box with the number of lines, but not necessary if it ...
Noob_Latex's user avatar
1 vote
1 answer
260 views

Numbers not shown with matlab-prettifier and beamer

I'm trying to add MATLAB code to a beamer presentation, but using matlab-prettifier package numbering isn't showing. Does anybody knows why this is happening? I'm not even sure that using matlab-...
IvanB's user avatar
  • 11
1 vote
1 answer
56 views

Run and include output of matlab code in document

I want to run a matlab program and include the output in my document. To do this, I'm trying to combine \input and matlab-prettifier. This is what I tried: \begin{lstlisting}[ style = Matlab-...
Panda's user avatar
  • 111
1 vote
1 answer
341 views

Matlab Prettifier Package Question

I am having difficulties changing the font size of the matlab-prettifier package. Here is a MWE. This works great if I am okay with the default font size. But it's too big I think. I'd like to shrink ...
Nukesub's user avatar
  • 525
1 vote
1 answer
310 views

Degree symbol and \lstinputlisting

How can I print a degree symbol (°) in a listing with \lstinputlisting? I have noticed the questions based on the lstlisting environment but it does not work with \lstinputlisting. This illustrate the ...
AlMa's user avatar
  • 546
1 vote
0 answers
48 views

literate's replace option unable to deal with square brackets?

I am using matlab-pretifier to add some Matlab code to an appendix, and I would like to replace the units [g/cm^3] in the matlab code by $\mathrm{\left[g \cdot {cm}^{-3}\right]}$. For that I use the ...
Euclides's user avatar
0 votes
1 answer
153 views

latex interpretation of selected German and Latin as well as mathematics-physics characters via matlab-prettifier

I want to append some matlab code to a tex document and I use the matlab-prettifier package for that. I updated my miktex installation yesterday and I am now forced to use the \UseRawInputEncoding ...
Euclides's user avatar
1 vote
1 answer
43 views

Problem with Chapterbib and Matlab-prettifier

I am trying to insert a Maltab code in a Latex document using Matlab-Prettifier. I am configuring the package as indicated below: \usepackage[framed]{matlab-prettifier} \lstset{ style ...
Fabio Barbosa's user avatar
1 vote
1 answer
411 views

Different programming language environment using \newtcblisting

In the code given below, I am attempting to generate different programming languages syntax environments. With the current code, I am not able to get output to show up with color highlighted syntax ...
Joe's user avatar
  • 9,024
1 vote
1 answer
441 views

Using matlab prettifier to put 100 lines of code per page

I need to put my code for a software I have written in my thesis appendix. There's about 4000 lines of code across multiple files, so I'd like to have 100 lines of code per page. Using these settings,...
Corinne's user avatar
  • 13
1 vote
1 answer
88 views

compile/interpret matlab code with one single greek character with matlab prettifier

I use the matlab prettifier package with the matlab editor option to compile a file containing matlab code in LaTeX. Question: is it possible to somehow insert a LaTeX-like command for a single ...
euclides's user avatar
0 votes
0 answers
335 views

Matlab prettifier problem with *

I'm trying to use the matlab-prettifier. Following code does not compile: \begin{lstlisting}[ style = Matlab-editor, basicstyle = \mlttfamily, ] ro=zeros(length(prec),length(prec)+length(h)-1); ...
Karl's user avatar
  • 23
3 votes
2 answers
376 views

How do I stop matlab-prettifier thinking print strings are comments?

I am trying to put my code into a Latex document using matlab-prettifier. I am doing this by using \lstinputlisting[style=Matlab-editor]{Trap.m}. An example of Trap.m (a MATLAB file) is as follows ...
K-Q's user avatar
  • 151
1 vote
0 answers
440 views

Minted vs matlab-prettifier for thesis [closed]

I am writing my PhD thesis now for which I need to list snippets of source-code within the main text and full listings in the appendix. I did my coding entirely in MATLAB using advanced constructs ...
Dr Krishnakumar Gopalakrishnan's user avatar
0 votes
1 answer
260 views

Can't get Bera font with Matlab-prettifier

I've used Matlab-Prettifier in the past to format my Matlab code, but having moved out of ShareLaTeX and into a local environment, I can't seem to get the Bera Mono font. E.g., the code ... \...
Andy Donzelli's user avatar
1 vote
1 answer
696 views

How do i remove numbered lines from the main text in doccument using Matlab-prettifier

I'm using \usepackage[numbered]{matlab-prettifier} but want to insert one line in the main document WITHOUT line numbers. I'm adding MATLAB codes in appendix for which I need the numbers. I'm ...
Jab's user avatar
  • 11
2 votes
1 answer
289 views

numbering isn't showing with matlab-pretifier package

does anybody know why this might be? I tried changing my document class from "Article" to "Beamer" and also tried deleting a bunch of packages but nothing has made the numbering on the Matlab-editor ...
user391838's user avatar
1 vote
1 answer
2k views

Adjust matlab-prettifier to page width

According to Richard Johnson's Elements of MATLAB Style paragraph 6, it is a best practice to keep content to within 80 characters. Although matlab-prettifier wraps lines nicely, in my opinion, ...
ktolbol's user avatar
  • 13
1 vote
0 answers
77 views

Why doesn´t this new environment work? [duplicate]

I´m using the Matlab-prettifier package to include Matlab-code in my Latex-file, and it generally works, i.e, when I´m using the custom environment from the package: \begin{lstlisting}[style=Matlab-...
Niels Petter Liset's user avatar
2 votes
2 answers
1k views

Use of Bera Mono font with \mlttfamily described by matlab-prettifier

I am using latex with pdftex and trying to use the Bera Mono font with the \mlttfamily described by matlab-prettifier documentation. However, my generated output seams to ignore my \lstset basicstyle ...
Lonny T's user avatar
  • 151
0 votes
1 answer
335 views

\endscname error using package matlab-prettifier

I'm trying to prepare a beamer document using the matlab-prettifier package but I come across errors whenever I include a frame where I use code. I always get the following log: ! Missing \endcsname ...
ladyp's user avatar
  • 3
1 vote
1 answer
975 views

Move listing numbers outside of framed box in Matlab Prettifier

The question is building off the solution give here. How do you remove the mcode package so that listings 1 - 3 will have the Matlab code that resembles the last listing and also contain the line ...
Joe's user avatar
  • 9,024
2 votes
1 answer
1k views

Different Matlab code listings environment in same document with Matlab-prettifier

I wanted to be able to have different Matlab code listings in the same document. The first three listings are from the solution found here. How do I get rid of the thin lined boxes in the first 3 ...
Joe's user avatar
  • 9,024
0 votes
1 answer
191 views

matlab-prettifier: How to insert a green-colored dots as prebreak argument?

In this MWE, how can I color \ldots, which is the prebreak argument, in green without getting errors? \RequirePackage{luatex85} \documentclass{article} \usepackage[tuenc]{fontspec} \usepackage[...
Diaa's user avatar
  • 9,269
3 votes
1 answer
2k views

`\lstinputlisting` not respecting basicstyle=\tiny

I am trying to fit MATLAB code in my document without wrapping, but I cannot change the font size when using matlab-prettifier. Here's a MWE using both lstinputlisting and environment style: \...
jessexknight's user avatar
  • 2,647
3 votes
1 answer
2k views

adding frame=none to lstlisting options in \lstdefinestyle gives error with tabular

lstlisting has an option called frame= But when I use the frame=none in \lstdefinestyle and put the lstlisting command inside tabular or longtable I get an error Forbidden control sequence It ...
Nasser's user avatar
  • 20.1k
2 votes
1 answer
206 views

why is adding subdepth package makes lstlisting give Matlab error loading file?

If I have a dollar each time I find a conflict between Latex packages I would be a rich man. I added \usepackage[low-sup]{subdepth} and now I am starting to get errors from matlab-prettifier when ...
Nasser's user avatar
  • 20.1k
4 votes
2 answers
704 views

Why font missing message shows up when using standalone and import packages only?

Took me long time to find the cause of this one. From some bizzar reason, when I use standlone package, the font changes in the lstlisting of my Matlab code due to Latex not finding some fonts. I am ...
Nasser's user avatar
  • 20.1k
2 votes
2 answers
246 views

Conditional formating of a verbatim type argument

I write problem sets whose answer keys contain matlab code. To accomplish this, I'm using matlab-prettifier, but I need to condition the output on whether I'm outputing the problem set questions or ...
Leo Simon's user avatar
  • 2,169
1 vote
1 answer
225 views

enclosing a lstlisting environment inside my own environment using matlab-prettifier

I've just started using matlab-prettifier. Since the line \begin{lstlisting}[style=Matlab-editor] is a lot to type, I created my own environment: \newenvironment{myMP} {\begin{samepage}\begin{...
Leo Simon's user avatar
  • 2,169