quarto_titlepages icon indicating copy to clipboard operation
quarto_titlepages copied to clipboard

bad argument #1 to 'for iterator' error when rendering PDF with cover-bg-image defined

Open jfy133 opened this issue 2 years ago • 0 comments

quarto_titlepages relies on features of Quarto that are new. To help us out,

  • Please run quarto --version from a terminal (shell) and report the Quarto version you are using.
$ quarto --version
1.3.340
  • Tell us what operating system you are on.

    Ubuntu 22.04.2 LTS

Having trouble rendering to PDF? Like it just doesn't work at all, not like it works but looks janky. In order to help, we some info:

  • How you are rendering Quarto docs (RStudio, VS Code, command line, etc)?

    VSCode

  • What TeX and version you are using? Run tex --version in a terminal (or shell).

    $ tex --version
    TeX 3.141592653 (TeX Live 2022/dev/Debian)
    kpathsea version 6.3.4/dev
    

Description

When trying to render the following Quarto book: https://github.com/SPAAM-community/intro-to-ancient-metagenomics-book/blob/pdf-cover/_quarto.yml, within VSCode + Quarto extension

I get the following error

Error running filter /opt/quarto/share/filters/main.lua:
...k/_extensions/nmfs-opensci/titlepage/coverpage-theme.lua:271: bad argument #1 to 'for iterator' (table expected, got nil)
stack traceback:
        ...k/_extensions/nmfs-opensci/titlepage/coverpage-theme.lua:271: in function <...k/_extensions/nmfs-opensci/titlepage/coverpage-theme.lua:47>
        [C]: in ?
        [C]: in method 'walk'
        /opt/quarto/share/filters/main.lua:170: in function 'run_emulated_filter'
        /opt/quarto/share/filters/main.lua:450: in local 'callback'
        [string "..."]:1789: in field 'withScriptFile'
        /opt/quarto/share/filters/main.lua:453: in upvalue 'run_emulated_filter_chain'
        /opt/quarto/share/filters/main.lua:496: in function </opt/quarto/share/filters/main.lua:477>
stack traceback:
        /opt/quarto/share/filters/main.lua:170: in function 'run_emulated_filter'
        /opt/quarto/share/filters/main.lua:450: in local 'callback'
        [string "..."]:1789: in field 'withScriptFile'
        /opt/quarto/share/filters/main.lua:453: in upvalue 'run_emulated_filter_chain'
        /opt/quarto/share/filters/main.lua:496: in function </opt/quarto/share/filters/main.lua:477>

If I specify 'coverpage: false' it renders a PDF with no error.

Note I have done this semi blindly, i.e. I'm not experienced with LaTeX etc, and I just copy and pasted the commands in the example documentation on: https://nmfs-opensci.github.io/quarto_titlepages/.

I would just like to have a single image as a cover page (no additional text etc.).

Some tips that might help you out

  • tex --version says command not found. Try installing tinytex and see if that solves your problems. Installation instructions.

    $ quarto install tinytex
    tinytex is already installed and up to date.
    

    I am using the latest version (2023.08)

  • Are you using tinytex? Note tinytex is a version of TeXLive so you won't see it when you get the tex version.

    • I don't know and I don't know how to find out. Ok.
    • Are you on a linux machine with Debian and Ubuntu? If you are on a virtual machine machine, then probably yes. Try typing cat /etc/os-release in a terminal (shell). Debian comes with an out of date version of TeXLive, which is going to cause you headaches. If you completely uninstall that TeX installation and install tinytex, things work better.

    See above. Version according to Quarto is 2023.08

  • I am on Windows or Mac. Did you install LaTeX, like MikTeX or MacTeX?

    • No I didn't. Try installing tinytex.
    • Yes I did. Oy. Quarto seems to work best with tinytex having to do with auto-updating of packages. You can try installing tinytex and Quarto might find that. You might have to edit your system path. Editing your path might cause you problems for your non-Quarto TeX workflow though.

jfy133 avatar Aug 05 '23 13:08 jfy133