0

I want to insert the label of each sub-figure in its correct position.

Fig1: enter image description here

Therefore, I want the label of the sub-figures to be the same as the fig.2, and the location of the caption to be the same as the fig.1 (don't change).

Fig2: enter image description here

Note:

  1. \documentclass[smallextended]{svjour3} is used.
  2. I asked this question previously but I couldn't solve this yet, this link.

Code:

\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}

Additional information:

According to my code, the problem was because of \usepackage[caption=false]{subfig} and also setting of [clip, trim=0cm 1cm 1cm 0.8cm]. Although the position of the labels is still not good enough!

First solution:

\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}

enter image description here

Second solution:

\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}

enter image description here

Ellie
  • 242

2 Answers2

1

To long for a comment -:(

First let me copied solution of @John Kormylo on your one of previous question, and adopted it to three subfigures and slightly modified aligning of the main caption, which is designed for use in elsarticle document class:

\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}

It works fine and gives the following result:

enter image description here

The same result you will get if you replace the first line of above MWE with

\documentclass[smallextended]{svjour3} 

As you see, In above MWE is left out most of the your preamble. I suggest, that you add it on the step by step way on place indicated by comment in MWE.

So I wonder, what is your problem. Moving subcaption to the left of the sun images?

Zarko
  • 296,517
  • If you add the \usepackage{floatrow}, \floatsetup[table]{capposition=top}, and \floatsetup[table]{captionskip=0.1pt} to your code, you can see the problem still remains! I can't remove them! – Ellie Oct 29 '21 at 13:13
  • Why you should use floatrow? It is not needed in provided solution. Please read last two sentences in my answer. Sorry, but your question is unclear. – Zarko Oct 29 '21 at 13:18
  • They are used for big tables in my manuscript. – Ellie Oct 29 '21 at 13:24
  • Please add the section of (\begin{figure} .... \end{figure}) from your code to the part of (\begin{figure} .... \end{figure}) in my code. – Ellie Oct 29 '21 at 14:28
  • @Ellie, no, I will not do this (actually I'm not able to this since your article is unknown to me). Your preamble (and maybe your document code too) is apparently broken. In my answer I told you what you should do. Please read it carefully again in try to do what I suggested you in the code comments as well in the explanation. Sorry, there is no short and easy way. From my MWE, which works, try to build your article from scratch by adding contents and necessary packages. Step by step. – Zarko Oct 29 '21 at 15:13
1

Besides subcaption and subfig being incompatible, the package caption, which subcaption depends on is not compatible with svjour3.

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

Here's a simple way to produce what you want, without 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}

enter image description here

We exploit the fact that the boxes produced by \subfloat have the reference point at the bottom of the image, so a bottom aligned minipage does the trick.

egreg
  • 1,121,712