TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how should i write a command to automatically place a box on the left side wherein this box can contain text and beside the box are lines which depends on an argument.

share|improve this question
Can you please describe in more detail the desired result? Should the framed box have fixed height and width? – Gonzalo Medina Nov 26 '12 at 16:35
Do you want the box (and lines) be break across pages? – Aditya Nov 26 '12 at 16:50
up vote 5 down vote accepted

Without more details about the width and height of the framed box and a MWE, this is a raw answer:

\foreach \x in {1,...,#1}{%
\leftbox{text will be placed here inside this box with a frame}\lines{4}

enter image description here

The pgffor package can be avoided by using (Thanks to Gonzalo):

\loop \ifnum\value{lines}<#1\relax 
share|improve this answer

There are various possibilities for the alignment, but something like this

enter image description here


\hrule width\hsize
\advance\count0 -1


\leftbox{The text goes here\\
and here\\
and here}

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.