I'd like to typeset some source code with minted. Unfortunately, a lot this source code runs over 80 columns, some of it up to 132.

What are good settings (and open source fonts?) to use with minted so that I can avoid as much line wrapping as possible?

  • 1
    There's no technical solution to 'my text is too wide': usually this comes up with tables, but it's the same for source code. You'll have to make a human judgement about where line's can be altered. – Joseph Wright May 30 '16 at 8:10

I am not sure what the problem actually is ;) since minted does not do line wrapping. So to make 132 columns fit on the page, you'd have to make the font size smaller, that is all. All other settings of minted are not affected and can be changed as needed.

Mathematica graphics




This is my 132 wide code in mint
function foo()
%this is loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooog
%comment, 132 long

x=sin(1); %my sinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn function

This is shorter code

function foo()
%this is not a long comment

x=sin(1); %my sine function

Another option is to make it landscape, and keep the font size normal size, but now it will all fit. Just change the above line to


Mathematica graphics

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.