How to properly add math and refs to captions
skwde opened this issue · comments
Stefan Weber commented
I fail to find out how to properly add math and references to captions.
Unfortunately there is nothing mentioned in the examples.
Following a minimal working example from one of my tries:
doc = Document('basic')
a = Math(data=[
'5',
r'\cdot',
r'10^{4}'
], inline=True, escape=False).dumps_content()
with doc.create(Figure(position='h!')) as fig:
x = [1,2,3,4]
plt.plot(x,x)
fig.add_plot()
fig.add_caption(f"abc ")
tex = doc.dumps()
print(tex)
doc.generate_pdf(clean_tex=True)
So how do I add math to the caption such that it is rendered correctly?
Something similar goes for references.