
Untitled
By: a guest on
Aug 5th, 2012 | syntax:
None | size: 0.76 KB | hits: 9 | expires: Never
newcommand and math environement [migrated]
newcommand{twopartdef}[3]
{
left{
begin{array}{ll}
#1 & mbox{if } #2 \
#3 & mbox{otherwise}
end{array}
right
}
f$(x)$ = twopartdef{$lbrace alpha rbrace}{$x >$ 10}{lbrace beta rbrace}
documentclass{article}
newcommand{twopartdef}[3]{%
left{
begin{array}{ll}
#1 & mbox{if } #2 \
#3 & mbox{otherwise}
end{array}
right.
}
begin{document}
[
f(x) = twopartdef{{ alpha }}{x > 10}{{ beta }}
]
end{document}
documentclass{article}
usepackage{amsmath}% http://ctan.org/pkg/amsmath
newcommand{twopartdef}[3]{%
begin{cases}
#1 & text{if #2} \
#3 & text{otherwise}
end{cases}
}
begin{document}
[
f(x) = twopartdef{{ alpha }}{$x > 10$}{{ beta }}
]
end{document}