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.
user49915
Posts: 39
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

  1. \documentclass[envcountsame,envcountsect]{svmono}%%% V 5.6 from <!-- m --><a class="postlink" href="http://www.springer.com/gp/authors-editors/book-authors-editors/resources-guidelines/rights-permissions-licensing/manuscript-preparation/5636">http://www.springer.com/gp/authors-edit ... ation/5636</a><!-- m -->
  2. %\def\defAndThmname{Definition und Theorem}\makeatletter\spn@wtheorem{defAndThm}{Definition und Theorem}{\bfseries}{\itshape}\makeatother%%% One way which doesn't work
  3. \spnewtheorem{defAndThm}[theorem]{Definition und Theorem}{\bfseries}{\itshape}%%% Another way which doesn't work.
  4. \usepackage{cleveref}
  5. \crefname{defAndThm}{Def.\ und Thm.}{Defn.\ und Thme.}%%% This is all German; the actual language doesn't matter (yet).
  6. \Crefname{defAndThm}{Definition und Theorem}{Definitionen und Theoreme}
  7. \begin{document}
  8. \chapter{MyChapter}
  9. \section{MySection}
  10. \section{MySubSection}
  11. \begin{theorem}[My Theorem]1+1=2\end{theorem}
  12. \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}
  13. Let's reference it: \cref{defAndThm:MyTheorem}.
  14. \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
screenshot.png
Result of processing by pdflatex
screenshot.png (40.7 KiB) Viewed 245 times
Last edited by user49915 on Thu Apr 18, 2019 10:15 pm, edited 5 times in total.

User avatar
Johannes_B
Site Moderator
Posts: 4044
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: Baidu [Spider] and 4 guests