<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% This file is embedded in datatool-user.pdf version 3.4 2025-04-03
% Example 19 Testing if an Element is in a Comma-Separated List
% Label: "ex:DTLifinlist"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
 \usepackage{datatool-base}
\newcommand{\goose}{goose}
\newcommand{\mylist}{duck,\goose,{ant},zebra} 
\begin{document}
 `ant' in list? \DTLifinlist{ant}{\mylist}{true}{false}. 

`goose' in list? \DTLifinlist{goose}{\mylist}{true}{false}. 

`\goose' in list? \DTLifinlist{\goose}{\mylist}{true}{false}. 

`duck' in list? \DTLifinlist{duck}{\mylist}{true}{false}. 

`zebra' in list? \DTLifinlist{zebra}{\mylist}{true}{false}. 
\end{document}
</pre></body></html>