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.

1
  • 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). Commented Sep 25, 2013 at 9:05

1 Answer 1

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.

1
  • 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. Commented Oct 2, 2013 at 4:06

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.