Test document:

````markdown
---
title: "example"
format:
  pdf:
    pdf-engine: lualatex
    mainfont: Open Sans
    sansfont: Open Sans
    keep-tex: true
---

# content

````

**OpenSans** fonts is not correctly auto-installed. Log in Job pane is: 

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

compilation failed- no matching packages
Package fontspec Error: The font "OpenSans" cannot be found.
````

With R Markdown and **tinytex** it works ok: 

<details>
<summary>With this sample file</summary>

````markdown
---
title: "example"
output:
  pdf_document: 
    latex_engine: lualatex
    keep_tex: true
mainfont: Open Sans
sansfont: Open Sans
---

Content
````

</details>

This took me a while to debug this and here is where I am at. 

Quarto command seems to correctly searching for `OpenSans(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf)` using `tlmgr search`. 
However, running in debug mode, I find that the issue is a quoting issue in Windows command line because the result of 
```typescript
const result = await tlmgrCommand(
        "search",
        [...args, ...(opts || []), searchTerm],
        true,
      );
```
is an error 
````
code:255
stderr:''Italic' n’est pas reconnu en tant que commande interne\r\nou externe, un programme exécutable ou un fichier de commandes.\r\n'
stdout:''
success:false
````

The `stderr` means 
> 'Italic' is not recognized as a internal or external command, an executable program or a command file. 

I believe this is because `|` is not seems as part of an argument to `tlmgr search` the command being something like 
````
tlmgr search --file --global OpenSans(-(Bold|Italic|Regular).*)?[.](tfm|afm|mf|otf|ttf)
````
as I am not sure `Deno.Run()` is quoting by default. 

It seems like adding double quote will help on Windows

* No quotes = it will error 
````powershell
> await Deno.run({cmd: ["cmd.exe", "/c", "tlmgr", "search", "--file", "--global", "OpenSans(-(Bold|Italic|Regular).*)?[.
](tfm|afm|mf|otf|ttf)"]}).status()
'Italic' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
````
* With quotes = no error 
````powershell
> await Deno.run({cmd: ["cmd.exe", "/c", "tlmgr", "search", "--file", "--global", "\"OpenSans(-(Bold|Italic|Regular).*)?
[.](tfm|afm|mf|otf|ttf)\""]}).status()
tlmgr.pl: package repository https://ctan.mines-albi.fr/systems/texlive/tlnet (verified)
{ success: true, code: 0 }
````

So this is a first potential issue. However, even by adding quotes in Quarto code around the arg, I do not get the correct output. No output is returned by the command in `result.stdout`. 

I have found this issue in Deno (https://github.com/denoland/deno/issues/8852) but not sure that is directly related to why no result.

So I am still looking into this. 




cderv
2022-02-14T11:10:56Z
cderv
closed
missing font not correctly detected on Windows with latexmk
https://github.com/quarto-dev/quarto-cli/issues/336