Skip to content

Equation number alignment #12766

@lu-kas

Description

@lu-kas

Bug description

This is a (potential) bug for a book project. The number alignment of a labeled equation does change if I explicitly set the html-math-method to mathjax (which is AFAIK the default).

  1. If the html-math-method is not set, the equation number is right aligned. This is the behavior I'm interested in.
  2. If the variable is set to mathjax, the equation number is directly after the equation.

Background: I need to set this option, as I need to specify an individual MathJax URL.

Steps to reproduce

_quarto.yml:

project:
  type: book

book:
  title: "equation test"
  author: "Nobody"
  date: "5/18/2025"
  chapters:
    - index.qmd


format:
  html:
    # comment/remove the following option to trigger the change in behavior
    html-math-method:
      method: mathjax
    theme:
      - cosmo
      - brand

index.qmd:

# Preface {.unnumbered}

$$
\alpha = \beta
$$ {#eq-ab}

This is @eq-ab.

Actual behavior

The equation number is directly after the equation.

Image

Expected behavior

The equation number should be right alligned.

Image

Your environment

  • OS: MacOS 15.4.1 (24E263)
  • IDE: none

Quarto check output

Quarto 1.7.28
[✓] Checking environment information...
      Quarto cache location: /Users/.../Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.85.1: OK
      Deno version 1.46.3: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.7.28
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Tex:  (not detected)

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: /Applications/Xcode.app/Contents/Developer/usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.1.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library
      knitr: 1.38
      rmarkdown: 2.13

[✓] Checking Knitr engine render......OK

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthtmlIssues with HTML and related web technology (html/css/scss/js)mathany issue related to math support in specific formats

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions