Skip to content

Rendering multiple formats not working with markdown variants #1929

Closed

Description

@rjake

Bug description

When I use format gfm or commonmrk and use quarto render README.qmd I see the .md file popup but then go away.

When I call quarto::quarto_render("README.qmd", output_format = "all") I see the following steps:

  • README.rmarkdown added
  • README.rmarkdown deleted
  • README.md added
  • README.rmarkdown added
  • README.rmarkdown deleted
  • README.md deleted -- 👀 not expecting this step

If I use docx instead of gfm both formats come back as expected

---
title: "quarto"
format: 
  # commonmark: default
  gfm: default
  revealjs: default
---

## Quarto

Using

RStudio 2022.07.1 Build 554
Windows 10 Build 19042

quarto check Output

quarto check

[>] Checking Quarto installation......OK
      Version: 99.9.9
      Path: C:\Users\rileyj3\github\quarto-cli\package\dist\bin\
      CodePage: 1252

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

[>] Checking Python 3 installation....OK
      Version: 3.9.12
      Path: C:/Users/rileyj3/AppData/Local/Programs/Python/Python39/python.exe
      Jupyter: 4.11.1
      Kernels: python3

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

[>] Checking R installation...........OK
      Version: 4.2.0
      Path: C:/Users/rileyj3/R/R-4.2.0
      LibPaths:
        - C://Users/rileyj3/R/win-library/4.2/library
      rmarkdown: 2.14
[>] Checking Knitr engine render......OK

quarto tools check Output

[>] Inspecting tools

Tool         Status            Installed     Latest
chromium     Not installed     ---           869685
tinytex      Not installed     ---           v2022.08

Checklist

  • formatted your issue so it is easier for us to read?
  • 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.
  • documented the quarto version you're running, by pasting the output from running quarto check in the "Quarto Check Output" text area?
  • 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?
  • documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • documented which operating system you're running? If on Linux, please provide the specific distribution as well.
  • upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?

Activity

  1. added
    bug
    on Aug 16, 2022
  2. cscheid commented on Aug 16, 2022

    @cscheid
    Member

    This is an unfortunate clash with our intermediate files. It's not a quick fix because a lot of the tools we depend on are the ones doing the overwriting. But you can work around it like so:

    ---
    title: "quarto"
    format: 
      commonmark: 
        output-file: out-commonmark.md
      gfm:
        output-file: out-gfm.md
      revealjs: default
    ---
    
    ## Quarto
    
  3. added this to the Future milestone on Aug 16, 2022
  4. ShKlinkenberg commented on Sep 17, 2022

    @ShKlinkenberg

    Are there any other options?

    ---
    title: "Quarto"
    format: 
      html: 
        output-file: doc.html
      revealjs: default
    ---
    

    I have a lot of options to apply to the revealjs yaml and by going for default, it seems that nothing else can be specified. Secondly, I would prefer not to have to change the name of the output file but instead change the output-dir just like with projects.

  5. cscheid commented on Sep 19, 2022

    @cscheid
    Member

    I have a lot of options to apply to the revealjs yaml and by going for default, it seems that nothing else can be specified.

    default simply means "Render this, but with no further yaml". You can always put anything else you want in the yaml entry for revealjs:

    title: "Quarto"
    format: 
      html: 
        output-file: doc.html
      revealjs:
        # for example, 
        self-contained: true
        # etc etc
  6. the-solipsist commented on Sep 8, 2023

    @the-solipsist
    Contributor

    @rjake: One other way to overcome the clash of markdown files is to use the output-ext option:

    format:
      …
      markdown:
        output-ext: pandoc.md
      …
    

    You can place that in _metadata.yml. That way, you don't need to include the output filename in each file.

  7. cderv commented on Sep 8, 2023

    @cderv
    Member

    I believe this could have just been fixed by

    This should be checked with next pre-release build of 1.4 (1.4.353 or above)

    At least for gfm + revealjs.

    For two markdown variants like gfm + commonmark this will require different work in 1.5 probably

  8. added
    verify-fixed
    on Sep 8, 2023
  9. cderv commented on Apr 16, 2026

    @cderv
    Member

    Verified fixed in Quarto 1.10.3.

    The fix landed via #6773 (back in 1.4). Rendering gfm + revealjs together now correctly produces both output files — the .md is no longer deleted during multi-format render.

    Note: rendering two markdown variants that share the same .md extension (e.g. gfm + commonmark) will still overwrite each other since they target the same output filename. This is expected behavior, not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugverify-fixed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions