% This file is embedded in datatool-user.pdf version 3.4.5 2026-08-23
% Example 56 Sorting Lists with \dtlsortlist (Letter vs Word)
% Label: "ex:sortlistwordletter"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage{datatool-base}
\newcommand{\mylist}{sea, sea lion, Sealyham, seal, sealant, sealing wax} 
\begin{document}
\dtlsortlist{\mylist}{\dtlletterindexcompare}
Letter: \DTLformatlist{\mylist}. 

\dtlsortlist{\mylist}{\dtlwordindexcompare}
Word: \DTLformatlist{\mylist}. 
\end{document}
