How to typeset argmin and argmax in Markdown?
Asked Answered
Q

4

18

There are posts in TeX.SE that shows how argmin and argmax with limits can be typesetted using the \DeclareMathOperator* command. But how to do this in Markdown?

I am especially interested in doing this in Jupyter Notebook when I'm documenting in Markdown.

Is this possible?

Quadrille answered 23/3, 2016 at 10:1 Comment(0)
Q
42

The way to do this is by using the \underset command.

Syntax:

\underset{<constraints>}{\operatorname{<argmax or argmin>}}

Example:

$\underset{c\in C}{\operatorname{argmax}}$

Quadrille answered 23/3, 2016 at 10:23 Comment(0)
O
4

Maybe this is what you look for

$ \hat{\theta}^{MLE}=\underset{a}{\operatorname{\argmax}} P(D|\theta) = \frac{a_1}{a_1+a_0} $

The trick is done by \underset, which put a character under an expression, as you see below.

underset arg max

Anyway, I see widely used the simple underscore expression, along with \argand \max, as you see below.

plain arg max

If you want to know something more about the many ways you can choose, take a look at here: Command for argmin or argmax?

Hope to be helpful

Orgiastic answered 28/1, 2021 at 8:9 Comment(0)
S
3

This worked for me when using pandoc for markdown-to-PDF conversion. (The subscript 'a' is correctly placed underneath the 'argmin'):

---
header-includes:
    - \newcommand{\argmin}{\mathop{\mathrm{argmin}}\limits}
---

Some text.

$A = \argmin_a f(a)$
Stinkpot answered 23/5, 2020 at 22:4 Comment(0)
W
0

You can try this

\underset{<parameter>}{\text{argmax}} <expression>

This one is for LaTeX though. Should work in jupyter markdown as well.

Woodpile answered 27/6 at 8:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.