Text alignment in figure layouts #1534
Replies: 2 comments 12 replies
-
Either of these produce pretty good results for me - do either of these work for you? ::: {#fig-test layout-ncol=2 fig-cap="This is the text in the layout but it is center-aligned under the layout in the rendered PDF document."}
{width="250"}
{width="250"}
::: or ::: {layout-ncol=2}
{width="250"}
{width="250"}
:::
This is the text in the layout but it is center-aligned under the layout in the rendered PDF document. |
Beta Was this translation helpful? Give feedback.
-
I'm using the custom layouts, namely two columns to show an image and some text. I'm doing this, because a markdown table results in odd vertical alignment in the PDF (the text aligns with the bottom of the image, which looks bad when you have multiple lines of text). Here's the ref to the documentation: https://quarto.org/docs/authoring/figures.html#vertical-alignment Here's a MWE: ::: {layout="[10,-2,30]" layout-valign="center"}

This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
::: This is great in HTML: The text is left-aligned, which is what I expect. However, in the PDF output, the text is centered, which is not what I would expect: I turned on \begin{minipage}[c]{0.83\linewidth}
{\centering
This work is licensed under a
\href{http://creativecommons.org/licenses/by/4.0/}{Creative Commons
Attribution 4.0 International License}.
}
\end{minipage}% So, I wonder if there's a better way to do this in LaTeX. Perhaps use Based on how the LaTeX is generated, I hacked a workaround for my MWE which relies on ---
format:
pdf:
keep-tex: true
header-includes: |
\usepackage{ragged2e}
---
::: {layout="[5,-1,30]" layout-valign="center"}

This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
:::
::: {layout="[5,-1,30]" layout-valign="center"}

\justifying \noindent This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).
::: Cheers! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
How does one change the alignment of text with a Quarto figure layout? Here is a snippet of a layout containing two images and some text underneath:
The text in the layout is always center-aligned under the layout when rendered to PDF. Does anyone know how to override this to be left aligned in the rendered PDF?
Thanks in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions