Last active
July 3, 2020 08:30
-
-
Save moewew/8ef53a51c97e52ab33a57c73eecbe5d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{etoolbox} | |
\newcommand{\fixsmpl}[1]{% | |
\edef\mytempstr{#1}% | |
\ifdefstring{\mytempstr}{l}% | |
{Sample runs from april to may}% | |
{\ifdefstring{\mytempstr}{s} | |
{Sample 2} | |
{\PackageError{fixsmpl}{Undefined option to fixsmpl command}{}}}% | |
} | |
\newcommand*\X{s} | |
\begin{document} | |
% Works fine | |
A\fixsmpl{s} | |
% Doesn't work | |
B\fixsmpl{\X} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment