minipage
supports empty values for its optional arguments:
\begin{minipage}[c][][c]{1cm} test \end{minipage}
or
\begin{minipage}[c][\relax][c]{1cm} test \end{minipage}
but it doesn't if that empty values are passed by a macro:
\def\param{}
\begin{minipage}[c][\param][c]{1cm} test \end{minipage}
or
\def\param{\relax}
\begin{minipage}[c][\param][c]{1cm} test \end{minipage}
How can I properly define the macro, so that minipage takes an empty value?
\let\param\relax
rather than\def\param\relax
(which is wrong:\def
requires a braced definition, so you'd need\def\param{\relax}
)\let\param\relax \fbox{\begin{minipage}[c][\param][c]{1cm} test \end{minipage}} \def\param{1cm} \fbox{\begin{minipage}[c][\param][c]{1cm} test \end{minipage}}
(and with\def\param{\relax}
you will get an error)\ifx
-equal to\relax
, and the way to get that is with\let\param\relax