当前位置:网站首页>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/
原文很好,在此收藏保留
边栏推荐
- Concurrency tool class - introduction and use of CountDownLatch, CyclicBarrier, Semaphore, Exchanger
- Zhongang Mining: Strong downstream demand for fluorite
- aliases节点分析
- How does Jenkins play with interface automation testing?
- 基于Qiskit——《量子计算编程实战》读书笔记(四)
- 基于Qiskit——《量子计算编程实战》读书笔记(二)
- Kubernetes:(十六)Ingress的概念和原理
- pytorch框架学习(5)torchvision模块&训练一个简单的自己的CNN (二)
- pytorch learning
- Qiskit 学习笔记1
猜你喜欢

Practical skills 19: Several postures of List to Map List

论文精度 —— 2017 ACM《Globally and Locally Consistent Image Completion》

基于Servlet的验证码登陆demo

Kubernetes:(十六)Ingress的概念和原理

基于Qiskit——《量子计算编程实战》读书笔记(一)

Linear Algebra (4)
![[Thesis Notes] Prototypical Contrast Adaptation for Domain Adaptive Semantic Segmentation](/img/ac/51c2b2e4efed822f110d6963308eef.png)
[Thesis Notes] Prototypical Contrast Adaptation for Domain Adaptive Semantic Segmentation

Conda creates a virtual environment method and pqi uses a domestic mirror source to install a third-party library method tutorial

pytorch框架学习(1)网络的简单构建

Order table delete, insert and search operations
随机推荐
EasyGBS connects to mysql database and prompts "can't connect to mysql server", how to solve it?
Kubernetes:(十六)Ingress的概念和原理
canvas canvas drawing clock
Arduino框架下合宙ESP32C3 +1.8“tft 网络时钟
基于Qiskit——《量子计算编程实战》读书笔记(六)
pytorch框架学习(5)torchvision模块&训练一个简单的自己的CNN (二)
【论文笔记1】小样本分类
An article will help you understand what is idempotency?How to solve the idempotency problem?
【yolov5训练错误】WARNING: Ignoring corrupted image
基于Qiskit——《量子计算编程实战》读书笔记(七)
Error when installing oracle rac 11g and executing root.sh
How to simulate the background API call scene, very detailed!
k-近邻实现手写数字识别
Jenkins 如何玩转接口自动化测试?
树莓派入门(3)树莓派GPIO学习
AVL tree insertion--rotation notes
FPGA engineer interview questions collection 11~20
FPGA工程师面试试题集锦21~30
FPGA工程师面试试题集锦1~10
Qiskit学习笔记(三)