2

I would like to be able to set the vertical spacing around an align environment globally. The aim would be to have the same space above and below the equations in the align environment, regardless of the spacing the equation takes up. I would like for the spacing to always be the same, but I believe this will take some work to make a global option (either in a cls file or the preamble is fine with me).

A MWE example follows where equation 1 has different space above and below. Also equations 2 and 3 have different spacing as a whole than equations 4 and 5. I would like for all of the red lines (added to picture for clarity) to be the same length. Red Lines Should be Equal in Length

\documentclass{article}
\usepackage{mathtools}

\usepackage{setspace}

\begin{document}
\doublespace
asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf alkdfj;lasdfiwe;q  a;sdljf; asknvc covhoienr asldkfj as;ldkjf a;lkdsfj a;sdljf; lsdkjf alkdfj;lasdfiwe;q  a;sdljf; asknvc covhoienr asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf alkdfj;lasdfiwe;q  a;sdljf; asknvc covhoienr 
\begin{align}
Pr(X^* = x^*, Y^* = y^* &| X=x, Y=y, C =c) \nonumber \\
    &= \sum_{y=0}^{y=1} \sum_{x=0}^{x=1} 
          Pr(y^*|y)Pr(x^*|x)Pr(y|x,c)Pr(x|c) \label{eq:Likelihood_Ind_ND},
\end{align}
asldkfj as;ldkjf a;lkdsfj asldkfj  a;sdljf; asknvc covhoienr asldkfj as;ldkjf a;lkdsfj lasdfiwe;q  a;sdljf; asknvc covhoienr asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf alkdfj;lasdfiwe;q  a;sdljf; 

asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf alkdfj;lasdfiwe;q  a;sdljf; asknvc covhoienr asldkfj as;ldkjf a;lkdsdkjf alkdfj;lasdfiwe;q  a;sdljf; asknvc covhoienr asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf alkdfj;lasdfiwe;q  a;sdljf; 
\begin{align}
  \!y^*|y &\sim \text{Bern}(y S_y + (1-y)(1-C_y)) \\
  \!x^*|x &\sim \text{Bern}(x S_x + (1-x)(1-C_x)).
\end{align}
asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf  a;sdljf; asknvc covhoienr asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf  asldkfj as;ldkjf  alsdkjf alkdfj;lasdfiwe;q  a;sdljf; 
\begin{align}
  L_m &= \prod_{i=1}^{n_m} \left\{ \sum_{y_i=0}^{y_i=1} \sum_{x_i=0}^{x_i=1} 
          Pr(y_i^*|y_i)Pr(x_i^*|x_i)Pr(y_i|x_i,c_{iy})Pr(x_i|c_{ix}) \right\}\\
  L_v &= \prod_{j=1}^{n_v} \left\{
          Pr(y_j^*|y_j)Pr(x_j^*|x_j)Pr(y_j|x_j,c_{jy})Pr(x_j|c_{jx}) \right\}
\end{align}
asknvc covhoienr asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf alkdfj;lasdfiwe;q  a;sdljf; asknvc covhoienr asldkfj as;ldkjf a;lkdsfj asldkfj alsdkjf alkdfj;lasdfiwe;q  a;sdljf; asknvc covhoienr 
\end{document}
  • I'm not sure if I understood. But you can do something locally with \\[1em] for example, or some other value. – Sigur Apr 21 '18 at 17:34
  • The problem is not within the align environment so I don't think that will work. And, I have 100pages with equations on almost every page... to do this locally would be a pain. – trineebell Apr 21 '18 at 17:48
  • @Sigur I added another example that I hope helps to explain the issue. This is my first posting so I am not sure how to show the compiled version in my question; I only know how to show the code. – trineebell Apr 21 '18 at 18:24
  • 1
    \doublespace should be \doublespacing – David Carlisle Apr 21 '18 at 19:50
  • 1
    note tex is mostly trying to preserve or specify baseline-to-baseline space so the red lines in your image are the wrong place, the equations \hat{x}=2 and x=2 would normally be placed at the same place as tex sets the space to the baseline, the fact that the hat makes one equation taller doesn't mean that it is set lower, but if you draw a red line from the top of the hat to the previous paragraph it will be shorter than the red line to the equation without a hat. – David Carlisle Sep 6 '18 at 20:06

Your Answer

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

Browse other questions tagged or ask your own question.