Skip to content

How to properly add math and refs to captions #358

@skwde

Description

@skwde

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions