# Reformat the mathematical product sign

I'm pretty sure there is a simple formatting solution to this, I just can't find it anywhere.
I'll describe what I want to achieve with the code and the picture.

In my last post I was told to add code to my posts, to make it easier for others to help, so there it the relevant part:

\underline{Definition}: A \textbf{state} (or equivalently, an \textbf{instance})  of a database,
is a\\function $f:\Phi\rightarrow \prod_{D\in \mathbb{D}}D$.
Intuitively, $f$ takes a relation name $\phi\in \Phi$ and gives
it an interpretation as a table.


Which produces this:

Notice how the symbol D\in\mathbb{D} does not sit right under the \prod symbol as I intend.
It does sit there when I wrap it with double , but it also places the mathematical expression and basically ruins everything...:

and that's not something I want...

Is there a way to do it?

• What is does here is the right way to do it. if $\prod_x$ writes x under the \prod then it messes up the line spacing making the doc look ugly and unprofessional. So leave LaTeX to do its thing. BTW: you might want to use a better defind for your definition. Noone use underlining anymore. – daleif Nov 12 '14 at 12:20
• I think @daleif is suggesting leaving it as it, which is the correct way to present the limits "inline". If you wanted to see the ugliness of the alternative, add the macro \displaystyle prior to the \prod. It would make the \prod look the way you ask, but screw up the line spacing in the process. – Steven B. Segletes Nov 12 '14 at 12:28
• "so there it the relevant part:" posting fragments is very rarely helpful, it is always better to post a document so people can run the code. although in this case I agree with the previous commenters that you are best not to change the way inline subscripts are set. – David Carlisle Nov 12 '14 at 12:34
• @so.very.tired, that is why it is called minimal, you take a copy of your document, remove what is irrelevant, and post that. – daleif Nov 12 '14 at 13:00
• some guidance on "professional" formatting of mathematics is given with the question Right way to typeset a mathematical document. the current edition of the chicago manual of style also contains recognized guidelines. – barbara beeton Nov 12 '14 at 13:29

You can use the nccmath package and its \medop command (medium-sized operator, ~ 80 % of display style) You can have the index under the product symbol if you insert a new paragraph afterwards. Here are two ways of doing things. I use an unnumbered definition environment with the label in small caps, with the ntheorem package. Underlining titles dates back to the times of typewriters…

\documentclass[a4paper]{article}
\usepackage{amsmath, amsfonts}
\usepackage{nccmath}

\setlength\parindent{1em}
\usepackage[thmmarks, amsmath, thref]{ntheorem}
\theoremstyle{nonumberplain}
\theorembodyfont{\normalfont}
\theoremseparator{:}
\newtheorem{Def}{Definition}
\begin{document}

\begin{Def}
A \textbf{state} (or equivalently, an \textbf{instance}) of a database, is a function $f \colon \Phi \longrightarrow \medop\prod \limits _{D \in \mathbb{D}}D$.

Intuitively, $f$ takes a relation name $\phi \in \Phi$ and gives it an interpretation as a table.\end{Def}

\begin{Def}
A \textbf{state} (or equivalently, an \textbf{instance}) of a database,is a function $f \colon \Phi \longrightarrow \medop\prod _{D \in \mathbb{D}}D$. Intuitively, $f$ takes a relation name $\phi \in \Phi$ and gives it an interpretation as a table.\end{Def}
\end{document}


I think that if you really want to (or need to) to place the limit term (D\in\mathbb{D}}) below the product symbol and thereby give it a lot of visual prominence, you should definitely go "all the way" and place the entire math expression on a line by itself, in display-math mode.

\documentclass{article}
\usepackage{amssymb} % for \mathbb macro
\setlength\textwidth{8cm} % just for this example
\begin{document}
\noindent
\underline{Definition}: A \textbf{state} (or equivalently, an \textbf{instance})  of a database is a function
$f\colon\Phi\rightarrow \prod_{D\in \mathbb{D}}D\,.$
Intuitively, $f$ takes a relation name $\phi\in \Phi$ and gives it an interpretation as a table.
\end{document}