### Bug description

**Problem:**

When including a remote image (from a web URL) inside a (q)md file, the rendering to latex/pdf with quarto fails, but works just fine when directly using pandoc.

**Minimum working example:**

File `issue_remote_image.qmd`:
```
---
title: Test using a remote image in a markdown file
author: John Doe
format:
  pdf
---

Here is the image:

![](https://quarto.org/quarto.png)

```

Rendering to pdf with pandoc works just fine (and the pdf contains the remote image):
```
$ pandoc --from=markdown --to=pdf -o issue_remote_image.pdf issue_remote_image.qmd
```
but rendering with quarto fails:
```
$ quarto render issue_remote_image.qmd                                            
pandoc 
  to: latex
  output-file: issue_remote_image.tex
  standalone: true
  pdf-engine: xelatex
  variables:
    graphics: true
    tables: true
  default-image-extension: pdf
  
metadata
  documentclass: scrartcl
  classoption:
    - DIV=11
    - numbers=noendperiod
  papersize: letter
  header-includes:
    - '\KOMAoption{captions}{tableheading}'
  block-headings: true
  title: Test using a remote image in a markdown file
  author: John Doe
  
running xelatex - 1
  This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022/Arch Linux) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode
  

compilation failed- missing packages (automatic installed disabled)
Unable to load picture or PDF file 'https://quarto.org/quarto.png'.
<to be read again> 
                   }
l.156 ...degraphics{https://quarto.org/quarto.png}
                                                   

see issue_remote_image.log for more information.
```
The problematic line in the generated `issue_remote_image.tex` is the following:
```tex
\includegraphics{https://quarto.org/quarto.png}
```

And I face a similar problem when forcing to use `lualatex` as pdf engine with the yml directive `pdf-engine: lualatex`.

**Config:**

OS: ArchLinux 6.1.11-arch1-1

```
$ quarto -V
1.2.335
```

```
$ quarto pandoc --version
pandoc 2.19.2
Compiled with pandoc-types 1.22.2.1, texmath 0.12.5.2, skylighting 0.13,
citeproc 0.8.0.1, ipynb 0.2, hslua 2.2.1
Scripting engine: Lua 5.4
```

```
$ pandoc --version
pandoc 3.0.1
Features: +server +lua
Scripting engine: Lua 5.4
```

### Checklist

- [X] Please include 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] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
2023-02-21T09:49:28Z
gdurif
bug
closed
Problem with remote images when converting to latex/pdf (works with pandoc but not with quarto)
https://github.com/quarto-dev/quarto-cli/issues/4443