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

Option for parentheses around equation numbers reference in addition to eq-prefix #2439

Open
Tracked by #4944
cderv opened this issue Sep 14, 2022 Discussed in #2413 · 2 comments
Open
Tracked by #4944

Option for parentheses around equation numbers reference in addition to eq-prefix #2439

cderv opened this issue Sep 14, 2022 Discussed in #2413 · 2 comments
Assignees
Labels
crossref enhancement New feature or request math any issue related to math support in specific formats
Milestone

Comments

@cderv
Copy link
Collaborator

cderv commented Sep 14, 2022

Discussed in #2413

Originally posted by jordan-melendez September 12, 2022
In certain journals it is common to format references to equations like Eq. (1.1) with parentheses around the equation number. Quarto supports modifying Eq. with eq-prefix, but would it be possible to either

  1. Add a parameter similar to eq-prefix that allows one to customize the reference further, and/or
  2. Ensure that, when compiled to PDF, \eqref gets used rather than \ref for equation references. This would require amsmath I suppose, but would automatically add parentheses and permit further customization.

Thanks!

@cderv cderv added the enhancement New feature or request label Sep 14, 2022
@cderv cderv added this to the Future milestone Sep 14, 2022
@cderv
Copy link
Collaborator Author

cderv commented Sep 14, 2022

Some notes:

\eqref is defined in amsmath, and seems widely use for referencing equation as it adds the parenthesis (https://en.wikibooks.org/wiki/LaTeX/Labels_and_Cross-referencing#eqref). Maybe we could add an option so that \ref can be replaced by \eqref for equations ?

-- for latex inject a \ref, otherwise format manually
if _quarto.format.isLatexOutput() then
ref:extend({pandoc.RawInline('latex', '\\ref{' .. label .. '}')})

This would be for LaTeX output only, possibly useful in Quarto Journals - Allowing to tweak that through a Lua filter could also be a way to solves this for PDF only.

More generally, support parenthesis around reference for equation in HTML and PDF requires some specific formatting work for HTML outputs.

@cderv cderv added the crossref label Sep 14, 2022
@cscheid cscheid modified the milestones: Future, v1.2 Sep 15, 2022
@cscheid
Copy link
Collaborator

cscheid commented Sep 15, 2022

Re-milestoning it to match the rest of our crossref work (even if we eventually choose to move it to 1.3, this seems like a natural thing for us to support)

@dragonstyle dragonstyle modified the milestones: v1.2, v1.3 Sep 23, 2022
@cscheid cscheid self-assigned this Nov 15, 2022
@cscheid cscheid modified the milestones: v1.3, v1.4 Feb 27, 2023
@cscheid cscheid modified the milestones: v1.4, v1.5 Dec 1, 2023
@cscheid cscheid modified the milestones: v1.5, Future Mar 1, 2024
@mcanouil mcanouil added the math any issue related to math support in specific formats label Jun 4, 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 math any issue related to math support in specific formats
Projects
None yet
Development

No branches or pull requests

4 participants