% This file is embedded in datatool-user.pdf version 3.0.1 2025-03-05 % Example 20 String Equality Tests % Label: "ex:streq" % arara: pdflatex % arara: pdfcrop \documentclass[12pt]{article} \pagestyle{empty} \usepackage{datatool-base} \newcommand{\strA}{zebra} \newcommand{\strB}{Zebra} \begin{document} `\strA' is \DTLifstringeq{\strA}{\strB}{the same}{not the same} as `\strB' (case). `\strA' is \DTLifstringeq*{\strA}{\strB}{the same}{not the same} as `\strB' (no case). `\strA' is \DTLifstringeq{\strA}{zebra}{the same}{not the same} as `zebra' (case). `\emph{ant}' is \DTLifstringeq{\emph{ant}}{ant}{the same}{not the same} as `ant'. \DTLsetup{compare={skip-cs}} `\emph{ant}' is \DTLifstringeq{\emph{ant}}{ant}{the same}{not the same} as `ant' (skip cs). `ant zebra' is \DTLifstringeq{ant zebra}{ant \strA}{the same}{not the same} as `ant \strA' (no expansion). \DTLsetup{compare={expand-cs}} `ant zebra' is \DTLifstringeq{ant zebra}{ant \strA}{the same}{not the same} as `ant \strA' (expansion). \end{document}