Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcode expansion inside attributes requires single quotes #11650

Open
marianoibaldi opened this issue Dec 10, 2024 · 2 comments
Open

Shortcode expansion inside attributes requires single quotes #11650

marianoibaldi opened this issue Dec 10, 2024 · 2 comments
Assignees
Labels
bug Something isn't working shortcodes issues related to shortcodes
Milestone

Comments

@marianoibaldi
Copy link

Bug description

Hello,

I have a Quarto project with a document and an associated variables file (_variables.yml). When I try to use one of these shortcodes in the fig-scap option, it is not replaced by its associated value. Additionally, and depending on the quotes used for the content of the fig-scap option, the results are different:

  • If single quotes are used, the shortcode is expressed in its original form (e.g. {{< var vars.ttx >}}).

  • If double quotes are used, the reference to the figure and its caption is completely broken and so it is not appearing in the list of figures.

Steps to reproduce

I created a github repository with the minimal reproducible example:

https://github.com/marianoibaldi/figscap.git

Expected behavior

The text displayed in the list of figures should appear as: Short text TLex

Actual behavior

Unwanted behavior is highlighted in red in the figure.

Image

Your environment

  • IDE:RStudio 2024.09.1+394
  • OS: Windows 10 Pro 22H2

Quarto check output

quarto check
Quarto 1.6.39
[>] Checking environment information...
Quarto cache location: C:\Users\User\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.6.39
Path: C:\Users\User\AppData\Local\Programs\Quarto\bin
CodePage: 1252

[>] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)

[>] Checking LaTeX....................OK
Using: TinyTex
Path: C:\Users\User\AppData\Roaming\TinyTeX\bin\windows
Version: 2024

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

[>] Checking Python 3 installation....(None)

  Unable to locate an installed version of Python 3.
  Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK
Version: 4.4.2
Path: C:/PROGRA1/R/R-441.2
LibPaths:
- C:/Users/User/AppData/Local/R/win-library/4.4
- C:/Program Files/R/R-4.4.2/library
knitr: 1.49
rmarkdown: 2.29

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

@marianoibaldi marianoibaldi added the bug Something isn't working label Dec 10, 2024
@cscheid
Copy link
Collaborator

cscheid commented Dec 10, 2024

This is a known issue, and you currently have to use single quotes if you want to use shortcodes in attributes. It's an ugly quirk but one we really cannot easily fix at the moment.

@cscheid cscheid changed the title Issues with variable shortcodes inside fig-scap Shortcode expansion inside attributes requires single quotes Dec 10, 2024
@cscheid cscheid added the shortcodes issues related to shortcodes label Dec 10, 2024
@cscheid cscheid self-assigned this Dec 10, 2024
@cscheid cscheid added this to the Future milestone Dec 10, 2024
@marianoibaldi
Copy link
Author

Thank you @cscheid! But when I use the single quotes, the result is the unprocessed shortcode (as the figure 2 in my screen capture).
Maybe I am loosing something of your explanation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working shortcodes issues related to shortcodes
Projects
None yet
Development

No branches or pull requests

2 participants