2

The following subfigures are not real subfigures, but I will call them pseudo-subfigures, since I would like to have captions above them like one can easily do with real subfigures.

However, I would not like to use real subfigures (decided after having many compatibility issues, which I can not all remember).

Here might be some of the reasons why one would prefer to use pseudo-subfigures (I might be wrong, as my memory fails):

  • It seems that it is a big chore (cf. Forcing subfigures to have same height and take overall X% of linewidth in LaTeX) to have real subfigures of equal height, while there is no labour with the pseudo-subfigures & (if wanted together with the previous) it seems to be even a bit more difficult to have sugfigures placed closely against each-other (cf. Reduction of Space between two Sub-figures).
  • I think using real subfigures would also conflict with having the footnotes there...
  • Somehow some other compatibility issue would appear, with some of the featured list items in relation to having the custom figurer environment (cf. code). In any way, I will use the figurer environment for each figure in my document of purpose, and thus will also use its numberings. Therefor, in casu, I would not like to revert to using real main figure captions.

MWE

P.S.: You need to compile this with LuaLaTex...

\documentclass{article}
\usepackage{graphicx}% images from mwe package

\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{calc}
\newcounter{picture}

%%%%% figurer environment

\newmdenv[
hidealllines=true,
innertopmargin=16pt,
innerbottommargin=10pt,
leftmargin=0cm,
rightmargin=0cm,
skipabove=10pt,
skipbelow=10pt,
singleextra={
  \coordinate (aux) at ( $ (O)!0.5!(P) $ );
  \fill[rounded corners=6pt,line width=1pt,blue!30]
    (O|-P) -- 
    (aux|-P) --
    ([yshift=12pt]aux|-P) --
    ([yshift=12pt,xshift=4cm]aux|-P) --
    ([xshift=4cm]aux|-P) -- 
    (P) {[sharp corners] --
    ([yshift=-6pt]P) -- 
    ([yshift=-6pt]O|-P) } -- cycle;
  \draw[rounded corners=6pt,line width=1pt,blue]
    (O|-P) -- 
    (aux|-P) --
    ([yshift=12pt]aux|-P) --
    ([yshift=12pt,xshift=4cm]aux|-P) --
    ([xshift=4cm]aux|-P) -- 
    (P) --
    (P|-O) --
    (O) -- cycle;
  \node at ([xshift=2cm,yshift=3pt]aux|-P)
    {\refstepcounter{picture}\large Figure~\thepicture} ; 
  },
firstextra={
  \coordinate (aux) at ( $ (O)!0.5!(P|-O) $ );
  \fill[rounded corners=6pt,line width=1pt,blue!30,overlay]
    (O|-P) -- 
    (aux|-P) --
    ([yshift=12pt]aux|-P) --
    ([yshift=12pt,xshift=4cm]aux|-P) --
    ([xshift=4cm]aux|-P) -- 
    (P) {[sharp corners] --
    ([yshift=-6pt]P) -- 
    ([yshift=-6pt]O|-P) } -- cycle;
  \draw[rounded corners=6pt,line width=1pt,blue,overlay]
    (O) --
    (O|-P) -- 
    (aux|-P) --
    ([yshift=12pt]aux|-P) --
    ([yshift=12pt,xshift=4cm]aux|-P) --
    ([xshift=4cm]aux|-P) -- 
    (P) --
    (P|-O);
  \node[overlay] at ([xshift=2cm,yshift=3pt]aux|-P)
    {\refstepcounter{picture}\large Figure~\thepicture} ; 
  },
middleextra={
  \draw[rounded corners=6pt,line width=1pt,blue,overlay]
    (O|-P) -- 
    (O);
  \draw[rounded corners=6pt,line width=1pt,blue,overlay]
    (P) -- 
    (P|-O);
  },
secondextra={
  \coordinate (aux) at ( $ (O)!0.5!(P|-O) $ );
  \draw[rounded corners=6pt,line width=1pt,blue,overlay]
    (O|-P) -- 
    (O) --
    (P|-O) --
    (P);
  },
]{figurer}

%%%%% begin the beguine

\begin{document}

\begin{figurer}

\begin{center}
\includegraphics[height=1cm]{example-image}
\includegraphics[height=1cm]{example-image} 
\includegraphics[height=1cm]{example-image}
\includegraphics[height=1cm]{example-image}
\includegraphics[height=1cm]{example-image}

This would be my caption here (We can even have footnotes here).\footnote{I like how the footnote stays inside the figure box.}

\end{center}

\end{figurer}

\end{document}

Is it somehow possible to have pseudo-subcaptions above each pseudo-subfigure? They don't need to be numbered anything: thus no need for a), b), c) etc...

Let's imagine the pictures are from a person, and one would simply briefly like to indicate the age of the person above each image?

P.S.: I would like to have a dynamic solution, which would work with any number of pictures (at least any number of pictures on 1 line), while all pictures (at least on 1 line) can be of equal (but differing per MWE) height.

MWE example

Please note that the text "This would be my caption here" is considered a "pseudo-caption" of the main "pseudo-figure" here, not a caption of any seperate "pseudo-subfigure".

1

I'd suggest setting all the pseudo-subfigures inside a tabular:

enter image description here

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\begin{center}
  \begin{tabular}{ *{5}{c} }
    \small A & \small B & \small C & \small D & \small E \\
    \includegraphics[height=1cm]{example-image} &
    \includegraphics[height=1cm]{example-image} &
    \includegraphics[height=1cm]{example-image} &
    \includegraphics[height=1cm]{example-image} &
    \includegraphics[height=1cm]{example-image}
  \end{tabular}

This is a pseudo-caption.
\end{center}

\end{document}

tabular columns expand relative to the widest element (caption or image). You can also adjust the inter-column spacing (given by \tabcolsep).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.