[Tex/LaTex] How to align lines and automaticaly break the lines if they are too long

alignline-breaking

I'm trying to align in LaTeX all equal signs, but I'm encountering a problem. If the line is too long it won't automatically break.

My code at the moment:

\begin{align*}
n &= \text{number of days in the support and resistance range;} \\
e &= \text{used for an alternative definition of extrema where a low (high) can be defined as the most recent closing price that is less (greater) than the n previous closing prices;} \\
b &= \text{fixed band multiplicative value;}
\end{align*}

Result at the moment:
Result

What I want to get:

End Result

So I want the line to automatically break if it's too long and put the new line right under the first line (after the equal sign).

How can I do this?
P.s. Additional: Does somebody also know how much (cm/mm) the "align" command shifts the text vertical down? I don't really want the command to shift the text downwards, and want to correct this with "\vspace{-Xmm}".

Best Answer

An equation-oriented environment such as align* isn't well suited for the task at hand. Instead, consider using a table-like environment such as tabularx.

The following code uses the construct @{${}={}$} to insert a properly-spaced = symbol between the first and second column of the tabularx environment; the X column type, used for the second column, "wraps" its contents automatically as needed. The overall width of the table is set to 0.75\textwidth -- adjust this setting as you see fit.

enter image description here

\documentclass{article}
\usepackage{tabularx}
\begin{document}

\begin{center}
\begin{tabularx}{0.75\textwidth}{>{$}r<{$} @{${}={}$} X}
  n &number of days in the support and resistance range; \\
  e &used for an alternative definition of extrema where 
     a low (high) can be defined as the most recent closing     
     price that is less (greater) than the n previous closing 
     prices; \\
  b &fixed band multiplicative value.\\
\end{tabularx}
\end{center}
\end{document}
Related Question