2

I'm using the multicol package to get two columns, but sometimes the contents is too wide in a particular column and I was wondering if there is a way to first make sure the contents will fit (horizontally) in two columns and if it doesn't just print a normal one column.

I want to do this in a new environment definition and I thought I could use the ifthen package.

Werner
  • 603,163
jcis27
  • 21
  • As in David Carlisle's answer you need give an example here. Are you thinking about equations overfilling lines? If so (or presumably for figures) you could consider a widetext environment (making this conditional would be a nice little exercise). – Chris H Sep 25 '13 at 09:05

1 Answers1

1

In general the answer is no, text does not have a "natural width" You specify the column width and then TeX breaks the text into lines of that width, it may have difficulty breaking some lines and make overfull boxes, but there is no certainty that if you widen the line length that will not happen somewhere else. In your particular case (you should always include a complete example document) that there are particular items such as images that you don't want to scale. It is possible to measure those items and then start or not start multicol depending on the width.

David Carlisle
  • 757,742
  • Thanks for the answers. This matter is about equations that sometimes get wide. Here is an example:\newenvironment[2]{ejemplo}{\par#1\par\ifthenelse{test}{\begin{multicols}{2}#2\end{multicols}}{#2}}{\par}. The problem is i can't find the right test. – jcis27 Oct 02 '13 at 04:06