diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 5aeef255bfe..16eb7e72e4a 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -48,18 +48,11 @@ jobs: pytorch-version: ${{ matrix.pytorch-version }} pypi-dir: ${{ env.PYPI_CACHE }} - - name: Install Latex - if: ${{ matrix.target == 'html' }} - # install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux - run: | - sudo apt-get update --fix-missing - sudo apt-get install -y \ - texlive-latex-extra texlive-pictures texlive-fonts-recommended dvipng cm-super - - name: Install package & dependencies run: | make get-sphinx-template - pip install . -U -r requirements/_docs.txt \ + # install with -e so the path to source link comes from this project not from the installed package + pip install -e . -U -r requirements/_docs.txt \ --find-links="${PYPI_CACHE}" --find-links="${TORCH_URL}" - run: pip list - name: Full build for deployment @@ -70,7 +63,10 @@ jobs: run: echo "SPHINX_ENABLE_GALLERY=0" >> $GITHUB_ENV - name: make ${{ matrix.target }} working-directory: ./docs - run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going" + run: | + pwd + ls -la + make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going" - name: Upload built docs if: ${{ matrix.target == 'html' && github.event_name != 'pull_request' }} diff --git a/docs/source/conf.py b/docs/source/conf.py index 9484761ba7a..d7a68156a9e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -269,6 +269,11 @@ def _set_root_image_path(page_path: str) -> None: ), ] +# MathJax configuration +mathjax3_config = { + "tex": {"packages": {"[+]": ["ams", "newcommand", "configMacros"]}}, +} + # -- Options for Epub output ------------------------------------------------- # Bibliographic Dublin Core info. @@ -358,8 +363,7 @@ def package_list_from_file(file: str) -> list[str]: autodoc_mock_imports = MOCK_PACKAGES -# Resolve function -# This function is used to populate the (source) links in the API +# Resolve function - this function is used to populate the (source) links in the API def linkcode_resolve(domain, info) -> Optional[str]: # noqa: ANN001 return _linkcode_resolve(domain, info=info, github_user="Lightning-AI", github_repo="torchmetrics")