Page LayoutVertically justify minipages/parbox

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
tornadof3
Posts: 1
Joined: Fri Jan 16, 2015 9:34 pm

Vertically justify minipages/parbox

Post by tornadof3 »

Hello

I am writing a documentclass for exam papers and using a \question command:

Code: Select all

\newcommand{\question}[3]{%
  \section{\grade/\thesection}%
  #2\\
  \fbox{%
  \begin{minipage}{0.98\columnwidth}
    	\parbox[t][#1]{0.97\columnwidth}{#3}
  \end{minipage}
}
}
argument 1 is the height of the box, argument two is text that goes above the response box and argument three is anything that would go inside the response box.

Is there a way to get the minipage or parbox to vertically scale so that it is *at least* the height of the first argument, but will go more than that to space things out?

At present, when I have several questions, if the 'next' question is too large to fit on the page, it creates it on a new page, but the current page might have three or four questions with the last one on the current page maybe 10cm above the end of the page. I am using a twocolumn layout. Thanks.
Attachments
test.tex
(827 Bytes) Downloaded 264 times
gradetrakexam2.cls
new documentclass
(1.53 KiB) Downloaded 238 times

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Vertically justify minipages/parbox

Post by Johannes_B »

Hi and welcome, i haven't looked at the files yet.

Are you aware, that there are packages and classes out there for that purpose? exsheets is a very good and highly customizable package. exam is less customizable but still very usable.

fbox is very low lebel LaTeX command. You might be interested in tcolorbox or mdframed.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply