-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28190 from meeseeksmachine/auto-backport-of-pr-28…
…103-on-v3.9.x Backport PR #28103 on branch v3.9.x ([DOC]: Fix compatibility with sphinx-gallery 0.16)
- Loading branch information
Showing
5 changed files
with
48 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import sys | ||
|
||
|
||
def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf, | ||
**kwargs): | ||
""" | ||
Reduce srcset when creating a PDF. | ||
Because sphinx-gallery runs *very* early, we cannot modify this even in the | ||
earliest builder-inited signal. Thus we do it at scraping time. | ||
""" | ||
from sphinx_gallery.scrapers import matplotlib_scraper | ||
|
||
if gallery_conf['builder_name'] == 'latex': | ||
gallery_conf['image_srcset'] = [] | ||
return matplotlib_scraper(block, block_vars, gallery_conf, **kwargs) | ||
|
||
|
||
# Clear basic_units module to re-register with unit registry on import. | ||
def clear_basic_units(gallery_conf, fname): | ||
return sys.modules.pop('basic_units', None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters