I recently wanted to add a few empty lines to a document for taking handwritten notes on a printed copy. Somewhat similar to a package available for slides created with the document class beamer (see handoutWithNotes). However, I couldn’t find a package that allows me to do that. So I wrote a few lines of code which go into the preamble of the document. Since it’s not very handy to copy the code every time, I’m considering writing a package.
The code it simple, it defines a command notes
which has 3 arguments (1 is optional).
\notes[add. vertical space]{number lines}{width}
number lines
: the number of lines to be drawnwidth
: the vertical space occupied by these linesadd. vertical space
: adds more vertical space between the lines
Preamble code
\usepackage{pgffor, ifthen} \newcommand{\notes}[3][\empty]{% \noindent Notes\vspace{10pt}\\ \foreach \n in {1,...,#2}{% \ifthenelse{\equal{#1}{\empty}} {\rule{#3}{0.5pt}\\} {\rule{#3}{0.5pt}\vspace{#1}\\} } }
Example 1
\notes{5}{\textwidth}
Example 2
\notes[10pt]{3}{\textwidth}
Complete code example
\documentclass{article} \usepackage{pgffor, ifthen} \newcommand{\notes}[3][\empty]{% \noindent Notes\vspace{10pt}\\ \foreach \n in {1,...,#2}{% \ifthenelse{\equal{#1}{\empty}} {\rule{#3}{0.5pt}\\} {\rule{#3}{0.5pt}\vspace{#1}\\} } } \begin{document} \begin{minipage}{0.5\textwidth} \rule{5cm}{5cm} \end{minipage} \begin{minipage}{0.5\textwidth} \notes[10pt]{6}{\textwidth} \end{minipage} \end{document}
Feel free to propose enhancements.
copiancestral
For what I see your plans are to split an existing document via minipage and add the notes to the side. It could be interesting to add a notes page similar to what Adobe Acrobat Pro does when printing a document with notes. Like a summary of comments, assuming the document is not to long, you could include an additional page with note blocks per existing page.
tom
Thanks for your comment. The initial idea was to leave space for taking handwritten notes on a document that I would bring to a meeting or on handouts for a workshop, etc. However, I would keep it flexible enough to fit many possible applications.
JohnAtl
Just what I needed. Thanks!
sarvesh
Dear Sir,
I am facing difficulty while putting the marks along with question using exam.sty
In this i am able to assign the integer number with \marks{3} it work.
But if i want to use decimal number e.g \marks{3.5} it does not work.
please help me to sort out this issue.
thanks
sarvesh
tom
Hi Sarvesh,
I wasn’t able to download exam.sty. But there is a document-class exam which allows non-integer marks. I took the sample code from the documentation.
Gilu
Thanks!
Very easy to use!
Adriano Cortes
Thank you. Very useful command!
Madhav
This is super useful! This is exactly what I needed to set the exams for my students where I need them to write handwritten answers. Very easy to customise. Thanks a lot.
tom
Thanks for your feedback. I appreciate it. Best, Tom
Oliver
Thank you, very useful and looks beautiful. I underlined “Notes” and use #1 as vspace here aswell.
\usepackage{pgffor, ifthen}
\newcommand{\notes}[3][\empty]{%
\noindent \underbar{Notes}\vspace{#1}\\
\foreach\n in {1,…,#2}{%chktex 11
\ifthenelse{\equal{#1}{\empty}}
{\rule{#3}{0.5pt}\\}
{\rule{#3}{0.5pt}\vspace{#1}\\}
}
}
Alexander Göransson
After an hour or two of messing around, I ended up with this. I was using \vfill to make the lines be at the bottom of the page, but there was always some extra space below the last line. Using \par instead of \\ removes this.
I also set the default vspace skip to 16 pt. Makes it less cramped when writing.
Normally the argument I give to the command is \textwidth or \marginparwidth (from the document class scrartcl, using a tufte-style layout)
\usepackage{pgffor, ifthen}
%
% args=[extra_vspace=16pt]{number_of_lines}{line_width}
% [ #1 ]{ #2 }{ #3 }
\newcommand{\nts}[3][16pt]{
\foreach \n in {1,…,#2}
{
\ifthenelse{\equal{\n}{#2}}% on last line?
{
\noindent\rule{#3}{0.5pt}\par
}
{
\noindent\rule{#3}{0.5pt}\vspace{#1}\newline
}
}
}