Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latex multicols. Can I group content so it won't split over cols and/or suggest colbreaks?

Tags:

latex

multicol

I'm trying to learn LaTeX. I've been googling this one for a couple days, but I don't speak enough LaTeX to be able to search for it effectively and what documentation I have found is either too simple or goes way over my head (http://www.uoregon.edu/~dspivak/files/multicol.pdf)

I have a document using the multicol package. (I'm actually using multicols* so that the first col fills before the second begins instead of trying to balance them, but I don't think that's relevant here.) The columns output nicely, but I want to be able to indicate that some content won't be broken up into different columns.

For instance,

aaaaaaaa  bbbbbbb  
aaaaaaaa  bbbbbbb  
aaaaaaaa  
          ccccccc  
bbbbbbbb  ccccccc  

That poor attempt at ascii art columns is what's happening. I'd like to indicate that the b block is a whole unit that shouldn't be broken up into different columns. Since it doesn't fit under the a block, the entirety of the b block should be moved to the second column.

Should b be wrapped in something? Is there a block/float/section/box/minipage/paragraph structure I can use? Something specific to multicol? Alternatively is there a way that I can suggest a columnbreak? I'm thinking of something like \- that suggests a hyphenated line break if its convenient, but this would go between blocks.

Thanks!

like image 999
valadil Avatar asked Mar 08 '10 16:03

valadil


2 Answers

Would putting the text inside a minipage not work for this?

\begin{minipage}{\columnwidth}
text etc
\end{minipage}
like image 198
Seamus Avatar answered Nov 06 '22 23:11

Seamus


Forcing a column break is as easy as \columnbreak.

There are some gentler possibilities here.

If you decide to fight LaTeX algorithms to the bitter end, there is also this page on preventing page breaks. You can try the \samepage command, but as the page says, "it turns out to be surprisingly tricky".

like image 7
AVB Avatar answered Nov 06 '22 23:11

AVB