Following the solution from this question as a guide - Are there any "if" commands like "\ifnum" in LaTeX? - I have setup a newcommand to perform a string comparison. Unfortunately I can't get greek characters from the textgreek
package to compare.
The following MWE shows that a math mode alpha can be compared, but because my Greek characters are part of protein names I can't use math mode definitions because of the italics. I can't override the math mode definitions to remove the italics because I still want this when I actually use mathematical formulas.
I would like either:
- a greek character alternative
- a string comparison that will work with
textgreek
MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\setlength\parindent{0pt}
\usepackage{siunitx,microtype,textcomp,textgreek}
\newcommand{\evaltest}[2]{%
\ifnum\pdfstrcmp{#1}{#2}=0
#1 equals #2%
\else
#1 does not equal #2%
\fi
}
\begin{document}
\begin{itemize}
\item \evaltest{a}{b}
\item \evaltest{a}{a}
\item \evaltest{a a}{a a}
\item $\alpha$
\item \evaltest{$\alpha$}{$\alpha$}
\item \textalpha
%\item \evaltest{\textalpha}{\textalpha}
\end{itemize}
\end{document}