Quantcast
Channel: newcommand with two arguments, one optional - TeX - LaTeX Stack Exchange
Browsing latest articles
Browse All 2 View Live

Answer by EngBIRD for newcommand with two arguments, one optional

I would use the xparse package as it keeps the default behaviors for an optional argument very manageable.\documentclass[10pt]{article}\usepackage{xparse}%\ExplSyntaxOn...

View Article



Image may be NSFW.
Clik here to view.

newcommand with two arguments, one optional

I'm struggling with a command that doesn't do what I expect. This is my code\newcommand{\expectation}[2][]{\mathrm{E}_{#1}\left[#2\right]}\begin{document}I get $\expectation{A}{B}$, but I expect...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images