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

Callouts: language configuration bugs across formats #10894

Closed
snhansen opened this issue Sep 26, 2024 · 5 comments · Fixed by #10897
Closed

Callouts: language configuration bugs across formats #10894

snhansen opened this issue Sep 26, 2024 · 5 comments · Fixed by #10897
Assignees
Labels
bug Something isn't working callouts Issues with Callout Blocks. crossref
Milestone

Comments

@snhansen
Copy link

snhansen commented Sep 26, 2024

Bug description

The language key callout-tip-title can be used to set the title of tip callouts. However, when making the callout cross-referenceable this title is ignored and "Tip X" is used instead.

Steps to reproduce

---
format: html

language: 
  callout-tip-title: "Note"
---

::: {#tip-123 .callout-tip}

Text

:::

Expected behavior

Title of the callout should be "Note 1"

Actual behavior

Title of the callout is "Tip 1"

Your environment

Windows 11

Quarto check output

[>] Checking versions of quarto binary dependencies...
	  Pandoc version 3.2.0: OK
	  Dart Sass version 1.70.0: OK
	  Deno version 1.41.0: OK
	  Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
	  Version: 1.6.10
	  Path: C:\Users\au234616\AppData\Local\Programs\Quarto\bin
	  CodePage: 1252

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

[>] Checking LaTeX....................OK
	  Tex:  (not detected)

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

[>] Checking Python 3 installation....OK
	  Version: 3.11.1
	  Path: C:/Users/au234616/AppData/Local/Programs/Python/Python311/python.exe
	  Jupyter: 5.2.0
	  Kernels: python3

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

[>] Checking R installation...........OK
	  Version: 4.4.0
	  Path: C:/PROGRA~1/R/R-44~1.0
	  LibPaths:
		- C:/Users/au234616/AppData/Local/R/win-library/4.4
		- C:/Program Files/R/R-4.4.0/library
	  knitr: 1.48.3
	  rmarkdown: 2.28

[>] Checking Knitr engine render......OK
@snhansen snhansen added the bug Something isn't working label Sep 26, 2024
@cscheid cscheid self-assigned this Sep 26, 2024
@cscheid cscheid added crossref callouts Issues with Callout Blocks. labels Sep 26, 2024
@cscheid cscheid added this to the v1.6 milestone Sep 26, 2024
@cscheid cscheid changed the title callout-tip-title is ignored when callouts can be referenced Callouts: language configuration bugs across formats Sep 26, 2024
@cscheid
Copy link
Collaborator

cscheid commented Sep 26, 2024

Thanks. I can spot lots of little bugs in this subsystem.

I'm going to use this issue to solve as many as I can find+fix today.

  1. In html, as reported.
  2. In revealjs, we do not add the counter to the crossreferenceable callout title
  3. In pdf, we repeat the name of the callout and use its name as a default title: "Tip 1: Tip"
  4. In typst, we have the same bug as in PDF, and we add a spurious line break to the callout title.
  5. In docx: TBD

@snhansen
Copy link
Author

@cscheid: Thanks for a quick fix. I just tested it and found out that references to the callout still uses "Tip" though. So @tip-123 in the above example evaluates to "Tip 1".

@cscheid
Copy link
Collaborator

cscheid commented Sep 27, 2024

There's two separate options: one for the title and one for the reference prefix.

language:
  callout-tip-title: "Note" # this one goes on the callout itself
  crossref-tip-prefix: "Note" # this one goes on the references to the callout

@snhansen
Copy link
Author

snhansen commented Sep 27, 2024

@cscheid: Ah, that's good to know. Perhaps this page (https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/language/_language.yml) should be updated with this information or is there another way to figure that out?

@cscheid
Copy link
Collaborator

cscheid commented Sep 27, 2024

We should change that, but it's complicated. With this fix, you should also now be able to customize language for custom crossref environments, and we can't know ahead of time which those are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working callouts Issues with Callout Blocks. crossref
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants