pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
603 stars 165 forks source link

short-caption does not work with subfigures #62

Closed LukasCBossert closed 5 years ago

LukasCBossert commented 5 years ago

When you have subfigures like this (and using pandoc-crossref)

<div id="fig:figureRef">
![subfigure 1 caption](example-image-a){#fig:figureRefA short-caption="short subfigure caption A" width=45%}

![subfigure 2 caption](example-image-b){#fig:figureRefB short-caption="short subfigure caption B"  width=45%}

Caption of figure
</div>

the filter won’t work, since it adds another figure environment.

\begin{figure}
\centering

\begin{figure}
\centering
\subfloat[subfigure 1
caption]{\includegraphics[width=0.45\textwidth,height=\textheight]{example-image-a}\label{fig:figureRefA}}
\caption[{short subfigure caption A}]{subfigure 1 caption}
\label{fig:figureRefA}
\end{figure}

\begin{figure}
\centering
\subfloat[subfigure 2
caption]{\includegraphics[width=0.45\textwidth,height=\textheight]{example-image-b}\label{fig:figureRefB}}
\caption[{short subfigure caption B}]{subfigure 2 caption}
\label{fig:figureRefB}
\end{figure}

\caption{Caption of figure}

\label{fig:figureRef}

\end{figure}
tarleb commented 5 years ago

I believe subfigures are out of scope for this filter; we will support subfigures when pandoc does. However, if you want to contribute a fix for this, we would consider it.