Skip to content

Weird fig-cap placement with fig-subcap with pdf output #3711

@cscheid

Description

@cscheid

Discussed in #3710

Originally posted by agerlach December 19, 2022
When using fig-cap with fig-subcap I am getting a weird layout for the main caption with pdf output. fig-cap is placed fine when fig-subcap is not used. Is this a bug, or am I doing something incorrectly?

---
title: Hello World
jupyter: julia-1.8
---

```{julia}
#| echo: false
#| fig-cap: "My Plots"
#| fig-subcap: 
#|   - "Plot A"
#|   - "Plot B"
#| layout-ncol: 2

using Plots

plot(rand(25)) |> display
plot(rand(25)) |> display
```

```{julia}
#| echo: false
#| fig-cap: "My Plots 2"

plot(rand(25)) |> display
```

Screen Shot 2022-12-19 at 9 14 11 AM

image

The resulting *.tex contains

\begin{figure}

\begin{minipage}[t]{0.50\linewidth}

{\centering 

\raisebox{-\height}{

\includegraphics{subcap_files/figure-pdf/cell-2-output-1.pdf}

}

\caption{Plot A}

}

\end{minipage}%
%
\begin{minipage}[t]{0.50\linewidth}

{\centering 

\raisebox{-\height}{

\includegraphics{subcap_files/figure-pdf/cell-2-output-2.pdf}

}

\caption{Plot B}

}

\end{minipage}%
\newline
\begin{minipage}[t]{0.50\linewidth}

{\centering 

My Plots

}

\end{minipage}%

\end{figure}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions