Is there a way to align figure captions when put side by side in PDF? #11314
-
DescriptionI'm looking forward to replicate something similar to a latex code using \figure and \minipage to put 2 figures side by side. It seems to me that the latex code aligns the caption by default and not the figure. Here is a minimal reproducible code: ---
title: "Align captions"
format:
pdf:
pdf-engine: lualatex
lof: true
colorlinks: false
keep-tex: true
---
Reference check to @fig-1 and @fig-2.
::: {layout-ncol=2}
{#fig-1 fig-scap="Short caption for Figure 1"}
{#fig-2 fig-scap="Short caption for Figure 2"}
:::
\begin{figure}[h!]
\begin{minipage}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/figure1.jpg}
\caption[Short caption 1 via latex]{Caption for Figure 1}
\label{fig:figure1}
\end{minipage}
\hfill
\begin{minipage}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/figure2.jpg}
\caption[Short caption 2 via latex]{Caption for Figure 2}
\label{fig:figure2}
\end{minipage}
\end{figure} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
See https://quarto.org/docs/authoring/figures.html#vertical-alignment Note that your example is not reproducible. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
See https://quarto.org/docs/authoring/figures.html#vertical-alignment
Note that your example is not reproducible.
Also, you should not have bare raw code, use raw code blocks, see https://quarto.org/docs/authoring/markdown-basics.html#raw-content
You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four
````
).See https://quarto.org/bug-reports.html#small-is-beautiful-aim-for-a-single-document-with-10-lines.
If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.