Improving the Look of Product Functions in Math

  • Context: MHB 
  • Thread starter Thread starter MarkFL
  • Start date Start date
  • Tags Tags
    Functions Product
Click For Summary

Discussion Overview

The discussion revolves around the formatting of product functions and summation symbols in mathematical expressions, particularly in the context of LaTeX typesetting. Participants explore how to display indices above and below these symbols rather than to the side, especially when used within fractions.

Discussion Character

  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • One participant notes that the indices of product functions displayed using the \prod command appear to the right of the symbol when placed in a fraction, which they find less visually appealing.
  • Another participant suggests using the \limits command to force the indices to appear above and below the product symbol, providing an example of its application.
  • A third participant expresses appreciation for the \limits command and mentions that adjusting the scaling of math settings improved the visual appearance of the equations.
  • A later post explains the different styles in TeX for typesetting mathematical formulas, detailing how displaystyle and textstyle affect the placement of indices and the size of operators.
  • The same post also mentions the amsmath package and its commands \dfrac and \tfrac for typesetting fractions in different styles, noting that the style is determined before the fraction.

Areas of Agreement / Disagreement

Participants generally agree on the utility of the \limits command for formatting indices, but there is no consensus on the best approach to achieve the desired visual effect, as different methods and preferences are discussed.

Contextual Notes

The discussion includes various assumptions about the use of LaTeX commands and the impact of different mathematical styles on the appearance of equations, which may not be universally applicable depending on the context of use.

MarkFL
Gold Member
MHB
Messages
13,284
Reaction score
12
Hello all,

In a recent post, I discovered that when putting a product function in a fraction (using the \prod command), the indices are displayed to the right of the product function's symbol rather than below and above, which I find much more pleasing to the eye. I find that the same thing happens with the \sum command.

Using the MATH tags, which implies the \displaystyle command, we see that alone, i.e., not in a fraction, we get:

$$\prod_{k=k_i}^{n}\left(\frac{f(k)}{g(k)} \right)$$

Writing this in its equivalent form, we get:

$$\frac{\prod_{k=k_i}^{n}\left(f(k) \right)}{\prod_{k=k_i}^{n}\left(g(k) \right)}$$

My question: is there a way to force the indices to be displayed as they are in the first expression of the product?
 
Physics news on Phys.org
$\displaystyle \frac{\prod\limits_{k=k_i}^{n}\left(f(k) \right)}{\prod\limits_{k=k_i}^{n}\left(g(k) \right)}$

Like that? I just found that from a quick Google search. The two commands to keep in mind are \limits and \nolimits. \limits forces the top/bottom layout like you see above. On MHB and all sites that use Mathjax, you can scale all equations up or down if you wish. I had the scale set to 100%, or no scaling I suppose, and the above looked pretty bad. I just changed it to 115% and now it looks much better.

Right click -> "Math Settings" -> "Scale all math"
 
Thank you kindly for the \limits command knowledge about the scaling...it does look better! (Yes)
 
TeX has four styles for typesetting mathematical formulas: displaystyle, textstyle, scriptstyle and scriptscriptstyle. Each style has a corresponding command. If a fraction is typeset in a certain style, the numerator and the denominator and rendered in the following smaller style, except that scriptscriptstyle is the smallest. The sub- and superscripts of a symbol in displaystyle or textstyle are written in scriprstyle; otherwise (for the two smallest styles) they are written in scriptscriptstyle.

The difference between displaystyle and textstyle shows, in particular, in the size of big operators like \prod and \sum and in the location of the operator's indices, which can also be specified using \limits and \nolimits. The size of regular symbols like $x$ and $+$, however, is the same.

Therefore, there are two ways to place indices above and below big operators: either write the formula in displaystyle or use \limits. Also, the package amsmath provides commands \dfrac and \tfrac, which are abbreviations of \displaystyle\frac and \textstyle\frac. Note, however, that the style is specified before the fraction, so the numerator and the denominator are never typeset in displaystyle.

Math styles are discussed in the TeXbook, chapter 17, and The LaTeX Companion (2nd ed.), section 8.7.1.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
725
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 6 ·
Replies
6
Views
7K