# Blank Line after \myequations

I'm using \myequation, but is being inserted blank line after, what can I do to solve?

Thanks

Example in LaTeX:

%%Preamble
\documentclass[12pt]{report}
\usepackage{amsmath}
%Equations
\usepackage{tocloft}
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\setlength{\cftmyequationsnumwidth}{2.5em}
%%%%%%%%%%%%%%%%%
\begin{document}
\listofmyequations

\chapter{}

$$\label{eq:mlmM} y_i = X_i\beta + Z_i\gamma_i + \varepsilon_i$$
\myequations{Generalized Linear Mixed Models}

$$\begin{cases} \gamma_i \sim N_q(0,\psi)\\ \varepsilon_i \sim N_n(0,\sigma^2\wedge _i) \end{cases}$$\\

\end{document}

• Don't use $$...$$, that is deprecated syntax. Use $...$ instead, Also the \ after $$ is pretty useless – user31729 Feb 11 '17 at 18:20 • In addition, I don't see a blank line – user31729 Feb 11 '17 at 18:24 ## 2 Answers I suggest a different approach. First of all, never use $$ in LaTeX. Second, never have two consecutive displays: use gather or align.

The \myequations command should be, with this code, inside the equation, be it equation, align or gather.

\documentclass[12pt]{report}
\usepackage{amsmath}
\usepackage{tocloft}
\usepackage{etoolbox}
\usepackage{lipsum}

\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\setlength{\cftmyequationsnumwidth}{2.5em}

\makeatletter
\appto{\endequation}{\myequations@hook\gdef\myequations@hook{}}
\appto{\endalign}{\myequations@hook\gdef\myequations@hook{}}
\appto{\endgather}{\myequations@hook\gdef\myequations@hook{}}
\newcommand{\myequations}[1]{%
\ifmeasuring@\else
\gappto\myequations@hook{%
}%
}%
\fi
}
\makeatother

\begin{document}

\listofmyequations

\chapter{Title}

\lipsum*[2]
$$y_i = X_i\beta + Z_i\gamma_i + \varepsilon_i \label{eq:1} \myequations{Attempt}$$
\lipsum*[2]
\begin{gather}
y_i = X_i\beta + Z_i\gamma_i + \varepsilon_i
\label{eq:mlmM}
\myequations{Generalized Linear Mixed Models}
\\
\begin{cases}
\gamma_i \sim N_q(0,\psi)\\
\varepsilon_i \sim N_n(0,\sigma^2\wedge _i)
\notag
\end{cases}
\end{gather}
\lipsum[4]

\end{document}


If I understand you right, you want to remove some white space. But you are inserting it manually using that command.

\newcommand{\myequations}[1]{%

This ends with \par. Just remove that and you have some white space less.