TransWikia.com

Subfigure and subtable side-by-side?

TeX - LaTeX Asked by Mas A on July 28, 2020

enter image description here

I have to do something like above.I saw similar questions, but I didn’t find anything about what I need to do exactly.

Here an example of what i did (it doesn’t work as i want):

begin{figure*}[!h]
centering
  begin{subfigure}[t]{0.48textwidth}
  includegraphics[width=1.0linewidth]{figure.png} 
  caption{Caption 1}
  label{fig:fig1}
  end{subfigure}
    
  begin{subtable}[t]{}
  scalebox{0.5}{
    begin{tabular}{|c|c|}
    1 & 2\ hline
    11 & 22\ hline
    end{tabular}
  }
  caption{Caption 2}
  label{table:table}
  end{subtable}
caption{Caption 3}
label{fig:mainfigure}
end{figure*}

One Answer

documentclass[twocolumn]{article}
usepackage[demo]{graphicx} % do not use demo option in actual document.
usepackage{subcaption}

begin{document}

begin{figure*}[!h]
centering
  begin{subfigure}[b]{0.48textwidth}
  includegraphics[width=1.0linewidth]{figure.png} 
  caption{Caption 1}
  label{fig:fig1}
  end{subfigure}
%
  begin{subtable}[b]{0.48textwidth}
  centering
    begin{tabular}{|c|c|}
    1 & 2\ hline
    11 & 22\ hline
    end{tabular}
  caption{Caption 2}
  label{table:table}
  end{subtable}
caption{Caption 3}
label{fig:mainfigure}
end{figure*}

end{document}

enter image description here

Correct answer by leandriis on July 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP