I am trying to find a easy way to write Rademacher complexity so that I just need to write different index, function and constraint every time. Like defining partial derivative I previously read somewhere

\newcommand*{\pdv}[3][]{\ensuremath{\frac{\partial^{#1} #2}{\partial #3}}}

enter image description here I defined it as

\newcommand*{\RC}[1][2][3]{\ensuremath{\mathbb{E}_S[\mathbb{E}_\sigma \sup_{#2}\frac{1}{#1}\sum_{i=1}^{#1} \sigma_i #3]}}

But it does not work.

Could anyone help me, thank you in advance.

  • 2
    Not [1][2][3] but just [3] – egreg Feb 16 at 22:14
  • Thank you. So here [3] does not mean the place it should appear but number of different signs? – Mr.Robot Feb 16 at 22:21
  • 5
    Yes, it denotes the number of arguments to the macro being defined. – egreg Feb 16 at 22:21
  • @Mr.Robot If you want something like [1][2][3], you can use the TeX command \def. For example: \def\RC#1#2#3{\ensuremath{\mathbb{E}_S[\mathbb{E}_\sigma \sup_{#2}\frac{1}{#1}\sum_{i=1}^{#1} \sigma_i #3]}} (unchecked). – user156344 Feb 17 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.