Skip to content

Rendering to a non declared custom format silently renders to quarto default format #3955

@cderv

Description

@cderv
> quarto use template quarto-journals/acs

Quarto templates may execute code when documents are rendered. If you do not
trust the authors of the template, we recommend that you do not install or
use the template.
 ? Do you trust the authors of this template (Y/n) » Yes
 ? Directory name: » test-quarto-acs
[>] Downloading
[>] Unzipping
    Found 1 extension.
[>] Copying files...

Files created:
 - bibliography.bib
 - placeholder.png
 - style-guide
 - test-quarto-acs.qmd
 - _extensions

> cd .\test-quarto-acs\

Then rendering to acs-html does "work" as no warning or error is thrown but

  • html is not defined in the _extensions.yml
  • document is rendered to HTML without using the common information defined in _extensions.yml (like the CSL file)

So it seems if the format is not explicitly defined, it will just pass through to main one, here HTML

Details of the render
> quarto render .\test-quarto-acs.qmd --to acs-html
pandoc
  to: html
  output-file: test-quarto-acs.html
  standalone: true
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png

metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  author:
    - name: Andrew N. Other
      note: A shared note
    - name: Fred T. Secondauthor
      affiliations:
        - name: Current address
          city: Some other place
          country: Germany
    - name: I. Ken Groupleader
      email: i.k.groupleader@unknown.uu
      phone: +123 (0)123 4445556
      fax: +123 (0)123 4445557
      affiliations:
        - id: unknown1
          name: Unknown University
          department: Department of Chemistry
          town: Unknown Town
        - id: second-uni
          name: Second University
          department: Department of Chemistry
          town: Nearby Town
      note: A shared note
    - name: Susanne K. Laborator
      email: s.k.laborator@bigpharma.co
      affiliations:
        - name: BigPharma
          town: Big Town
          country: USA
    - name: Kay T. Finally
      affiliations:
        - ref: second-uni
        - ref: unknown1
  title: 'A demonstration of the _achemso_ {{< latex >}} class^[A footnote for the title]'
  title-short: An _achemso_ demo
  keywords: 'American Chemical Society, LaTeX'
  abstract: |
    This is an example document for the _achemso_ documentclass, intended for submissions to the American Chemical Society for publication. The class is based on the standard LaTeXe _report_ file, and does not seek to reproduce the appearanceof a published paper.
    This is an abstract for the _achemso_ document class demonstration document.  An abstract is only allowed for certain manuscript types.  The selection of `journal` and `manuscript` will determine if an abstract is valid.  If not, the class will issue an appropriate error.This is the abstract.
  bibliography:
    - bibliography.bib

Output created: test-quarto-acs.html

I believe it should error if we expect to have explicitly a defined format in the extensions i.e at least adding html: default

YAML would be
title: ACS Journal Format
author: Charles Teague
version: 0.9.1
contributes:
  formats:
    common:
      csl: american-chemical-society.csl
      shortcodes:
        - fancy-text
      filters:
        - latex-environment
      environments:
        - scheme
        - chart
        - graph
        - tocentry
        - acknowledgement
        - suppinfo
      commands:
        - ce
    pdf:
      cite-method: natbib
      biblio-config: false
      format-resources:
        - achemso.bst
      template-partials:
        - "doc-class.tex"
        - "title.tex"
        - "_affiliation.tex"
    html: default

Or we should at least use the common information in format as someone passing explicitly a custom format e.g acs-html would expect that (I was)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions