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

Figure with alt text fails to render #8207

Closed
bluewin4 opened this issue Jan 10, 2024 · 5 comments
Closed

Figure with alt text fails to render #8207

bluewin4 opened this issue Jan 10, 2024 · 5 comments
Labels
extensions relates to Quarto extensions mechanism support a request for support

Comments

@bluewin4
Copy link

Bug description

Was using the ACM template to generate a file for writing my paper and had some trouble compiling it into a pdf. I narrowed the problem down to this:

![1907 Franklin Model D roadster. Photograph by Harris \& Ewing, Inc. [Public domain], via Wikimedia Commons. (<https://goo.gl/VLCRBB>).](sample-franklin.png){#fig-dresses fig-alt="A woman and a girl in white dresses sit in an open car."}

As long as there is the {fig-alt="A woman and a girl in white dresses sit in an open car."} the pdf fails to render, upon removal it works just fine.

The only thing I saw related to this was #4142 but it seems to be a separate issue.

Steps to reproduce

Run

quarto use template quarto-journals/acm

Then attempt to render

Expected behavior

Produces a template pdf

Actual behavior

Fails to produce a pdf

Your environment

VSCode on Ubuntu

Quarto check output

Quarto 1.4.538
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.11: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.4.538
Path: /opt/quarto/bin

[✓] Checking tools....................OK
TinyTeX: v2024.01
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/jack/.TinyTeX/bin/x86_64-linux
Version: 2023

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

[✓] Checking Python 3 installation....OK
Version: 3.10.12
Path: /bin/python3
Jupyter: (None)

  Jupyter is not available in this Python installation.
  Install with python3 -m pip install jupyter

  There is an unactivated Python environment in obs. Did you forget to activate it?

[✓] Checking R installation...........OK
Version: 4.3.2
Path: /usr/lib/R
LibPaths:
- /home/jack/R/x86_64-pc-linux-gnu-library/4.3
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.44
rmarkdown: 2.25

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

@bluewin4 bluewin4 added the bug Something isn't working label Jan 10, 2024
@mcanouil
Copy link
Collaborator

Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks.

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
engine: knitr
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)
```

![A placeholder image](https://placehold.co/600x400.png)

The end.
````

@mcanouil mcanouil added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Jan 10, 2024
@mcanouil
Copy link
Collaborator

The following compiles properly:

---
title: "Quarto Playground"
format: pdf
---

This is a playground for Quarto.

![1907 Franklin Model D roadster. Photograph by Harris \& Ewing, Inc. [Public domain], via Wikimedia Commons. (<https://goo.gl/VLCRBB>).](https://placehold.co/600x400.png){#fig-dresses fig-alt="A woman and a girl in white dresses sit in an open car."}
image

@mcanouil mcanouil added the extensions relates to Quarto extensions mechanism label Jan 10, 2024
@mcanouil
Copy link
Collaborator

mcanouil commented Jan 10, 2024

It seems to be an issue with the template extension which causes conflict with the new Cross-reference system from 1.4, i.e., an invalid figure float is created:

\begin{figure}

\centering{

\begin{figure}
{\centering \includegraphics{sample-franklin.png}}
\caption{}
\Description{A woman and a girl in white dresses sit in an open car.}
\end{figure}

}

While the default LaTeX template produces:

\begin{figure}

\centering{

\includegraphics{index_files/mediabag/600x400.png}

}

\caption{\label{fig-dresses}1907 Franklin Model D roadster. Photograph
by Harris \& Ewing, Inc.~{[}Public domain{]}, via Wikimedia Commons.
(\url{https://goo.gl/VLCRBB}).}

\end{figure}%

Note that this issue is in the template: https://github.com/quarto-journals/acm/issues
To be precise, the issue is the following Lua filter: https://github.com/quarto-journals/acm/blob/main/_extensions/quarto-journals/acm/fancy-figure.lua#L61-L65

@mcanouil mcanouil removed the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Jan 10, 2024
@cderv
Copy link
Collaborator

cderv commented Jan 10, 2024

I opened

to follow up on this

@cderv cderv closed this as completed Jan 10, 2024
@bluewin4
Copy link
Author

Thanks so much for looking into this!

@mcanouil mcanouil added support a request for support and removed bug Something isn't working labels Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions relates to Quarto extensions mechanism support a request for support
Projects
None yet
Development

No branches or pull requests

3 participants