Recently I asked a question about the incompatibility of caption
in revtex4-2
. I utilized the suggestions but now I face new problems, e. g.:
- the difference between the number style of the figure in the text and below it
- I would like to place pictures side by side. I attach the file (I don't know how attach the pictures)
\documentclass[aps,pra,twocolumn,floatfix,footinbib,notitlepage,superscriptaddress,groupaddress,subcaption,caption,showpacs]{revtex4-2}
\usepackage{graphicx,graphics,times,bm,bbm,bbold,amssymb,amsmath,amsfonts,dsfont,hyperref,mathrsfs,color,cancel}
\usepackage{adjustbox}
\usepackage{tabularx}
\usepackage{tabulary}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{booktabs}
\usepackage{nicefrac}
\usepackage{subfig}
%\usepackage[mathlines]{lineno}% Enable numbering of text and display math
%\linenumbers\relax % Commence numbering lines
\usepackage{kantlipsum} % dummy text <<<<<<<<<<<<<<<
\begin{document}
\preprint{AIP/123-QED}
1. \kant[1-2]
%\title[Sample title]{Sample Title:\\with Forced Linebreak\footnote{Error!}}% Force line breaks with \\
\begin{abstract}
\end{abstract}
\keywords{}
\maketitle
\begin{quotation}
% The ``lead paragraph'' is encapsulated with the \LaTeX\
% \verb+quotation+ environment and is formatted as a single paragraph before the first section heading.
% (The \verb+quotation+ environment reverts to its usual meaning after the first sectioning command.)
% Note that numbered references are allowed in the lead paragraph.
%
% The lead paragraph will only be found in an article being prepared for the journal \textit{Chaos}.
\end{quotation}
\section{Introduction}\label{sec:introduction}
\textcolor{blue}{As Fig.~(\ref{fig1}) and Fig.(\ref{fig2}) show there is a difference between the number of the picure in text and caption }
\begin{figure}[ht!]\label{fig1}
\subfloat[\label{subfig2a}]{%}
\includegraphics[width=0.45\textwidth]{fig1}%
}\hfill
\subfloat[\label{subfig2b}]{%
\includegraphics[width=0.45\textwidth]{fig2}%
}\hfill
\caption{caption for \ref{subfig2a} subfloat 1 \ref{subfig2b} subflot2}
\end{figure}
\begin{figure}[ht!]\label{fig2}
\subfloat[\label{subfig3a}]{%}
\includegraphics[width=0.45\textwidth]{fig1}%
}\hfill
\subfloat[\label{subfig3b}]{%
\includegraphics[width=0.45\textwidth]{fig2}%
}\hfill
\caption{caption for \ref{subfig2a} subfloat 1 \ref{subfig2b} subflot2}
\end{figure}
2. \kant[2-4]
\end{document}
%
% ****** End of file aipsamp.tex ******
Best Answer
Try
From comparison of above code and your you should observe:
subcaption
package (version 1.3 or newest)graphics
package (it is load bygraphicx
).Addendum:
In the cases, that you like to have for example for image in figure, which span bot document columns, than you need to use
figure*
float. For example:Figure will appear at the top of the next page from point of it insertion.