animation.hook is ignored for LaTeX output in the knitr engine
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- latex, r
- Ambito
- build-system, tooling
Direzione di ricerca
Start in src/resources/rmd/hooks.R, especially latex_animation(), the animation dependency handling, and the linked hook setup; then inspect src/resources/schema/cell-figure.yml. Compare the current logic with knitr's hook_plot_tex() behavior. Done means a non-built-in animation.hook is honored for LaTeX/PDF output and the animate dependency is not added when that hook supplies the output.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The animation.hook chunk option works for HTML output but has no effect for LaTeX/PDF output.
For a chunk with fig.show: animate, we only inject a default hook when the format is not LaTeX
The HTML branch then delegates to knitr's hook_animation(), so a user-supplied hook is honored there. The LaTeX branch instead calls our own latex_animation(), which always emits \animategraphics{} and never looks at animation.hook
It also adds a dependency on the LaTeX animate package unconditionally
Upstream knitr changed this in yihui/knitr#2452: hook_plot_tex() now calls a user-supplied animation.hook (or the package option animation.fun) to generate the LaTeX code, so LaTeX packages other than animate can be used, xmpmulti for beamer overlays being the motivating example. The built-in hooks (ffmpeg, gifski, scianimator, r2swf) generate HTML and keep being ignored for LaTeX. Our latex_animation() is a port of knitr's code from before that change.
So with the next knitr release this will work in .Rmd but not in .qmd.
We could port the same logic into latex_animation(): when animation.hook is a function and is not one of knitr's built-in HTML hooks, call it instead of emitting \animategraphics{}, and skip the animate dependency in that case.
Two things to sort out if we do this. Our schema documents animation-hook with default: ffmpeg while we actually inject gifski for non-LaTeX output, and it is typed as a string with completions, so a function can only be passed with the classic R chunk syntax ({r, animation.hook=my_hook}) and not with #| YAML.
- Lingua principale
- JavaScript
- Stelle
- 6k
- Fork
- 458
- Merge medio
- 1g 9h
- PR unite (30g)
- 41
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quarto-dev/quarto-cli
-
binder bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
quarto-dev/quarto-cli#14907 · 3 commenti ·
-
brand bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
quarto-dev/quarto-cli#14891 ·
-
brand bug html revealjs
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
quarto-dev/quarto-cli#14882 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
quarto-dev/quarto-cli#14875 ·
-
Percent scripts: accept raw-string (r""") and '''-delimited markdown cells, as jupytext writes them Apertaengines-jupyter enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
quarto-dev/quarto-cli#14850 · 2 commenti ·
Tutte le issue di quarto-dev/quarto-cli
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
matrix-org/matrix.org#3649 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vadimdemedes/ink#1029 ·