2

I think that this is a very basic question but i couldn't find any answer. I have written the following equation in latex:

\begin{equation}
U= \frac{\bar{X}_1 -\bar{X}_2}{\sqrt{\frac{S^2_1}{n_1}+\frac{S^2_1}{n_1}}}
\end{equation}

I want to write the variable names also e.g.

Where,

\bar{X}_1 = mean of first dataset and so on.

Problem:

I tried suggestion here but then i facing another problem. The details about my variable are a little loner so the text is touching the margin as shown in the image below:

image

PS: I am writing in IEEEtran

My code for whole equation:

\begin{align*}  
    U &= \frac{\bar{X}_1 -\bar{X}_2}{\sqrt{\frac{S^2_1}{n_1}+\frac{S^2_1}
{n_1}}}
\intertext{where}
    \bar{X}_1 &= \text{mean of correctly recognized In-direction distractors}; \\
    \bar{X}_2 &= \text{mean of correctly recognized Out-direction distractors}; \\
    S_1 &= \text{variance of correctly recognized In-direction distractors}; \\
    S_2 &= \text{variance of correctly recognized Out-direction distractors}.
\end{align*}
skm
  • 960

2 Answers2

3

The question which I linked in the comment above works fine here too.

\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{enumitem}
\SetLabelAlign{myright}{\hss\llap{$#1$}}
\newlist{where}{description}{1}
\setlist[where]{labelwidth=2cm,labelsep=0.5em,itemsep=0pt,
                        leftmargin=!,align=myright,font=\normalfont}

\begin{document}
\begin{equation}
U= \frac{\bar{X}_1 -\bar{X}_2}{\sqrt{\frac{S^2_1}{n_1}+\frac{S^2_1}{n_1}}}
\end{equation}
Where:
\begin{where}
\item[\bar{X}_1 =] mean of correctly recognized In-direction distractors some text filled for this line and in to the next line; 
\item[\bar{X}_2 =] mean of correctly recognized Out-direction distractors; 
\item[S_1 =] variance of correctly recognized In-direction distractors; 
\item[S_2 =] variance of correctly recognized Out-direction distractors.
\end{where}

\end{document}

enter image description here

If you don't want to type = in every item, replace \SetLabelAlign{myright} with this:

\SetLabelAlign{myright}{\hss\llap{$#1 =$}}
2

You could use a tabularx instead of align:

\documentclass{IEEEtran}
\usepackage{amsmath}
\usepackage{array,tabularx}
\begin{document}
\begin{equation}
U= \frac{\bar{X}_1 -\bar{X}_2}{\sqrt{\frac{S^2_1}{n_1}+\frac{S^2_1}{n_1}}}
\end{equation}
\begin{tabularx}{\linewidth}{>{$}r<{$} @{${}={}$} X}
\bar{X}_1 & mean of correctly recognized In-direction distractors; \\
\bar{X}_2 & mean of correctly recognized Out-direction distractors; \\
S_1 & variance of correctly recognized In-direction distractors; \\
S_2 & variance of correctly recognized Out-direction distractors.
\end{tabularx}
\end{document}

enter image description here

Torbjørn T.
  • 206,688