我正在使用counter-format=se.qu.
以下输出来回答我的问题
在我的例子中,我想隐藏解决方案中的计数器(这样我只能得到解决方案。没有 3.1),但我想避免在每个解决方案的前面和后面分别写\SetupExSheets{counter-format=}
和。我尝试将这两个命令包含在和属性中,但没有任何变化。\SetupExSheets{counter-format=se.qu.}
pre-hook
post-hook
您将如何隐藏解决方案中的计数器?
平均能量损失
\documentclass{article}
\usepackage{exsheets}
\SetupExSheets{
counter-format=se.qu.,
headings=block-subtitle,
solution/print=true
}
\begin{document}
\begin{question}[name=Custom problem,subtitle=Cauchy product]
Question with fancy math.
\end{question}
\begin{solution}[name=Custom solution.]
A difficult solution.
\end{solution}
\end{document}
答案1
我将使用一个单独的headings
实例来表示不打印数字的解决方案:
\documentclass{article}
\usepackage{exsheets}
\DeclareInstance{exsheets-heading}{block-no-nr}{default}{
attach = {
main[l,vc]title[l,vc](0pt,0pt) ;
main[r,vc]points[l,vc](\marginparsep,0pt)
}
}
\RenewQuSolPair
{question}[headings=block-subtitle]
{solution}[headings=block-no-nr]
\SetupExSheets{
counter-format=se.qu.,
solution/print=true ,
question/name=Custom problem ,
solution/name=Custom solution.
}
\begin{document}
\begin{question}[subtitle=Cauchy product]
Question with fancy math.
\end{question}
\begin{solution}
A difficult solution.
\end{solution}
\end{document}
答案2
你可以按照你想要的方式做 -通过重新定义和环境counter-format
,对问题和解决方案使用不同的方法:question
solution
\documentclass{article}
\usepackage{exsheets}
\SetupExSheets{
%counter-format=se.qu.,
headings=block-subtitle,
solution/print=true
}
\let\oldquestion\question
\let\oldsolution\solution
\renewenvironment{question}{%
\SetupExSheets{counter-format=se.qu.}
\oldquestion
}
\renewenvironment{solution}{%
\SetupExSheets{counter-format=}
\oldsolution
}
\begin{document}
\begin{question}[name=Custom problem,subtitle=Cauchy product]
Question with fancy math.
\end{question}
\begin{solution}[name=Custom solution.]
A difficult solution.
\end{solution}
\begin{question}[name=Custom problem,subtitle=Something else]
Question with no math.
\end{question}
\begin{solution}[name=Custom solution.]
A simple solution.
\end{solution}
\end{document}