It is important that you make sure your mathematical equations and formulas display correctly in the published article.

### Mathematical Typography and Why It Matters

Typographical conventions for mathematical formulas have been developed to provide uniformity and clarity of presentation across mathematical texts. This enables the readers of those texts to both understand the author’s ideas and to grasp new concepts quickly. While software such as LaTeX and MathType can produce aesthetically pleasing math when used properly, it is also very easy to misuse the software, potentially resulting in incorrect math display.

IEEE aims to provide authors with the proper guidance on mathematical typesetting style and assist them in writing the best possible article.

As such, IEEE has assembled a set of examples of good and bad mathematical typesetting examples. You will see how various issues are dealt with. The following publications have been referenced in preparing this material:

*Mathematics into Type,*published by the American Mathematical Society*The Printing of Mathematics,*published by Oxford University Press*The LaTeX Companion,*by F. Mittelbach and M. Goossens*More Math into LaTeX,*by G. Grätzer- AMS-StyleGuide-online.pdf, published by the American Mathematical Society

### Example 1: Cases

##### Example 1-1

**Incorrect Example:** The wrong environment is used (array instead of cases), the tabs are missing, and the text is not formatted correctly (should not be italic).

\begin{equation}

P(Y=1|\boldsymbol{X_{i}^{j}})=

\left\lbrace

\begin{array}{l}

0, correct \\

1, erroneous.

\end{array}

\right.

\tag{1}\end{equation}

