70

I am having trouble trying to create a simple to-do list in LaTex. Basically, what I want is a list with empty squares/boxes down the left side instead of bullets, numbers, letters, etc.

Here is what I have been playing around with:

%%To do list%%

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
    %\setenumerate[0]{label=(\square*)}
%\usepackage{enumitem}
    \usepackage[checklist]{enumitem}
\renewcommand{\theenumi}{\square{enumi}}

%\renewcommand{\labelitemi}{$\Box$}
%\renewcommand{\labelitemi}{$\star$}
\renewcommand{\labelenumi}{\theenumi}

\begin{document}
My todo list.\\
Immediate plan of action.\\

\let\oldenumerate\enumerate
\renewcommand{\enumerate}{
  \oldenumerate
  \setlength{\itemsep}{1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}
}

    \begin{enumerate}
        \item List item 1 goes here.  
        \item List item 2 goes here. 
            \begin{enumerate}
                \item Sublist item 1 goes here. 
                \item Sublist item 2 goes here. 
            \end{enumerate}
        \item List item 3 goes here
        \item List item 4 goes here.
    \end{enumerate}
\end{document}

I have tried placing the new command after \begin{enumerate} in a few different ways, even tried to place it before and after \item, but nothing seems to work. I can get the list to enumerate with circles, stars, diamonds, etc. but for some reason, not the box/square. What am I doing wrong?

I have been using LaTex for nearly a decade now and know there are more-often-then not numerous ways to achieve the same goal with LaTex, yet, I cannot figure this one out.

3 Answers 3

61

I would use enumitem (and not intermix it with using the enumerate package):

enter image description here

\documentclass{article}
\usepackage{enumitem,amssymb}
\newlist{todolist}{itemize}{2}
\setlist[todolist]{label=$\square$}
\begin{document}
My ToDo list

\begin{itemize}
  \item Immediate plan of action.

  \begin{todolist}
    \item List item 1 goes here.
    \item List item 2 goes here.
    \begin{todolist}
      \item Sublist item 1 goes here.
      \item Sublist item 2 goes here.
    \end{todolist}
    \item List item 3 goes here
    \item List item 4 goes here.
  \end{todolist}

\end{itemize}
\end{document}

We create a new type of list called todolist, which has two levels of nesting and is based on itemize. Each label within a todolist is set as $\square$, at both levels.

3
  • @samcarter; thank you cleaning up my first post. @Werner; thank you for the code, it is appreciated and what I was looking for.
    – jaykeno
    May 29, 2015 at 20:22
  • 3
    If one does not want to use $\square$ (for example in a pandoc template) one can also use the following: \newcommand{\checkbox}{\text{\fboxsep=-.15pt\fbox{\rule{0pt}{1.5ex}\rule{1.5ex}{0pt}}}} and then replace all $\square$ with \checkbox. Oct 12, 2016 at 16:50
  • that works fine! I use the \tightlist-command in my other lists. It works here, too - just not at the end of the first-level-list before starting the 2nd-level-list. Any idea how to solve that?
    – PikkuKatja
    Sep 10, 2020 at 10:07
104

Here is a variant of Werner's answer with checkmarks for recording progress.

\documentclass{article}
\usepackage{enumitem,amssymb}
\newlist{todolist}{itemize}{2}
\setlist[todolist]{label=$\square$}
\usepackage{pifont}
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\newcommand{\done}{\rlap{$\square$}{\raisebox{2pt}{\large\hspace{1pt}\cmark}}%
\hspace{-2.5pt}}
\newcommand{\wontfix}{\rlap{$\square$}{\large\hspace{1pt}\xmark}}

\begin{document}
My ToDo list

\begin{itemize}
  \item Immediate plan of action.
  \begin{todolist}
  \item[\done] Frame the problem
  \item Write solution
  \item[\wontfix] profit
  \end{todolist}
\end{itemize}
\end{document}

enter image description here

1
  • Using the suffix package, it is possible to define, e.g., \item* instead of \item[\done].
    – equaeghe
    Jun 2, 2021 at 10:10
9

I adjust the font size of the icon from packages pifont and amssymb, use \raisebox and \hspace to fit the icon position, finally, it looks good, here is a full example:

\documentclass{article}

\usepackage{pifont}
\usepackage{amssymb}

\begin{document}

\begin{itemize}
\item[$\square$]
no checked
\item[\rlap{\raisebox{0.3ex}{\hspace{0.4ex}\tiny \ding{52}}}$\square$]
failed
\item[\rlap{\raisebox{0.3ex}{\hspace{0.4ex}\scriptsize \ding{56}}}$\square$]
checked
\end{itemize}
\end{document}

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.