Hello,
I have to create a enrollment-form, which will be filled in with pencils. It must have rectangles, which has to be filled in by one letter each. It should look like this:
Name: |_||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_|
Date of birth: |_||_||_||_||_||_||_||_|
Institution: |_||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_||_|
The rectangles should have a top line aswell, just couldn't write it. How do create these rectangles?
I use TeXLive.
Regards, Fleet
General ⇒ Enrollment form
Enrollment form
Last edited by fleet on Tue Mar 15, 2011 6:30 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Posts: 274
- Joined: Fri Feb 05, 2010 10:15 pm
Enrollment form
Code: Select all
|\underline{\hspace{.10in}||
Re: Enrollment form
Thanks for your answer but, I need to create true rectangles for people to write letters in. It shouldn't just be underscores and |'s.
Regards, Fleet
Regards, Fleet
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Enrollment form
Try something with the pgf/tikZ package.
Thorsten
Code: Select all
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\newcommand*{\fillout}[1]{%
\begin{tikzpicture}[x=1em,y=3ex,baseline]
\foreach \x in {0,1,...,#1}
\draw (0,0) +(\x,0) rectangle (1,1);
\end{tikzpicture}
}
\begin{document}
\begin{tabular}{@{}ll@{}}
Name: & \fillout{20} \\
Date of Birth: & \fillout{8} \\
Institution: & \fillout{23}
\end{tabular}
\end{document}
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Enrollment form
Thanks, Thorsten. Your example helped my write what I needed. I have one question more, though:
How do I remove the inner margin/padding in a tikz node, so the text will start at the left edge?
Regards, Fleet
How do I remove the inner margin/padding in a tikz node, so the text will start at the left edge?
Regards, Fleet
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Enrollment form
The package manual suggests to use the »inner sep« option.fleet wrote:[…] How do I remove the inner margin/padding in a tikz node, so the text will start at the left edge? […]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10