cleveref を使用してユーザー定義の exsheets 環境を参照する方法

cleveref を使用してユーザー定義の exsheets 環境を参照する方法

パッケージ内に環境を定義しexsheets、パッケージを使用してそれを引用したいのですcleverefが、方法が見つかりません。いろいろ試し、exsheetsマニュアルを読もうとしました。検索もしました。マニュアルやインターネットに解決策があるかもしれませんが、見つけられませんでした。助けが必要です。

以下は、説明不要と思われるコード(動作しません)です。

\documentclass[12pt]{book}
\usepackage{graphicx}
\usepackage{cleveref}
\usepackage{exsheets}
\NewQuSolPair{example}[name=Example,headings=runin]{egsolution}[name=Solution,print=true,headings=runin]
\begin{document}
\chapter{Sample chapter}
This is some text.
\begin{example}\label{ex:test}
  This is some example.
\end{example}
\begin{egsolution}
  This is the solution.
\end{egsolution}
This is some example \cref{ex:test}

\end{document}

答え1

パッケージexsheetsでは、まだ別のカウンターの使用は許可されていませんquestion(私が知る限りでは、@clemens に変更を依頼しましたが ;-))

しかし、cleverefラベルの種類が分からないquestionので、

\crefname{question}{question}{questions}大文字の変形

\Crefname{question}{Question}{Questions}後で定義する必要があります。

cleverefまた、最後にロードされるパッケージの 1 つである必要があります (つまり、後exsheetsなど)。

\documentclass[12pt]{book}
\usepackage{graphicx}
\usepackage{exsheets}
\usepackage{cleveref}
\NewQuSolPair{example}[name=Example,headings=runin]{egsolution}[name=Solution,print=true,headings=runin]
\crefname{question}{question}{questions}
\Crefname{question}{Question}{Questions}
\begin{document}
\chapter{Sample chapter}
This is some text.
\begin{example}\label{ex:test}
  This is some example.
\end{example}
\begin{egsolution}
  This is the solution.
\end{egsolution}


This is some example \cref{ex:test}. \Cref{ex:test} shows that ...

\end{document}

関連情報