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

Add option to add labels to table #2

Open
djvanderlaan opened this issue Jul 10, 2021 · 4 comments
Open

Add option to add labels to table #2

djvanderlaan opened this issue Jul 10, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@djvanderlaan
Copy link
Owner

Perhaps if omitted and the code-block has an id and the table has a caption, use the id of the code-block.

When the table has no caption the function should give a warning and ignore the request to add a label.

@djvanderlaan djvanderlaan added the enhancement New feature or request label Jul 10, 2021
@djvanderlaan
Copy link
Owner Author

This is something that is not supported yet in pandoc markdown. It is not possible to add an id (and classes etc) to tables. Will keer this open for now in case pandoc fixes this.

@emeralit
Copy link

emeralit commented Dec 24, 2021

With pandoc-crossref filter adding to the caption {#tbl:label} is enough.

@djvanderlaan
Copy link
Owner Author

Thanks. I know. However, as far as I know it doesn't come standard with the default pandoc installation. That's why I didn't yet include it. Perhaps I could add the option and add in the documentation that this feature only works with the plugin installed. On the other hand there are workarounds:

```{.R fun=output_table caption="Sample iris {#id}"}
iris[1:5, ]
```

or

: Caption {#id}

```{.R fun=output_table}
iris[1:5, ]
```

Let me know if you think it is better to add this to the package (I don't think I am against it :-) ).

@emeralit
Copy link

I agree, the real issue is as pandoc-crossref manages labels. Please, add the examples to the documentation,
Thanks a lot for your job.

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

No branches or pull requests

2 participants