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
SUMMARY

This discussion focuses on improving the visual presentation of product functions in mathematical expressions using LaTeX commands. The key commands highlighted are \prod, \sum, \limits, and \nolimits, which control the placement of indices in fractions. Users can enhance the appearance of their equations by utilizing the \displaystyle command and adjusting scaling settings in MathJax. The amsmath package also offers \dfrac and \tfrac for better fraction formatting, emphasizing the importance of style in typesetting mathematical formulas.

PREREQUISITES
  • Familiarity with LaTeX typesetting
  • Understanding of MathJax rendering
  • Knowledge of mathematical notation and operators
  • Basic concepts of the amsmath package
NEXT STEPS
  • Explore the use of \limits and \nolimits in LaTeX for controlling index placement
  • Learn about the amsmath package and its commands like \dfrac and \tfrac
  • Investigate the different styles of typesetting in TeX, including displaystyle and textstyle
  • Review the TeXbook and The LaTeX Companion for advanced typesetting techniques
USEFUL FOR

This discussion is beneficial for mathematicians, educators, and anyone involved in typesetting mathematical documents using LaTeX or MathJax, particularly those looking to enhance the visual quality of their mathematical expressions.

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
539
  • · 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 19 ·
Replies
19
Views
6K
  • · Replies 11 ·
Replies
11
Views
2K