**Correct Example:** The correct environment is used. Using the “cases” environment will save keystrokes (from not having to type the “\left\brace{“) and automatically provide the correct column alignment. The tabs have been inserted and the text formatting corrected.

\begin{equation*}

P(Y=1|\boldsymbol{X_{i}^{j}})=

\begin{cases}

0, & \text{correct} \\

1,& \text{erroneous.}

\end{cases}

\tag{1a}\end{equation*}

##### Example 1-2

**Incorrect Example:** The wrong environment is used and the column alignment is incorrect. Columns in cases should be left aligned.

\begin{equation}

{z_m(t)} = \left\lbrace {\begin{array}{cc}1,&{{\mathrm {if}}\

{{\beta }_m(t)} < \frac{\mathfrak {B}_{m}^{\max }}{{ |\mathcal {U}_m|r_{m,i}^{\min } }}},\\

{0,}&{{\mathrm {otherwise.}}} \end{array}} \right.

\tag{2}\end{equation}

**Correct Example:** The correct environment is being used. Using the “cases” environment will save keystrokes (from not having to type the “\left\brace{“) and automatically provide the correct column alignment.

\begin{equation*}

{z_m(t)} = \begin{cases}

1,&{\mathrm {if}}\ {\beta }_m(t) < \frac{\mathfrak {B}_{m}^{\max }}{{ |\mathcal {U}_m|r_{m,i}^{\min } }},\\

{0,}&{\mathrm {otherwise.}}

\end{cases}

\tag{2a}

\end{equation*}

##### Example 1-3

**Incorrect Example:** The wrong environment is used; a space is missing after the word “if.” In this instance an extra bit of space is needed.

\begin{align}

h_{i}(x,y) &= \left\lbrace \begin{array}{ll}+1 & \mathrm{if} \xi _{i}(x)=\eta _{i}(y),\\

-1 & \mathrm{otherwise },\end{array} \right.\nonumber \\

&=(2 \xi _{i}(x)-1)(2\eta _{i}(y)-1),

\tag{3}\end{align}

**Correct Example:** The correct environment is being used. Using the “cases” environment will save keystrokes (from not having to type the “\left\brace{“) and automatically provide the correct column alignment. The text formatting is corrected by using \text{} to surround the textual elements “if” and “otherwise.”

\begin{align}

h_{i}(x,y) &=

\begin{cases}+1 & \mathrm{if }~ \xi _{i}(x)=\eta _{i}(y),\\

-1 & \text{otherwise },

\end{cases} \nonumber \\

&=(2 \xi _{i}(x)-1)(2\eta _{i}(y)-1),

\tag{3a}\end{align}

### Example 2: Text Functions

##### Example 2-1

**Incorrect Example:** This example has incorrect text formatting and alignment issues. Please use \max, \min, and \text\{…\} for the conditions or text. \; should not be used for spacing: when the code is reused in other composition software, it will likely format differently than expected. Using tabs will provide concrete alignment points.

\begin{equation}

LD(a_{x},b_{y})

\begin{cases}

max(x,y) \;\;\;\;\;\;\;\;\;\;\;if\; min(x,y)=0 \\

min

\begin{cases}

L(a,b)(x-1,y)+1 \\

L(a,b)(x,y-1,j)+1 & Otherwise\\

L(a,b)(x-1,y-1)+1(a_{x}\neq b_{y})

\end{cases}

\end{cases}\tag{7}

\end{equation}

**Correct Example:** This example has the correct text formatting and tabs are used to correctly set column alignment. Note the use of \hfill to replace the multiple \; for alignment purposes.

\begin{equation}

LD(a_{x},b_{y})

\begin{cases}

\max(x,y) \hfill \text{if } \min(x,y)=0 \\

\min

\begin{cases}

L(a,b)(x-1,y)+1 & \\

L(a,b)(x,y-1,j)+1 & \text{Otherwise} \\

L(a,b)(x-1,y-1)+1 & (a_{x}\neq b_{y})

\end{cases}

\end{cases}\tag{7a}

\end{equation}

##### Example 2-2

**Incorrect Example:** This example has bad formatting of the function min. When coded as shown, it formats incorrectly as italic text.

\begin{equation*}

d_{l}^{KM} = \underset {\mathbf {p}_{w}}{min} || \mathbf {p}_{f}^{l} – \mathbf {p}_{w} ||,

\tag{12}

\end{equation*}

**Correct Example:** This example shows the use of \min to get the correct formatting of the function min.

\begin{equation*}

d_{l}^{KM} = \underset {\mathbf {p}_{w}}\min || \mathbf {p}_{f}^{l} – \mathbf {p}_{w} ||,

\tag{12a}

\end{equation*}

##### Example 2-3

**Incorrect Example:** This example has bad formatting of the function “arg min.” When coded as shown, it formats incorrectly as italic text.

\begin{equation*}

d_{R}^{KM} = \underset {d_{l}^{KM}}{arg~{min}} \{ d_{1}^{KM},\ldots,d_{6}^{KM}\}.

\tag{13}

\end{equation*}

**Correct Example:** This example shows the use of {\text{arg min}} to get the correct formatting of the function “arg min.”

\begin{equation*} d_{R}^{KM} = \underset {d_{l}^{KM}} {\text{arg min}} \{ d_{1}^{KM},\ldots,d_{6}^{KM}\}.

\tag{13a}

\end{equation*}

### Example 3: Limits

##### Example 3-1

**Incorrect Example:** The upper and lower limits in a display formula should generally be above and below the operators.

\begin{equation*}

c_{r_i} = \beta _0+\sum \nolimits _{j=1}^{n}{\beta _j \times c_{r_j}},

\tag{15}

\end{equation*}

**Correct Example:** In this example, the \nolimits was removed as it was causing the incorrect formatting. \nolimits has appropriate uses for inline equations and in certain subelements of a display equation.

\begin{equation*}

c_{r_i} = \beta _0+\sum_{j=1}^{n}{\beta _j \times c_{r_j}},

\tag{15a}

\end{equation*}

##### Example 3-2

**Incorrect Example:** When limits appear in fractions within a display formula, they should be off to the side of the operator.

\begin{equation*}

{C_{D}} = \frac {{\sum \limits _{i = 1}^{N} {\left ({{C_{D}({n_{\max }}) – {C_{D}}({n_{i}})} }\right)} }}{{ \sum \limits _{i = 1}^{N} {\left ({{C_{D}(n_{\max }^ {*}) – {C_{D}}(n_{i}^{*})} }\right)} }}

\tag{18}

\end{equation*}

**Correct Example:** This example shows the proper formatting when \limits are removed. LaTeX will automatically format the limits correctly when within a fraction.

\begin{equation*}

{C_{D}} = \frac {{\sum _{i = 1}^{N} {\left ({{C_{D}({n_{\max }}) – {C_{D}}({n_{i}})} }\right)} }}{{ \sum _{i = 1}^{N} {\left ({{C_{D}(n_{\max }^ {*}) – {C_{D}}(n_{i}^{*})} }\right)} }}

\tag{18a}

\end{equation*}

### Example 4: Text Acronyms

##### Example 4-1

**Incorrect Example:** This example shows when the acronym “MSE” is not coded as text, it will appear in italic. This is inconsistent with how it appears in the text and it should be consistent.

\begin{equation*}

MSE = \frac {1}{n}\sum _{i=1}^{n}(Y_{i} – \hat {Y_{i}})^{2}

\tag{19}

\end{equation*}

**Correct Example:** This example shows where the acronym “MSE” is coded using \text{} to match how it appears in the text.

\begin{equation*}

\text {MSE} = \frac {1}{n}\sum _{i=1}^{n}(Y_{i} – \hat {Y_{i}})^{2}

\tag{19a}

\end{equation*}

##### Example 4-2

**Incorrect Example:** This example shows an instance where the formatting of the acronym “NCC” is inconsistent between text and its use in a formula.

The calculation of NCC is calculated as follows:

\begin{equation*}

{NCC}=\dfrac {\left |{\sum _{i=1}^{n}(a_{i}-\mu _{A})(b_{i}-\mu _{B})}\right |}{l\times \sigma _{A} \times \sigma _{B}},

\tag{20}

\end{equation*}

**Correct Example:** This example shows where the acronym “NCC” is coded using \text{} to match how it appears in the text.

The calculation of NCC is calculated as follows:

\begin{equation*}

\text {NCC}=\dfrac {\left |{\sum _{i=1}^{n}(a_{i}-\mu _{A})(b_{i}-\mu _{B})}\right |}{l\times \sigma _{A} \times \sigma _{B}},

\tag{20a}\end{equation*}

##### Example 4-3

**Incorrect Example:** This example shows an instance where the formatting of the acronym “RMS” is inconsistent between text and its use in a formula.

As an error measure, the root-mean-square (RMS) distance between Gs and Gr is determined. For a guidewire with N centerline points, the error measure is defined as follows:

\begin{equation*}

RMS_{rs}=\sqrt {\frac {1}{N}\sum \limits _{i}^{N} {\left ({{d_{rs}(i)} }\right)^{2}}}

\tag{32}

\end{equation*}

**Correct Example:** This example shows where the acronym “RMS” is coded using \text{} to match how it appears in the text.

As an error measure, the root-mean-square (RMS) distance between Gs and Gr is determined. For a guidewire with N centerline points, the error measure is defined as follows:

\begin{equation*}

\text{RMS}_{rs}=\sqrt {\frac {1}{N}\sum \limits _{i}^{N} {\left ({{d_{rs}(i)} }\right)^{2}}}

\tag{32a}

\end{equation*}

### Example 5: Fences

##### Example 5-1

**Incorrect Example:** In this example, the parentheses are not growing to properly surround the content in between them.

\begin{equation*}

\delta \approx 1 – ({e^{-\frac {d^{2}}{2 \times C^{m}_{T}}} \times e^{-\frac {d^{2}}{2 \times C^{m-1}_{T}}}})

\tag{21}

\end{equation*}

**Correct Example:** In this example, the use of \left( and \right) enables the parentheses to grow to the height of the content in between them.

\begin{equation*}

\delta \approx 1 – \left({e^{-\frac {d^{2}}{2 \times C^{m}_{T}}} \times e^{-\frac {d^{2}}{2 \times C^{m-1}_{T}}}}\right)

\tag{21a}

\end{equation*}

##### Example 5-2

**Incorrect Example:** In this example, the square brackets are not growing to properly surround the content in between them.

\begin{equation*}

[\sqrt {(\Delta x_{i}+d_{x})^{2}+(\Delta y_{i})^{2}} -\mu ^{k}]>\epsilon \mu ^{k}

\tag{22}

\end{equation*}

**Correct Example:** In this example, the use of \left[ and \right] enables the square brackets to grow to the height of the content in between them.

\begin{equation*}

\left[ \sqrt {(\Delta x_{i}+d_{x})^{2}+(\Delta y_{i})^{2}} -\mu ^{k}\right] >\epsilon \mu ^{k}

\tag{22a}

\end{equation*}

##### Example 5-3

**Incorrect Example:** In this example, the parentheses are not growing to properly surround the content in between them.

\begin{equation*}

\textrm {T} = ({\frac {c}{B}})^{2}

\tag{34}

\end{equation*}

**Correct Example:** In this example, the use of \left( and \right) enables the parentheses to grow to the height of the content in between them.

\begin{equation*}

\textrm {T} = \left({\frac {c}{B}}\right)^{2}

\tag{34a}

\end{equation*}

### Style Issue Basics

Below are some of the common mathematical style issues IEEE has seen. Authors should be aware of these issues in order to write the best article and get it accepted for publication. Please note that IEEE recommends that you do not include mathematical symbols in your article title or abstract because they may not display properly.

##### Variables

Variables should always be set in *italic* font in both text and in equations. A variable will sometimes be *italic* in a formula, but roman when part of the text, which is incorrect. There should be consistency between items in the text and those in the inline or display formulas.

Example: *a* + *b* = *c*

##### Vectors

Vectors should always be in **bold** type.

Example: For vector **n**, *n _{i}* represents its

*i*th component.

##### Functions

Functions should always be set as roman type. The most common functions include:

arcsin

arctan

arg

cos

det

diag

exp

Im

inf

int

lim

lim inf

lim sup

ln

log

Log

max

min

mod

Re

sgn

sin

sinh

tan

There are many other less common functions. Please see the publications referenced above for more information.

##### Alignment and Line Breaks for Display Formulas

Please refer to the American Mathematical Society’s* Math into Type*, Chapter 3.2.2, for details about line breaking rules.

###### Break and Align on Mathematical Verbs

###### Break at Mathematical Conjunctions and Align to the Right of the First Mathematical Verb

###### Always Keep Expressions Visually Within Fences

Note the position of the “+” under and to the right of the parentheses surrounding the expression. For more examples of fences, see Example 5 above.

##### Do Not Use Obsolete Codes and Delimiters (eqnarray, $$ display math delimiters)

Avoid the use of outdated macros, such as eqnarray and $$ math delimiters, for display equations. The $$ display math delimiters are left over from PlainTeX and should not be used in LaTeX, ever. Poor vertical spacing will result.

##### Use Appropriate Delimiters for Display Equations

Some improper mathematical coding advice has been given in various YouTube^{TM} videos on how to write scholarly articles, so please follow these good examples:

- For single-line unnumbered display equations, please use only the following delimiters: \[ . . . \] or \begin{equation*} . . . \end{equation*}
- For multiline unnumbered display equations, please use only the following delimiters: \begin{align} . . . \end{align}
- For single-line numbered display equations, please use only the following delimiters: \begin{equation} . . . \end{equation}
- For multiline numbered display equations, please use only the following delimiters: \begin{align} . . . \end{align}

##### mathcal vs. RSFS script

In 1991, the RSFS script mathematical font package was created as an alternative to the existing mathcal fonts. Over the years, IEEE has seen authors using RSFS incorrectly, when mathcal should be used. Please see the RSFS documentation at http://ftp.math.purdue.edu/mirrors/ctan.org/fonts/rsfs/README for proper use.

### LaTeX Topics

##### IEEE Templates and their Limitations

The IEEEtran templates were built to enable authors to estimate their final page count and get an approximation of the final look of the article. They were not intended to be used for final publication presentation. As a result, line and page breaks may display differently after the source files are processed through the IEEE’s composition systems.

##### Use of Two-Column Format for Setting Line Breaks on Large Equations

The advantage of using the two-column format is that authors will be able to determine if any of their display math falls outside the page column width. Authors will be able to make adjustments for new line breaks or recode as pagewide equations as necessary.

##### LaTeX Community Forums and Other Resources

The LaTeX community has two great online forums where users can get their questions answered:

The moderators and active participants freely give their LaTeX expertise.

##### LaTeX Online Tutorials

IEEE has reviewed many LaTeX tutorials on YouTube^{TM} and found that several give good instruction on the basics of setting up a LaTeX document. However, most fall short on giving good advice for mathematical coding. Several of these videos show instances of poor mathematical coding practices (i.e., eqnarray, $$ delimiters for display math, etc.). For examples of best practices in mathematical coding, please consult the examples provided above or the “LaTeX Community Forums and Other Resources” section for more accurate examples of math coding.

### MathType Topics

##### IEEE Recommends MathType for Microsoft Word Users

For Microsoft Word users, IEEE recommends the MathType 7 plugin as of 2019. This is available at: https://store.wiris.com/en/products/mathtype/download. IEEE does not recommend using the Microsoft Word equation editor.

##### MathType Resources

http://www.wiris.com/en/mathtype

##### Tutorials

https://www.youtube.com/watch?v=izzFYtLjfFU

https://www.youtube.com/watch?v=pegDm3gjZJ8

##### Formatting Equations

https://www.youtube.com/watch?v=ucV2GSGUXrw

### MathJax on IEEE *Xplore*

##### What Is MathJax?

MathJax is a JavaScript display engine for mathematics that works in all browsers.

There is no additional setup or fonts required by the end-user.

##### How Is It Used?

MathJax is currently used to display equations in the HTML version of articles on IEEE *Xplore*. MathJax renders LaTeX and MathML equations in high-quality typography.

##### How to See the Equation Source Code

Right-click on any equation in an IEEE *Xplore* HTML article and you will get a menu (see screenshot below). You can select TeX/LaTeX or MathML source code to view.

For more information on MathJax please see https://www.mathjax.org/ and https://en.wikipedia.org/wiki/MathJax.