quarto-dev / quarto-dev/quarto-cli

Code listings and "filename" cause error for PDF files

Open
#9,243 6 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Apr 1, 2024.

bug crossref latex listings lua
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

When setting "listings: true" for format PDF, the div parameter "filename" causes an error:

Package keyval Error: filename undefined.

See the keyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.151 \begin{lstlisting}[filename=Terminal]

Using "title" instead of "filename" does not throw the error. However, "title" does not produce the code listings heading in html.

Steps to reproduce
---
title: "Test Listings"

format: 
  pdf:
    listings: true
---

## Test with listings

```{.zsh filename="Terminal"}
echo "Hello World"
```

more text

Expected behavior
  • "filename" should be used as title for the code
Actual behavior
  • The PDF compilation stops with an error
Your environment
  • IDE: Version 2023.12.1+402 (2023.12.1+402)
  • Quarto: version 1.4.552
  • macOS: Sonoma 14.4.1
Quarto check output

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.