I am currently preparing for an exam to which we are allowed to bring 1 sheet of paper. Naturally, I want to fit as much information as possible on it.
The information that I need are a bunch of (pseudo code) algorithms. Right now I am using multicolumn on minipages to space them out evenly, which works very well for the maths part of the sheet, but now I want to fit the whole algorithm without column break to read it nicely. I have looked at this question., but my problem is that all the grid cells have a different length and width, similar to a handwritten sheet.
How can I set this up in Latex? It should be able to cope with mathmode and lstlistings. How can I tell multicols when to stark a new column? This would be my fallback solution.