conflict between lineno and amsmath packages in TeXLive 2022? Some environments (like \gather) are already defined

Christopher W. Ryan cryan at binghamton.edu
Thu Jan 5 18:43:27 CET 2023


I'd been working with MikTex 2.9 on Windows 10 for many years. Figured
it was time to update, plus I needed the latexdiff function that MikTeX
2.9 seemed not to have? At any rate, I switched over to TeXLive 2022.

I'm now encountering significant problems compiling a manuscript with a
journal publisher's template. The template loads a *ton* of packages and
seems rather complex, at least to me.  Based on some investigation
online, I believe the problem stems from the sequence of loading the
amsmath and lineno packages. The publisher's template loads lineno first.

For simplicity, below is a MWE that reproduces the error message I get.
As written, it compiles properly. But switch the order of the two
packages and I get this error:

ERROR: LaTeX Error: Command \gather already defined.

--- TeX said ---
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.1560 }

and a pointer to the section of ams.sty that defines the gather environment.

The log file actually shows numerous errors, all similar, about many
amsmath environments being already defined: align, alignnat, multline,
equation, and all their starred versions too.

Swapping the order of loading those two pacakges in the publisher's .sty
file, to load amsmath first, doesn't help.

I'd be most grateful for any advice.

Thanks.

--Chris Ryan


========== begin MWE ===========

\documentclass{article}

\usepackage{amsmath}
\usepackage{lineno}

\begin{document}

Working Model:

\begin{equation}
\begin{split}
 \log{\frac{P_t}{1-P_t}} &= \beta_1 + \beta_2(GUV_t) +
\beta_3(temperature_t) +  \beta_4(temperature_t^2) + \\
 & \quad \beta_5(GUV_t)(temperature_t) + \beta_6(GUV_t)(temperature_t^2)
+ \nu_t
 \end{split}
 \end{equation}

   \vspace{-3ex}where\vspace{-3ex}

  \begin{align*}
    t &= \mbox{month, numbered sequentially. GUV installed at t = 60} \\
    P_t &= \mbox{proportion of possible student-days missed in month t} \\
    GUV_t &= \mbox{GUV present (1) or absent (0) in month t} \\
    temperature_t &= \mbox{mean temperature in month t} \\
    \nu_t &= \rho\nu_{t - 1} + \epsilon_t \mbox{ and }  \epsilon_t \sim
N(0, \sigma^2_\epsilon)
  \end{align*}

Fit to data, the working model yields the following results:

\begin{equation}   \label{workingmodel}
\begin{split}
 \log{\frac{P_t}{1-P_t}} &= -1.509 + -0.674(GUV_t) +
0.02(temperature_t) +  -0.003(temperature_t^2) + \\
 & \quad -0.012(GUV_t)(temperature_t) +  0.001(GUV_t)(temperature_t^2)
 \end{split}
 \end{equation}

 \end{document}

=========== end MWE ===============


More information about the texhax mailing list.