# Equation Parameters alignment

This question is similar to many others (infact the code I am using comes from an answer in a previous question: How to write a perfect equation parameters description?)

The comment section is becoming really long and I just think it would be easier to start a different thread (apologies for the inconvenience)

\usepackage{array,tabularx,calc}

\newlength{\conditionwd}
\newenvironment{conditions}[where:]
{%
#1\tabularx{\textwidth-\widthof{#1}}[t]{
>{$}l<{$} @{${}={}$} X@{}
}%
}
{\endtabularx\\[\belowdisplayskip]}

\begin{document}
\citet{hernandez1992probabilistic} further refines the PROLAM model and uses a virtual work calculation (see equation \ref{eqn:PROLAM deflection} to calculate the deflection ($\Delta$) which can be used in standard elastic deflection MOE calculations \ref{eqn:MOE4pt}.

\begin{equation}
\Delta = \displaystyle\sum_{i=1}^{n} \left[\left(\frac{M_x m_x}{E_c I_i}+\frac{kV_xv_x}{A_iG_i}\right) \times \Delta_x \right]
\label{eqn:PROLAM deflection}
\end{equation}

\begin{conditions}
$\Delta$        & The total glulam beam deflection at $x$,\\
$M_x$           & The bending moment at $x$ caused by actual loading,\\
$m_x$           & The bending moment at $x$ caused by a unit load at the midspan of the beam,\\
$V_x$           & The shear at $x$ caused by actual loading,\\
$v_x$           & The shear at $x$ caused by a unit load at the midspan of the beam,\\
$k$             & A form factor (1.2 for rectangular section),\\
$E_c$           & A constant MOE value used in the transformed cross section,\\
$I_i$           & The moment of inertia of the ith transformed cross section at x,\\
$A_i$           & The transformed area at the ith transformed cross section at x,\\
$G_i$           & The shear modulus of the ith transformed cross section at x,\\
$\Delta_x$      & The increment at which calculations are performed,\\
$n$             & The total number of increments along the beam length.\\
\end{conditions}

\end{document}


which produces: As you can see, the parameter descriptions produces an overfull box. Does anybody know why this is? Could it possibly be to do with one of my other \packages?

You should not leave a blank line between \end{equation} and \begin{conditions} or the description might be detached from the equation.

Nor you should have a blank line before \begin{equation} under any circumstance.

On the other hand, such a long description of variables is quite likely to produce bad page breaks, be it detached or not from the equation.

Probably a simple list environment is better for such cases: the equals signs are not necessary and can be replaced by the verb is.

Here's a fixed version of your code; I've made several small fixes and you can compare them with your version. After = there is no capital letter: they're heavy and don't go along with the commas; ith should be $i$th and at x should always be at $x$ (even better, at~$x$). Ending with \endtabularx\\[\baselineskip] will produce a warning.

\usepackage{array,tabularx,calc}

\newlength{\conditionwd}
\newenvironment{conditions}[where:]
{%
#1\tabularx{\textwidth-\widthof{#1}}[t]{
>{$}l<{$} @{${}={}$} X@{}
}%
}
{\endtabularx\\[\belowdisplayskip]}

\begin{document}
\citet{hernandez1992probabilistic} further refines the PROLAM model and uses a virtual work calculation (see equation \ref{eqn:PROLAM deflection} to calculate the deflection ($\Delta$) which can be used in standard elastic deflection MOE calculations \ref{eqn:MOE4pt}.

\begin{equation}
\Delta = \displaystyle\sum_{i=1}^{n} \left[\left(\frac{M_x m_x}{E_c I_i}+\frac{kV_xv_x}{A_iG_i}\right) \times \Delta_x \right]
\label{eqn:PROLAM deflection}
\end{equation}

\begin{conditions}
$\Delta$        & The total glulam beam deflection at $x$,\\
$M_x$           & The bending moment at $x$ caused by actual loading,\\
$m_x$           & The bending moment at $x$ caused by a unit load at the midspan of the beam,\\
$V_x$           & The shear at $x$ caused by actual loading,\\
$v_x$           & The shear at $x$ caused by a unit load at the midspan of the beam,\\
$k$             & A form factor (1.2 for rectangular section),\\
$E_c$           & A constant MOE value used in the transformed cross section,\\
$I_i$           & The moment of inertia of the ith transformed cross section at x,\\
$A_i$           & The transformed area at the ith transformed cross section at x,\\
$G_i$           & The shear modulus of the ith transformed cross section at x,\\
$\Delta_x$      & The increment at which calculations are performed,\\
$n$             & The total number of increments along the beam length.\\
\end{conditions}

\end{document} Here's with a list.

\documentclass{article}
\usepackage{array,tabularx,calc}
\usepackage{natbib}
\usepackage{enumitem}

\newlength{\conditionwd}
\newenvironment{conditions}[where:]
{%
#1\tabularx{\textwidth-\widthof{#1}}[t]{
>{$}l<{$} @{${}={}$} X@{}%>{\raggedright\arraybackslash}X@{}
}%
}

\begin{document}
\citet{hernandez1992probabilistic} further refines the PROLAM model and uses
a virtual work calculation (see equation~\ref{eqn:PROLAM deflection}) to calculate
the deflection ($\Delta$) which can be used in standard elastic deflection MOE
calculations~\ref{eqn:MOE4pt}
\begin{equation}
\Delta = \sum_{i=1}^{n} \left[
\left(\frac{M_x m_x}{E_c I_i}+\frac{kV_xv_x}{A_iG_i}\right) \times \Delta_x
\right]
\label{eqn:PROLAM deflection}
\end{equation}
where
\begin{itemize}[labelindent=0pt,leftmargin=*,widest=$M_x$,align=left,itemsep=0pt]
\item[$\Delta$]   is the total glulam beam deflection at $x$,
\item[$M_x$]      is the bending moment at $x$ caused by actual loading,
\item[$m_x$]      is the bending moment at $x$ caused by a unit load at the midspan of the beam,
\item[$V_x$]      is the shear at $x$ caused by actual loading,
\item[$v_x$]      is the shear at $x$ caused by a unit load at the midspan of the beam,
\item[$k$]        is a form factor ($1.2$ for rectangular section),
\item[$E_c$]      is a constant MOE value used in the transformed cross section,
\item[$I_i$]      is the moment of inertia of the $i$th transformed cross section at $x$,
\item[$A_i$]      is the transformed area at the $i$th transformed cross section at $x$,
\item[$G_i$]      is the shear modulus of the $i$th transformed cross section at $x$,
\item[$\Delta_x$] is the increment at which calculations are performed,
\item[$n$]        is the total number of increments along the beam length.
\end{itemize}

\end{document} • I like your second suggestion of setting out, thanks. Is there a way I could get the first and last line of the \begin{itemize} to be automatically generated and then just change the widest=$M_x$ value?. Maybe a new command or macro type of thing? Still kind of new to this. – Aaron Rhodes May 22 at 12:56
• Or perhaps when I type \begin{equation} it produces something like this: imgur.com/ooLgCdB . If you could just point me to a similar question somewhere else that would be perfect. – Aaron Rhodes May 22 at 13:08
• @AaronRhodes What's the problem if a dumb editor underlines keywords? – egreg May 22 at 13:49
• I'm not sure I know what you mean? – Aaron Rhodes May 22 at 13:56
• @AaronRhodes The picture shows the editor's window. Those red underlines have no consequence on TeX, or do they? – egreg May 22 at 16:25

There is an indent on the line where the conditions environment begins. In your example, the conditions environment is defined as

\newenvironment{conditions}[where:]
{%
#1\tabularx{\textwidth-\widthof{#1}}[t]{
>{$}l<{$} @{${}={}$} X@{}
}%
}
{\endtabularx\\[\belowdisplayskip]}


So when the conditions environment is called with the default value where: for its optional argument, "where:" is written, and a tabularx environment begins. The width of this tabularx is defined to be \textwidth minus the width of "where:". Hence, the indent at the beginning of the line is not taken into account in the width of the tabularx: as you can see on your on your picture, the extra width on the parameters description matches the length of an indent. So just adding \noindent right before the conditions environment will solve the spacing issue.

Also, the tabularx environment called by conditions already places the first column in math mode, so you should not place manually the content of every cell between \$.