# Using Equations in Your Article

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:

• The LaTeX Companion, by F. Mittelbach and M. Goossens
• More Math into LaTeX, by G. Grätzer

### 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).

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

\left\lbrace

\begin{array}{l}

0, correct \\

1, erroneous.

\end{array}

\right.

\tag{1}

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.

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

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.

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}

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.

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}

##### 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 nni represents its ith 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

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

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

### 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

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