# Place one math expression over the other [duplicate]

The following formula appears in the Stanford ML Course:

How do I express this format, in which minimize is in line with the J(...) expression, and directly above the Thetas?

I tried looking for a similar example in the LaTeX/Mathematics book, but did not notice anything similar.

## marked as duplicate by Guido, Martin Schröder, Stefan Pinnow, Andrew Swann, ZarkoMar 19 '17 at 8:42

The * form here gives the "limits" setting with the subscript below.

\documentclass{article}

\usepackage{amsmath}
\DeclareMathOperator*\minz{minimize}
\begin{document}

$\minz_{\theta_0,\theta_1}J(\theta_0\theta_1)$
\end{document}

• Fantastic. Works like a charm, but being a newbie, I fail to understand the code. Would you please be able to further explain how and why it works, or even paste a link so I can further read? – Adam Matan Mar 19 '17 at 12:32
• @AdamMatan basically what you ask for is standard behaviour for "math operators eg \sum where the subscript is placed under the operator in display mode. amsdoc amsmath` will give you the documentation of the amsmath package command I used. – David Carlisle Mar 19 '17 at 13:23