实现对子图片的引用,比如引用Fig.1(a)而不是Fig.1a

2021-02-01 18:12发布

## 编译环境 操作系统 * [1 ] Windows 7/8/10 * [ ] macOS * [ ] Linux `若需勾选,请把[ ]改成[x]` Tex发行版 * [1 ] TexLive ...

## 编译环境 操作系统 * [1 ] Windows 7/8/10 * [ ] macOS * [ ] Linux `若需勾选,请把[ ]改成[x]` Tex发行版 * [1 ] TexLive `年份` * [ ] MikTeX `版本号` * [ ] CTeX `若需勾选,请把[ ]改成[x]` ## 我的问题 实现对子图片的引用,比如引用Fig.1(a)而不是Fig.1a mwe已上传附件
2条回答
``` \documentclass{mcmthesis} % See Section 6 in subcaption.pdf \usepackage[labelformat=simple]{subcaption} \renewcommand{\thesubfigure}{(\alph{subfigure})} \captionsetup[subfigure]{font+=footnotesize} \begin{document} \begin{figure}[htbp] \centering \begin{subfigure}{0.3\linewidth} \centering \includegraphics[height=0.15\textheight]{C2_4-1.png} \caption{Review percent per rating}\label{fig:sub-fig-4-1} \end{subfigure}% \begin{subfigure}{0.4\linewidth} \centering \includegraphics[height=0.15\textheight]{C2_4-1.png} \caption{Customer amount by review number}\label{fig:sub-fig-4-2} \end{subfigure}% \begin{subfigure}{0.3\linewidth} \centering \includegraphics[height=0.15\textheight]{C2_4-1.png} \caption{Rating score per month}\label{fig:sub-fig-4-3} \end{subfigure} \caption{Review amount from different angles}\label{fig:fig} \end{figure} Now we cite Figure~\ref{fig:sub-fig-4-1}. \end{document} ``` ![](https://wenda.latexstudio.net/data/attach/210201/rY7DXa05.png) 我习惯用 `subcaption` 而不是 `subfig`。 关于子图的题注,你给的宽度太窄了,所以文字一定换行。 三图并在一起的话,我也可以这么写。 ``` \documentclass{mcmthesis} % See Section 6.2 in subcaption.pdf \usepackage{subcaption} \captionsetup{subrefformat=parens} \begin{document} \begin{figure}[htbp] \centering \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=\linewidth]{C2_4-1.png} \caption{}\label{fig:sub-fig-4-1} \end{subfigure}% \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=\linewidth]{C2_4-1.png} \caption{}\label{fig:sub-fig-4-2} \end{subfigure}% \begin{subfigure}{0.3\linewidth} \centering \includegraphics[width=\linewidth]{C2_4-1.png} \caption{}\label{fig:sub-fig-4-3} \end{subfigure} \caption{Review amount from different angles. \subref{fig:sub-fig-4-1}: Review percent per rating. \subref{fig:sub-fig-4-2}: Customer amount by review number. \subref{fig:sub-fig-4-3}: Rating score per month}\label{fig:fig} \end{figure} Now we cite Figure~\ref{fig:fig}\subref{fig:sub-fig-4-1}. \end{document} ``` ![](https://wenda.latexstudio.net/data/attach/210201/ag1vedAB.png)

一周热门 更多>