using latex environment floatingfigure #4854
-
Dear all I could figure out how to set text side by side to an image in html output. In Latex I'm doing that with \begin{floatingfigure}. Nesting figure environments isn't possible in latex. Some hints how I can handle this ? Thank you very much in advance |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
Can you share a .qmd file / project of what you are doing ? If I understand correctly you are using if so, does setting Anyhow, I don't think you need the latex environment extension, and definitely not to replace internal figure env handling. Maybe we are missing something and we'll add it |
Beta Was this translation helpful? Give feedback.
-
This is what I get now: {\centering \includegraphics[width=4cm,height=\textheight]{ch_galvanische_elemente/images/voltaicPillar.jpg} } \caption{Voltaische Säule} \end{floatingfigure} and that's what I wrote in the qmd-file
There is now [ ] to much for latex so I can't see the figure Currently I removed the extension again ... |
Beta Was this translation helpful? Give feedback.
-
\begin{floatingfigure}[[r]{6cm}] |
Beta Was this translation helpful? Give feedback.
-
Is there some way to manipulate the *.tex file before running xelatex? In this case I could solve the problem with the brackets |
Beta Was this translation helpful? Give feedback.
-
Looks like Quarto handles A workaround would be to use conditional content to provide a raw LaTeX alternative for LaTeX/PDF output. ::: {.content-visible unless-format="pdf"}
{ width="4cm" }
:::
::: {.content-visible when-format="pdf"}
`\begin{floatingfigure}[r]{6cm}`{=latex}
{ width="4cm" }
`\caption{Voltaische Säule}`{=latex}
`\end{floatingfigure}`{=latex}
::: LaTex output: \begin{floatingfigure}[r]{6cm}
\includegraphics[width=4cm,height=\textheight]{./images/voltaicPillar.jpg}
\caption{Voltaische Säule} \end{floatingfigure} Important: you need both explicit LaTeX inlines `...`{=latex}, and to have no empty lines around \begin{floatingfigure}[r]{6cm}
{ width="4cm" }
\end{floatingfigure is copied verbatime in LaTeX output: \begin{floatingfigure}[r]{6cm}
{ width="4cm" }
\end{floatingfigure} And with empty lines around images you would get an extra `\begin{floatingfigure}[r]{6cm}`{=latex}
{ width="4cm" }
`\caption{Voltaische Säule}`{=latex}
`\end{floatingfigure}`{=latex} Renders in LaTeX as: \begin{floatingfigure}[r]{6cm}
\begin{figure}
{\centering \includegraphics[width=4cm,height=\textheight]{./images/voltaicPillar.jpg}}
\caption{Voltaische Säule}
\end{figure}
\caption{Voltaische Säule} \end{floatingfigure} Which is what you got with the ALTERNATIVE. You could use the ::: {.content-visible unless-format="pdf"}
{ width="4cm" }
:::
::: {.content-visible when-format="pdf"}
::::: {.floatingfigure options="r" arguments="6cm"}
{ width="4cm" }
\caption{Voltaische Säule}
:::::
::: |
Beta Was this translation helpful? Give feedback.
Looks like Quarto handles
fig-env="ENVRT" fig-pos="POS"
by producing "\begin{ENVRT}[POS]" in LaTeX output, so it can't handle the fact thatfloatingfigure
has an extra argument: withfig-pos="[r]{6cm"
you get\begin{ENVRT}[[r]{6cm}]
. Perhaps Quarto could introduce afig-opt
attribute for arbitrary additions, but it's not there yet.A workaround would be to use conditional content to provide a raw LaTeX alternative for LaTeX/PDF output.