quarto-dev / quarto-dev/quarto-cli
Passing LaTeX argument argument to `\includegraphics{}` (e.g `draft`)
@cscheid ci sta già lavorando.
Dal 18/7/2023.
- Lingua principale
- JavaScript
- Stelle
- 6k
- Fork
- 458
- Merge medio
- 1g 9h
- PR unite (30g)
- 41
Descrizione
Discussed in https://github.com/quarto-dev/quarto-cli/discussions/6234
Originally posted by ramiromagno July 17, 2023
Description
Is there a simple way of adding the draft option to:
such that instead of getting:
\begin{figure}[t]
{\centering \includegraphics[width=\textwidth,height=1.5in]{empty.pdf}}
\caption{\label{fig-fig1}This is the sample figure caption.}
\end{figure}
I would get the argument draft passed on to \includegraphics{}:
\begin{figure}[t]
{\centering \includegraphics[width=\textwidth,height=1.5in, draft]{empty.pdf}}
\caption{\label{fig-fig1}This is the sample figure caption.}
\end{figure}
Details
We could expect to do it like
{#fig-fig2 draft=true}
However this does not work. Currently I don't think Pandoc supports passing any attributes to LaTeX. They are ignored.
knitr does have a out.extra chunk option that allows that;
```{r}
#| fig.cap: This is the sample figure caption.
#| out.extra: draft
knitr::include_graphics("empty", error = FALSE)
```
but knitr does write the LaTeX markup directly in that case, and does not rely on Pandoc.
Note: This does not work in Quarto because quarto will always enforce Markdown syntax for image for all knitr output.
Not sure we can improve the feature without Pandoc support... 🤔 But still opening the issue to track the idea.
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.
Valutazione
Questa issue non è ancora stata valutata.