我有一组图形,我希望能够引用每个图形,而无需对其描述进行硬编码。\combination
命令允许通过设置来设置自动标签(a,b,c)\combination[alternative=label]
。但如何访问组合中的每个图形对我来说仍然是个谜。
以下是一个例子:
\starttext
\startchapter[reference=blah,referenceprefix=blah,title={Hei}]
Hello world
\startplacefigure[location=here, reference=test, title={descr}]
\startcombination[nx=2, ny=1, alternative=label]
{ \externalfigure[IMG_0001.jpg][width=5cm] }
{ \externalfigure[IMG_0001.jpg][width=5cm] }
\stopcombination
\stopplacefigure
\stopchapter
\startchapter[reference=blah1, title={Hei2}]
Chapter \in[blah]
Figure \in[test]
Figure by prefix \in[blah:test]
I want access of the following kind: \in[blah:test:a]
\stopchapter
\stoptext
因此,如果能自动设置引用名称或至少能够手动设置引用,那就太好了。我尝试了以下方法,但不起作用:
\starttext
\startchapter[reference=blah,referenceprefix=blah,title={Hei}]
Hello world
\startplacefigure[location=here, reference=test, title={descr}]
\startcombination[nx=2, ny=1, alternative=label]
{ \externalfigure[IMG_0001.jpg][width=5cm, reference=a] }
{ \externalfigure[IMG_0001.jpg][width=5cm, reference=b] }
\stopcombination
\stopplacefigure
\stopchapter
\startchapter[reference=blah1, title={Hei2}]
Figure by prefix \in[a]
\stopchapter
\stoptext
实际上,这种方法并不好,因为我必须想出独特的图像标签。所以更好的方法是使用自动引用(不起作用目前为止)。尽管根据线,手动引用前缀有效,当我设置referenceprefix
为时它在这里崩溃\startplacefigure
:
\starttext
\startchapter[reference=blah,referenceprefix=blah,title={Hei}]
Hello world
\startplacefigure[location=here, reference=test, referenceprefix=test, title={descr}]
\startcombination[nx=2, ny=1, alternative=label]
{ \externalfigure[IMG_0001.jpg][width=5cm, reference=a] }
{ \externalfigure[IMG_0001.jpg][width=5cm, reference=b] }
\stopcombination
\stopplacefigure
\stopchapter
\startchapter[reference=blah1, title={Hei2}]
Figure \in[test] -- crashes. Gives ?? in the output.
Figure by prefix \in[blah:test:a] -- consequently doesn't work as well.
\stopchapter
\stoptext
我认为这个工作流程很直观,但也许至少还有其他方法或解决方法。目前,唯一的出路是删除alternative=label
,在组合中手动标记字母 a、b、c:
{\externalfigure[IMG_0001.jpg]} {a}
然后通过父标签引用它,如:\in[test, left=(Fig.~, right=]a)
。可以设置自己的引用命令,但这不是重点。
谢谢你的支持!