1

Default setting of the Latex shows:

Figure 1.1. Caption....

I want to change the format to

Fig 1-1(without dot here) Caption

How can I change it similarily for tabel

A related question :How to change Figure 1: to bold Fig.1. in latex

the minimal example is :

\documentclass[12pt]{article}
\numberwithin{figure}{section}
\begin{document}
\begin{figure}[H]
            \centering
            \includegraphics[width=0.62\linewidth]{flow}
            \caption{}
            \label{}
\end{figure}

\begin{figure}[H] \centering \subfloat[]{\includegraphics[trim = 15mm 0mm 0mm 0mm, clip=true, width=8.5cm]{2.png}} \subfloat[]{\includegraphics[trim = 15mm 0mm 0mm 0mm, clip=true, width=8.5cm]{1.png}} \caption{}\label{} \end{figure} \end{document}

yi li
  • 167
  • That, in general, will depend on the document class and packages that you are using. Please add a short, minimal example document so that the answer can adapt to your case. – Rmano Mar 11 '22 at 08:15
  • thank you I have added more information – yi li Mar 11 '22 at 08:20
  • It's called Minimal WORKING Example for a reason. Nonetheless see this. Possible duplicate? – eliasf Mar 11 '22 at 08:54

1 Answers1

2

Use the following code:

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{caption}
\usepackage{float}

\renewcommand\thefigure{\thesection-\arabic{figure}} % the counter style \captionsetup[figure]{labelfont={bf},name={Fig},labelsep=space} % other settings

\begin{document} \section{This is a real MWE} \begin{figure}[H] \centering \includegraphics[width=0.62\linewidth]{example-image} \caption{Foo} \end{figure}

\begin{figure}[H] \centering \subfloat[foo]{\includegraphics[width=.4\linewidth]{example-image-a}} \subfloat[boo]{\includegraphics[width=.4\linewidth]{example-image-b}} \caption{Lipsum} \end{figure} \end{document}

I have made some edits so it can be compiled.

The result: Result

Tip: Do make the MWE compilable. For images, example-image and others can be a good choice.