2

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:

enter image description here

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...:

enter image description here

and that's not something I want...

Is there a way to do it?

10
  • 4
    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, 2014 at 12:20
  • 2
    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. Nov 12, 2014 at 12:28
  • 2
    "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. Nov 12, 2014 at 12:34
  • 1
    @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, 2014 at 13:00
  • 1
    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. Nov 12, 2014 at 13:29

2 Answers 2

1

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}
\theoremheaderfont{\scshape}
\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} 

enter image description here

3

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.

enter image description here

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .