0

I'm trying to use the mnotes package (\usepackage{mnotes}), which is a package for adding comments to the margins that point to text in the document.

but I'm getting this error:

(C:\ProgramsPortable\miktex-portable\texmfs\install\tex/latex/mnotes\mnotes.sty
)
! Incomplete \iffalse; all text was ignored after line 70.
<inserted text>
                \fi

I tried looking at the code in mnotes.sty, but I couldn't see any mismatched \ifs or \fis (as far I can see, though I'm no latex expert).

Turning on "basic" mode allows it to run, but functionality is greatly reduced:

\usepackage[basic]{mnotes}

Any ideas why this error is happening? Is the problem within mnotes or perhaps a dependency?

MD004
  • 1,226
  • it is a bug in mnotes. It uses \newif\ifoddpage and if \ifoddpage is already defined (by loading the ifoddpage package before mnotes) this gives an unbalanced \if / \fi. – Ulrike Fischer Jul 20 '23 at 22:18

1 Answers1

1

I made a MWE to test this issue, and the problem went away! I started adding in lines one-by-one from my original tex file until the issue re-appeared.

MWE with no issues:

\documentclass[dvipsnames]{article}
\usepackage{mnotes}

\begin{document} Hello world \MNOTE{This is an mnote} Goodbye \end{document}

Once I added the line which imports algorithm2e (for pseudocode formatting), then it broke again. But moving the mnotes import to be before algorithm2e fixes the problem (Note: I didn't test whether the pseudocode still works), like so:

\usepackage{mnotes}
\usepackage[linesnumbered,vlined,figure,tworuled]{algorithm2e}

However, back in my original document, I moved the mnotes import to be the first line after \documentclass and my problem still occurrs.

Next I removed ALL the \usepackage lines in my original document and started adding them back in. It broke once I got to \usepackage{ulem}. Even though that package comes after \usepackage{mnotes}, it still conflicts.

Conclusion: mnotes conflicts with other packages, if getting an error, remove other \usepackage lines until it works.

MD004
  • 1,226
  • don't add such info as answer. Edit your question, and put there an non-working example. – Ulrike Fischer Jul 20 '23 at 22:05
  • Thanks. It's fixed now. – MD004 Jul 20 '23 at 22:11
  • This isn't really an answer. We can try to find an answer for your problem so that you can still use ulem, but it would help if you edit your question to include a non-working example. – Teepeemm Jul 20 '23 at 22:16
  • 2
    I'd be wary to use mnotes. In my experiments I found that it doesn't work properly with TeX Live 2017 on. Besides, it uses \hoffset, which is a bad thing. – egreg Jul 20 '23 at 22:45