When using both hyperref and fleqn, I am getting some extra vertical space above numbered equations. This issue is I believe a known bug in hyperref and has already been discussed at
- fleqn document class option, long text lines, and hyperref package
- Hyperref adds vertical space to equation environment
but I have not been able to successfully apply the workarounds given there to my specific problem, and that is what I could use some help with. Here's a MnWE:
\documentclass[fleqn]{report}
\usepackage{hyperref}
\usepackage{amsmath}
\newcommand{\question}[4]{
\par \noindent \textbf{\ignorespaces#2}
\nopagebreak[2]
\vspace{10pt}
\par \noindent \ignorespaces#3 \textit{\ignorespaces#4}
\vspace{20pt}
}
\begin{document}
\question{default}{
A question whose answer is an equation*.
}{
\begin{equation*} \frac{x}{(1-x)^2} \end{equation*}
}{}
\question{default}{
A question whose answer is an equation.
}{
\begin{equation} \frac{x}{(1-x)^2} \end{equation}
}{}
\question{default}{
A question whose answer is plain old text.
}{
The answer.
}{}
\end{document}
Some Background
I have a collection of notes in question-answer format. I like to review them by covering the (printed) notes with a sheet of paper and moving that paper down until I can see only the question. At this point I try to remember the answer, and I once I think I've got it, I move the sheet down further to reveal the answer.
Until recently the tex file containing this was something of a mess, so I decided to try writing the macro you see above. If my macro is completely wrong, let me know and I'll open a separate question on how to do that properly.

