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

Automatic Link Text Generation in Referencing does not print in PDFs #21

Open
Marioheld opened this issue Jun 25, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@Marioheld
Copy link

I am trying to use this plugin to reference figures and tables while automating the numbering.
This also works without any problems in the website output.
However, it does not work in combination with the mkdocs-with-pdf plugin to export a PDF. Manually set link texts are displayed, but not the automatically generated ones.

Figure: Caption Text { #fig_id1 }

![](assets/demo.png)

See [Figure](#fig_id1) above for more details.

image

The example above does work both on the website and the PDF.

Figure: Caption Text { #fig_id2 }

![](assets/demo.png)

See [](#fig_id2) above for more details.

image

The example above does only work on the Website, but not in the PDF.

I am using Version 0.9.3 of the plugin mkdocs-with-pdf

Thanks a lot for any help.

@tobiasah
Copy link
Owner

thanks for bringing this up. I am not using the mkdocs-with-pdf plugin myself, so I was not aware of this issue.

I quickly tried to reproduce it, and I could see the same problem. From what I can see, it is a problem of priorities. Both plugins implement the on_post_page callback. Apparently, it is crucial that the mkdocs-caption one is called first.

A temporary fix would be to ensure this manually by first declaring the mkdocs-caption plugin and then the mkdocs-with-pdf

plugins:
  caption: {}
  with-pdf: {}

Can you verify if that indeed fixes the issue for you?

If that solves the problem, I will see if I can juggle the priorities around to ensure this happens automatically.

@tobiasah tobiasah self-assigned this Jun 25, 2024
@tobiasah tobiasah added the bug Something isn't working label Jun 25, 2024
@Marioheld
Copy link
Author

Thank you a lot for your help.
It does indeed work when changing the order of the plugins.
I thought the order would not be relevant, but thats not the case.

@tobiasah
Copy link
Owner

I'm happy to hear that. I will put it on my agenda to look into it and see what priority is best suited. Getting the priorities right is kind of like winning the lottery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants