Skip to content

Setting cols_width() in px() fails for Quarto PDF output (illegal unit of measure) #1582

Closed

Description

@salim-b

Prework

Description

See the reprex below.

Reproducible example

  1. Copy the following content into a new file test.qmd

    ---
    title: "test"
    ---
    
    ## Reprex
    
    ```{r}
    #| label: tbl-reprex
    #| tbl-cap: Reprex
    
    gt::exibble |>
      gt::gt() |>
      gt::cols_width(char ~ gt::px(100))
    ```
    
    ## Session info
    
    ```{r}
    sessioninfo::session_info()
    ```
  2. Render the document to PDF using the Quarto CLI:

    quarto render test.qmd --to=pdf

    This results in the following error (with latest stable Quarto v1.4.550):

    ERROR: 
    compilation failed- error
    Illegal unit of measure (pt inserted).
    <to be read again> 
                       p
    l.208 num & c
                 har & fctr & date & time & datetime & currency & row & group \\ 
    
    see test.log for more information.
    

Expected result

No LaTeX compilation error. px units should probably be converted to pt by gt internally to avoid the error.

Related

Session info

sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.2 (2023-10-31)
 os       Ubuntu 22.04.4 LTS
 system   x86_64, linux-gnu
 ui       X11
 language en_US.utf8
 collate  en_US.utf8
 ctype    en_US.utf8
 tz       Europe/Zurich
 date     2024-02-19
 pandoc   3.1.12.1 @ /usr/bin/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 package     * version  date (UTC) lib source
 backports     1.4.1    2021-12-13 [1] RSPM
 brio          1.1.4    2023-12-10 [1] RSPM (R 4.3.0)
 checkmate     2.3.1    2023-12-04 [1] RSPM (R 4.3.0)
 cli           3.6.2    2023-12-11 [1] RSPM (R 4.3.0)
 curl          5.2.0    2023-12-08 [1] RSPM (R 4.3.0)
 digest        0.6.34   2024-01-11 [1] RSPM (R 4.3.0)
 evaluate      0.23     2023-11-01 [1] RSPM (R 4.3.0)
 fastmap       1.1.1    2023-02-24 [1] RSPM (R 4.2.0)
 htmltools     0.5.7    2023-11-03 [1] RSPM (R 4.3.0)
 htmlwidgets   1.6.4    2023-12-06 [1] RSPM (R 4.3.0)
 httr          1.4.7    2023-08-15 [1] RSPM (R 4.3.0)
 jsonlite      1.8.8    2023-12-04 [1] RSPM (R 4.3.0)
 knitr         1.45     2023-10-30 [1] RSPM (R 4.3.0)
 lifecycle     1.0.4    2023-11-07 [1] RSPM (R 4.3.0)
 magrittr      2.0.3    2022-03-30 [1] RSPM (R 4.2.0)
 pal           0.0.9101 2024-01-19 [1] gitlab (rpkg.dev/pal@a488ac7)
 R6            2.5.1    2021-08-19 [1] RSPM
 rlang         1.1.3    2024-01-10 [1] RSPM (R 4.3.0)
 rmarkdown     2.25     2023-09-18 [1] RSPM (R 4.3.0)
 sessioninfo   1.2.2    2021-12-06 [1] RSPM (R 4.2.0)
 testthat      3.2.1    2023-12-02 [1] RSPM (R 4.3.0)
 xfun          0.41     2023-11-01 [1] RSPM (R 4.3.0)
 yaml          2.3.8    2023-12-11 [1] RSPM (R 4.3.0)

 [1] /home/salim/.software/managed/r
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library

──────────────────────────────────────────────────────────────────────────────

Activity

  1. changed the title [-]Setting `cols_width()` in `px()` fails for Quarto PDF output (ilegal unit of measure)[/-] [+]Setting `cols_width()` in `px()` fails for Quarto PDF output (illegal unit of measure)[/+] on Feb 21, 2024
  2. moved this to To discuss / To plan in R Markdown Team Projectson Feb 22, 2024
  3. added this to the v0.10.2 milestone on Feb 22, 2024
  4. added a commit that references this issue on Feb 28, 2024
    225d4d9
  5. added a commit that references this issue on Mar 7, 2024
    a6215df
  6. moved this from To discuss / To plan to Done in R Markdown Team Projectson Mar 7, 2024
  7. modified the milestones: v0.10.2, v0.11.0 on Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions