mikemahoney218 / quarto-arxiv

Quarto template for arXiv preprints
https://mike.quarto.pub/quarto-arxiv-template/template.pdf
MIT License
90 stars 4 forks source link

Issues with Fonts during Compilation #6

Closed jejjohnson closed 1 year ago

jejjohnson commented 1 year ago

Hi, first off thanks for the package! It looks super nifty for publishing to arxiv just from markdown!

I have an issue during the compilation that I wanted insight from. So it gives the error message:

...
updating existing packages
finding package for Latin Modern Roman(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf)

compilation failed- no matching packages
Package fontspec Error: The font "Latin Modern Roman" cannot be found.

For immediate help type H <return>.
 ...                                              

l.21   \setmathfont
                   []{Latin Modern Math} 

see /Users/eman/code_projects/quarto_papers/quarto-arxiv-main/template.log for more information.

Do you know if this is an issue with the underlying latex compiler?


Some things I did:


Some things I could try:


Here is the full error message if you're interested.

```bash quarto render /Users/eman/code_projects/quarto_papers/quarto-arxiv-main/template.qmd --to arxiv-pdf pandoc to: latex output-file: template.tex standalone: true pdf-engine: xelatex variables: graphics: true tables: true default-image-extension: pdf number-sections: true metadata block-headings: true knitr: opts_chunk: echo: false documentclass: article linenumbers: false doublespacing: false header-includes: - | \usepackage{arxiv} \usepackage{orcidlink} \usepackage{amsmath} \usepackage[T1]{fontenc} mathfont: Latin Modern Math mainfont: Latin Modern Roman title: Demo arXiv template author: - name: Michael J Mahoney affiliations: - name: State University of New York College of Environmental Science and Forestry department: Graduate Program in Environmental Science address: 1 Forestry Drive city: 'Syracuse, NY' country: USA postal-code: 13210 orcid: 0000-0003-2402-304X email: fake_email@fakeyfake.com url: 'https://mm218.dev' - name: Someone Else affiliations: - name: State University of New York College of Environmental Science and Forestry department: Department of Sustainable Resources Management address: 1 Forestry Drive city: 'Syracuse, NY' country: USA postal-code: 13210 abstract: | This document is only a demo explaining how to use the template. keywords: - template - demo bibliography: - bibliography.bib runninghead: A Preprint WARNING: Unable to resolve crossref @tbl-glm running xelatex - 1 This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode updating tlmgr updating existing packages finding package for Latin Modern Roman(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf) compilation failed- no matching packages Package fontspec Error: The font "Latin Modern Roman" cannot be found. For immediate help type H . ... l.21 \setmathfont []{Latin Modern Math} see /Users/eman/code_projects/quarto_papers/quarto-arxiv-main/template.log for more information. ```
mikemahoney218 commented 1 year ago

HI @jejjohnson ! At first glance, this looks like your version of TeX is missing the lm-math package. You should be able to install those via the command tlmgr install lm-math (and you might consider also running tlmgr install collection-fontsrecommended to get other common fonts). If that succeeds and quarto render still doesn't work, let me know!

jejjohnson commented 1 year ago

Thank you for the tip. I tried it and still got the same exact same error message.

I'm going to try and delete and reinstall latex on my system. Perhaps there is some unknown collision that I'm not aware of. I'll keep you posted.

danieltomasz commented 1 year ago

@jejjohnson if you are on mac you just need to download and install the font manually systemwide https://www.gust.org.pl/projects/e-foundry/lm-math/download/index_html

I think this is related to this problem https://tex.stackexchange.com/questions/400699/fontspec-package-cant-find-latin-modern-mono-on-macos-mactex

jejjohnson commented 1 year ago

Thank you @danieltomasz ! This worked!

For anyone else with similar specs (MBP M1, 2020, macOS Aventura 13.1), you can use homebrew/cask. Instructions for installing the fonts are here.

I Installed latin-modern and also latin-modern-math without any problems.

brew tap homebrew/cask-fonts
brew install font-latin-modern
brew install font-latin-modern-math

Thank you all again!