As an extension of my earlier question Automatically generate new commands, I want to generate commands for Greek random variables as well, that is:
\usepackage{bm}
\newcommand{\myrv}[1]{\bm{#1}}
\newcommand{\rvepsilon}{\myrv{\epsilon}}
\newcommand{\rvnu}{\myrv{\nu}}
Unfortunately, the tricks in the answers to the earlier question don't work in this case. For example, when I tried
\documentclass{article}
\usepackage{bm}
% Notation for Greek random variables
\newcommand{\myrv}[1]{\bm{#1}}
\makeatletter
\newcommand*\defrvar[1]{
\expandafter\newcommand\csname rv#1\endcsname[1][]{\myrv{#1}}}
\newcommand*\defrvars[1]{
\@for\@i:=#1\do{\expandafter\defrvar\expandafter{\@i}}}
\makeatother
\defrvars{epsilon,nu}
\begin{document}
$\rvepsilon = 1$
\end{document}
The output is "epsilon = 1" instead of the desired output "ε = 1".
Is there a way to define the commands automatically by looping over a list, say {alpha,beta,gamma,...}
?