public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	linux-doc@vger.kernel.org,
	Konstantin Ryabitsev <mricon@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Akira Yokosawa <akiyks@gmail.com>
Subject: Re: Invalid link generation for equations
Date: Wed, 25 Mar 2026 22:40:15 +0100	[thread overview]
Message-ID: <20260325224015.1ba54eda@foz.lan> (raw)
In-Reply-To: <87o6kbehr6.fsf@trenco.lwn.net>

On Wed, 25 Mar 2026 15:11:57 -0600
Jonathan Corbet <corbet@lwn.net> wrote:

> Shuah Khan <skhan@linuxfoundation.org> writes:
> 
> >> OK, so this is more than passing strange...I can't reproduce that
> >> problem locally.  The HTML I get is:
> >> 
> >>    <img src="../_images/math/d9936822[...]
> >> 
> >> On docs.kernel.org, instead:
> >> 
> >>    <img src="_images/math/d9936822[...]
> >> 
> >> Note the missing "../".
> >> 
> >> I will confess that I don't have a great understanding of how imgmath
> >> works and how that link gets set.  We could "fix" the problem generally
> >> by setting imgmath_embed=True, but it would be good to understand what's
> >> actually happening here.  
> >
> > Respect SPHINX_IMGMATH (for html docs only) in Documentation/conf.py
> > might explain why imgmath_embed=True works?
> >
> > # Load math renderer:
> > # For html builder, load imgmath only when its dependencies are met.
> > # mathjax is the default math renderer since Sphinx 1.8.
> > have_latex = have_command("latex")
> > have_dvipng = have_command("dvipng")
> > load_imgmath = have_latex and have_dvipng
> >
> > Without setting imgmath_embed=true, math_renderer is mathjax which is
> > default since Sphinx 1.8  
> 
> We default to imgmath if the requisite utilities (latex, dvipng) are
> installed on the system; perhaps that's not ideal, but it's what we have
> done for a while.  It all seems to be working as expected, except that
> the <img> element has the wrong URI in it.  Strange.

Looking at this changelog from Akira:

	6b0d3e7c5888 ("docs/conf.py: Treat mathjax as fallback math renderer")

It mentions that this is kept due to epub output. On a quick search:

	https://github.com/sphinx-doc/sphinx/issues/1570

I'm not sure how this is handled in PDF, but mathjax seems to be
specific for html output only.
	
Thanks,
Mauro

  reply	other threads:[~2026-03-25 21:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 12:56 Invalid link generation for equations Kevin Brodsky
2026-03-20  0:06 ` Bagas Sanjaya
2026-03-20  3:10   ` Randy Dunlap
2026-03-21  1:49     ` Bagas Sanjaya
2026-03-22 21:05 ` Jonathan Corbet
2026-03-25 20:23 ` Jonathan Corbet
2026-03-25 20:40   ` Shuah Khan
2026-03-25 21:11     ` Jonathan Corbet
2026-03-25 21:40       ` Mauro Carvalho Chehab [this message]
2026-03-26  9:30         ` Akira Yokosawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260325224015.1ba54eda@foz.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mricon@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox