我试过
\documentclass[10pt]{amsbook}
\usepackage[francais,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsthm}
\usepackage{xparse}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@thm}{\thm@headfont{\scshape}}{\thm@headfont{\scshape\bfseries}}{}{}
\patchcmd{\@thm}{\thm@notefont{\fontseries\mddefault\upshape}}{}{}{}
\usepackage{eufrak}
\usepackage{mathrsfs}
\theoremstyle{plain} %% This is the default, anyway
\newtheorem{thm}[equation]{Theorem}
\counterwithin*{equation}{subsubsection}
\renewcommand{\theequation}{%
\printuptozero{chapter,section,subsection,subsubsection}{equation}%
}
\newtheorem{lem}[equation]{Lemma}
\newtheorem{prop}[equation]{Proposition}
\ExplSyntaxOn
\NewExpandableDocumentCommand{\printuptozero}{mm}
{
\clist_map_function:nN { #1 } \ujs_printuptozero:n
\arabic{#2}
}
\cs_new:Nn \ujs_printuptozero:n
{
\int_compare:nTF { \value{#1}>0 } { \arabic{#1}. } { \clist_map_break: }
}
\ExplSyntaxOff
\begin{document}
\chapter{First Chapter}
\section{First Section of First Chapter}
\begin{lem}\label{lemma_s_label}
stuff
\end{lem}
\chapter{Second Chapter}
\section{First Section of Second Chapter}
blah
\section{Second Section of Second Chapter}
blah blah
\begin{prop}
As we saw in \ref{lemma_s_label}
\end{prop}
\end{document}
这使 :
和 :
我本来希望使用类似As we saw in Chap. 1, Section 1, 1.1.1
而不是这样的命令As we saw in 1.1.1
,这没有帮助。有没有办法用 来实现这一点cleveref
,或者使用不与 的使用冲突的其他方法cleveref
?