quarto-dev / quarto-dev/quarto-cli

Use `\tag{}` info for eq cross referencing in the HTML book output

Open
#310 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

books enhancement html math
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

In writing papers one sometimes needs to give an equation a special name, using the \tag{} command. A minimal example is as follows:

$$
a \ge b \tag{IC}
$${#eq-ic}

[Equation (-@eq-ic)] is nice.

The generated HTML book output made two 'mistakes'

  • it uses both (1) and (IC) as equation tags
  • More importantly, it uses 1 rather than IC for cross referencing.
Screen Shot 2022-02-05 at 9 55 05 PM

Meanwhile, the PDF output is normal:

Screen Shot 2022-02-05 at 9 57 19 PM

I wish to achieve the same output as in the PDF output. Is there any workaround?

I am using quarto 0.3.18 (I also have pandoc 2.17.0.1 installed, not sure whether this matters). Currently I work around by defining Pandoc metadata eq.ic: IC and then Equation {{< meta eq.ic >}}. It works well for me, both HTML and PDF. But I hope there is a more direct way to do this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the minimal equation example in an HTML book and compare its equation tag and cross-reference with the PDF output. Trace how the HTML output handles the LaTeX \tag{IC} and the equation label eq-ic; done means the HTML shows only (IC) and the cross-reference uses IC rather than 1.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.