
Я определил среду в exsheets
package и хочу сослаться на нее с помощью cleveref
package и не могу найти способ. Я пробовал многое и пытался читать руководство 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
также должен быть одним из пакетов, которые загружаются в последнюю очередь, т.е. после 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}