Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to properly add math and refs to captions #358

Open
skwde opened this issue Oct 10, 2022 · 0 comments
Open

How to properly add math and refs to captions #358

skwde opened this issue Oct 10, 2022 · 0 comments

Comments

@skwde
Copy link

skwde commented Oct 10, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant