0

I'm gonna typeset a NOT \ll using the method explained here by @Leo Liu.

This code snippet that uses the minimum required packages perfectly works:

\documentclass{article}

\usepackage{centernot}
\usepackage{amsmath}

\begin{document}

\begin{equation}
(\forall \pi_{i},\pi_{j} \in \mathcal{P}) [\pi_{i} \centernot\ll \pi_{j} \wedge \pi_{j} \centernot\ll \pi_{i}].
\end{equation}

\end{document}

But when I use the method in my main file including many other packages, an error is thrown about Missing $ inserted!

\documentclass{article}

\usepackage{graphicx}
\usepackage{mathptmx}
\usepackage{centernot}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage{mathrsfs}
\usepackage{mathtools}
\usepackage{tabularx}
\usepackage{fdsymbol}
\usepackage{rotating}
\usepackage{nth}
\usepackage{array}
\usepackage{makecell}
\usepackage{soul}
\usepackage[normalem]{ulem}
\usepackage{algorithm}
\usepackage{algorithmicx,algpseudocode}
\usepackage[top=2cm, left = 2cm, right = 2cm, bottom = 2cm]{geometry}
\usepackage{stackengine}
\usepackage{braket}

\begin{document}

\begin{equation}
(\forall \pi_{i},\pi_{j} \in \mathcal{P}) [\pi_{i} \centernot\ll \pi_{j} \wedge \pi_{j} \centernot\ll \pi_{i}].    % error is here
\end{equation}

\end{document}

I guess there is a package conflict.

How can I fix this issue?!

Edit 1:

The error:

Missing $ inserted. ...j} \in \mathcal{P}) [\pi_{i} \centernot\ll

Edit 2:

The conflict is with fdsymbol package.

  • Comment out packages until you make the error go away and identify the culprit that way. What else is there to do? I know robotics isn't rocket science, but .... Please provide the complete text of error messages. This will include a line number. Also, try pressing h for more help when you get the error. – cfr Aug 22 '17 at 04:01
  • @cfr: The problem is that I need all of those packages. The question is actually whether or not the issue can be fixed without removing any other packages. –  Aug 22 '17 at 04:04
  • @cfr: The error message and its location are added to the question. –  Aug 22 '17 at 04:06
  • The point is that you can tell us where the conflict is. We don't need a full list of everything you're loading. Find the conflict. See if the packages' manuals address it. If not, post a question about that conflict. This is all anybody can do unless they happen to know off-hand that X and Y conflict. It is just a mechanical diagnostic: you can do it as well or better than anyone else. – cfr Aug 22 '17 at 04:06
  • You can't possibly need to load packages twice. This in itself can cause problems. Also, mathtools loads amsmath, so you cannot possibly need both of those. tikz also loads graphicx, though there's more of a case for listing both if you want to remind yourself or something. – cfr Aug 22 '17 at 04:08
  • @cfr: Please find edit 2. –  Aug 22 '17 at 04:23
  • 1
    centernot clash with fdsymbol. instead \centernot\ll try if \nll from fdsymbol gives satisfactory result for you and if, removecenternot package from preamble. – Zarko Aug 22 '17 at 04:33
  • @Zarko: Thanks in advance. \nll saved me, and I completely got rid of fdsymbol. Your helpful comment is really an answer. If you add an answer, I can accept it. –  Aug 22 '17 at 04:41

2 Answers2

1

Package fdsymbol provides a wide range of symbols, in which many negated symbols from amssymb are available. Thus, package centernot is actually superfluous, and the clash will also be resolved.

I suggest using \nll from package fdsymbol instead of \centernot\ll.

Zarko
  • 296,517
0

Package centernot assumes the original \not, which is a simple relational symbol. Package fdsymbol redefines \not as macro with one argument.

The patch in the following example redefines \@centernot to allow \not being a macro with one argument:

\documentclass{article}

\usepackage{centernot}
\usepackage{fdsymbol}

% Patch centernot to support \not as macro with argument.
\usepackage{etoolbox}
\makeatletter
\patchcmd\@centernot{\not}{\not{\hphantom{=}}}{}{%
  \errmessage{Patching \noexpand\@centernot failed.}%
}
\makeatother

\begin{document}
  \begin{equation}
    (\forall \pi_{i},\pi_{j} \in \mathcal{P}) [\pi_{i} \centernot\ll \pi_{j}
    \wedge \pi_{j} \centernot\ll \pi_{i}].
  \end{equation}
\end{document}

Result

Of course, using a real negated symbol as \nll of package fdsymbol as in Zarko's answer is the preferred solution.

Heiko Oberdiek
  • 271,626