
Ich habe eine Tabelle mit Abbildungen verwendet, um deren Darstellung und Reihenfolge zu formatieren. Aber im Wesentlichen ist das Ganze eine Abbildung, also möchte ich, dass sie jetzt „Abbildung 5“ als Überschrift bekommt. Dazu muss ich wohl die gesamte Tabelle in eine Abbildung einfügen.
Ich mache Folgendes, aber es passiert nur, dass die Überschrift angezeigt wird, die Tabelle jedoch nicht, und es tritt ein Fehler auf:
! LaTeX-Fehler: Nicht im äußeren Par-Modus.
Der Code lautet wie folgt:
\begin{figure*}
\centering
\caption{Confusion matrices: Single 29-class model}
\label{Figure 5}
\begin{table}
\begin{tabularx}{\textwidth}{c X c }
\textbf{GentleBoost} & & \textbf{Baseline} \\ \noalign{\smallskip}\\
\includegraphics[width=7.25cm]{singlematrix_g1} & & \includegraphics[width=7.25cm]{singlematrix_b1} \\ \noalign{\smallskip}\\
\includegraphics[width=7.25cm]{singlematrix_g2} & & \includegraphics[width=7.25cm]{singlematrix_b2} \\ \noalign{\smallskip}\\
\includegraphics[width=7.25cm]{singlematrix_g3} & & \includegraphics[width=7.25cm]{singlematrix_b3} \\ \noalign{\smallskip}\\
\end{tabularx}
\end{table}
\end{figure*}
Mein einziges Anliegen ist jedoch, dass es als Abbildung und nicht als Tabelle angezeigt wird. Wenn es möglich ist, die Überschrift einfach von Tabelle in Abbildung zu ändern, dann wäre mir das lieber!
Antwort1
Ich musste die Bildgröße reduzieren, aber da sind sie:
% arara: pdflatex
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tabularx}
\usepackage{caption}
\begin{document}
\begin{table}
\begin{tabularx}{\textwidth}{c X c }
\textbf{GentleBoost} & & \textbf{Baseline} \\ \noalign{\bigskip}
\includegraphics[width=1.25cm]{singlematrix_g1} & & \includegraphics[width=1.25cm]{singlematrix_b1} \\ \noalign{\bigskip}
\includegraphics[width=1.25cm]{singlematrix_g2} & & \includegraphics[width=1.25cm]{singlematrix_b2} \\ \noalign{\bigskip}
\includegraphics[width=1.25cm]{singlematrix_g3} & & \includegraphics[width=1.25cm]{singlematrix_b3} \\ \noalign{\bigskip}
\end{tabularx}
\captionof{figure}{Confusion matrices: Single 29-class model}\label{Figure 5}
\end{table}
\end{document}
Antwort2
Verwenden Sie keine figure
Umgebung, sondern \captionof
, die im caption
Paket definiert ist. Hier ist ein Code-Fragment:
\begin{table}
\centering
\captionof{figure}{Confusion matrices: Single 29-class model}
\label{Figure 5}
\begin{tabularx}{\textwidth}{c X c }
\textbf{GentleBoost} & & \textbf{Baseline} \\ \noalign{\smallskip}\\
\includegraphics[width=7.25cm]{singlematrix_g1} & & \includegraphics[width=7.25cm]{singlematrix_b1} \\ \noalign{\smallskip}\\
\includegraphics[width=7.25cm]{singlematrix_g2} & & \includegraphics[width=7.25cm]{singlematrix_b2} \\ \noalign{\smallskip}\\
\includegraphics[width=7.25cm]{singlematrix_g3} & & \includegraphics[width=7.25cm]{singlematrix_b3} \\ \noalign{\smallskip}\\
\end{tabularx}
\end{table}
Antwort3
Benutzen Sie einfach figure
nichttable
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tabularx}
\begin{document}
\begin{figure}
\begin{tabularx}{\textwidth}{c X c }
\textbf{GentleBoost} & & \textbf{Baseline} \\ \noalign{\bigskip}
\includegraphics[width=1.25cm]{singlematrix_g1} & & \includegraphics[width=1.25cm]{singlematrix_b1} \\ \noalign{\bigskip}
\includegraphics[width=1.25cm]{singlematrix_g2} & & \includegraphics[width=1.25cm]{singlematrix_b2} \\ \noalign{\bigskip}
\includegraphics[width=1.25cm]{singlematrix_g3} & & \includegraphics[width=1.25cm]{singlematrix_b3} \\ \noalign{\bigskip}
\end{tabularx}
\caption{Confusion matrices: Single 29-class model}\label{Figure 5}
\end{figure}
\end{document}
Verwenden Sie es tabularx
hierfür jedoch nicht, da es langsam und mühsam ist und nichts wirklich Nützliches bewirkt, da die X-Spalte leer ist.
\documentclass{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}
\makebox[5.25cm]{\textbf{GentleBoost}}\hfill \makebox[5.25cm]{\textbf{Baseline} }
\bigskip
\includegraphics[width=5.25cm]{singlematrix_g1}\hfill\includegraphics[width=5.25cm]{singlematrix_b1}
\bigskip
\includegraphics[width=5.25cm]{singlematrix_g2}\hfill\includegraphics[width=5.25cm]{singlematrix_b2}
\bigskip
\includegraphics[width=5.25cm]{singlematrix_g3}\hfill\includegraphics[width=5.25cm]{singlematrix_b3}
\bigskip
\caption{Confusion matrices: Single 29-class model}\label{Figure 5}
\end{figure}
\end{document}