Tx · LaTeX & TikZ

How to Put Checkboxes Before List Labels in LaTeX

Published By the 9to5Science editorial team

At a glance

  1. 1. Load the packages

    Use enumitem to customize list labels and amssymb to provide the square checkbox symbol.

  2. 2. Set the list label

    Give enumitem a checkbox as the label, then adjust the label spacing and margin to suit your layout.

  3. 3. Compile and check

    Compile the example and confirm the checkbox aligns with each item's first line.

To put an empty checkbox before each list item, set the list label to a square symbol with the enumitem package. The amssymb package provides \square. This works for an itemize list, and you can adjust the indentation and gap between the checkbox and the text.

Minimal working example

The following complete document creates a checklist:

\documentclass{article}
\usepackage{enumitem}
\usepackage{amssymb}

\begin{document}

\begin{itemize}[label=\(\square\), leftmargin=*, align=left, labelsep=0.6em]
  \item Check the first requirement.
  \item Check the second requirement.
  \item Check the third requirement, which is long enough to wrap onto another line.
\end{itemize}

\end{document}

The label=\(\square\) option replaces the usual bullet with an empty square. leftmargin=* asks enumitem to calculate a suitable left margin for the label. align=left aligns labels consistently, and labelsep=0.6em sets the space between each square and its text. Adjust labelsep to make the gap narrower or wider.

Use the checkbox in other list types

The same idea works with enumerate or a custom list. For example, to show a checkbox followed by a number, use:

\begin{enumerate}[label=\(\square\)\ \arabic*., leftmargin=*]
  \item First numbered task.
  \item Second numbered task.
\end{enumerate}

Here \arabic* is an enumitem placeholder for the current item number. The label will look like a square followed by 1., 2., and so on. To use letters instead, change \arabic* to \alph*; for Roman numerals, use \roman*.

You can apply the setting to one list, as in the examples, or set it for every list of a given type. For example:

\setlist[itemize]{label=\(\square\), leftmargin=*, align=left}

Put this command in the preamble, after loading enumitem. It changes all itemize lists in the document. Use a local option on a particular list when you want that one list to look different.

Custom text labels

An optional label supplied to an individual \item replaces that item’s default label. For instance, \item[Important] prints “Important” instead of the checkbox. If you want a checkbox before a custom label, include it explicitly:

\begin{itemize}[label=\(\square\), leftmargin=*]
  \item[\(\square\) Important:] Read the instructions first.
  \item Check the remaining details.
\end{itemize}

If you need this often, define a small helper command in the preamble:

\newcommand{\checklabel}[1]{\(\square\)\ #1}

Then write \item[\checklabel{Important:}] Read the instructions first. The helper only formats the label; it does not make the checkbox interactive or clickable.

Common mistakes

  • Using \square without loading a package that defines it. Add \usepackage{amssymb} to the preamble. If your document already uses a font or symbol package that provides a square, avoid loading conflicting packages unnecessarily.
  • Putting label=... outside the list options. The setting belongs inside the brackets after \begin{itemize}, or in a \setlist command in the preamble.
  • Expecting an optional \item[...] label to keep the default checkbox. An explicit item label replaces the default. Add the square to that custom label when needed.
  • Trying to make the box interactive. \square is a printed glyph, not a form field. A clickable checkbox requires PDF form-field functionality and a different approach.

If the checkboxes appear too far from the text, adjust labelsep. If the whole list starts too far left or right, adjust leftmargin rather than inserting manual horizontal spaces into each item.

References

  1. The enumitem package documentation
  2. The amssymb package

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.