slatex / sTeX

A semantic Extension of TeX/LaTeX
50 stars 9 forks source link

make stexthm.sty work with llncs.cls #417

Closed kohlhase closed 8 months ago

kohlhase commented 8 months ago

I would like to use stexthm.sty together with llncs.cls but I get errors:

(/Users/kohlhase/localmh/ext/sTeX/tex/etc/stexthm.sty
(/usr/local/texlive/2023/texmf-dist/tex/latex/amscls/amsthm.sty

! LaTeX Error: Command \proof already defined.
               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.440 }

) (/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/thmtools.sty
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/thm-patch.sty
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/parseargs.sty))
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/thm-kv.sty)
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/thm-autoref.sty
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/aliasctr.sty))
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/thm-listof.sty)
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/thm-restate.sty)
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/thm-amsthm.sty)
(/usr/local/texlive/2023/texmf-dist/tex/latex/thmtools/thm-llncs.sty

Package thmtools Warning: LLNCS support disables automatic casing of theorem names .

))

! LaTeX Error: Command \c@observation already defined.
               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.25 ...n{observation}{sibling=theorem}{assertion}

)

I know that this probably means some special-casing, ... but sTeX wants to be compatible with everything.

Jazzpirate commented 8 months ago

This is contradictory. stexthm's whole point is that it defines standard math environments (theorem, definition, proof, etc) and patches the s*-environments to use those. llncs already defines such environments.

The fact that certain document classes such as llncs predefine these environments is the precise reason why stexthm is a separate package in the first place, so that one can omit it if one needs to use a package/class that already defines such environments ;)

kohlhase commented 8 months ago

Do you have a working example with llncs.cls?

Jazzpirate commented 8 months ago

https://gl.mathhub.info/Papers/22-CICM-Injecting-Formal-Mathematics/-/blob/main/source/highlights.tex?ref_type=heads

the tl;dr is this part:

\stexstyledefinition{\begin{definition}}{\end{definition}}
\stexstyleassertion[theorem]{\begin{theorem}}{\end{theorem}}

(to be extended by the desired list of amsthm-environments. Apparently "observation" is another one?)

kohlhase commented 8 months ago

thanks a lot, this helps