Code: Select all
\newcommand{\card}[1]{
if #1 is empty:
Empty argument.
else:
The argument is #1.
end if
}
Tim
Code: Select all
\newcommand{\card}[1]{
if #1 is empty:
Empty argument.
else:
The argument is #1.
end if
}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Code: Select all
\ifx&%
% #1 is empty
\else
% #1 is nonempty
\fi
Code: Select all
\usepackage{ifthen}
\newcommand{\card}[1]{
\ifthenelse{\equal{#1}{}}{Empty.}{Nonempty.}
}
Code: Select all
\isempty{#1}
Code: Select all
\equal{#1}{}}
Code: Select all
\newcommand{\card}[1]{
\ifthenelse{\isempty{#1}}{Empty.}{Nonempty.}
}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis