Skip to content

Commit 2c104e9

Browse files
committed
Merge branch '6.0.x'
# Conflicts: # CHANGES
2 parents c499f66 + a27d262 commit 2c104e9

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

CHANGES

+4-12
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,18 @@ Bugs fixed
6868
Testing
6969
--------
7070

71-
Release 6.0.1 (in development)
72-
==============================
71+
Release 6.0.1 (released Jan 05, 2023)
72+
=====================================
7373

7474
Dependencies
7575
------------
7676

77-
Incompatible changes
78-
--------------------
79-
80-
Deprecated
81-
----------
82-
83-
Features added
84-
--------------
77+
* Require Pygments 2.13 or later.
8578

8679
Bugs fixed
8780
----------
8881

89-
Testing
90-
--------
82+
* #10944: imgmath: Fix resolving image paths for files in nested folders.
9183

9284
Release 6.0.0 (released Dec 29, 2022)
9385
=====================================

sphinx/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
#:
3131
#: .. versionadded:: 1.2
3232
#: Before version 1.2, check the string ``sphinx.__version__``.
33-
version_info = (6, 0, 1, 'beta', 0)
33+
version_info = (6, 0, 1, 'final', 0)
3434

3535
package_dir = path.abspath(path.dirname(__file__))
3636

37-
_in_development = True
37+
_in_development = False
3838
if _in_development:
3939
# Only import subprocess if needed
4040
import subprocess

sphinx/ext/imgmath.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,9 @@ def render_math(
209209
"""Render the LaTeX math expression *math* using latex and dvipng or
210210
dvisvgm.
211211
212-
Return the filename relative to the built document and the "depth",
212+
Return the image absolute filename and the "depth",
213213
that is, the distance of image bottom and baseline in pixels, if the
214214
option to use preview_latex is switched on.
215-
Also return the temporary and destination files.
216215
217216
Error handling may seem strange, but follows a pattern: if LaTeX or dvipng
218217
(dvisvgm) aren't available, only a warning is generated (since that enables
@@ -319,7 +318,8 @@ def html_visit_math(self: HTML5Translator, node: nodes.math) -> None:
319318
image_format = self.builder.config.imgmath_image_format.lower()
320319
img_src = render_maths_to_base64(image_format, rendered_path)
321320
else:
322-
relative_path = path.relpath(rendered_path, self.builder.outdir)
321+
bname = path.basename(rendered_path)
322+
relative_path = path.join(self.builder.imgpath, 'math', bname)
323323
img_src = relative_path.replace(path.sep, '/')
324324
c = f'<img class="math" src="{img_src}"' + get_tooltip(self, node)
325325
if depth is not None:
@@ -359,7 +359,8 @@ def html_visit_displaymath(self: HTML5Translator, node: nodes.math_block) -> Non
359359
image_format = self.builder.config.imgmath_image_format.lower()
360360
img_src = render_maths_to_base64(image_format, rendered_path)
361361
else:
362-
relative_path = path.relpath(rendered_path, self.builder.outdir)
362+
bname = path.basename(rendered_path)
363+
relative_path = path.join(self.builder.imgpath, 'math', bname)
363364
img_src = relative_path.replace(path.sep, '/')
364365
self.body.append(f'<img src="{img_src}"' + get_tooltip(self, node) +
365366
'/></p>\n</div>')

0 commit comments

Comments
 (0)