如何将每个子图的标签设置在正确的位置?

如何将每个子图的标签设置在正确的位置?

我想将每个子图的标签插入到正确的位置。

图。1: 在此处输入图片描述

因此,我希望子图的标签与图 2 相同,标题的位置与图 1 相同(不要改变)。

图2: 在此处输入图片描述

笔记:

  1. \documentclass[smallextended]{svjour3}用来。
  2. 我之前问过这个问题,但还没能解决,这个关联

代码:

\documentclass[smallextended]{svjour3}       % onecolumn (second format)
%\documentclass[twocolumn]{svjour3}          % twocolumn
%
\usepackage{amsmath}
\usepackage{graphicx}
\graphicspath{ {./figures/} }
\usepackage[caption=false]{subfig}

\usepackage[colorlinks,allcolors=blue]{hyperref}
%\usepackage{float}
\usepackage{verbatim} %comments
\usepackage{lipsum,capt-of,graphicx}
\usepackage[a4paper, margin=2.5cm]{geometry}
\usepackage[numbers,sort&compress]{natbib}
\let\printorcid\relax
\usepackage[labelfont=bf,justification=raggedright,singlelinecheck=false, font={footnotesize}]{caption}
\captionsetup[figure]{name=Fig. ,labelsep=period, justification=justified, singlelinecheck=off}
\captionsetup[table]{labelsep=newline,font=footnotesize, justification=justified, singlelinecheck=off}%,skip=0pt,belowskip=0pt}
%\setlength\abovecaptionskip{-5pt}
%\setlength{\heavyrulewidth}{3\lightrulewidth}
\usepackage{subcaption}
\usepackage{setspace}

\usepackage{etoolbox}
\AtBeginEnvironment{table}{\sffamily}
\usepackage{booktabs,siunitx, multirow}
%\sisetup{table-format=1.4, tight-spacing=true, % separate-uncertainty}
\sisetup{separate-uncertainty}

\sisetup{
    output-exponent-marker = \text{e},
    exponent-product={},
    retain-explicit-plus,
    input-open-uncertainty  = ,
    input-close-uncertainty = ,
    table-align-text-pre    = false,
    table-align-text-post = false,
    round-mode=places,
    round-precision=2,
    table-space-text-pre    = (,
    table-space-text-post   = ),
}

\usepackage{amsmath}
\usepackage{adjustbox}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\floatsetup[table]{captionskip=0.1pt}
\usepackage{array, cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\usepackage{placeins}


\bibliographystyle{elsarticle-num}
%\bibliographystyle{spmpsci}

%\biboptions{sort&compress}
%\usepackage{xurl} % allow arbitrary line breaks in URL strings
%% These two lines are needed to get the correct paper size
%% in TeX Live 2016

\usepackage[misc]{ifsym}

\setlength\emergencystretch{3em}
\usepackage{microtype}
%


\begin{document}
\begin{figure*}
\subfloat[]{\label{main:a}\includegraphics[clip, trim=0cm 1cm 1cm 0.8cm, width=.4\textwidth,height=4cm]{example-image-a}}\quad
\subfloat[]{\label{main:b}\includegraphics[clip, trim=1cm 1cm 1cm 0.8cm, width=.4\textwidth,height=4cm]{example-image-b}}

\medskip

\subfloat[]\par
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,bottom},capbesidewidth=6cm}}]{figure}
{\caption{Caption is here.}
\label{fig2: neighborhood}}
{\label{main:c}\includegraphics[clip, trim=1cm 1cm 0.8cm 0.8cm, width=.4\textwidth,height=4cm]{example-image-c}}

\end{figure*}

\end{document} 

附加信息:

根据我的代码,问题是由于\usepackage[caption=false]{subfig}和 的设置造成的[clip, trim=0cm 1cm 1cm 0.8cm]。尽管标签的位置仍然不够好!

第一个解决方案:

\documentclass[smallextended]{svjour3}       % onecolumn (second format)
%\documentclass[twocolumn]{svjour3}          % twocolumn
%
\usepackage{amsmath}
\usepackage{graphicx}
\graphicspath{ {./figures/} }
%\usepackage[caption=false]{subfig}

\usepackage[colorlinks,allcolors=blue]{hyperref}
%\usepackage{float}
\usepackage{verbatim} %comments
\usepackage{lipsum,capt-of,graphicx}
\usepackage[a4paper, margin=2.5cm]{geometry}
\usepackage[numbers,sort&compress]{natbib}
\let\printorcid\relax
\usepackage[labelfont=bf,justification=raggedright,singlelinecheck=false, font={footnotesize}]{caption}
\captionsetup[figure]{name=Fig. ,labelsep=period, justification=justified, singlelinecheck=off}
\captionsetup[table]{labelsep=newline,font=footnotesize, justification=justified, singlelinecheck=off}%,skip=0pt,belowskip=0pt}
%\setlength\abovecaptionskip{-5pt}
%\setlength{\heavyrulewidth}{3\lightrulewidth}
\usepackage{subcaption}
\usepackage{setspace}

\usepackage{etoolbox}
\AtBeginEnvironment{table}{\sffamily}
\usepackage{booktabs,siunitx, multirow}
%\sisetup{table-format=1.4, tight-spacing=true, % separate-uncertainty}
\sisetup{separate-uncertainty}

\sisetup{
    output-exponent-marker = \text{e},
    exponent-product={},
    retain-explicit-plus,
    input-open-uncertainty  = ,
    input-close-uncertainty = ,
    table-align-text-pre    = false,
    table-align-text-post = false,
    round-mode=places,
    round-precision=2,
    table-space-text-pre    = (,
    table-space-text-post   = ),
}

\usepackage{amsmath}
\usepackage{adjustbox}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\floatsetup[table]{captionskip=0.1pt}
\usepackage{array, cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\usepackage{placeins}


\bibliographystyle{elsarticle-num}
%\bibliographystyle{spmpsci}

%\biboptions{sort&compress}
%\usepackage{xurl} % allow arbitrary line breaks in URL strings
%% These two lines are needed to get the correct paper size
%% in TeX Live 2016

\usepackage[misc]{ifsym}

\setlength\emergencystretch{3em}
\usepackage{microtype}
%


\begin{document}

\begin{figure*}
\subfloat[]{\label{main:a}\includegraphics[clip, trim=0cm 1cm 1cm 0.8cm, width=.48\textwidth,height=5cm]{example-image-a}}\quad
\subfloat[]{\label{main:b}\includegraphics[clip, trim=0cm 1cm 1cm 0.8cm, width=.48\textwidth,height=5cm]{example-image-b}}

\medskip

\subfloat[]\par
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,bottom},capbesidewidth=6cm}}]{figure}
{\caption{Caption is here.}
\label{fig2: neighborhood}}
{\label{main:c}\includegraphics[clip, trim=0cm 1cm 1cm 0.8cm, width=.48\textwidth,height=5cm]{example-image-c}}

\end{figure*}

\end{document}

在此处输入图片描述

第二种解决方案:

\documentclass[smallextended]{svjour3}       % onecolumn (second format)
%\documentclass[twocolumn]{svjour3}          % twocolumn
%
\usepackage{amsmath}
\usepackage{graphicx}
\graphicspath{ {./figures/} }
%\usepackage[caption=false]{subfig}

\usepackage[colorlinks,allcolors=blue]{hyperref}
%\usepackage{float}
\usepackage{verbatim} %comments
\usepackage{lipsum,capt-of,graphicx}
\usepackage[a4paper, margin=2.5cm]{geometry}
\usepackage[numbers,sort&compress]{natbib}
\let\printorcid\relax
\usepackage[labelfont=bf,justification=raggedright,singlelinecheck=false, font={footnotesize}]{caption}
\captionsetup[figure]{name=Fig. ,labelsep=period, justification=justified, singlelinecheck=off}
\captionsetup[table]{labelsep=newline,font=footnotesize, justification=justified, singlelinecheck=off}%,skip=0pt,belowskip=0pt}
%\setlength\abovecaptionskip{-5pt}
%\setlength{\heavyrulewidth}{3\lightrulewidth}
\usepackage{subcaption}
\usepackage{setspace}

\usepackage{etoolbox}
\AtBeginEnvironment{table}{\sffamily}
\usepackage{booktabs,siunitx, multirow}
%\sisetup{table-format=1.4, tight-spacing=true, % separate-uncertainty}
\sisetup{separate-uncertainty}

\sisetup{
    output-exponent-marker = \text{e},
    exponent-product={},
    retain-explicit-plus,
    input-open-uncertainty  = ,
    input-close-uncertainty = ,
    table-align-text-pre    = false,
    table-align-text-post = false,
    round-mode=places,
    round-precision=2,
    table-space-text-pre    = (,
    table-space-text-post   = ),
}

