Text FormattingShowing Matlab Codes in LaTeX

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bkarpuz
Posts: 124
Joined: Thu Dec 18, 2008 4:53 pm

Showing Matlab Codes in LaTeX

Post by bkarpuz »

Dear LC Members,

I need a similar way to that in the attached sample pdf file for showing my matlab codes in my tex file.
Is there a spacial way to do it?

Many thanks.
bkarpuz
Attachments
1.pdf
(225.23 KiB) Downloaded 168 times
Last edited by bkarpuz on Thu Dec 16, 2010 12:09 pm, edited 1 time in total.

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

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Showing Matlab Codes in LaTeX

Post by josephwright »

Normally the best way to include code in a LaTeX file is to use the listings package. The documentation has lots of examples.
Joseph Wright
Post Reply