Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTex - how to create boxes with fixed heights and widths, with enclosed text that is vertically and horizontally aligned?

Tags:

latex

tex

This is for creating flashcards in LaTeX. My printer doesn't support duplex printing - which packages like flashcards and flacards seem to require - so I am trying to create a two-column arrangement as follows on each page:

[Col1: Front side of the card] [Col2: Back side of the card]

Each row would correspond to a single flashcard. The plan is to cut each row up, fold them along the middle and staple them to create a "card".

The question: how best can I create a single box with a specified height and width, and with the text in it aligned vertically?

I am relatively new to Latex, so this cripples my options. I don't need full, detailed answers necessarily - any pointers at all in the right direction would help immensely! Any suggestions on alternative methods to achieve what I'm shooting for would also be helpful.

Many thanks!

like image 833
ARV Avatar asked Jan 09 '10 17:01

ARV


People also ask

How do I enclose a textbox in latex?

\makebox{text}, \mbox{text} enclose text into a box and then print, can be used in math mode. \framebox{text}, \fbox{text} enclose text into a framed box and then print.

How do I draw a rectangle around text in latex?

You can use \fbox{...} to put a frame around a \parbox{...} containing your text.

What is VBOX in latex?

\vbox , vertical box with reference point at the last line inside it. \vtop , vertical box with reference point at the first line inside it.

How do you make an empty box in latex?

You can use \framebox(200,300){} where the size is given in multiples of \unitlength , defaulting to 1pt .


1 Answers

Suppose you want to create the box of 40pt height and 3cm width:

\vbox to 40pt {\vfil \hbox to 3cm{Some info}% \vfil } 
like image 199
Alexey Malistov Avatar answered Sep 22 '22 04:09

Alexey Malistov