Skip to content

Latex build broken in Sphinx 8 #242

@stefanodavid

Description

@stefanodavid

Describe the bug

context
When I build a PDF, which includes fontawesome icons, using latexpdf builder using Sphinx 8.2.3, the build fails with error

(/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/fontawesome5.sty
 
! Package fontawesome5 Error: Incompatible version of Font Awesome already
(fontawesome5)                loaded

The PoC is very simple: just use code from your docs (see below)

expectation
I expected a successful build, because the same code builds with Sphinx 7.2.6.

problem
I understand this should be of little impact, as it is a very limited use case (I don't believe building PDFs is the main output when using sphinx), but this could impact

Reproduce the bug

  1. use code below in an empty document
- An icon :fas:`spinner;sd-text-primary`, some more text.
- An icon :fab:`github`, some more text.
- An icon :fab:`gitkraken;sd-text-success fa-xl`, some more text.
- An icon :fas:`skull;sd-text-danger`, some more text.

  1. add to conf.py lines
latex_engine = 'lualatex'
sd_fontawesome_latex = True
  1. build using make latexpdf
  2. See build fail

This should be due to two main causes:

  1. the builder includes \usepackage{fontawesome}, which loads

    (/usr/share/texlive/texmf-dist/tex/latex/fontawesome/fontawesome.sty
    (/usr/share/texlive/texmf-dist/tex/latex/fontawesome/fontawesomesymbols-generic.tex)
    (/usr/share/texlive/texmf-dist/tex/latex/fontawesome/fontawesomesymbols-xeluatex.tex)
    
  2. sd_fontawesome_latex = True causes to add \usepackage{fontawesome5} (/usr/share/texlive/texmf-dist/tex/latex/fontawesome5/fontawesome5.sty), which is incompatible with the other package and does not define command \faicon, but \faIcon.

However, note that by manually deleting \usepackage{fontawesome}, and replacing \faicon, with \faIcon, the build is successful.

List your environment

Sphinx==8.2.3
sphinx_design==0.6.1

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions