Text Formatting\vfill with multicol

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
chimanrao
Posts: 8
Joined: Mon Mar 01, 2010 8:39 am

\vfill with multicol

Post by chimanrao »

hi

I am trying to typeset a document with two column layout. I want to use \vfill to force some text to the bottom of the page.

Code: Select all

\documentclass[a4paper]{article}
\usepackage{multicol}

\setlength{\columnsep}{0.5in}		% default=10pt
\setlength{\columnseprule}{0.25pt}		% default=0pt (no line)

\begin{document}
\thispagestyle{empty}
\begin{multicols}{2}
Test
\vfill
This should come at bottom of page
\columnbreak 
Test
\end{multicols}
\end{document}

The example above is not working.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: \vfill with multicol

Post by localghost »

What is the text on the bottom going to represent? A short explanation could help in order to find a possible alternative.


Thorsten
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

\vfill with multicol

Post by frabjous »

I think the problem has to do with the multicol package's column balancing mechanism. Try the starred version of the multicols environment, which doesn't try to balance:

Code: Select all

\documentclass[a4paper]{article}
\usepackage{multicol}

\setlength{\columnsep}{0.5in}      % default=10pt
\setlength{\columnseprule}{0.25pt}      % default=0pt (no line)

\begin{document}
\thispagestyle{empty}
\begin{multicols*}{2}
Test
\vfill
This should come at bottom of page
\columnbreak 
Test
\end{multicols*}
\end{document}
pac
Posts: 2
Joined: Fri Feb 17, 2012 5:38 am

\vfill with multicol

Post by pac »

I also was trying to combine vfill within multicols to vertically space items. Using the multicols* environment worked great -- thanks!

(I did notice something unexpected with the spacing, though. If \vfill is the last command inside multicols*, it generates extra space, as in this example. If you uncomment the last \vfill, the two columns will have different spacing:)

Code: Select all

\documentclass[11pt]{letter}
\usepackage{multicol}
\begin{document}

\begin{multicols*}{2}
(a) Text here
\vfill

(b) Text here
\vfill

(c) Text here
\vfill

\columnbreak
(d) Text here
\vfill

(e) Text here
\vfill

(f) Text here
%\vfill          % Uncommenting this \vfill makes for uneven spacing.
\end{multicols*}
\end{document}
Post Reply