LaTeX forum ⇒ Document Classessvmonov5.6: reference new theorem environments with cleveref

Information and discussion about specific document classes and how to create your own document classes.
Posts: 79
Joined: Wed Apr 17, 2019 12:51 pm

svmonov5.6: reference new theorem environments with cleveref

Postby user49915 » Thu Apr 18, 2019 8:29 pm

Consider the input

\documentclass[envcountsame,envcountsect]{svmono}%%% V 5.6 from
%\def\defAndThmname{Definition und Theorem}\makeatletter\spn@wtheorem{defAndThm}{Definition und Theorem}{\bfseries}{\itshape}\makeatother%%% One way which doesn't work
\spnewtheorem{defAndThm}[theorem]{Definition und Theorem}{\bfseries}{\itshape}%%% Another way which doesn't work.
\crefname{defAndThm}{Def.\ und Thm.}{Defn.\ und Thme.}%%% This is all German; the actual language doesn't matter (yet).
\Crefname{defAndThm}{Definition und Theorem}{Definitionen und Theoreme}
\begin{theorem}[My Theorem]1+1=2\end{theorem}
\begin{defAndThm}[My Definition and Theorem]\label{defAndThm:MyTheorem}A \emph{white} number is any number equaling its square. All white numbers \(x\) satisfy \(x(x-1)=0\).\end{defAndThm}
Let's reference it: \cref{defAndThm:MyTheorem}.

The output is attached. Its last line is

Let's reference it: theorem 1.2.2.

But it better be

Let's reference it: Def. und Thm. 1.2.2.

How to get it with `\cref` from `cleveref` automatically?

Loading `ntheorem` is unfortunately a no-go (way too antique, way too many bugs). Loading `amsthm` ist also opposed to, especially if you wish to explicitly typeset your own QED symbols that depend on the enclosing environments. In any case, my attempts to solve the problem with any of the two packages failed.

The same question has been opened at,p,106043.html and ... t-cleveref
Result of processing by pdflatex
screenshot.png (40.7 KiB) Viewed 1970 times
Last edited by user49915 on Thu Apr 18, 2019 10:15 pm, edited 5 times in total.

User avatar
Site Moderator
Posts: 4185
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Apr 18, 2019 8:53 pm

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 1 guest