I have made a macro that takes certain arguments. However, I would like it to output an error when it encounters an unexpected argument. Something like this:
MWE:
\documentclass{article}
\usepackage{xcolor}
\usepackage{fontawesome}
\usepackage{ifthen}
\definecolor{icons}{HTML}{46A247}
\makeatletter
\newcommand{\@symbolheading}[2]{\large\textcolor{icons}{#1}\hspace{10pt}\textbf{#2}}
\newcommand{\pubtitle}[1]{%
\ifthenelse{\equal{#1}{book}}{\@symbolheading{\faBook}{Book}}{}
\ifthenelse{\equal{#1}{article}}{\@symbolheading{\faFileText}{Article}}{}
}
\makeatother
\begin{document}
\pubtitle{book}
\pubtitle{article}
\pubtitle{invalidArgument}
\end{document}
Which produces the output:
In this case, I would like it to get an errormessage for the \pubtitle{invalidArgument}
that sort of looks something like this:
pubtitle command Warning: No supported entry field 'invalidArgument' for bibliography.
Perhaps you meant '\pubtitle{custom}'?
Sidenote: I want to use this command in the bibliography (using biblatex) like this: \printbibliography[heading=pubtype,type=book,title=\pubtitle{book}]
That is the reason the warning says 'entry field for bibliography', because that is what this command is used for.