TeX - LaTeX Asked on March 1, 2021
In some places in my document I have used the following (and it works quite well):
documentclass{article}
usepackage{amsmath}
DeclareMathOperator*{argmax}{argmax} % thin space, limits underneath in displays
begin{document}
[z = argmax_x f(x)]
end{document}
However, when I try to use something like this:
documentclass{article}
usepackage{amsmath}
DeclareMathOperator*{argmax}{argmax} % thin space, limits underneath in displays
begin{document}
begin{tabular}{c l}
$z = argmax_x f(x)$
$z = argmax_{x in mathcal{X}} f(x)$
end{tabular}
end{document}
It does not work anymore. It seems that tabular
is somehow to blame here.
UPDATE2:
Well, it was clearly because I was using inline math ($). Thanks David!
It isn't clear what you mean by "not work" the output is as I expect.
documentclass{article}
usepackage{amsmath}
DeclareMathOperator*{argmax}{argmax} % thin space, limits underneath in displays
begin{document}
a
[z = argmax_x f(x)]
b
[z = argmax_{x in mathcal{X}} f(x)]
end{document}
Updated question shows it is just an issue of display or inline setting:
documentclass{article}
usepackage{amsmath}
DeclareMathOperator*{argmax}{argmax} % thin space, limits underneath in displays
begin{document}
a
[z = argmax_x f(x)]
b
[z = argmax_{x in mathcal{X}} f(x)]
a2
$z = argmax_x f(x)$
b2
$z = argmax_{x in mathcal{X}} f(x)$
a3 (don't do this)
$z = argmaxlimits_x f(x)$
b3 (or this)
$z = argmaxlimits_{x in mathcal{X}} f(x)$
c
begin{align*}
z &= argmax_x f(x)
z &= argmax_{x in mathcal{X}} f(x)
end{align*}
end{document}
Correct answer by David Carlisle on March 1, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP