quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.96k stars 326 forks source link

LaTeX crash when using custom font #3794

Open kjohnsen opened 1 year ago

kjohnsen commented 1 year ago

Bug description

My render fails (at the XeLaTeX part?) whenever I use a custom font. I'm on Ubuntu 18.04 WSL on Windows 11.

test.qmd:

---
format: 
  pdf: 
    mainfont: Arial
---

# Hello there!

This is a test.

So, quarto render test.qmd --to pdf fails, unless I stop trying to specify the font.

  This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode
  Fontconfig warning: FcPattern object weight does not accept value [50 200)

updating tlmgr

updating existing packages

compilation failed- error
see test.log for more information.

By the way, I always see that Fontconfig weight warning, whether I try to set the font or not. And I'm not a LaTeX expert, but I don't see anything useful in the log.

Quarto check:

[✓] Checking Quarto installation......OK
      Version: 1.2.280
      Path: /opt/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.8.8 (Conda)
      Path: /home/kyle/anaconda3/bin/python
      Jupyter: 4.7.1
      Kernels: conda-env-test2-py, ..., julia-1.8

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

I also just upgraded TinyTex to 2022.12.12.

Checklist

dragonstyle commented 1 year ago

I'm not sure what the underlying issue is. Are there any other errors in test.log that might shed some light on the issue?

kjohnsen commented 1 year ago

I attached test.log so you can see for yourself. It doesn't complain about any errors. So I have no idea what's going wrong.

dragonstyle commented 1 year ago

Sorry I missed that. Yeah no clues at all. This looks a little like a permissions issue, but that should've been fixed in Quarto 1.2.280 - did you install tinytex using this latest version? If not, perhaps give that a try that (the issue was in the way we install tinytex so actually doing the install with the latest version is important).

Have you tried removing intermediates between each try compiling? I've seen those cause issues in the past though I have no specific reason to suspect them here.

kjohnsen commented 1 year ago

It's not an intermediate files issue, since the same thing happens with totally fresh files, in a totally fresh directory. And yeah, I installed TinyTex with the newest version. Maybe there's an issue with the new install installing over the old one though 🤷‍♂️

dragonstyle commented 1 year ago

The upgrade of tinytex using Quarto does do an uninstall of the old one and then an install of the new one, so that should clear up the issue if that was the cause.

It is working locally for me, so I'm guessing there is something about the local configuration / environment (which I can't explain) that is causing the issue. You could also try removing our tinytex installation and using another way to install tinytex or a texlive distro - we should automatically detect that and use it if our version isn't present.

Sorry I don't have better ideas...

kjohnsen commented 1 year ago

I deleted TinyTex and installed it from scratch. Same problem

I disabled auto-install with latex-auto-install: false in the front matter. Now I get this:

compilation failed- missing packages (automatic installed disabled)

Yet when I run tlmgr update --all I get

tlmgr: package repository https://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet/ (verified)
tlmgr: no updates available

When I specify keep-tex: true and look at test.tex, I don't see any red flags. The weird thing is, I was able to generate PDFs with custom fonts just a couple weeks ago

dragonstyle commented 1 year ago

I'll try adding some additional debug logging that we can enable to see if we can determine why we think there are packages missing... I'll update this once I have that ready.

mcanouil commented 1 day ago

This seems to be an issue with the LaTeX distribution rather than Quarto. As of current 1.6.33 pre-release, I cannot reproduce the issue.

cderv commented 11 hours ago

Same here. @kjohnsen do you still have an issue in your setup with that ?