如何在LaTeX中垂直对齐单页上的3张R Studio导出PNG图片?
解决LaTeX中三张图片垂直对齐排列的问题
问题分析
你当前的代码已具备垂直排列图片的基础,但可能存在图片未居中、子图排版不够规整的问题。以下是两种优化方案,帮你实现整齐的垂直对齐效果:
优化方案1:保留子图标注的规整排版
通过添加居中命令和强制换行,确保每张图片垂直居中排列,子图标题格式统一:
\documentclass[11pt,fleqn,a4paper]{article} \usepackage{graphicx} \usepackage[caption=false]{subfig} \begin{document} \begin{figure}[htp] \centering % 让整个figure内容居中 \subfloat[德国,行业C26至C30]{% \includegraphics[clip,width=0.8\columnwidth]{Images/deu.png}% 可调整宽度适配页面 }\\ % 强制换行,确保下一张图在下方 \subfloat[意大利,行业C29-C30]{% \includegraphics[clip,width=0.8\columnwidth]{Images/ITA.png}% }\\ \subfloat[美国,行业C29-C30]{% \includegraphics[clip,width=0.8\columnwidth]{Images/USA.png}% } \caption{离岸外包水平。\\来源:基于WIOT和SEA表格(2016)整理的数据。} \end{figure} \end{document}
优化方案2:无标注的简洁垂直排版
如果不需要子图的字母标注,直接用\includegraphics加换行即可,代码更简洁:
\documentclass[11pt,fleqn,a4paper]{article} \usepackage{graphicx} \begin{document} \begin{figure}[htp] \centering \includegraphics[clip,width=0.8\columnwidth]{Images/deu.png}\\ \caption*{德国,行业C26至C30} \includegraphics[clip,width=0.8\columnwidth]{Images/ITA.png}\\ \caption*{意大利,行业C29-C30} \includegraphics[clip,width=0.8\columnwidth]{Images/USA.png}\\ \caption*{美国,行业C29-C30} \caption{离岸外包水平。\\来源:基于WIOT和SEA表格(2016)整理的数据。} \end{figure} \end{document}
关键调整说明
- 添加
\centering命令:避免图片左对齐的杂乱感,让所有内容居中显示 - 使用
\\强制换行:确保每张图片单独占一行,实现严格的垂直排列 - 调整图片宽度:
0.8\columnwidth让图片左右留空更美观,若需占满整行可设为1\columnwidth - 中文适配:已将原英文标题翻译为符合中文排版习惯的表述
内容的提问来源于stack exchange,提问作者Maximilian
相关产品推荐
相关产品推荐

