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*}
  • 1
    Do you mean something like tex.stackexchange.com/questions/45928/…? – Torbjørn T. Apr 9 '14 at 6:30
  • I think this question is related link – Tahtisilma Apr 9 '14 at 6:48
  • Also related: Description list for equation's terms This should solve your long lines problem. – user11232 Apr 9 '14 at 7:01
  • Sorry, nothing helped. I am able to bring where. My problem is that the text of where is touching the image as shown in the image above. How to get rid of it? – skm Apr 9 '14 at 7:06
  • Can you post some code? – user11232 Apr 9 '14 at 7:12
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

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 =$}}
  • Thanks, i used the above answer which worked perfect in my case :) – skm Apr 10 '14 at 6:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.