Problems using QT.cls

I am attempting to use the class file qt.cls, available at the journal's website, but when I try to compile, even just using their example document in TexShop v3.61, I get the error:

and when I go to the spot in the class file where this occurs, it looks like this:

\@ifpackageloaded{amstex}{%
\def\@tempa{TT}%
}{%
\def\@tempb#1 v#2.#3\@nil{#2}%
\ifnum\@xp\@xp\@xp\@tempb\csname ver@amsmath.sty\endcsname v0.0\@nil
<\tw@
\def\@tempa{TT}%
\else
\def\@tempa{TF}%
\fi
}{%
\def\@tempa{TF}
}%
}
\if\@tempa
\fi
\newcommand{\openbox}{\leavevmode
\hbox to.77778em{%
\hfil\vrule
\vbox to.675em{\hrule width.6em\vfil\hrule}%
\vrule\hfil}}
\DeclareRobustCommand{\textsquare}{%
\begingroup \usefont{U}{msa}{m}{n}\thr@@\endgroup
}
\providecommand{\qedsymbol}{\openbox}
\newenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
\itshape
}{%
\popQED\endtrivlist\@endpefalse
}
\providecommand{\proofname}{Proof}


Can anyone figure out what the problem is here? I am a newcomer to the forum, so please feel free to re-tag.

• @barbarabeeton seems they are messing with \[, wasn't \[ made robust by default in a recent amsmath update? Line 1284, right before looking for amstex – daleif May 4 '16 at 20:56
• well, i was mistaken -- the trap for amstex is still in the public version of amsthm, which is embedded in full in this document class, with only minor modifications of a reasonable nature. however, what is shown in your error message isn't an accurate copy of what's in QT.cls that i just downloaded. there should be a closing brace just before \@ifpackageloaded{amstex} and it's missing. that would explain the Paragraph ended error. but there's lots more missing there. i think you have a corrupted QT.cls file. – barbara beeton May 4 '16 at 20:57
• @barbarabeeton where exactly is that brace missing? I seem to have a } right above \@ifpackageloaded{amstex}{%, ahh, no amsmath is even used. Was it the core that made \[ robust? – daleif May 4 '16 at 20:58
• @daleif -- brace missing from line 1286 of the version of QT.cls that i just downloaded, right after the \@nil. there's another problem i spotted: amsthm checks to see if amsmath is loaded, but QT.cls doesn't load amsmath (with \RequirePackage{amsmath}) until after the embedded amsthm. but that wouldn't cause the error as reported. and i don't see \x@protect anywhere in QT.cls, so i don't know how it got into the error report in the log. – barbara beeton May 4 '16 at 21:05
• @daleif: so is the robustness of [ causing an error because there's no closing ] on line 1286? – Jim Conant May 4 '16 at 21:11

Second it has everything to do with the QT.cls file. There are several \RequirePackage lines around line 1339. Copy all of those lines and duplicate them just after the \ProcessOptions line at line 130. You can then remove the original lines if you wish. The example file compiles fine afterward.
I followed daleif's idea and commented out the line \expandafter\@tempa\[\@nil from the qt.cls class file. It seems to compile normally now.