Skip to content

Instantly share code, notes, and snippets.

@moewew

moewew/drstrings.tex

Last active Jul 3, 2020
Embed
What would you like to do?
\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
You can’t perform that action at this time.