### Bug description

The following is on an M1 Mac.

I had an Rmd document which following this great blog post [here](https://www.andrewheiss.com/blog/2021/08/27/tikz-knitr-html-svg-fun/#connecting-dvisvgm-to-ghostscript-on-macos), includes tikz code chunks which produce dvi files, which are converted to svg files with `dvisvgm` (which is simply obtained with `tinytex::tlmgr_install('dvisvgm')`). 

On macOS, for the dvi to svg conversion, it is required to provide the `dvisvgm` executable with the path to the dynamically linked Ghostscript library libgs.dylib.

I naively installed Ghostscript using Homebrew with a simple `brew install ghostscript`. On aarch64 R under `rmarkdown::render(...)` the calls to `dvisvgm` worked as I expected but when I tried to render the document using Quarto the calls to `dvisvgm` failed.

I found that the *libgs.dylib* from the Homebrew installation was only for the arm64 architecture.
```
$ file /opt/homebrew/Cellar/ghostscript/9.56.1/lib/libgs.dylib.9.56
/opt/homebrew/Cellar/ghostscript/9.56.1/lib/libgs.dylib.9.56: Mach-O 64-bit dynamically linked shared library arm64
```

I then obtained a full Ghostscript installation from the pkg installer from [here](https://pages.uoregon.edu/koch/) which has both architectures.
```
$ file /usr/local/share/ghostscript/9.56.1/lib/libgs.dylib.9.56      
/usr/local/share/ghostscript/9.56.1/lib/libgs.dylib.9.56: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64
- Mach-O 64-bit dynamically linked shared library x86_64] [arm64]
/usr/local/share/ghostscript/9.56.1/lib/libgs.dylib.9.56 (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/share/ghostscript/9.56.1/lib/libgs.dylib.9.56 (for architecture arm64):	Mach-O 64-bit dynamically linked shared library arm64
```

Linking to this dylib meant the calls to `dvisvgm` ran as expected under Quarto.

I was wondering if it is worth mentioning somewhere in the docs that the architecture of linked dylibs currently can't just be arm64 (until I guess you have an arm64 version of Quarto).

An example Qmd file is as below.

````rmd
---
title: "Example for dylib architecture issue"
format: gfm
---

```{r setup, include=FALSE}
require('tinytex')
if (!tinytex::check_installed('dvisvgm')) tinytex::tlmgr_install('dvisvgm')
```

* Call to `dvisvgm` with the arm64 dylib. In its output this is missing the 
`ps` row to show the dylib has been linked.
```{r}
system2(
  'dvisvgm',
  c(
    '--libgs=/opt/homebrew/Cellar/ghostscript/9.56.1/lib/libgs.dylib.9.56',
    '-l'
  ),
  stdout = TRUE
)
```

* Using the dylib including both architectures produces the expected output.
```{r}
system2(
  'dvisvgm',
  c(
    '--libgs=/usr/local/share/ghostscript/9.56.1/lib/libgs.dylib.9.56',
    '-l'
  ),
  stdout = TRUE
)
```
````

It produces

````
Example for dylib architecture issue
================

-   Call to `dvisvgm` with the arm64 dylib. In its output this is
    missing the `ps` row to show the dylib has been linked.

``` r
system2(
  'dvisvgm',
  c(
    '--libgs=/opt/homebrew/Cellar/ghostscript/9.56.1/lib/libgs.dylib.9.56',
    '-l'
  ),
  stdout = TRUE
)
```

    [1] "bgcolor    background color special"                        
    [2] "color      complete support of color specials"              
    [3] "dvisvgm    special set for embedding raw SVG snippets"      
    [4] "em         line drawing statements of the emTeX special set"
    [5] "html       hyperref specials"                               
    [6] "papersize  special to set the page size"                    
    [7] "pdf        PDF hyperlink, font map, and pagesize specials"  
    [8] "tpic       TPIC specials"                                   

-   Using the dylib including both architectures produces the expected
    output.

``` r
system2(
  'dvisvgm',
  c(
    '--libgs=/usr/local/share/ghostscript/9.56.1/lib/libgs.dylib.9.56',
    '-l'
  ),
  stdout = TRUE
)
```

    [1] "bgcolor    background color special"                        
    [2] "color      complete support of color specials"              
    [3] "dvisvgm    special set for embedding raw SVG snippets"      
    [4] "em         line drawing statements of the emTeX special set"
    [5] "html       hyperref specials"                               
    [6] "papersize  special to set the page size"                    
    [7] "pdf        PDF hyperlink, font map, and pagesize specials"  
    [8] "ps         dvips PostScript specials"                       
    [9] "tpic       TPIC specials"                                   

````


### `quarto check` Output

```
(base) toms-Mac-mini:~ tom$ quarto check

[✓] Checking Quarto installation......OK
      Version: 0.9.649
      Path: /Applications/RStudio.app/Contents/MacOS/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.12 (Conda)
      Path: /Users/tom/opt/miniconda3/bin/python
      Jupyter: 4.10.0
      Kernels: python3

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

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/tom/Library/R/arm64/4.2/library
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/site-library
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK
```

### `quarto tools check` Output

```bash
(/) Inspecting toolsDownload https://deno.land/x/cache@0.2.12/directories.ts
(|) Inspecting toolsDownload https://deno.land/x/cache@0.2.12/deps.ts
[✓] Inspecting tools

Tool         Status                    Installed     Latest  
chromium     Not installed             ---           869685  
tinytex      External Installation     ---           v2022.07
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-07-25T16:57:49Z
remlapmot
documentation
Future
closed
[Suggestion] Document when using Quarto on M1 Macs that linked `dylib`s to executables need to be both (or maybe just x86_64?) architectures
https://github.com/quarto-dev/quarto-cli/issues/1526