I have applied in combination of following two solutions. How to make figure and listing share their counter and How to change listing caption?. I was able to combine them and make it work but I just want to remove : after the Figure.
The template I am using does not put : after the Figure N caption. Here is it possible to change the format of caption, where in Figure 1: Descriptive Caption Text can where remove the semicolon?
my code:
\documentclass[AMA,LATO1COL]{WileyNJD-v2} % \documentclass{article}
\usepackage{listings}% http://ctan.org/pkg/listings
\renewcommand{\lstlistingname}{\textbf{Figure}}% Listing -> Algorithm
\renewcommand{\lstlistlistingname}{List of \lstlistingname s}% List of Listings -> List of Algorithms
\makeatletter
\AtBeginDocument{%
\let\c@figure\c@lstlisting
\let\thefigure\thelstlisting
\let\ftype@lstlisting\ftype@figure % give the floats the same precedence
}
\makeatother
\begin{document}
\begin{figure}
\centering
\includegraphics[width=8cm,height=5cm]{myPictureName.png}%
\caption{My Picture}
\end{figure}
\begin{lstlisting}[caption={Descriptive Caption Text},label=DescriptiveLabel]
for i:=maxint to 0 do
...
done
\end{lstlisting}
\end{document}
- class file could be downloaded from here (https://onlinelibrary.wiley.com/pb-assets/assets/10991476/AMA-stix_New-1658766862393.zip), under:
ama/WileyNJD-v2.cls:
or from overleaf-link.
output of the corresponding part:
In the wanted Figure I want Figure 2 to be same as templated Figure N format I believe it is defined as just bold \textbf{Figure 2} Descriptive Caption Text.


