1

As the title says, when I add an extra pair of {} brackets to the equation environment (on the outside), it adds a whitespace about the width of a space to the next line. Adding \noindent to the next line does not remove the space. Really I was trying to localize the scope of \medmuskip=3mu to the single equation with the brackets (see code below), which seems to have worked, but the whitespace is annoying me.

\documentclass[12pt]{report}
\begin{document}
\noindent Paragraph stuff lalala.
{\medmuskip=3mu
\begin{equation}
    Ax=b
\end{equation}}
Hello % there's an extra space before Hello
\end{document}
  • 1
    \noindent won't work because this isn't the start of a new paragraph. \ignorespaces should wprk, but the easiest fix is to add a % after the closing brace, as stated in the answers. – barbara beeton May 26 '17 at 0:53
2

For eliminating white space on beginning of next paragraph add % after curly braces:

\documentclass[12pt]{report}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
{\medmuskip=3mu
\begin{equation}
    Ax=b
\end{equation}
}% <--- added
\lipsum[2]
\end{document}

enter image description here

  • Ah, you deleted and then restored the same answer that I gave.... I'll remove mine since you beat me by three minutes. – JPi May 25 '17 at 23:11
1

The closing bracket seems to start a new paragraph. Add \noindent:

\documentclass[12pt]{report}

\begin{document}

\noindent Paragraph stuff lalala.
{\medmuskip=3mu
\begin{equation}
    Ax=b
\end{equation}}\noindent
Hello % there's an extra space before Hello

\end{document} 
  • hm, it seems that it sufficient to add % e.g.: \end{equation}}%. It not start new paragraph but insert spurious space (of one letter). – Zarko May 25 '17 at 22:22
  • You're right. Actually , adding anything immediately after the bracket works. I'll remove my answer, as it's not the real explanation. Please write your own answer. – Bernard May 25 '17 at 22:26
1

Just set the parameter inside equation:

\documentclass[12pt]{report}

\begin{document}

\noindent Paragraph stuff lalala.
\begin{equation}
\medmuskip=20mu
    Ax=b+c
\end{equation}
Hello

\noindent Paragraph stuff lalala.
\begin{equation}
    Ax=b+c
\end{equation}
Hello

\end{document}

enter image description here

This wouldn't work with amsmath alignments; here's a workaround: the optional argument to local must be assignments, the mandatory argument is the environment to use internally.

\documentclass[12pt]{report}
\usepackage{amsmath,xparse}

\NewDocumentEnvironment{local}{O{}m}
 {#1\csname #2\endcsname}
 {\csname end#2\endcsname\ignorespacesafterend}

\begin{document}

\noindent Paragraph stuff lalala.
\begin{local}[\medmuskip=20mu]{equation}
    Ax=b+c
\end{local}
Hello

\noindent Paragraph stuff lalala.
\begin{local}[\medmuskip=20mu]{align}
    Ax&=b+c\\
    Bx&=d
\end{local}
Hello

\noindent Paragraph stuff lalala.
\begin{align}
    Ax&=b+c\\
    Bx&=d
\end{align}
Hello

\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.