子图中标签的移位

子图中标签的移位

我有

\documentclass[12pt]{article}
\usepackage[left=10mm, top=20mm, right=10mm, bottom=20mm]{geometry}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[font=scriptsize]{caption}
\captionsetup{width=0.8\textwidth}
\begin{document}

\begin{figure}[h!]
\centering
\subfloat[xxx]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\qquad
\subfloat[yyy]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\qquad
\subfloat[zzz]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\caption{.}
\label{appendix}
\end{figure}
\end{document}

并得到 在此处输入图片描述

你能帮帮我吗,我该如何处理(a)xxx、(b)yyy、(c)zzz 的水平移动?

UPD:这样的例子

\documentclass[12pt]{article}
\usepackage[left=10mm, top=20mm, right=10mm, bottom=20mm]{geometry}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[font=scriptsize]{caption}
%\captionsetup{width=0.8\textwidth}

\begin{document}
\title{title}
\author{authors}
\date{}
\maketitle
\abstract{abstract}
\section{Introduction}
just main text just main text just main text just main text just main text just main text just main text just main text just main text just main text just main text
\begin{figure}[h!]
\centering
\subfloat[]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\qquad
\subfloat[]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\qquad
\subfloat[]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\caption{just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption}
\label{appendix}
\end{figure}
\end{document}

结果 在此处输入图片描述

这似乎是由标题的宽度引起的。

答案1

正如我在评论中所说,标题文本的宽度不能超过\textwidth。导致问题的原因是命令\abstract{abstract}将后面的文本缩小到摘要文本的宽度。

您的案例的正确 MWE 是:

\documentclass[12pt]{article}
\usepackage[hmargin=10mm, vmargin=20mm]{geometry}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\usepackage[font=scriptsize]{caption}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum} % for generating dummy text

\begin{document}
\title{title}
\author{authors}
\date{}
\maketitle

\begin{abstract} % <--- correct syntax
\lipsum[66]
\end{abstract}   % <---

\section{Introduction}
\lipsum[11]
    \begin{figure}[ht]
    \centering
\subfloat[]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\qquad
\subfloat[]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\qquad
\subfloat[]{\includegraphics[width=0.25\textwidth]{1.jpg}}
\caption{just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption just a caption}
\label{appendix}
    \end{figure}
\end{document}

给出了预期的结果:

在此处输入图片描述

(红线显示页面布局)。

如您所见,标题文本的宽度等于文本的宽度。子标题也位于正确的位置。这就是您想要的吗?

相关内容