
パッケージ内に環境を定義し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}