Created
February 19, 2016 12:07
-
-
Save shakthimaan/36c1f335fd1480f02f7e to your computer and use it in GitHub Desktop.
ifthenelse example
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{ifthen} | |
\newcommand{\test}[2] | |
{ | |
\ifthenelse{\equal{#1}{}} | |
{#2} % No optional argument Expected: Second | |
{#2 #1} % With optional argument Expected: Second Argument | |
} | |
\begin{document} | |
\test[Argument]{Second} % Observed: A [rgument]Second. Why? | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to use \newcommand{\test}[2][] % Add optional argument.