How to insert caption to graphics in the table so that they get properly converted?

Let’s say I want to combine several figures in one environment, such as the image shown below. I am using a table with 2 rows and two columns. Using this method, and converting to LaTex, I get the code below. How can I make it so that the convertion process recognizes the cations as captions and places them inside caption tags?

\begin{figure}[h]
  {\noindent}\begin{tabularx}{1.0\textwidth}{cc}
    \resizebox{0.35\columnwidth}{!}{\includegraphics{s1_b_d1.pdf}} &
    \resizebox{0.35\columnwidth}{!}{\includegraphics{s1_b_d1.pdf}}\\
    (a) caption & (a) caption
  \end{tabularx}
  \caption{}
\end{figure}

I don’t know to get what you want—I think you want subfigures that can be converted into LaTeX.
I made an Internet search with key ‘subfigures TeXmacs’ and I found that there is a package that does that: https://savannah.gnu.org/patch/?7777
I did not look inside that code. As far as I understand it is not part of the official TeXmacs distribution (as I did not find a reference to subfigures in the TeXmacs manual) and I assume there is no LaTeX translation included; but one needs to check.

I also tried in a different way: insert a table inside a big-figure, a small Named figure inside each cell:


The export to LaTeX of this construct seems bugged: I get

\documentclass{article}
\usepackage[english]{babel}
\usepackage{graphicx}

\begin{document}

\begin{figure}[h]
  \begin{tabular}{ll}
    {\rendersmallfigure{}{(a)}{\raisebox{0.0\height}{\includegraphics[width=3.48511084874721cm,height=0.889298832480651cm]{export-figure-captions-1.pdf}}}{Left
    test}} &
    {\rendersmallfigure{}{(b)}{\raisebox{0.0\height}{\includegraphics[width=3.48511084874721cm,height=0.889298832480651cm]{export-figure-captions-2.pdf}}}{Right
    test}}
  \end{tabular}
  \caption{test of big figure}
\end{figure}

\end{document}

and the \rendersmallfigure macro is not defined. This looks like a bug.

Perhaps someone is able to help you better. I have a feeling that maybe one can insert “by-hand” some LaTeX constructs using the specific tag that would get you what you want but it needs some work; the LaTeX package to consider is capt-of I think (I found it out while I was trying a different approach to obtaining subfigures in TeXmacs).

1 Like