# Text boxes in Latex

In an article is it possible to create boxes so that when the document has been printed users have some text boxes areas where they are able to make notes in?

A very basic mock up using word with text boxes looks like the attached picture. Notes can then be written inside the box, or used as an area on a form that information needs to be written in for example.

Right now I need to do it for a work book that I am writting, it has exercises to complete with questions about the exercises that the user just completed, and a notes section for them to make additional notes on the module and exercises they just completed. The text in the box must be in the top left corner.

I've been able to make a text box sort of in Latex, but I can't seem to increase the size of the box vertically as pictured.

The boxes should fit on a single page, should a box need to be bigger than a page or what is left of that page, a new box will be on the following page, but no header would be on this box.

The boxes will vary in height as this would depend on the size the box is able to be following the content on the page where the box starts.

• You might add an invisible rule oriented downwards. – Bernard Feb 4 '19 at 19:49
• @Bernard Do you happen to have a brief example of the command for that? am not sure I have ever used one before, I don't think I have. – AeroMaxx Feb 4 '19 at 19:54
• Is the box always expected to fit on a single page? – Steven B. Segletes Feb 4 '19 at 20:10
• Will your boxes all have the same height? Should they be able to break across pages? – Bernard Feb 4 '19 at 20:12
• @StevenB.Segletes I've added the answer to your question into the original question, but basically the boxes will take up whatever is left on the page they started on, if the boxes was too small a new box will be required on the following page but no header would be on the box. – AeroMaxx Feb 4 '19 at 22:28

Did somebody say text boxes? Well tcolorbox is meant for text color boxes, the 'color' can be set to white, of course. The example below defines a mytextbox with some preset options, which can be set differently with the optional argument, see the 2nd box example.

\documentclass{article}

\usepackage[margin=2cm]{geometry}
\usepackage[most]{tcolorbox}

\newtcolorbox{mytextbox}[1][]{%
sharp corners,
enhanced,
colback=white,
height=10cm,
attach title to upper,
#1
}

\begin{document}

\begin{mytextbox}

Give some text here:

\end{mytextbox}

\begin{mytextbox}[colupper=blue,fontupper=\bfseries\large]

Give other some text here:

\end{mytextbox}

\end{document}

• I'll need to have a go at this, just one question can the height also be set differently so I can have boxes of varying heights? – AeroMaxx Feb 4 '19 at 22:35
• @AeroMaxx: Of course, you can say \begin{mytextbox}[height=5cm] etc. just as you like it or you can even let them break at page bottom with \begin{mytextbox}[breakable,height=20cm] – user31729 Feb 4 '19 at 22:37

A simple solution with framed and multido. There is an optional argument (the number of lines of the box after the title) and a mandatory (the title text). It can break across pages:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{lipsum}
\usepackage{framed, multido}

\newcommand{\mytextbox}[2][6]{% 6\baselineskip bydefault
\begin{framed}
\noindent#2%
\multido{\i=1+1}{#1}{\newline …}
\end{framed}}

\begin{document}

\vspace*{10cm}
\lipsum[1]

Some more text
\mytextbox[10]{Some title text}

\end{document}


• this is fine kind of, the "Some title text" is an indicator to the person in possession of the document as to what is meant to be filled in the box. The box itself will have no other text within it as the document will be printed and given out and as a result will be filled in using pen and paper. Can the box be made taller without having to have those dots placed in it? I removed them and the box shrunk so I was back to square one sadly. – AeroMaxx Feb 5 '19 at 7:30
• @sebastiano I did not read the question carefully enough and answered too quickly. I deleted my answer. – Eric Domenjoud Feb 5 '19 at 10:23