\usepackage{amsmath}
\usepackage{adjustbox}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\floatsetup[table]{captionskip=0.1pt}
\usepackage{array, cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\usepackage{placeins}


\bibliographystyle{elsarticle-num}
%\bibliographystyle{spmpsci}

%\biboptions{sort&compress}
%\usepackage{xurl} % allow arbitrary line breaks in URL strings
%% These two lines are needed to get the correct paper size
%% in TeX Live 2016

\usepackage[misc]{ifsym}

\setlength\emergencystretch{3em}
\usepackage{microtype}
%


\begin{document}

\begin{figure}
\subfloat[]{\label{main:a}\includegraphics[clip, trim=0cm 1cm 1cm 0.8cm, width=.48\textwidth,height=5cm]{example-image-a}}\quad
\subfloat[]{\label{main:b}\includegraphics[clip, trim=0cm 1cm 1cm 0.8cm, width=.48\textwidth,height=5cm]{example-image-b}}

\medskip

\subfloat[]\par
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,bottom},capbesidewidth=7.3cm}}]{figure}
{\caption{Caption text}\label{fig:test}}
{\label{main:e}\includegraphics[clip, trim=0cm 1cm 1cm 0.8cm, width=.48\textwidth,height=5cm]{example-image-c}}
\end{figure}

\end{document} 

在此处输入图片描述

答案1

太渴望评论了-:(

首先让我复制解决方案@John Kormylo在您之前的一个问题上,并将其采用到三个子图,并稍微修改了主标题的对齐方式,旨在用于elsarticle文档类:

\documentclass[review]{elsarticle}
\usepackage[font=footnotesize, labelfont=bf,
            justification=raggedright,
            singlelinecheck=false, 
            ]{caption}
\captionsetup[figure]{name=Fig. ,labelsep=period}
\captionsetup[table]{labelsep=newline}%,skip=0pt,belowskip=0pt}
%\usepackage[caption=false]{subfig} % don't load it when is used subcaption
\usepackage{subcaption}

\usepackage{graphicx}
\graphicspath{ {./figures/} }
% insert here left out part of your preamble
% before doing this, check, if you really need all heir package, 
% setups and definitions; please cleanup it
\usepackage{hyperref}
\usepackage{geometry}

\begin{document}
    \begin{figure}
    \setkeys{Gin}{width=.48\textwidth,height=5cm}
\subfloat[]{\label{main:a}\includegraphics{example-image-a}}\hfill%
\subfloat[]{\label{main:b}\includegraphics{example-image-b}}

\medskip
\subfloat[]{\label{main:c}\includegraphics{example-image-c}}\quad
\begin{minipage}[b]{.48\textwidth}
    \captionsetup{skip=0pt}
    \caption{Caption text}
    \label{fig:test}
\end{minipage}
\end{figure}

\end{document}

它运行良好并给出以下结果:

在此处输入图片描述

如果你将上面的 MWE 的第一行替换为

\documentclass[smallextended]{svjour3} 

如您所见,上面的 MWE 省略了大部分序言。我建议您按照 MWE 中注释所示位置的分步方式添加它。

所以我想知道,你的问题是什么。将副标题移到太阳图像的左侧?

答案2

除了subcaption和不兼容之外,所依赖的subfig包也与不兼容。captionsubcaptionsvjour3

Package caption Warning: Unknown document class (or package),
(caption)                standard defaults will be used.
See the caption package documentation for explanation.

这是一个生成您想要的东西的简单方法,无需floatrow

\documentclass[smallextended]{svjour3}       % onecolumn (second format)

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[caption=false]{subfig}

\begin{document}

\begin{figure*}
\centering

\subfloat[]{\label{main:a}\includegraphics[
  clip, trim=0cm 1cm 1cm 0.8cm, width=.4\textwidth,height=4cm
]{example-image-a}}\quad
\subfloat[]{\label{main:b}\includegraphics[
  clip, trim=1cm 1cm 1cm 0.8cm, width=.4\textwidth,height=4cm
]{example-image-b}}

\medskip

\subfloat[]{\label{main:c}\includegraphics[
  clip, trim=1cm 1cm 0.8cm 0.8cm, width=.4\textwidth,height=4cm
]{example-image-c}}\quad
\begin{minipage}[b]{0.4\textwidth}
\caption{Caption is here.\label{fig2: neighborhood}}
\end{minipage}

\end{figure*}

\end{document}

在此处输入图片描述

我们利用由 生成的框\subfloat在图像底部具有参考点这一事实,因此底部对齐minipage就可以达到目的。

相关内容