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

Heading labels #62

Open
Anaphory opened this issue May 20, 2020 · 4 comments
Open

Heading labels #62

Anaphory opened this issue May 20, 2020 · 4 comments
Labels
feature request lua Related to the Lua interface and implementation plaintex Related to the plain TeX interface and implementation

Comments

@Anaphory
Copy link

Anaphory commented May 20, 2020

Currently, \label{}s are only generated for tables and figures, it appears. With headerAttributes=true, headings can get HTML attributes including, according to the examples, of the shape {#foo} which

currently have no effect other than enabling content slicing, see the slice option.

When writing a paper with some of its content in Markdown, it would be very nice to be able to provide internal cross-references to sections. I can, obviously, use mixed mode and provide manual \label{}s, but given that the HTML attribute syntax already exists, is parsed and used for some purpose, wouldn't it make sense to use it (maybe optionally) also for generating heading labels?

@Witiko
Copy link
Owner

Witiko commented May 20, 2020

Currently, \label{}s are only generated for tables and figures, it appears.

Sorry to say that labels are currently not generated at all, not even for tables or figures.

wouldn't it make sense to use it (maybe optionally) also for generating heading labels?

It would be a welcome feature, but I currently do not have the time to implement it.
In June, perhaps, or if someone else is interested in implementing the feature.

@Witiko Witiko added lua Related to the Lua interface and implementation plaintex Related to the plain TeX interface and implementation feature request labels May 20, 2020
@Anaphory
Copy link
Author

Ah. I had just been searching for \label in the technical documentation and

\label{tab:#1}%

in a fitting context made me think that tables got labels, similarly for figures.

@Witiko
Copy link
Owner

Witiko commented May 22, 2020

What I said above was not entirely true. Figures do receive labels with the default LaTeX renderer prototypes: ![an-example](example.png "An example") can be referenced as \ref{fig:an-example}.

Tables do not receive labels: line 16,496 only applies to CSV files specified through content blocks and it does nothing useful, only redefines label tab:csv. Thanks for noticing, I removed the line in 4b516f7.

@TomBener
Copy link

pandoc-crossref is a useful project which provides additional features for cross reference (figure, table, equation and section) in Markdown. So it would be great if markdown package could support the syntax of pandoc-crossref.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request lua Related to the Lua interface and implementation plaintex Related to the plain TeX interface and implementation
Projects
None yet
Development

No branches or pull requests

3 participants