3

Apologies if this has already been answered, but I couldn't find this particular problem anywhere.

After a displayed math environment, there is a tiny indentation that I cannot seem to get rid of no matter what I try to do. For example, this code:

language, and defined in~\Cref{fig:semanticsEnv,fig:semantics}. The judgment
takes the form
\[
   Judgement
\]
where $\Sigma : TermVar -> Exp$ is an environment mapping term variables to
expressions and is what we use to allow us to deal with function

produces the following output:

enter image description here

Out of desperation, I have also tried adding a \noindent but with the exact same output.

The part that really confuses me is that it isn't even enough indentation for a paragraph, so it seems like something to do with the spacing/text-packing algorithm..

Any help would be very much appreciated.

Edit 1:

I have managed to work around the problem, but I don't understand why it works...

I checked for and made sure there weren't any whitespace characters after the \] but the space still remained. However, once I put the 'where' on the same line as the end of the \]: \]where.. the space disappeared. i.e., the following gets rid of the weird indentation:

language, and defined in~\Cref{fig:semanticsEnv,fig:semantics}. The judgment
takes the form
\[
   Judgement
\]where $\Sigma : TermVar -> Exp$ is an environment mapping term variables to
expressions and is what we use to allow us to deal with function

Edit 2 (with a somewhat compilable example):

It appears as though this is an issue caused either by the particular (non-standard) class that I'm using, or by the interaction of that class with the amsmath package.

Here is a minimal compilable example (using pdflatex). Although you'll need the JFP class (along with possible supporting files all of which can be found here.)

It appears as though this only happens when the \RequirePackage{amsmath} line is present.

Here's the example:

\NeedsTeXFormat{LaTeX2e}
\RequirePackage{amsmath}
\documentclass{./styles/jfp1}

\title{Test}
\author[foo]
{FOO}

\begin{document}

\section{No Indentation Afterwards}
\lipsum[1]
\[
Math
\]where \lipsum[1]

\section{Indentation Afterwards}
\lipsum[1]
\[
Math
\]
where \lipsum[1]

\end{document}
  • Delete the line break (all whitespaces, resp.) between \] and "where". A cleaner solution would be to use AmsMath the equation* environment. – Lupino Dec 20 '17 at 14:08
  • I've checked for trailing whitespace, and made sure that there isn't any whitespace between the \] and "where" but sadly the space persists :( Also just tried using the equation* environment as well, but sadly that doesn't change anything either – Tim Dec 20 '17 at 14:15
  • 3
    @TimZakian Please, post a complete compilable example. – Manuel Dec 20 '17 at 14:29
  • 2
    This is clearly a space that kicks in, but the standard \[...\] doesn't produce it. The only possibility is that you (or the class/template you're using) modified the definition for \]. – egreg Dec 20 '17 at 14:40
  • @egreg That appears to be the case. I'm using a non-standard class, but once I tried it out in the article class it all seemed to work fine. I've added a minimal compilable example above in case anyone is interested. – Tim Dec 20 '17 at 15:26
7

The jfp1 class does

\@namedef{equation*}{$$}
\@namedef{endequation*}{$$}

which is quite incorrect.1

Loading amsmath with \RequirePackage is not the solution.

\documentclass{jfp1}

% fix the class's abominable definitions
\expandafter\let\csname equation*\endcsname\relax
\expandafter\let\csname endequation*\endcsname\relax
%% end fix

\usepackage{amsmath}

\usepackage{lipsum}

\title{Test}
\author[foo]{FOO}

\begin{document}

\section{No Indentation Afterwards}
\lipsum[1]
\[
Math
\]where \lipsum[1]

\section{Indentation Afterwards}
\lipsum[1]
\[
Math
\]
where \lipsum[1]

\end{document}

1An abomination, to be precise.


What should the class do? Easy:

\AtBeginDocument{%
  \@ifpackageloaded{amsmath}
    {}% do nothing, equation* is already available
    {\newenvironment{equation*}{\displaymath}{\enddisplaymath}}%
}

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.