Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I know that this question is not about strictly mathematica issue, but I think that in this site should be many pepople that use latex to distribute mathematica source code/examples. If the moderators think that I should delete this question, please tell me.. and I excsuse me, and I´m doing it as soon as possible.

I have mathematica source code (with any long lines), and I want to attach to a job(using latex), as an appendix.

What do you think is the best way(package) to insert the code (in sourcecode.nb) in the latex document?.

I was reading in any posts o LATEX StackExchange about minted(would be neccesary to configure paths and other details, the package seems to be so pretty) and listings package but this packages seems to be more focused in languages as C, C++, java,... to highlight the reserved words.

I was reading Highlighting Mathematica code in LaTeX document but I dont´see a suitable solution

I was reading about minted and.. I understand that don´t supports Mathematica. but then I found where seems to mathematica be supported.

Have you any suggestion?

share|improve this question
what is wrong with listings? Please see… fanciest-way-to-include-mathematica-code-in-latex for examples. I've used it with M and it works. But mostly, I just use fancyvrb package, and just include M code as Verbatim in Latex document. – Nasser Jun 21 '14 at 7:14
If you need a 1:1 notebook documentation with graphics etc., you can print your notebook as single enumerated pdf pages and batch-include those as images with a bit of custom TeX code. – Yves Klett Jun 21 '14 at 7:22
@Nasser , because minted have color and is more pretty visually. But... I was trying and listings is enoguh for me. Now I have a problem that you can see in the edited original post. – Mika Ike Jun 21 '14 at 9:27
@nasser Finally I didn´t edit the original post. I´m trying to compiled with spanish characters but no success. I tried… with no success – Mika Ike Jun 21 '14 at 9:41
It looks like this is now a tex issue? Maybe you should post it as latex question on the tex group with MWE. – Nasser Jun 21 '14 at 10:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.