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

Sections/Parts custom cross-reference #8080

Open
mcanouil opened this issue Jan 1, 2024 · 3 comments
Open

Sections/Parts custom cross-reference #8080

mcanouil opened this issue Jan 1, 2024 · 3 comments
Assignees
Labels
crossref enhancement New feature or request
Milestone

Comments

@mcanouil
Copy link
Collaborator

mcanouil commented Jan 1, 2024

Currently it is not possible to define custom cross-reference for sections.

Initially from #4581 (reply in thread)

---
title: "My Paper"
format: html
crossref:
  custom:
    - kind: float
      key: suppsec
      reference-prefix: Supplement
---

To keep this paper short, see @suppsec-details for more details.
For even more information, see @suppsec-information.

## Details {#suppsec-details .appendix}

Here are fascinating tidbits.

## Information {#suppsec-information .appendix}

Even more fascinating tidbits!
@mcanouil mcanouil added enhancement New feature or request crossref triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. labels Jan 1, 2024
@mcanouil
Copy link
Collaborator Author

mcanouil commented Jan 1, 2024

Possibly to be added to:

@maia-sh
Copy link

maia-sh commented Jan 2, 2024

Thanks for opening this issue for the use-case I brought up. Sharing one more detail on my planned use, in case it's helpful in the development. In addition to being able to custom cross-ref sections/parts (e.g., Supplement 1) and divs/figures/tables (e.g., Supplemental Table 1), I would like to be able to cross-ref divs/figures/tables within sections/parts (e.g., S1 Table 1, S1 Table 2, S2 Figure 1). Once there is sections/parts custom cross-ref, I believe I can accomplish this by making custom divs/figures/tables types for each section/part, but flagging it now in case there is a better way to integrate this. Here's what I have in mind

---
title: "My Paper"
format: html
crossref:
  custom:
    - kind: float
      key: suppsec
      reference-prefix: Supplement
  custom:
    - kind: float
      key: suppfigdetails
      latex-env: suppfigdetails
      reference-prefix: Figure
      space-before-numbering: true
      latex-list-of-description: Supplemental Figure
  custom:
    - kind: float
      key: suppfiginfo
      latex-env: suppfiginfo
      reference-prefix: Figure
      space-before-numbering: true
      latex-list-of-description: Supplemental Figure
---

To keep this paper short, see @suppsec-details for more details. For a visual representation, see [S@suppsec-details] @suppfigdetails-tidbits.
For even more information, see @suppsec-information. For a visual representation, see [S@suppsec-information] @suppfiginfo-fascination.

## Details {#suppsec-details .appendix}

Here are fascinating tidbits.

![Tidbits](details-image.png){#suppfigdetails-tidbits}

## Information {#suppsec-information .appendix}

Even more fascinating tidbits!

![Fascination](details-image.png){#suppfiginfo-fascination}

@cscheid
Copy link
Collaborator

cscheid commented Jan 2, 2024

A few comments.

A section wouldn't be a "float"; floats are blocks that can be repositioned in the resulting layout (think "LaTeX" figures). Currently, the only custom crossreference types that can be created are floats. Section crossrefs are what we (will) call "anchor crossrefs": they reference only a position in the document, and have otherwise no content associated with it. IT would be good to be able to customize them, but it's another big change in our crossref system. We would like to support it, but it won't happen in the near future.

@cscheid cscheid added this to the Future milestone Jan 2, 2024
@cscheid cscheid removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crossref enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants