
나는 이런 종류의 보고서를 생성하기 위해 rmarkdown을 사용하고 있습니다. 사진의 크기가 동일하지 않다는 것을 보여주기 위해 프레임박스를 사용했습니다. 크기가 다른 11장의 그림(행당 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를 사용할 필요가 없을 수도 있습니다 .
m
array
framebox
includegraphics
\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}