当前位置:网站首页>latex图片排版技巧总结
latex图片排版技巧总结
2022-08-10 05:30:00 【LIAN_U】
目录
两图并排
两图竖直排放,共享标题
\begin{figure}[htbp]
\centering
\includegraphics[width=0.2\textwidth]{number_1.jpg} \\
\includegraphics[width=0.2\textwidth]{number_2.jpg}
\caption{两图竖直摆放,共享标题}
\label{fig:ver_2figs_1cap}
\end{figure}
两图水平排放,共享标题
\begin{figure}
\begin{minipage}[t]{0.5\linewidth}
\centering
\includegraphics[width=2.2in]{number_1.jpg}
\end{minipage}
\begin{minipage}[t]{0.5\linewidth}
\centering
\includegraphics[width=2.2in]{number_2.jpg}
\end{minipage}
\caption{两图水平摆放,共享标题}
\label{fig:hor_2figs_1cap}
\end{figure}
两图竖直排放,独立标题
\begin{figure}
\centering
\begin{minipage}[t]{0.5\linewidth}
\centering
\includegraphics[width=2.2in]{number_1.jpg}
\caption{标题一}
\label{fig:ver_2figs_2cap_1}
\end{minipage}
\\
\begin{minipage}[t]{0.5\linewidth}
\centering
\includegraphics[width=2.2in]{number_2.jpg}
\caption{标题二}
\label{fig:ver_2figs_2cap_2}
\end{minipage}
\end{figure}
两图水平排放,独立标题
\begin{figure}
\begin{minipage}[t]{0.5\linewidth}
\centering
\includegraphics[width=2.2in]{number_1.jpg}
\caption{标题一}
\label{fig:hor_2figs_2cap_1}
\end{minipage}
\begin{minipage}[t]{0.5\linewidth}
\centering
\includegraphics[width=2.2in]{number_2.jpg}
\caption{标题二}
\label{fig:hor_2figs_2cap_2}
\end{minipage}
\end{figure}
两图水平排放,统一大标题,独立子标题
\begin{figure}
\centering
\subfigure[子标题一]{
\begin{minipage}[b]{0.2\textwidth}
\includegraphics[width=1\textwidth]{number_1.jpg}
\end{minipage}
\label{fig:hor_2figs_1cap_2subcap_1}
}
\subfigure[子标题二]{
\begin{minipage}[b]{0.2\textwidth}
\includegraphics[width=1\textwidth]{number_2.jpg}
\end{minipage}
\label{fig:hor_2figs_1cap_2subcap_2}
}
\caption{两图水平排放,统一大标题,独立子标题}
\label{fig:hor_2figs_1cap_2subcap}
\end{figure}
四图并排
四图水平摆放,统一大标题,两两独立子标题
\begin{figure}
\centering
\begin{minipage}[b]{0.45\textwidth}
\subfigure[标题一]{
\includegraphics[width=0.4\textwidth]{number_1.jpg}
\includegraphics[width=0.4\textwidth]{number_2.jpg}
\label{fig:hor_4figs_1cap_2subcap_1}
}
\end{minipage}
\begin{minipage}[b]{0.45\textwidth}
\subfigure[标题二]{
\includegraphics[width=0.4\textwidth]{number_3.jpg}
\includegraphics[width=0.4\textwidth]{number_4.jpg}
\label{fig:hor_4figs_1cap_2subcap_2}
}
\end{minipage}
\caption{四图水平摆放,统一大标题,两两独立子标题}
\label{fig:hor_4figs_1cap_2subcap}
\end{figure}
四图栅格摆放,统一大标题,两两独立子标题
\ref{fig:grid_4figs_1cap_2subcap_2}。
\begin{figure}
\centering
\subfigure[标题一]{
\begin{minipage}[b]{0.5\textwidth}
\includegraphics[width=0.4\textwidth]{number_1.jpg}
\includegraphics[width=0.4\textwidth]{number_2.jpg}
\end{minipage}
\label{fig:grid_4figs_1cap_2subcap_1}
}
\subfigure[标题二]{
\begin{minipage}[b]{0.5\textwidth}
\includegraphics[width=0.4\textwidth]{number_3.jpg}
\includegraphics[width=0.4\textwidth]{number_4.jpg}
\end{minipage}
\label{fig:grid_4figs_1cap_2subcap_2}
}
\caption{四图栅格摆放,统一大标题,两两独立子标题}
\label{fig:grid_4figs_1cap_2subcap}
\end{figure}
四图栅格摆放,统一大标题,独立子标题
\begin{figure}
\centering
\subfigure[标题一]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{number_1.jpg}
\end{minipage}
\label{fig:grid_4figs_1cap_4subcap_1}
}
\subfigure[标题二]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{number_2.jpg}
\end{minipage}
\label{fig:grid_4figs_1cap_4subcap_2}
}
\\
\subfigure[标题三]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{number_3.jpg}
\end{minipage}
\label{fig:grid_4figs_1cap_4subcap_3}
}
\subfigure[标题四]{
\begin{minipage}[b]{0.3\textwidth}
\includegraphics[width=1\textwidth]{number_4.jpg}
\end{minipage}
\label{fig:grid_4figs_1cap_4subcap_4}
}
\caption{四图栅格布局摆放,统一大标题,独立子标题}
\label{fig:grid_4figs_1cap_4subcap}
\end{figure}
并排摆放,统一大标题,独立子标题
总结
如果想要两幅并排的图片共享一个标题,并各有自己的子标题,一般有两种办法。但需要特别注意:这两种方法不互相兼容,即在同一份文档中,你只能选择其中的一种方法使用。
方法一:使用宏包subfig(不推荐)
使用subfig宏包提供的\subfloat命令,需要使用宏包\usepackage{graphicx}和\usepackage{subfig}。subfloat命令缺少宽度参数,虽然可以用\hspace命令调整子图的距离,子标题却只能和子图本身一样宽,会出现折行。为了避免子标题折行,一般在\subfloat里再嵌套个minipage,因为后者是有宽度的。
\begin{figure}[htbp]
\centering
\subfloat[子标题一]{
\label{fig:1}
\begin{minipage}[c]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{number_1.jpg}
\end{minipage}
}
\subfloat[子标题二]{
\label{fig:2}
\begin{minipage}[c]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{number_2.jpg}
\end{minipage}
}
\caption{两图水平排放,统一大标题,独立子标题}
\label{fig:2figs}
\end{figure}
方法二:使用宏包subfigure(推荐)
使用subfigure宏包提供的\subfigure命令,需要使用宏包\usepackage{graphicx}和\usepackage{subfigure},subfigure不支持\换行,可以把minipage放在subfigure{}中,在minipage{}里换行。
\begin{figure}
\centering
\subfigure[子标题一]{
\begin{minipage}[b]{0.2\textwidth}
\includegraphics[width=1\textwidth]{number_1.jpg}
\end{minipage}
\label{fig:hor_2figs_1cap_2subcap_1}
}
\subfigure[子标题二]{
\begin{minipage}[b]{0.2\textwidth}
\includegraphics[width=1\textwidth]{number_2.jpg}
\end{minipage}
\label{fig:hor_2figs_1cap_2subcap_2}
}
\caption{两图水平排放,统一大标题,独立子标题}
\label{fig:hor_2figs_1cap_2subcap}
\end{figure}
以上显示在单列。如果希望跨列显示,并且修改相应的宽度参数。
原文:https://vvingerfly.github.io/2018/02-16-Tex-imageTypesetting/
原文很好,在此收藏保留
边栏推荐
- Mysql CDC (2.1.1) inital snapshot database set up five concurrent degree, se
- CORS跨域资源共享漏洞的原理与挖掘方法
- AVL tree insertion--rotation notes
- Touch chip used in smart touch remote control
- 我用这一招让团队的开发效率提升了 100%!
- An article to master the entire JVM, JVM ultra-detailed analysis!!!
- 基于Qiskit——《量子计算编程实战》读书笔记(六)
- pytorch框架学习(1)网络的简单构建
- FPGA engineer interview questions collection 31~40
- 图纸怎么折?(A0,A1,A2,A3の图纸如何折成A4大小)
猜你喜欢
基于Qiskit——《量子计算编程实战》读书笔记(七)
基于Qiskit——《量子计算编程实战》读书笔记(二)
CORS跨域资源共享漏洞的原理与挖掘方法
树莓派入门(4)LED闪烁&呼吸灯
论文精度 —— 2017 ACM《Globally and Locally Consistent Image Completion》
pygame学习计划(1)
利用PyQt5制作YOLOv5的GUI界面
【格式转换】将JPEG图片批量处理为jpg格式
Zhongang Mining: Strong downstream demand for fluorite
pytorch框架学习(6)训练一个简单的自己的CNN (三)细节篇
随机推荐
Read the excerpt notes made by dozens of lightweight target detection papers for literacy
我用这一招让团队的开发效率提升了 100%!
训练集Loss收敛,但是测试集Loss震荡的厉害?
openGauss源码,在window系统用VSCode维护吗?
虚拟土地价格暴跌85% 房地产泡沫破裂?依托炒作的暴富游戏需谨慎参与
25张炫酷交互图表,一文入门Plotly
Kubernetes:(十六)Ingress的概念和原理
【格式转换】将JPEG图片批量处理为jpg格式
Introduction to curl command
OpenGauss source code, is it maintained with VSCode in the window system?
WSTP初体验
文章复现:超分辨率网络-VDSR
CORS跨域资源共享漏洞的原理与挖掘方法
并发工具类——CountDownLatch、CyclicBarrier、Semaphore、Exchanger的介绍与使用
SQLSERVER 2008 parses data in Json format
基于Qiskit——《量子计算编程实战》读书笔记(一)
FPGA engineer interview questions collection 41~50
基于Servlet的验证码登陆demo
FPGA工程师面试试题集锦31~40
MySql之json_extract函数处理json字段