Generaltables with tick boxes

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
72 GJ 08
Posts: 3
Joined: Fri Nov 30, 2007 9:08 pm

tables with tick boxes

Post by 72 GJ 08 »

Hi,
I'm trying to configure a yes / no tick box questionaire using the tabular environment.
The problem I have is merely how to produce a uniformly sized tick box in the centre of both the 'yes' and 'no' columns.
Any help appreciated :D

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

tables with tick boxes

Post by gmedina »

I'm not sure if this is what you need. Add in the preamble

Code: Select all

\usepackage{amssymb}
and then something like

Code: Select all

\begin{tabular}{|c|c|c|}
  \hline
  {\bfseries Question} & {\bfseries Yes} & {\bfseries No}\\
  \hline\hline
  First question & $\square$ & $\square$\\
  \hline
\end{tabular}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
72 GJ 08
Posts: 3
Joined: Fri Nov 30, 2007 9:08 pm

tables with tick boxes

Post by 72 GJ 08 »

Yes that's great, many thanks :D
I know that was a newbie question, but that's where I'm at just now.
I'd been struggling to find this sort of thing on the net.
Seems so simple when you know how :oops:

After I posted initially, I visited CTAN and downloaded the comprehensive symbol list, here : http://tug.ctan.org/tex-archive/info/sy ... ols-a4.pdf
and from there had deduced a very similar code layout:

Code: Select all

\documentclass[a4paper]{article}
\usepackage[ngerman]{babel}

%\load BB ding symbol package
\usepackage{bbding}

\begin{document}
\begin{center}
\Large tickbox form\\
\vspace{10mm}
\normalsize
\begin{tabular}{l c c}
\textbf{Questions} & \textbf{Yes} & \textbf{No}\\ 
\textbf{Question 1:} & {\Square} & {\Square} \\
\textbf{Question 2:} & {\Square} & {\Square}\\
\textbf{Question 3:} & {\Square} & {\Square}\\
\textbf{Question 4:} & {\Square} & {\Square}\\
\end{tabular}
\end{center}

\end{document}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

tables with tick boxes

Post by gmedina »

You can improve your code:

Code: Select all

\documentclass[a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage{bbding}
\usepackage{array}

\begin{document}

\begin{center}
  {\Large tickbox form}\\
  \vspace{10mm}
  \begin{tabular}{>{\bfseries}l c c}
    Questions & \textbf{Yes} & \textbf{No} \\ 
    Question 1: & \Square & \Square \\
    Question 2: & \Square & \Square \\
    Question 3: & \Square & \Square \\
    Question 4: & \Square & \Square \\
  \end{tabular}
\end{center}

\end{document}
Remarks: 1) Use {\Large ...} so the change will affect only the expressions enclosed. (Now, in your example you don't need to restore the normalfont).
2)>{declaration} inserts declaration directly in front of the entry of the column. (In your example, since all the entries in the first column will be in boldface type, then you can make the declaration in the table format).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
72 GJ 08
Posts: 3
Joined: Fri Nov 30, 2007 9:08 pm

Re: tables with tick boxes

Post by 72 GJ 08 »

:D That's great, Thank you :D
Post Reply