Document Classessvmonov5.6: reference new theorem environments with cleveref

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

svmonov5.6: reference new theorem environments with cleveref

Post by user49915 »

Consider the input

Code: Select all

\documentclass[envcountsame,envcountsect]{svmono}%%% V 5.6 from http://www.springer.com/gp/authors-editors/book-authors-editors/resources-guidelines/rights-permissions-licensing/manuscript-preparation/5636
%\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.
\usepackage{cleveref}
\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{document}
\chapter{MyChapter}
\section{MySection}
\section{MySubSection}
\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}.
\end{document}
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 http://golatex.de/viewtopic,p,106043.html and http://texwelt.de/wissen/fragen/24620/s ... t-cleveref
Attachments
Result of processing by pdflatex
Result of processing by pdflatex
screenshot.png (40.7 KiB) Viewed 4349 times
Last edited by user49915 on Thu Apr 18, 2019 10:15 pm, edited 5 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

svmonov5.6: reference new theorem environments with cleveref

Post by Johannes_B »

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