zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.78k stars 6.58k forks source link

doc: inconsolata-nerd-font.sty missing when generating PDF locally. #76387

Open smrtos opened 3 months ago

smrtos commented 3 months ago

Describe the bug I try to follow the Zephyr [doc]https://docs.zephyrproject.org/latest/contribute/documentation/generation.html#documentation-generation) to generate the pdf locally on Ubuntu 20.04.

But it seems below font is still missing after following the instructions in Zephyr document. Especially, the texlive-fonts-recommended and texlive-fonts-extra have been installed.

Actually, I met a similar issue for noto.sty before this one. See below:

The missing noto.sty can be fixed by apt install texlive-fonts-extra.

But the inconsolata-nerd-font.sty is still missing.

I also tried sudo apt install fonts-inconsolata. This package looks promising at first.

But it still doesn't include the inconsolata-nerd-font.sty.

To Reproduce

Just follow the official steps on a Ubuntu 20.04.

smrtos commented 3 months ago

It seems the texlive-fonts-extra (2024.20240706-2) has the But the Ubuntu 20.04 only installs texlive-fonts-extra (2019.202000218-1).

Only the former one has the inconsolata-nerd-font.

smrtos commented 3 months ago

Found the inconsolata-nerd-font pacakge at here. But it doesn't contain the inconsolata-nerd-font.sty file.

Downloaded the inconsolata-font from here. Extract it and rename the inconsolata.sty to inconsolata-nerd-font.sty. Now it can run until below failure:

Latexmk: Summary of warnings from last run of (pdf)latex:
  Latex failed to resolve 1 reference(s)
  =====Latex reported missing or unavailable character(s).  <=================== HERE
=====See log file for details.
  Latex failed to resolve 58 citation(s)
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  makeindex zephyr.idx: Command for 'makeindex zephyr.idx' gave return code -0.00390625
      Refer to 'zephyr.ilg' for details
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs, or warnings treated as errors.
make: *** [Makefile:29: zephyr.pdf] Error 12
FAILED: CMakeFiles/pdf /home/ming/dev/zephyrproject/zephyr/doc/_build/CMakeFiles/pdf
cd /home/ming/dev/zephyrproject/zephyr/doc/_build/latex && /usr/bin/cmake -E env LATEXMKOPTS="-halt-on-error -no-shell-escape" /usr/bin/make
ninja: build stopped: subcommand failed.
dottspina commented 2 months ago

I too have had troubles generating the PDF documentation (Fedora land):

@smrtos , since your last error is related to makeindex, you may be missing Xindy: at the moment I don't use Debian based systems too much, but it's not obvious to me it's installed with texlive-latex-extra, have you tried apt-get install xindy ?

kartben commented 1 month ago

Hi folks, can you check if this unblocks you? Not sure we actually need any of the glyphs in the nerd-font variant so it's probably much safer to just rely on the base inconsolata package.

diff --git a/doc/conf.py b/doc/conf.py
index 4308e69f640..8f51cf0f399 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -219,7 +219,7 @@ latex_elements = {
     "makeindex": r"\usepackage[columns=1]{idxlayout}\makeindex",
     "fontpkg": textwrap.dedent(r"""
                                     \usepackage{noto}
-                                    \usepackage{inconsolata-nerd-font}
+                                    \usepackage{inconsolata}
                                     \usepackage[T1]{fontenc}
                                 """),
     "sphinxsetup": ",".join(
Iwyil commented 1 month ago

Hi. I had this problem and the fix worked for me on a freshly updated Arch Linux machine (texlive-fontsextra v2024.2-3) [zephyr main 2f47de60a0a 2024-09-18]. But it was working as is, without the fix, on my Arch Linux machine at home which has not been updated yet (texlive-fontsextra v2024.2-2) [zephyr main 4cc3134aa1c 2024-09-27].