複数の写真をタイトルと説明に合わせて配置する

複数の写真をタイトルと説明に合わせて配置する

私は rmarkdown を使用してこの種のレポートを作成しています。画像のサイズが同じではないことを示すためにフレームボックスを使用しました。異なるサイズの 11 枚の画像 (1 行あたり 6 枚、2 行) を揃え、上部にタイトルを追加し、各画像の下に段落を追加しようとしています。タイトルは 1 行と 2 行が混在しています。画像

ここに画像の説明を入力してください

\setmainfont{Roboto}
\newfontfamily\Ofont{Oswald}
\newfontfamily\ORfont{Oswald Regular}
\newfontfamily\RMfont{Roboto Medium}
\newfontfamily\RLfont{Roboto Light}
\renewcommand{\baselinestretch}{1}
\setlength{\columnsep}{0.2cm}
 \begin{multicols}{6}
\begin{center}
\textbf{\ORfont{\fontsize{11}{48} \selectfont  \\Agriculture}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Agriculture}}\\ 
\vspace{10mm}\textbf{\ORfont{\fontsize{11}{48} \selectfont  \\Transport}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Transport}}\\ 
\vspace{10mm}\columnbreak
\textbf{\ORfont{\fontsize{11}{48} \selectfont  \\Education}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Education}}\\ 
\vspace{10mm}\textbf{\ORfont{\fontsize{11}{48} \selectfont Water, Sanitation \&\\Urban Services}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Water, Sanitation & Urban Services}}\\ 
\vspace{10mm}\columnbreak
\textbf{\ORfont{\fontsize{11}{48} \selectfont  \\Energy}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Energy}}\\ 
\vspace{10mm}\textbf{\ORfont{\fontsize{11}{48} \selectfont Industry \&\\Mining}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Industry & Mining}}\\ 
\vspace{10mm}\columnbreak
\textbf{\ORfont{\fontsize{11}{48} \selectfont  \\Finance}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Finance}}\\ 
\vspace{10mm}\textbf{\ORfont{\fontsize{11}{48} \selectfont  \\Real Estate}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Real Estate}}\\ 
\vspace{10mm}\columnbreak
\textbf{\ORfont{\fontsize{11}{48} \selectfont  \\Health}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Health}}\\ 
\vspace{10mm}\textbf{\ORfont{\fontsize{11}{48} \selectfont  \\Others}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Others}}\\ 
\vspace{10mm}\columnbreak
\textbf{\ORfont{\fontsize{11}{48} \selectfont Information \&\\Communications}}\\ 
\vspace{1cm}\framebox{\includegraphics[height=0.25\textheight]{Information & Communications}}\\ 
\vspace{10mm}\columnbreak
\end{center}
\end{multicols}

答え1

すべての画像を整列させる最も簡単な方法は、おそらく、tabular環境を使用して、それらをテーブルに配置することです。ここでは、空白の画像を使用した小さな例を作成しました。各セルでテキストを垂直方向と水平方向の両方で中央揃えにするために、パッケージの列タイプCに基づいて新しい列タイプを定義しました。 また、画像のサイズが異なっていても、のオプションの引数でサイズを直接指定できるため、おそらく any を使用する必要はありません。marrayframeboxincludegraphics

\documentclass[11pt]{article}
\usepackage{array}
\usepackage[demo]{graphicx}
\usepackage[margin=2cm]{geometry}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\newlength{\colwidth}
\setlength{\colwidth}{2.8cm}

\begin{document}

\begin{table}
\centering
\begin{tabular}{C{\colwidth}C{\colwidth}C{\colwidth}C{\colwidth}C{\colwidth}C{\colwidth}}
    Agriculture & Finance & Information \& communications & Title 4 & Title 5 & Title 6 \\
        \includegraphics[width=0.8\linewidth]{a} &
        \includegraphics[width=0.8\linewidth]{b} &
        \includegraphics[width=0.8\linewidth]{c} &
        \includegraphics[width=0.8\linewidth]{d} &
        \includegraphics[width=0.8\linewidth]{e} &
        \includegraphics[width=0.8\linewidth]{f} \\
        11 projects & 
        11 projects & 
        11 projects & 
        11 projects & 
        11 projects & 
        11 projects \\
        \$US 11.0m & 
        \$US 11.0m & 
        \$US 11.0m & 
        \$US 11.0m & 
        \$US 11.0m & 
        \$US 11.0m \\[4mm]
    Ttile 7 & Title 8 & Title 9 & Title 10 & Title 11 & Title 12 \\
        \includegraphics[width=0.8\linewidth]{g} &
        \includegraphics[width=0.8\linewidth]{h} &
        \includegraphics[width=0.8\linewidth]{i} &
        \includegraphics[width=0.8\linewidth]{j} &
        \includegraphics[width=0.8\linewidth]{k} &
        \includegraphics[width=0.8\linewidth]{l} \\
        11 projects & 
        11 projects & 
        11 projects & 
        11 projects & 
        11 projects & 
        11 projects \\
        \$US 11.0m & 
        \$US 11.0m & 
        \$US 11.0m & 
        \$US 11.0m & 
        \$US 11.0m & 
        \$US 11.0m \\
\end{tabular}
\end{table}

\end{document}

関連情報