Text FormattingA neat booking form

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
dickturnip
Posts: 12
Joined: Wed Nov 25, 2009 4:45 pm

A neat booking form

Post by dickturnip »

Hi there.

I am putting together a brochure - on the fourth page is a form customers can fill in and fax over.

I would like the bit where they put their name to be underlined with dots.
\dotfill is of course very good at filling the rest of the line with dots.

I am hoping to get something that would give me the equivalent of this:

Code: Select all

\begin{verbatim}
Name:............... Position:...............
Company:.....................................
Address:.....................................
....................Post Code:...............
Phone:....................fax:...............
email:.......................................
\end{verbatim}
the key is to get vertical alignment between all the colons following 'Position', Post Code', 'fax'.

Do I have to do this in the verbatim environment? I have struggled with tabular. I would like to stay in the same font I have been using.

What I suppose I want is a table where I specify the full width of the table and perhaps each of the columns and any space is automatically filled in with dots.

Can anybody suggest a solution, or different path?

Many thanks in advance,

dt

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

A neat booking form

Post by gmedina »

Hi,

you can use a tabular environment; something along these lines:

Code: Select all

\documentclass{article}

\begin{document}

\noindent\begin{tabular}{p{4cm}@{\hspace*{-1mm}}r@{:}p{4cm}}
  \setlength\tabcolsep{0pt}
  Name:\dotfill &  \dotfill\, Position & \dotfill\\
  \multicolumn{3}{l}{Company:\dotfill}\\
  \multicolumn{3}{l}{Adress:\dotfill}\\
  \hspace*{-.3mm}\dotfill & \dotfill\, Post Code & \dotfill\\
  Phone:\dotfill & \dotfill\, Fax & \dotfill\\
  \multicolumn{3}{l}{email:\dotfill}
\end{tabular}

\end{document}
Of course, you can improve my example and adapt it according to your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
dickturnip
Posts: 12
Joined: Wed Nov 25, 2009 4:45 pm

Re: A neat booking form

Post by dickturnip »

That is superb, many thanks.

dt
Post Reply